Shopping Cart Operations > Built-in Features

Conditional options?

(1/2) > >>

rnkwoodworks:
Coming from Prestacart due to it's limitations on options.

We sell things like cutting boards, plaques, etc and offer custom laser engraving at an additional charge.

It's great that I can offer this in AbanteCart but I also need to get input about what they want engraved.
I have an input box but unless people realize they HAVE to choose an engraving option, I don't want them assuming anything.

Is there a way I can have a text input conditional based on whether they chose engraving or not?

Basara:
Hello.
There is no such feature but it is possible to add the HTML block to the product page layout with small javascript code to make the text input required if for example checkbox is selected.
Something like https://stackoverflow.com/questions/41104324/make-input-text-field-required-if-checkbox-was-selected

rnkwoodworks:
Thanks so much for the answer but I figured out an easier way to do it.

Instead of a select box with engraving options and then an input with what they want engraved, I am just going to have several inputs that explain what they're for. I believe this leaves no doubt as to what they're getting. Something like the screen snippet attached.

It's great that AbanteCart updates the total once they type something in any of the boxes.

Basara:
You can also add a regex pattern to validate or limit the input

rnkwoodworks:

--- Quote from: Basara on February 07, 2022, 05:33:16 AM ---You can also add a regex pattern to validate or limit the input

--- End quote ---

Yea I appreciate the idea but I just spent an hour trying to figure out the regular expressions to use but had no success. I tried downloading Expresso but it hasn't helped. I tried /[a-zA-Z]+ [a-zA-Z]+/i but it allows more than two words.

 Eventually I'll figure it out.

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod