onLoad Catalog Client Script in Variable Set running on all phases of Order Guide

tahnalos
Kilo Sage

Is there any way to prevent an onLoad Catalog client script from running on the options phase of an order guide?

 

We have a variable set that is supposed to prepopulate certain data on load of any Catalog Item.  In this specific case, we are running it on an Order Guide, but if we allow it to run on order guide, we don't want it to run for each catalog item in the order guide because we were thinking that entering the info in the order guide would propagate to each catalog item, so we do not want the Catalog Client Script to be running for those child items.

 

Is there any way to detect if the item is on the Order guide so that we don't run it?  We could do separate onLoad scripts, one for the Order Guide, and one for individual Catalog Items not in the Order guide, but would like to know how to set that up.

 

Ideas?

1 REPLY 1

Nitin Panchal
Tera Guru

Hi @tahnalos , 

To check if the catalog item is on order guide or not , you can use following setup. 

1) Create  "is_orderguide" checkbox type variable and make it part of variable set. Set the default value to 'false' . This variable set must be shared with orderguide and its child catalog items. 
2) Have a client script running on the order guide to make this variable to "true" onLoad script of the order guide.
3) This variable will be hidden all the time on order guide and on its child catalog items. You can create a UI policy on the variable set to make this happen.

Now in this setup when order guide is loaded , your onload client script will run and mark the variable to "true". This way you can check if the order guide is loaded or not.

On the flip side when individual catalog item of that order guide is loaded, the "is_orderguide" variable will be false due to its default value.


Please mark my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you
Nitin