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)
#4430 by Innonic
26 Jul 2017, 17:18

I encountered the following problem:

I have an item with a weight of 600g. The delivery is a DHL package up to 2kg.

When I'm in the basket view and I click on '+' the shipping costs disappear when I reach 4 items. 4 items mean, there's a weight of now 2400g. That means, need the DHL 5kg package now. If I click '+' another time, the shipping costs are visible again. And if I press '-' afterwards, they are also visible for 4 items.

Same, when I reach 9 items. 9 items mean 5400g and a DHL 10kg package. Shipping costs disappear and reappear.

See images 1 - 4.

It seems, there's some problem when switching the Delivery option. Is there any solution, yet?

Thanks in advance!!!
img3.png (46.44 KiB) Viewed 679 times
img2.png (41.49 KiB) Viewed 679 times
img1.png (45.99 KiB) Viewed 679 times
#4434 by Innonic
28 Jul 2017, 14:12
I added the screenshots. I hope it is, what you requested. There is still much left in the original condition.

Thank you for your help!
plug-in.png (89.59 KiB) Viewed 672 times
service2.png (123.52 KiB) Viewed 672 times
service1.png (130.13 KiB) Viewed 672 times
#4436 by aimeos
28 Jul 2017, 20:08
Guess, the isAvailable() method of your decorator returns false for all delivery options for this condition. You have to debug why this happens. Best thing is to add some statement to output the result at the line where it returns false.
#4444 by Innonic
02 Aug 2017, 13:28
So I checked the isAvailable() method.

Depending on the values, it's behaving correctly.

I have 8 items (600g) in the basket. I add another one and the currently printed values are:
Current weight is 5400.0g while min weight is 2000.1g and max weight is 5000.0g.
That is absolutely correct for the 5kg DHL-package. But there is a 10kg DHL-package defined, which matches.

It seems, that only the package category is checked, that we are already in (5kg package). If I add another one everything's allright again and we're in the 10kg package category.

If I remove one item, it's ok, still the 10kg package. If I remove another one, it's like above.

I can see in both cases, that the 2kg package option has been checked before. But it neither seems to check the 5kg option while we're in the 10kg package category nor the 10kg option while we're in the 5kg package category...

I don't get it since it works when another item is added/removed... It's just when the package category is switched...
#4448 by Innonic
04 Aug 2017, 09:53
Can you exchange the positions of the Autofill and ServicesUpdate basket plug-ins? (ServicesUpdate: 0, Autofill: 1)

That did the trick! Thank you so much.

One last question concerning this issue is:
In the Plug-In list, is it ok to have a position used twice?
I mean I now have got 'Autofill' on position 1 but also 'AdressesAvailable'. Should I move the positions in that way, that there's each position used once only?

Thank you again!
#4541 by Innonic
28 Aug 2017, 09:11
Need to reopen this issue:

Now I observed the same issue when removing articles from the basket. Scenario:

1. Step: I put a small artice into the basket. Shipping costs for small package are shown.
2. Step: I put a big article into the basket. Shipping costs for a big package are shown.
3. Step: I remove the big article from the basket. No shipping costs are shown.

If I change the number of articles (like we had in this isue), shipping costs are shown again.

Do you have any ideas for this use case, too? Thanks in advance!