Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom entities in product compare list #29

Open
Amadeco opened this issue Aug 14, 2021 · 0 comments
Open

Support custom entities in product compare list #29

Amadeco opened this issue Aug 14, 2021 · 0 comments

Comments

@Amadeco
Copy link

Amadeco commented Aug 14, 2021

Good afternoon,

To reproduce this issue :
1- You need to have at least one custom entity defined in your administration
2- In Catalog attribute configuration, after selecting your catalog product attribute, in "Storefront Properties", you must select "Comparable on Storefront" to Yes.
3- In your frontend, add a product to the compare list with custom entity defined previously in the admin
4- Display the compare list

You must have an error :

Exception #0 (Exception): Notice: Array to string conversion in /home/amadeco/public_html/Future/vendor/magento/module-catalog/Block/Product/Compare/ListCompare.php on line 209

This error is produced by
getProductAttributeValue function
in magento/module-catalog/Block/Product/Compare/ListCompare.php

The custom entity value return an array, a string is expected.

Not sure if we need to define a plugin to correct this issue with a conditional approach.
$attribute->getFrontendInput() == 'smile_custom_entity'
or if we have a proper solution to handle this case.

Ilan Parmentier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant