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
283 14 76

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?

tobebuilds
Shopify Partner
283 14 76

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.

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
283 14 76

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...