VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: lexi on May 06, 2016, 12:17:05 PM

Title: Mandatory custom fields
Post by: lexi on May 06, 2016, 12:17:05 PM
Hi,

I have bought an extension for a calendar (used as custom field). I would like this custom field to be mandatory in order to Add to Cart. I have searched in the forum but there doesn't seem to be any solutions. I tried to add code as suggested here http://forum.virtuemart.net/index.php?topic=100172.15 on Reply #27, but it didn't work. Any ideas on how I can do this please?

I'm using Joomla 3.4.5 and VM 3.0.10
The calendar extension I'm talking about is this http://virtuemartcalendardate.com/joomla-2-joomla-3-cms-extensions/virtuemart-extension-custom-field-plugin/vm-ecommerce-calendar-picker/virtuemart-calendar-date-advanced-version

Thanks :)
Title: Re: Mandatory custom fields
Post by: GJC Web Design on May 06, 2016, 22:44:32 PM
why not just some simple js check that the field isn't empty when the confirm button is clicked?
Title: Re: Mandatory custom fields
Post by: lexi on May 09, 2016, 08:41:41 AM
That's what I had in mind but I don't know how to do it since i have the confirm button in catproduct/defult.php and the input field in datetime/default.php (they are 2 different extensions). Any help please?

Thanks
Title: Re: Mandatory custom fields
Post by: GJC Web Design on May 09, 2016, 19:38:54 PM
but JS works at the page level so just check it on clicking the add to cart

if this is a cat layout with multiple add to cart and products then u would need to assign a unique id to each product "tile"