Author Topic: Exclude cart field from reaching checkout? "disabled" doesn't work.  (Read 394 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 498
Hello,

I have a hidden (display: none) select box in the addtocart section, which I enable ondemand via JS, when another field is set to a specific option.
The hidden select box is set to "disabled", like so:

<select name="customProductData[234432][432]" class="vm-chzn-select" disabled>
<option value="19794484">Hidden option 1</option>
<option value="19794485">Hidden option 2</option>
</select>

However, when Ι add the product to cart, the disabled select field, along with all its options, are added to the product info in the checkout!

Any idea how to avoid that?

EDIT: The select box is initially set to disabled by JS




Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Exclude cart field from reaching checkout? "disabled" doesn't work.
« Reply #1 on: December 06, 2022, 15:01:58 pm »
You need customfield plugin, instead of this hidden thing. Then you can filter it out with a trigger
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

EvanGR

  • Jr. Member
  • **
  • Posts: 498
Re: Exclude cart field from reaching checkout? "disabled" doesn't work.
« Reply #2 on: December 07, 2022, 10:32:06 am »
Thank you Milbo.

I am not sure I understand.

I need a 3rd party plugin? Or make a plugin myself?

I use native VM custom fields for this case. Can you point me to an example/source on how to "filter it out with a trigger"?
e.g. A VM code file I can study would be great!

Thank you!