wagnerwagner / merx

Merx is a plugin to create online shops with Kirby.
https://merx.wagnerwagner.de
104 stars 10 forks source link

Dynamic shipping prices (request) #67

Closed rhjp92 closed 1 year ago

rhjp92 commented 1 year ago

Thanks so much for your work on this plugin so far!

It would be really great to see in the future some functionality where different shipping prices could be set according to destination country and also per product. Our product sizes and weights vary which influences postage prices and we'd also like to offer shipping to customers outside our country. Thanks!

tobiasfabian commented 1 year ago

Hi @rhjp92,

Thanks for your comment.

You can add a shipping price per product (add a new field called shippingPrice). Say the product coffee beans has a shipping price of $2 and the product sofa has a shipping price of $50. Using the cart hook you can manipulate the shipping price. In your case, you need to add up all the shippingPrice fields of the products in the cart. Since shipping can be very different depending on different use cases, I don't see any other/simpler general solution to this problem. But I am open to any ideas.

Update shipping price based on destination country. This is a little different because the shipping price needs to be updated on user input (on the checkout page). We have done this on the Merx checkout page. We do not update the shipping price, but we do update the tax. If you select Germany the tax will be added to the license. There's no big difference on the backend side between updating the tax or updating the shipping. See /site/plugins/site/index.php for the backend implementation.