how to add a 'split case' charge to a product?

how to add a 'split case' charge to a product?

mduvall216
Shopify Partner
3 0 0

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.

Replies 3 (3)

AliReviews
Shopify Partner
773 90 356

Hello @mduvall216 ,

 

You can try to follow these steps:

  • Go to Online Store -> Products -> click on the product you want to add the split case charge to.
  • Go to Variants section -> Edit 
  • In the Pricing section, click on the Compare at price checkbox and enter the price of a full case of 4 units. For example, if the unit price is $10, the full case price would be $40.
  • In the Shipping section, click on Add shipping rate and enter the split case charge. For example, if the split case charge is $5, you would enter a shipping rate of $5 for orders of 1, 2, or 3 units.
  • Save the variant and repeat for any other variants you want to add the split case charge to.
  • Add custom code to display the split case charge message, like this example:
{% 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 %}
  • Save and test

Hope this can help.

Ali Reviews team.

- Was my answer helpful? Please hit Like or Mark it as solution!
- Ali Reviews - The must-have Shopify app that empowers you to effortlessly collect, display, and manage product reviews.
- Start your FREE trial today!
mduvall216
Shopify Partner
3 0 0

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 !

mduvall216
Shopify Partner
3 0 0

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.