News:

Support the VirtueMart project and become a member

Main Menu

Require User Selection of Only One Custom Field

Started by cmb, October 11, 2012, 04:55:24 AM

Previous topic - Next topic

cmb

I have products with several Cart Variant custom fields. Usually the default selection is fine and the user needn't change it. There is one, however, that the user must make a decision on so I have set it for three options:
Please Choose
Option A
Option B


The default option, Please Choose, must not remain set for the product to be added to the shopping cart. An error message should be shown to the user unless Option A or Option B is selected.

According to the VirtueMart Roadmap there is no plan to implement such an feature so we are left to our own devices. There is a possible solution discussed in How to make one of custom field REQUIRED? which refers to "Generic Child Variant" - Prevent adding Parent to Shopping cart. Unfortunately, the code provided there appears to be a blanket solution in that all custom fields must not be set to the default options.

Is there any hope that this feature will be added to custom fields? Do you know of any way to selectively apply a test to just one custom field? Is there another way to force the user to make a choice of options when ordering a product?

VirtueMart 2.0.12b, Joomla 2.5.7
Charles

MrSandman

#1
This is such a well worded question, I am saddened to see that no one has come here to answer it. There must be a way to add the "required" element to one or more custom fields and  and the do a check for it in default_addtocart.php -I wish .....

cmb

This question is so old that I had forgotten I wrote it. As I recall I found the solution by using the Product Builder extension.
Charles

Maxim Pishnyak

Could I see test product where it's necessary to have required selection of only one custom field?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart