Paul van den Dool
Paul van den Dool

Reputation: 3212

shopify liquid: plus shipping cost not working

I want to multiply the subtotal price by 21% and then add the shipping costs. Because the shipping costs are variable I use the following code.

{{ order.subtotal_price | times:1.21 | plus:shipping_method.price | money }}

But the shipping costs aren't added.

The example code in the documentation states you can divide a price by product.compare_at_price so I thought it should work the same for shipping_method.price.

What am I doing wrong? Or is it even possible?

Upvotes: 1

Views: 596

Answers (1)

sjagr
sjagr

Reputation: 16502

You are using the wrong object. What you're actually looking for is order.shipping_price:

{{ order.subtotal_price | times:1.21 | plus:order.shipping_price | money }}

Upvotes: 2

Related Questions