In this latest version of CartFlows and CartFlows Pro, we have introduced a set of new shortcodes and variables to be used in the custom JS script.
Variables are which available from the CartFlows Free version.
You can use these variables on any page of CartFlows except the checkout page. The reason behind this is that the values for those variables are generated after the order is placed.
Variables that are available from the CartFlows Pro are as follows:
These variables are available only on the upsell/dowsell pages as they are upsell/downsell specific.
Now, you might be wondering how to use these variables in real cases? Don’t worry, below is a short example to help you understand the use case.
JS Triggers for upsell & downsell accepted/rejected
These options are available only on the upsell and downsell pages. Below are the steps to add the offer accepted or rejected the scripts.
Step 1: Navigate to the Flows menu
Step 2: Click edit on the flow for which you want to add custom scripts.
Step 3: Click edit on the upsell / downsell pages according to your requirements.
Step 4: Click on the settings tab and click on the custom script option.
Step 5: Add your custom JS script which needs to be executed when the offer is accepted or rejected.
Step 6: Click on the Save button to save the changes.
While adding an offer accept/reject script, you can use below JS variables/shortcodes in your custom script code to send/get the offer data.
Once you add your custom offer accept or reject scripts, they will be automatically executed on the proper events as the offer accepted script will be executed when the upsell or downsell offer is accepted and similarly, the offer rejected script will be executed when the upsell or downsell offers are rejected.