VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: EvanGR on January 13, 2021, 11:25:14 AM

Title: Exclude custom fields from checkout?
Post by: EvanGR on January 13, 2021, 11:25:14 AM
Hello,

TL;DR
How can I remove unwanted/disabled fields from appearing in the client's checkout page?

Longer story....

I have a set of custom fields in the addtocart area.
They are usually select/dropdowns (multiple String fields).

Some of these fields are optional, and I show/hide them via script, depending on what options are selected.
(Hidden fields are also set to "disabled", besides setting their style to "display:none")

e.g.
Field 1: Include Extras?
Options: No extras, 1 extra, 2 extras, 3 extras, 4 extras

Field 2: Type of Extras
Options: Type A, Type B, Type C, Type D

Field 2 is shown depending on Field 1.

However, in the checkout, Field 2 appears always. Which confuses the user as they never selected that option.