Personalized checkout and custom promotions with Shopify Scripts
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.
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?
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.
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
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:
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024