Author Topic: Mandatory custom fields  (Read 1366 times)

lexi

  • Beginner
  • *
  • Posts: 2
  • A beginner
Mandatory custom fields
« 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 :)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9308
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Mandatory custom fields
« Reply #1 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?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

lexi

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Mandatory custom fields
« Reply #2 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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9308
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Mandatory custom fields
« Reply #3 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"
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation