Category Decorator and Product Variants

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Category Decorator and Product Variants

Post by stiller » 12 Feb 2024, 23:08

hi there.

did the behavior of the category decorator change in Version 2022.x?
before, when limiting delivery services to a category all variants of a selection products where included if the parent product was allocated to a category.
Now it doesn't work anymore.
What could be a working alternative?

cheers, V

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

Re: Category Decorator and Product Variants

Post by aimeos » 15 Feb 2024, 08:25

If it doesn't work any more, this was not intentional. The code still uses the ID of the selection product for the check:
https://github.com/aimeos/aimeos-core/b ... y.php#L177

Can you check what happens there in your case?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Re: Category Decorator and Product Variants

Post by stiller » 16 Feb 2024, 23:36

up to this point everything seems to work as expected
$parentid contains the correct Selection Product ID
and the array $productIds contains [0] the ID of the Variant and [1] the ID of the Selection Product

stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Re: Category Decorator and Product Variants

Post by stiller » 17 Feb 2024, 14:18

after further tests I've to admit
the heading is misleading.
the category service decorator is not working at all.
even if I add the category directly to the variant product,
the required delivery service with the category.include argument doesn't show up.

the behavior seems to be as follows:
category.include > the required services are not displayed
category.exclude > services are displayed even if products in the basket are referenced to the excluded category

for further testing:
how do I print the serviceId inside the isAvailable function?

Aimeos Version: 22.10

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

Re: Category Decorator and Product Variants

Post by aimeos » 18 Feb 2024, 12:10

Can you please check what happens here:
https://github.com/aimeos/aimeos-core/b ... #L106-L127

To get the service item with ID, you can call "$this->getServiceItem()":
https://github.com/aimeos/aimeos-core/b ... #L119-L122
This should call the method of the nested provider object and return the item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Re: Category Decorator and Product Variants

Post by stiller » 19 Feb 2024, 23:23

as far as I can see,
the function either returns 'null' or 'false'.
even if the category matches it returns 'false'

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

Re: Category Decorator and Product Variants

Post by aimeos » 21 Feb 2024, 10:55

Can you please find out why NULL or FALSE are returned?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Re: Category Decorator and Product Variants

Post by stiller » 22 Feb 2024, 08:31

in our case the function getCatalogIds always returns an empty array.
https://github.com/aimeos/aimeos-core/b ... y.php#L132

$filter seems to contain the right dataset, but
$manager->search( $filter )->keys()->all()
can't find the existing category entry.

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

Re: Category Decorator and Product Variants

Post by aimeos » 22 Feb 2024, 08:35

Can you add a debug output in the getCatalogIds() method with:

Code: Select all

print_r( $filter->__toArray() );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Posts: 88
Joined: 05 Mar 2016, 15:59

Re: Category Decorator and Product Variants

Post by stiller » 22 Feb 2024, 10:41

this is what I get
Array ( [&&] => Array ( [0] => Array ( [&&] => Array ( [0] => Array ( [==] => Array ( [catalog.code] => Array ( [0] => Spedition ) ) ) ) ) [1] => Array ( [&&] => Array ( [0] => Array ( [>=] => Array ( [catalog.status] => 1 ) ) ) ) ) )

Post Reply