How can I show the shipping rate on the cart screen? At the moment this defaults to 0.00 - I assume as we don;t know the customers location so no shipping method can be applied. Ideally I want to show the standard shipping rate based on UK and then allow the user to click and change location to apply a different shipping rate. Ideally I want to do this in the Cart screen so users can see the full total before logging in or checkout out as a guest. I want to eliminate the shipping selection page. Any ideas on how to go about this?

  • I assume this is for the Craft Commerce plugin? – Brad Bell Aug 8 '16 at 17:16
  • Yes. Craft Commerce. – Terry Upton Aug 8 '16 at 17:18
  • Any ideas on this? – Terry Upton Aug 9 '16 at 15:58

I've not tried this so early in the checkout process, but how about adding the following to your Add To Cart forms? Replace the # with the correct value obviously.

<input type="hidden" name="shippingAddress[countryId]" value="#">
<input type="hidden" name="shippingMethod" value="#">

That way, as soon as people arrive on the Cart page a country has been added already as a shipping address, which, I think, should be enough for shipping to be calculated.

  • This is great, thanks Clive. I have tried a quick test and I think it will work nicely. – Terry Upton Aug 10 '16 at 17:59
  • Glad it worked! – Clive Portman Aug 10 '16 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.