Articles on: Discounts

How to add a discount to an AI generated upsell

In the AI upsell offer, let the shopper know about the discount by adding it to the upsell visual:

To add a discount to an AI generated upsell, we will add a script to the Script Editor.

Input.cart.line_items.each do |line_item|
if"__upsell_id") and["__upsell_id"]
line_item.change_line_price(line_item.line_price * 0.90, message: "Special discount")
Output.cart = Input.cart

Add the discount you want to apply. (*0.90 = 10% discount). The same discount will apply to all auto recommended products.

Updated on: 24/05/2023

Was this article helpful?

Share your feedback


Thank you!