New Shopify Certification now available: Liquid Storefronts for Theme Developers

How to calculate custom pricing in .liquid template and include the correct tax / VAT rate

partner_fitc_ws
Shopify Partner
3 0 0

A customer needs to be able to offer different pricing for different customer types - trade customers and loyalty scheme customers for example. The prices are based on a percentage mark up of the unit or base price or the product, so the regular price is for example 1.4 x the unit price, the trade customer price is 1.3 x the unit price. Different products hav different percentage mark up. When the unit price changes, all other prices change accordingly.

 

We have this working well on the product and collections page but we are not able to find a value that Shopify uses for the tax amount. Does anyone know where we can get this? We are hoping to try and avoid storing every countries tax rate separately to Shopify's own logic to do this and working it out that way.

 

Secondly, when it comes to the checkout, I have read that support for editing the checkout.liquid file is being taken away from August 2024 unless you want to pay $2,000 per month. The alternative is to develop a custom app which appears to be fairly over complicated and involves learning a new stack just for some basic functionality. Is this the only way to do this meaning we need to have to have two different approaches? Is the tax rate easier to obtain using this approach and does anyone have any experience in doing something similar?

 

I've search online and asked similar in discord servers but not been able to get any more useful information so far.

Replies 2 (2)
SBD_
Shopify Staff
Shopify Staff
1671 235 346

Hey @partner_fitc_ws 

 

Have you experimented with Customer Segments? You can create a customer segment (e.g. Trade customer) and apply a discount to those customers. This should then calculate the correct taxes all the way through to checkout.

Scott | Developer Advocate @ Shopify 

partner_fitc_ws
Shopify Partner
3 0 0

As far as I am aware this applies a specific discount across the board and not different discounts for individual products that was mentioned and also not discounts based on the  multiplier of the unit / base price mentioned. Let me know if I've missed something.