1. Chris Moffitt
  2. satchmo
  3. Issues
Issue #1421 new

Custom Product / Product Variations multiple selections

Dean Murphy
created an issue

When creating a custom product, I would like to allow a customer to select multiple options from an option group.

In product/views/init.py the function used to parse the product options from a POST to cart/add doesn't take into consideration the presence of multiple values for a given option group:

{{{ chosen_options = [] for opt_grp in configurableproduct.option_group.all(): if POST.has_key(str(opt_grp.id)): chosen_options.append('%s-%s' % (opt_grp.id, POST[str(opt_grp.id)])) return sorted_tuple(chosen_options) }}}

It would be nice if it would check for multiple options passed in a group, something like this.

{{{ chosen_options = [] for opt_grp in configurableproduct.option_group.all(): if POST.has_key(str(opt_grp.id)): opts = POST.getlist(str(opt_grp.id)) if opts and isinstance(opts, list): for opt in opts: chosen_options.append('%s-%s' % (opt_grp.id, opt)) else: chosen_options.append('%s-%s' % (opt_grp.id, POST[str(opt_grp.id)])) }}}

return sorted_tuple(chosen_options)

This would allow the configuration of a custom product with multiple options where the shop could be configured to allow the user to select one of more of from a list of options.

Comments (0)

  1. Log in to comment