Personalized checkout and custom promotions with Shopify Scripts
Hiya,
We're currently looking after a Shopify site for a major e-commerce clothing brand who are looking to perform a few updates to their site in preparation for a new launch. They currently have Shopify plus and we both have full time developers who could potentially pick up the work but I'm working to see if there's any other suggestions we have that could hit our objectives either through applications or via Shopify's admin interface.
The real objective here is to stop anyone who is considered to be Europe based being able to check out with more than €150 in their basket and there is no real limit on how this is done.
Currently the site only has the UK GBP currency attached to it and has shipping profiles that are set up that limit and utilize formats based off weight criteria. They want these to stay though which is understandable so we can't add a €150 euro rule into the shipping profiles because of this.
It's also worth noting that the site has references to a 'Spend £'X' amount and get free shipping' which is all UK GBP based, so if we convert to EU and restrict then we will have to remove those with conditional scripts.
From our side, we were thinking the best way to do this would be:
• Set up a new EU market within the Shopify site which then allows for EU conversion (seems the simplest way to get EU on the site)
• Set up scripts to hide the £X value free shipping as mentioned above
• Set up a check on the basket page which says that if the address is within EU, check basket order total and if equal to or greater than €150.00 then grey out the checkout button and show a message
Before we go forwards with the full development though, I wanted to check if anyone else had any suggestions or any insights that might make the process above easier either through applications or the admin interface and something we might have missed?
Thanks again for any information put forwards.
Hi,
if you want to prevent EU customers from ordering for an amount > 150 EUR, the easiest way to do this is in the shipping script.
In principle, you have to check the currency and the amount of the shopping cart, and if the amount exceeds 150 EUR, you remove the shipping methods.
This can be done with three lines of code:
if Input.cart.presentment_currency == "EUR" && Input.cart.subtotal_price > Money.new(cents: 150 * 100)
shipping_rates.delete_if { |shipping_rate| true }
end
However, you should then still check the same facts via JS and bring an error message in the checkout. The customer should know why he can't get past the shipping step in the checkout.
The story with the free shipping, on the other hand, should be solved via the configuration of the shipping zones. You can set these for each country, and then there is free shipping for the UK above a certain amount, but not for the European countries.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024