You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the default item_option_group value be a non-valid "Choose Size" (or similar).
Currently, there doesn't appear to be a way to specify a non-valid option as the default option_group_value. I hacked a solution by altering the product_detail template to insert default option outside of the recommended "{% for option in options %}" loop:
I then hacked the SimplevariationsCartDetails.post method to modify the "key.startswith('add_item_option_group_') section to check for an empty key value:
if not self.request.POST[key]:
messages.warning(self.request,'No Size Select! Please select Size below.')
nextURL = self.request.GET.get('next', '')
return HttpResponseRedirect(nextURL)
Aside: I also modified product_detail template to include a "next" value in the product_detail template form action attribute, so it would be available above.
I'm not sure if this is valuable to others, or if there is a way to incorporate this as a feature that can be enabled/disabled to allow adding into a pull request.
Thoughts?
The text was updated successfully, but these errors were encountered:
I would like the default item_option_group value be a non-valid "Choose Size" (or similar).
Currently, there doesn't appear to be a way to specify a non-valid option as the default option_group_value. I hacked a solution by altering the product_detail template to insert default option outside of the recommended "{% for option in options %}" loop:
I then hacked the SimplevariationsCartDetails.post method to modify the "key.startswith('add_item_option_group_') section to check for an empty key value:
Aside: I also modified product_detail template to include a "next" value in the product_detail template form action attribute, so it would be available above.
I'm not sure if this is valuable to others, or if there is a way to incorporate this as a feature that can be enabled/disabled to allow adding into a pull request.
Thoughts?
The text was updated successfully, but these errors were encountered: