Jontee Posted June 10, 2023 Share Posted June 10, 2023 Hi, Do anyone know of a simple and elegante code to add the brand logos (images) beside the product images in product list, for example on category pages, homepage modules (popular product, bestsellers etc.).? I am running Prestashop 8.0.x Many thanks in advance. Have a great weekend. Best regards, Link to comment Share on other sites More sharing options...
ps8modules Posted June 11, 2023 Share Posted June 11, 2023 (edited) Hi. Just modify one file. (prestashop 8.x) ./themes/your_theme/templates/catalog/_partials/miniatures/product.tpl add after: {hook h='displayProductPriceBlock' product=$product type="before_price"} small code: {block name='brand_miniature_item'} {if $product.id_manufacturer} <div class="brand-img"> <a href="{$link->getmanufacturerLink($product.id_manufacturer)}"> <img src="/img/m/{$product.id_manufacturer}-small_default.jpg" alt="{$product.manufacturer_name}" title="{$product.manufacturer_name}" loading="lazy" > </a> </div> {/if} {/block} result: Edited June 13, 2023 by ps8moduly.cz Remove li tag (see edit history) Link to comment Share on other sites More sharing options...
Jontee Posted June 12, 2023 Author Share Posted June 12, 2023 Hi! MANY THANKS for this one! Unfortunately it doesn't seem to be working as expected, the brand logo is overlapped at the bottom and the price won't show as well. Also, there appears a "dot" under the product title. Do you have any idea to resolve this? Should the "block" be inside of the price block, or maybe before? Thanks again, appreciate it. Best regards, Link to comment Share on other sites More sharing options...
Jontee Posted June 12, 2023 Author Share Posted June 12, 2023 Forgot to mention, this is for the regular Classic theme. Best regards, Link to comment Share on other sites More sharing options...
Jontee Posted June 12, 2023 Author Share Posted June 12, 2023 @ps8moduly.cz Did you get the result as you attached in Prestashop 8.0.4? I don't know what I did wrong, it seems the div container height for the product item isn't high enough? Also, the <li> seems to be making the dot. Thanks in advance. Best regards, Link to comment Share on other sites More sharing options...
ps8modules Posted June 13, 2023 Share Posted June 13, 2023 Hi. You can remove the li tag in the code. Link to comment Share on other sites More sharing options...
Jontee Posted June 13, 2023 Author Share Posted June 13, 2023 Hi, thanks! Now I know why the thumbail-container was set for a specific height (358px), it was because of the old module "Legal Compliance" still being active in my shop. So I disabled it and everything is working like a charm now. Many thanks. https://github.com/PrestaShop/PrestaShop/issues/26794 1 Link to comment Share on other sites More sharing options...
ps8modules Posted June 13, 2023 Share Posted June 13, 2023 I gladly helped 🤪 Link to comment Share on other sites More sharing options...
Jontee Posted June 13, 2023 Author Share Posted June 13, 2023 Many MANY thanks, it works great now! Have a nice day. Best regards, Link to comment Share on other sites More sharing options...
Jontee Posted June 17, 2023 Author Share Posted June 17, 2023 Hi! I am expanding this topic to also include adding the brand logo (manfacturer image) to the product page itself, do you have any idea how to do that @ps8moduly.cz ? For example, above the product title, or below it, or similar. Thanks again. Best regards, Link to comment Share on other sites More sharing options...
Jontee Posted June 18, 2023 Author Share Posted June 18, 2023 Okay, so I opened up /themes/classic/templates/catalog/product.tpl and added this: {block name='brand_productpage'} {if $product.id_manufacturer} <div class="brand-productpage" style="margin-bottom:6px;"> <a href="{$link->getmanufacturerLink($product.id_manufacturer)}" title="{$product.manufacturer_name|escape:html:'UTF-8'}"> <img src="/img/m/{$product.id_manufacturer}-small_default.jpg" alt="{$product.manufacturer_name|escape:html:'UTF-8'}" loading="lazy" > </a> </div> {/if} {/block} BELOW this: {block name='page_header_container'} ..and it seems to be working fine. Do the block name has to refer to an actual "name" within Prestashop, or can I just use "brand_productpage" as I have done? Thanks in advance, Best regards, Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now