I love Zencart most of the time – but its implementation of size/colours attributes always causes me headaches.
A common request is for the size to be compulsory when adding a product to the basket.
But the official Zen cart way of doing it involves a complex process of adding a dummy option to the top and forcing that to be default. Not a great way – especially as you can still end up with an item in the basket that has a size of “Please select…”
Note: You will have to repeat the $(“input[name*=’id’]”).click() function for as many possible attributes you have. (Calls for some sort of loop surely?!)
Then change the following line:
So that it forces the checkOptions() function to run each time you try to add something to the cart
I admit this is very quick-and-dirty – and it only caters for 1 option at a time on the page.
Well it works for me for for now.
Who knows maybe I’ll post an update with all these issues addressed? For now, enjoy!