Show or Hide Item Custom Field based on Option or Checkbox

Hi everyone

As the title suggests, how can I show or Hide Item Custom Field based on Option or Checkbox in the Cart?

For example:

  1. if checkbox is checked → show custom field A
  2. if an option is selected → show custom field B

Any help is appreciated

Hey @MorningTide,

We don’t have a way to do this in the cart at the moment. However, I have a suggestion, you could add these options directly on your site, you’d have more control on this, and update the custom field value programmatically, similar to what is explained in this thread.

You could use readonly custom fields as documented here so that customers won’t be able to update the selection in the cart directly.

1 Like

Hello @charles,

following up on this I was wondering what your plans are regarding this?

Our use case is to have a checkbox Licensee differs from invoice recipient and ask for a name and an email address next, if this checkbox is checked. It is pretty simple to show/hide the text inputs with v-if. We only need access to the checkot view model.

This seems rather easy to implement but then again I do not have your insights :slight_smile: