Custom shipping CalcPrice being overwritten for delivery

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Custom shipping CalcPrice being overwritten for delivery

Post by cjr » 24 Jul 2020, 14:10

I have a CalcPrice decorator for my delivery service. It hits an external API to get the costs for shipping.

I extended the Service\Provider\Base.php->calcPrice to take in an array of values from my external API function.
It defaults to an empty array if nothing is passed in.

The cost is present in the delivery option check screen, all the way through to the summary page. Once I click "Buy Now", the basket sent to the process payment to be saved as ordered has 0.00 for all shipping costs. The order->getCosts() is 0, as well as the delivery cost in the services array.

I have a feeling somehow a blank Price object is getting passed in to my services.

How can you persist shipping costs from the delivery selection screen all the way to an order?

Do I need to set the basket costs within my CalcPrice decorator?

cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Re: Custom shipping CalcPrice being overwritten for delivery

Post by cjr » 27 Jul 2020, 12:15

So far I found a workaround where I store the basket in the session, and then pull it out of the session before the transaction is written to the db.

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

Re: Custom shipping CalcPrice being overwritten for delivery

Post by aimeos » 29 Jul 2020, 06:33

Your workaround should not be necessary. Can you post your code?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply