Jump to content

[SOLVED] How to Add “Add to Favorites” Button on Home Featured?


ajnglagla

Recommended Posts

I want to add "add to favorites" button below the each products on Home Featured.

 

I found an article how to make that for Category page, but i need to modify it to use for Homefeatured.

(http://blog.belvg.com/how-to-add-add-to-favorites-button-on-product-list-in-prestashop.html)

 

This code must be in (controllers/front/CategoryController.php (the function assignProductList())

if (Module::isEnabled('favoriteproducts')) {
    include_once(_PS_ROOT_DIR_ . '/modules/favoriteproducts/FavoriteProduct.php');
    foreach ($this->cat_products as &$cat_product) {
        $cat_product['isCustomerFavoriteProduct'] = (FavoriteProduct::isCustomerFavoriteProduct($this->context->customer->id, $cat_product['id_product']) ? 1 : 0);
    }
}

Seems i should modify and write it in controllers/front/IndexController.php to use for Homefeatured. Is there anyone made that before?

Edited by ajnglagla (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...