What's your biggest current challenge? Have your say in Community Polls along the right column.

Discount Paramenter in checkout not working anymore

Discount Paramenter in checkout not working anymore

enicolella
Shopify Partner
3 0 0

Hi everyone, I'm getting a bit desperate. Lately my shopify is having a few issues on checkout. The latest one is the following: I had a script on the cart php that would add a certain discount on the checkout based on the collection of the product

 

 

 

 

{% if customer %}
                      {% if customer.metafields.custom.agency_account %}
                          {% for collection in item.product.collections %}
                              
                              {% if collection.handle == "agenzia-8-di-commissione" %}
                                  <input class="js-form-discount" type="hidden" name="discount" id="discount" value="AGENZIA8"/>
                              {% elsif collection.handle == "agenzia-10-commissione" %}
                                  <input class="js-form-discount" type="hidden" name="discount" id="discount" value="AGENZIA10"/>
                              {% elsif collection.handle == "agenzia" %}
                                  <input class="js-form-discount" type="hidden" name="discount" id="discount" value="AGENZIA"/>
                              {% endif %}
                           {% endfor %}
                      {% endif %}
                  {% endif %}

 

 

 

 

 

 

In this case if the customer logged in had the tag 'business' and the product was in a knows collection it would add a discount on checkout. It worked PERFECTLY and it just stopped.

I see the paramenter discount gets added by the store on checkout but it's completely ignored. Any help on how to achieve this? getting a bit crazy.

Replies 4 (4)

tobebuilds
Shopify Partner
480 34 129

Hi, see this thread from yesterday for a discussion about this issue: https://community.shopify.com/c/customers-discounts-and-orders/auto-apply-discount-code-at-checkout-...

 

In that thread, I added some links to other previous discussions.

 

There's a chance this is either a new bug, or some past functionality was removed in a recent update.

 

Have you tried contacting Shopify Support?

Founder, Regios Discounts app (4.9 stars, 70 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
tobebuilds
Shopify Partner
480 34 129

Hi Enicolelella, a user named Starshards has posted a solution for this issue, in another thread: https://apps.shopify.com/regios-automatic-discounts

Check it out and see if it solves your problem.

Founder, Regios Discounts app (4.9 stars, 70 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
enicolella
Shopify Partner
3 0 0

That's an app, doesn't resolve the issue unfortunately as I'd need to pay an extra fee for something that has been working perfectly for ages

tobebuilds
Shopify Partner
480 34 129

Sorry, in my previous message, I accidentally pasted the wrong link, which was meant for another thread.

 

I didn't intend to promote my app here, and I'm sorry for any misunderstanding it may have caused.

 

Here are the links to some of Starshard's recent replies, where they suggested a solution for the issue:

 

https://community.shopify.com/c/customers-discounts-and-orders/auto-apply-discount-code-at-checkout-...

 

https://community.shopify.com/c/customers-discounts-and-orders/discount-code-is-not-applying-in-cart...

 

https://community.shopify.com/c/shopify-discussions/again-valid-discount-code-passed-as-a-query-para...

 

 

Founder, Regios Discounts app (4.9 stars, 70 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer