To make attributes required, Zen Cart recommends adding a display only attribute as the default for your options. However, installed Dynamic Dropdowns breaks this functionality as it adds it's own default option which is not a display only attribute. Then, it uses JavaScript to require a selection.
From time to time you may still get an order without an attribute selection because JavaScript was disabled or a JS error caused the validation to fail.
I've come up with the following workaround. Open includes/functions/functions_lookups.php and find:
PHP Code:
function zen_get_attributes_valid($product_id, $option, $value) {
Within the function find:
PHP Code:
$check_valid = true;
Add after:
PHP Code:
// disallow adding attributes with a value of 0
if ($option > 0 && $value === 0) {
$check_valid = false;
}
Bookmarks