Mandatory catalog item when variable selec

New user1212
Tera Contributor

Hi,
I need to create an option to make catalog item mandatory when a specific variabel is selected in the order guide. This is not covered by the UI policy, what do you think would be the best way to do it?

If in the catalog the External variable 'will the contractor use their own quipmnet...' has 'laptop required' selected, then the catalog item in the order guide Standard Hardware will be immediately marked as mandatory.

Untitled.png

thumbnail_image004 (1).png

  

 

 

3 REPLIES 3

Weird
Mega Sage

If I understood correctly you want to have a catalog item specified in the rule base always be included if the user selects a specific option.
I don't think there's a way to force just one catalog item. On the order guide you can uncheck "Show Include Toggle" checkbox and that should prevent the user from removing any options from the next page of the order guide.
Of course this also means that they can't remove any optional items.

You might be able to modify the order guide related scripts to implement this per catalog item if you felt like spending some time working on it.

and how complicated will it be?

Well, the widget is "widget-sc-order-guide-v2".
In the HTML section you can find mention of "switch" in classes. I guess the simplest way would be to try and hide the switch if the item is the one you don't want to show it on since it should be "on" by default, so no one could switch it off.

On server side there's the item object "itemData". You could try adding element "hidden" to it and then in the HTML side add some kind of check to hide it.

Note that I didn't spend a lot of time looking at the widget, so there might be much better options for configurations, but hopefully this gives some kind of idea on what you can try.