Discounts Applied via Launchpad are not reflected in the cart object

core
Shopify Partner
5 0 3

Hi There, 

When applying a discount via a launchpad event, I would expect the discounts property in the cart object to be populated rather than it being an empty array. Or at the very least the original_price property in the cart object to be the original (pre-discounted) price of the product. This limits the ability to should the original price strikethrough as well as how much the customer is saving in the cart and cart drawer.

 

I'm guessing I would need to get the products via the AJAX api and do the compare logic from there?

Seems like discounts applied via launchpad should be reflected in the cart object, but maybe I'm missing something here.

Replies 4 (4)

LitCommerce
Astronaut
2860 684 732

Hi @core,

The discount code shown and app on cart page is just 'Automatic discount', if you create 'Discount codes', it will work at checkout page. 

So if you want this you can install discounts related apps which will help you to set it up. Refer https://apps.shopify.com/discount-url or https://apps.shopify.com/search?q=discount%20code

Hope it helps!

LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool.
Effortlessly sell on biggest marketplaces like Amazon, Etsy, eBay, Facebook etc with bulk listing tool, real-time sync & smart order management. Use LitCommerce free for 1-year now!
core
Shopify Partner
5 0 3

@LitCommerce , What are you talking about?? I'm not using automatic discounts nor do I want to use an app! What I am saying is that when a merchant applies a storewide discount via launchpad I expect these discounts to be reflected in the cart object so that it shows the customer that 1. they not paying full price for the product and 2. they can see how much they are saving off their order. 

 

The requirement is that when a merchant has a product on sale, this is reflected in ALL the relevant places on the site. This is on collections pages, product pages and ui elements and pages using the cart object to display the cart information. Not sure why Shopify doesn't use the compare_at_price to show if any of the products in the cart are discounted? This would enable us to easily use liquid to show this rather than having to hack it with JS.

 

Not sure if you're trying to be helpful or just push an app? If you trying to be helpful you seem to have miss understood the question I am asking. If you're trying to push an app, get in the bin! I have no interest in apps as most are utterly hopeless and add loads or useless css that completely messes up themes. 

 

Thanks tho

alexchavet
Shopify Partner
1 0 1

Hey @core 

I have ran into the same frustrating realisation. I ended up setting an automatic discount to discount the products, and created a snippet in the frontend that override visually the compare at price on the PDP/PLP.

In details:
Instead of using LaunchPad to discount all the products for the collection "Sale 25%", I have set up an automatic discount for the collection "Sale 25%" (based on a product tag discount:25)

On the PDP/PLP if the product has a discount:{value} tag, I would visually replace the price by price * (1 - {value}

It kind of worked as a temporary fix. The main issue was that no one could use discount code if the automatic discount was applied.

Because of the latest, I am keen to try the LaunchPad approach again. Would love to hear if you found a solution. If you haven't I hope this quick fix could help.

I have been inspecting the line item data and couldn't find any attributes that could tell if the product was discounted by LaunchPad or not. Which makes it hard for a line item script.

I guess if the promotion is run through a tag approach. You can iterate through the line items, extract the ones that have the tag. Then reverse the discount to get the full price, inject a "You saved {totalFullPrice - total}" TotalFullPrice being the sum of all your reversed discounted items.

Going to try that, and update if I get any issues. Obviously a hacky solution, would love to hear a better one

core
Shopify Partner
5 0 3

Hey @alexchavet 

Yeah it's super frustrating. I really don't understand how the cart object doesn't reflect discounts that have been applied to the product object!

 

My work around is to allow launchpad discounts to take care if the strikethrough on the product and index pages and handle the missing strikethrough and savings etc. on the cart page with JS.

I get the product object using the Ajax API and then from there get the original price and use that to inject the prices and  calculate the savings. It's a lot of faffing about and becomes complicated when you have to handle changes to the cart via ajax as well, but it' works.

 

Hopefully Shopify update the cart object with the correct price and compare_at_price and we don't need these kinds of hacks!

 

Hope that helps!