Dynamic delivery services

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!
createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Dynamic delivery services

Post by createanet » 27 May 2021, 08:36

Hello again,

Just visiting this, I notice now that when updating product quantities (via ajax) the price assigned in the service remains the same. If I then "checkout", the customer is sent to last step with the original price of the delivery service. But, because the quantities have changed, the weight of the shipment has changed, which requires recalculating.

In the above instance, I guess I need to go back to a plugin approach? Or at the very least a plugin that listens to address and product events which will remove the delivery service from the basket as a result requiring the user to request a fresh list of delivery services available for the current basket and weight?

The alternative is to recalculate this in the plugin, this means repeating api requests for the updated costs to the customer for their chosen delivery service. I don't know if this good given the amount of times the plugin might be called (but can be limited based on the previous discussions we've had around hashing).

I think for now so I can continue moving forward I will look to remove the delivery service, which I expect will force the user to revisit the step when checking out.

Is there any other approach I should or could be taking to manage this please?

Cheers,

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Dynamic delivery services

Post by createanet » 28 May 2021, 06:25

So it seems removing the service from the basket via the plugin fails to interrupt the steps in the checkout process once the user attempts to checkout again.

I was hoping the removal of the delivery service would force this step as the next step as its incomplete.

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

Re: Dynamic delivery services

Post by aimeos » 29 May 2021, 10:51

createanet wrote: 27 May 2021, 08:36 Just visiting this, I notice now that when updating product quantities (via ajax) the price assigned in the service remains the same. If I then "checkout", the customer is sent to last step with the original price of the delivery service. But, because the quantities have changed, the weight of the shipment has changed, which requires recalculating.
If you didn't disable the ServicesUpdate plugin then this sounds like a bug because if the quantity is changed, the services should be rechecked.

Client HTML:
https://github.com/aimeos/ai-client-htm ... #L587-L590

Frontend controller:
https://github.com/aimeos/ai-controller ... .php#L311

Basket:
https://github.com/aimeos/aimeos-core/b ... e.php#L609

ServiceUpdate Plugin:
- https://github.com/aimeos/aimeos-core/b ... hp#L44-L51
- https://github.com/aimeos/aimeos-core/b ... e.php#L105
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: Dynamic delivery services

Post by aimeos » 29 May 2021, 10:58

createanet wrote: 28 May 2021, 06:25 So it seems removing the service from the basket via the plugin fails to interrupt the steps in the checkout process once the user attempts to checkout again.

I was hoping the removal of the delivery service would force this step as the next step as its incomplete.
These lines should stop the the checkout at the delivery step if no delivery option is in the basket:
https://github.com/aimeos/ai-client-htm ... #L263-L271

Can you check why it's not working in your case?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: Dynamic delivery services

Post by aimeos » 30 May 2021, 06:15

I think we've fixed the problem with stopping at the checkout step if you remove e.g. the choosen delivery option from the basket:
https://github.com/aimeos/ai-client-htm ... edd8d07c6f
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Dynamic delivery services

Post by createanet » 01 Jun 2021, 14:15

Thanks for looking into this...

Im still working on the 2020.10 LTS, and for now have no plans to upgrade to 2021.*.

What is required for me to pull in these changes please?

TY

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Dynamic delivery services

Post by createanet » 01 Jun 2021, 15:36

Just incase it is/isnt the correct way I have managed to get the updates via the following command.

Code: Select all

composer req aimeos/ai-client-html:2020.10.x-dev
Thanks again :)

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

Re: Dynamic delivery services

Post by aimeos » 03 Jun 2021, 08:43

That's correct.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply