Get products in comparison list

1 year ago
Hi,

I have some featured products on the home page. When a customer adds one of these products to their comparison list it changes the comparison list button color.

On page load i am trying to write a function to get the products that are in the comparison list so i can color the buttons accordingly based on whether its in their comparison list or not.

Has anyone had any experience with this?
1 year ago
SamSnap wrote:
Hi,

I have some featured products on the home page. When a customer adds one of these products to their comparison list it changes the comparison list button color.

On page load i am trying to write a function to get the products that are in the comparison list so i can color the buttons accordingly based on whether its in their comparison list or not.

Has anyone had any experience with this?


What are you looking forward to in response? Pls share what you have tried already?
1 year ago
SamSnap wrote:
Hi,

I have some featured products on the home page. When a customer adds one of these products to their comparison list it changes the comparison list button color.

On page load i am trying to write a function to get the products that are in the comparison list so i can color the buttons accordingly based on whether its in their comparison list or not.

Has anyone had any experience with this?


Hi,

Please have a look in our article - How to marked a product in Compare List?

With this solution, when a product added to the compare list, the system will adds "in-compare-list" CSS class to the root tag of the product details / product box view. So that, based on this class, you can style every child elements.

Hope this helped :)
1 year ago
NOTED it is code for nopCommerce 4, for 3.90 will be added later.
1 year ago
Updated code for nopCommerce 3.90
Please have a look :)
1 year ago
Hi ima9ines,

I would like to do the same thing as the comparison list but with the wishlist. how would i be able to do this?

Any help would be appreciated.

Thanks