Wishlist & Compare Products buttons

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
I am using Nop 4.5.

I need to change the color of the wish list & product compare buttons if the item is already in the wish list or the product compare section.
I could change the color using css on click, but if user logs out & comes back in, I need to still change the buttons of the items in each of the lists
1 year ago
Are you planning to change to core code or make a plugin ?

For Wishlist
You would need to use a routine to check if the Current Product is in the Wishlist
and then as you say change the css based on the result
See Views\Product\_AddToWishlist.cshtml

For CompareProducts
See Views\Product\_CompareProductsButton.cshtml and do similar to above

Are you using a Theme because if so then there maybe alternate files loaded in the theme to change
1 year ago
I am using the Default theme.
1 year ago
Are you a developer will you create a plugin or make the core code changes ?
1 year ago
Would it be the same section of code if buttons are in the Category list section instead of product detail?

I plan on making a core change.
1 year ago
In tha case see Views\Shared\_ProductBox.cshtml
1 year ago
_productBox uses @model ProductOverviewModel, __AddToWishlist  uses @model ProductDetailsModel.AddToCartModel

How do I reference this  (Model.UpdatedShoppingCartItemId > 0 && Model.UpdateShoppingCartItemType.HasValue && Model.UpdateShoppingCartItemType.Value == ShoppingCartType.Wishlist)
    {
}

within _productBox when I can only have one model?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.