Shopify themes, liquid, logos, and UX
I have a client with a special request to add a 'split case' charge to their product. The product is sold individually on their Shopify site, however each item is packed in a case of 4 units. They want the ability to have a customer order 1 or more units, however if the customer orders a multiple outside of 4, they will be charged a $5 'split case' charge. For example, if the unit costs $10 and the customer puts 5 items in their cart, a message will appear below the price explaining the 'split case' charge and add $5 to their checkout.
I was unable to find a plugin that would provide that functionality, if anyone knows of such a plugin let me know. Is there a way to modify the theme to check for a product tag and display the message? For example, if I create a product tag called 'split-case', then any time a product is tagged with 'split-case' I could modify the theme to check for the tag and display the split case message if the number of units is not divisible by 4.
Any suggestions would be greatly appreciated, thank you.
Hello @mduvall216 ,
You can try to follow these steps:
{% if product.variants[0].compare_at_price > product.variants[0].price %}
<p>Buy 4 units for ${{ product.variants[0].compare_at_price }} per case or pay a $5 split case charge for orders of 1, 2, or 3 units.</p>
{% endif %}
Hope this can help.
Ali Reviews team.
Thank you Ali Team, should be a great solution. I'm going to make your suggested adjustments and let you know the results. Again, thank you for the quick reply, huge help !
Thanks for the compare_at_price solution, I tried implementing the code and it worked however the point is that if the number of units are in multiple of 4, then the case split fee is not included. With the solution above, if someone has 8 units, the case fee notification still appears.
I tried looking for something like "if quantity % 4 !==0" then display message, but I could not figure out how to programmatically access the quantity input field.
The solution I'm recommending to my client now is to create separate variants for case and single units, but not a clean solution if someone clicks 5 individual units. Thanks for your help.
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024