Price rules applied in catalog but not in basket

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!
DmS
Posts: 56
Joined: 09 Aug 2021, 08:59

Price rules applied in catalog but not in basket

Post by DmS » 24 May 2022, 14:20

As the subject says, I've setup a price rule with -10% on a specific category.
I've added catalog to domains per the instructions here:
https://aimeos.org/docs/2021.x/manual/rule-decorators/

And the price is adjusted in lists and product detail page, exactly as advertized, but the price in the basket is the unchanged, standard price.

I've searched the forums and from earlier answers, tried turning off all plugins related to price, ProductPrice, TaxRates plus two custom plugins, no change.

The section client/html/catalog in my conf file looks like this:

Code: Select all

'catalog' => [
                'selection' => [
                    'type' => array('Vikt' => 'radio', 'Volym' => 'radio'),
                ],
                'lists' => [
                    'basket-add' => true,
                    'domains' => array('catalog', 'attribute', 'media', 'media/property', 'price', 'product', 'product/property', 'supplier' => array('text', 'media', 'supplier/address'), 'text'),
                    'pagination' => ['enable' => 1],
                    'size' => 100,
                    'sort' => 'relevance'
                ],
                'detail' => [
                    'basket-add' => false,
                ],
                'filter' => [
                    'attribute' => [
                        'types-option' => ['Varutyp'],
                    ],
                ],
                'stock' => [
                    'level' => [
                        'low' => 3
                    ]
                    ],
                #'domains' => array('catalog', 'media', 'media/property', 'price', 'text')
            ],
I know the docs say:
You need to add catalog to the client/html/catalog/domains configuration setting so the Category rule decorator is used, e.g. ['catalog', 'media', 'media/property', 'price', 'text'].
as the commented out line in conf, but if I use that line and don't have "catalog" under catalog/lists/domains it does not work at all.

What am I missing here?
Attachments
Screenshot 2022-05-24 at 15.42.14.png
Screenshot 2022-05-24 at 15.42.14.png (223.63 KiB) Viewed 1440 times
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25

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

Re: Price rules applied in catalog but not in basket

Post by aimeos » 25 May 2022, 15:30

The referenced documentation is only for displaying the correct price but the source of the problem was in the basket/standard code which had missed the "catalog" domain when fetching products.

Can you please update and try again:

Code: Select all

composer req aimeos/ai-client-html:2021.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

DmS
Posts: 56
Joined: 09 Aug 2021, 08:59

Re: Price rules applied in catalog but not in basket

Post by DmS » 27 May 2022, 07:47

I see.
Will try this and report back.
Thank you
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25

aimeosenv
Posts: 7
Joined: 13 Dec 2022, 21:04

Re: Price rules applied in catalog but not in basket

Post by aimeosenv » 17 Dec 2022, 19:55

I would just like to add to this issue in case someone runs on similar case.

When price rules were applied, from some reason changes were not applied to the basket.

Disabling ProductPrice plugin helped so pricing was applied correctly to the basket.

In addition to that Session/Pinned was not applying pricing correctly. Session/Seen works just fine.

Suggestion is to make change on this line to following, as everything works well once when 'catalog' was added.

Code: Select all

$domains = $config->get( 'client/html/catalog/domains', ['catalog', 'media', 'price', 'text'] );
============================
Aimeos 2022.10+ (2022.10.3)
PHP 8.1.12 / Laravel
Win (Develop)

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

Re: Price rules applied in catalog but not in basket

Post by aimeos » 18 Dec 2022, 09:56

aimeosenv wrote: 17 Dec 2022, 19:55 When price rules were applied, from some reason changes were not applied to the basket.
Disabling ProductPrice plugin helped so pricing was applied correctly to the basket.
This has been fixed now:
https://github.com/aimeos/aimeos-core/c ... 16b87dbf66

Can you install and test so that we can release a new version?

Code: Select all

composer req aimeos/aimeos-core:2022.10.x-dev
aimeosenv wrote: 17 Dec 2022, 19:55 In addition to that Session/Pinned was not applying pricing correctly.

Suggestion is to make change on this line to following, as everything works well once when 'catalog' was added.

Code: Select all

$domains = $config->get( 'client/html/catalog/domains', ['catalog', 'media', 'price', 'text'] );
Thanks, this has been also changed now. Please test:

Code: Select all

composer req aimeos/ai-client-html:2022.10.x-dev
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

aimeosenv
Posts: 7
Joined: 13 Dec 2022, 21:04

Re: Price rules applied in catalog but not in basket

Post by aimeosenv » 18 Dec 2022, 16:30

Thank you!

I have just installed updated aimeos-core and with ProductPrice plugin enabled all works well now. :)

Other package (Pinned) as well works fine after update via req process. :)

There is still bug with this part:

Code: Select all

minibutton change down
minibutton change up

Located here:
packages/mycustom-theme/templates/client/html/common/summary/detail.php
Once when change up or down in quantity is performed, FULL price is applied and not one with price rules applied.

Just one more quick question/note related to these updates.

One other note is strange here. In both cases when composer req was done, this file was overwritten:

Code: Select all

public/vendor/shop/themes/mycustom-theme/aimeos.css
Actually all files here were overwritten:

Code: Select all

public/vendor/shop/themes/mycustom-theme/
I have noticed only aimeos.css since I've made modifications to it, but shouldn't this be part of custom theme (extension) and not be overwritten? Have I placed it in wrong dir or something and it gets overwritten?
============================
Aimeos 2022.10+ (2022.10.3)
PHP 8.1.12 / Laravel
Win (Develop)

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

Re: Price rules applied in catalog but not in basket

Post by aimeos » 19 Dec 2022, 09:33

The "catalog" domain has been added here to:
https://github.com/aimeos/ai-controller ... d.php#L399

Can you please check:

Code: Select all

composer req aimeos/ai-controller-frontend:2022.10.x-dev
Please create a new topic for your other question as it doesn't fit in this thread.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply