Advanced JavaScript Methods for Upsell Customization

Advanced JavaScript Methods for Upsell Customization

We've already given you a taste for using the JavaScript methods in the tutorial Multiple sets of yes no buttons on an upsell page.  This document will describe all of the JavaScript methods available on the page upsell after page.

ucSelectItem

function ucSelectItem(value, quantity);

You can select a specific item on the upsell by calling:

ucSelectItem("ITEMID", 1);

ucSelectMultiple

function ucSelectMultiple(multipleSelectionDetails);

You can select a specific items on the upsell by calling the method with a CSV string like itemId,quantity,itemId,quantity,...

ucSelectMultiple("FOO,1,BAR,2");

With this method it is your responsibility to code up a form on the page to collect the customers answers and then call this method with the multiple selection details string that you build up.

ucSelectYes

function ucSelectYes();

You can select this upsell by calling the method:

ucSelectYes();

ucSelectYesWithQuantity

function ucSelectYesWithQuantity(quantity);

You can select this upsell with a quantity by calling the method:

ucSelectYesWithQuantity(2);

ucSelectNo

function ucSelectNo();

You can decline this upsell by calling the method:

ucSelectNo();