Jump to content

Add id_manufacturer to blockbestsellers


teralite

Recommended Posts

Hi all!

 

I have added a manufacturer logo to all the productlists, but i cant get it in on blockbestsellers on the front page.

I dont think the id_manufacturer is called in that module and i dont know how to solve this, anyone that can help me?

 

Edit:

When i look closer to it i get a few products in Bestsellers to show the manufacturer logo but on some products i get this with print_r:

 

Notice: Undefined index: id_manufacturer in /storage/content/10/108510/led-lampor.info/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 137 1

Notice: Undefined index: id_manufacturer in /storage/content/10/108510/led-lampor.info/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 140
 
Edit 2:
 
This is the code i use in product-list.tpl:
<div id="manufacturer">
                     {if ($product.id_manufacturer) && $product.id_manufacturer > 0}               
                    <img src="{$img_manu_dir}{$product.id_manufacturer}-manu_small.jpg" alt="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" title="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" />
                    </div>
 
Using prestashop 1.6.0.11 and created a new imagetype aswell.
Edited by teralite (see edit history)
Link to comment
Share on other sites

Easiest solution it to change the following at about line 263 of modules/blockbestsellers/blockbestsellers.php:

        if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, (int)Configuration::get('PS_BLOCK_BESTSELLERS_TO_DISPLAY'))))

to:

        if (!($result = ProductSale::getBestSales((int)$params['cookie']->id_lang, 0, (int)Configuration::get('PS_BLOCK_BESTSELLERS_TO_DISPLAY'))))

The getBestSales function includes the manufacturer ID and name, whereas the getBestSalesLight function doesn't.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 years 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...