Calculate Shipping Costs

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Florian
Posts: 1
Joined: 30 Oct 2018, 10:08

Calculate Shipping Costs

Post by Florian » 30 Oct 2018, 10:19

Hey there!

I would like to calculate the shipping costs like that: "weight of products" * "quantity of products".
How is the simplest way to do it?

PS: I'm an absolute beginner.

Thanks for feedback.

(PHP: 7.1.23, Aimeos: 18.7.3)

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Calculate Shipping Costs

Post by aimeos » 30 Oct 2018, 22:16

There's no existing service decorator for this. The "Weight" decorator only enables or disables delivery options if the weight of the products in the basket is within the configured range:
https://github.com/aimeos/aimeos-core/b ... Weight.php

You can use it's code as base and multiply the weight in the calcPrice() method by the amount per kilo or whatever your metric is. For details, please have a look into this article:
https://aimeos.org/docs/Developers/Libr ... _decorator

If you are very new, you should read the developer documentation first:
https://aimeos.org/docs/Developers
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

haseeb
Posts: 9
Joined: 24 Feb 2021, 16:34

Re: Calculate Shipping Costs

Post by haseeb » 25 Feb 2021, 08:36

hello ,
I am facing some problem in integrating delivery method ,currently I am using UPS Rate API to grab all the rate but problem is that i cant access that rate in response even that i dump my response variable noting happen , and aimeos moves to next step which is the selection of payment method and after that it moves to payment gateway ,
my question is that how can i get dynamic rate and put that price in to my delivery method or add that charge in to invoice.
currently I am following this documentation https://aimeos.org/docs/2020.x/provider ... status.and doing work as according to your document but i cant figure out so please help me.
thankyou in advance

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Calculate Shipping Costs

Post by aimeos » 26 Feb 2021, 09:40

Implement a service decorator and add it to your configuration in the services panel of the admin backend (that's important for using it!):
https://aimeos.org/docs/2020.x/provider ... ecorators/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

haseeb
Posts: 9
Joined: 24 Feb 2021, 16:34

Re: Calculate Shipping Costs

Post by haseeb » 02 Mar 2021, 13:17

thanks its work

Post Reply