Jump to content

How to move brand logo TO above product name in product.tpl ? PS1.7


BlackEdition

Recommended Posts

Hi,

 

On Prestashop 1.7.1.2 I tried playing around with product.tpl (THEME-NAME/templates/catalog/product.tpl)

 

But I couldn't find a way to move the brand logo to show it directly above the product name. The brand logo is already displayed by default in product details tab, but I want to move it to above the product name. I suspect the related code is already in product.tpl since the brand is displayed in product details but I can't find anything related to brand/manufacturer? What am I missing?

 

Im not good at programming and I spent the last 2 hours Googling this but everything I found was related to PS1.6 and below so it didn't work for me. I use a custom theme if that makes a difference.

 

Can someone help me please? thanks.

Edited by BlackEdition (see edit history)
Link to comment
Share on other sites

Solved!

 

I didn't know about this file product-details.tpl (THEME-NAME/templates/catalog/_partials/product-details.tpl)

 

I found the following code related to manufacturers/brand:

{if isset($product_manufacturer->id)}
      <div class="product-manufacturer">
        {if isset($manufacturer_image_url)}
          <a href="{$product_brand_url}">
            <img src="{$manufacturer_image_url}" class="img img-thumbnail manufacturer-logo" />
          </a>
        {else}
          <label class="label">{l s='Brand' d='Shop.Theme.Catalog'}</label>
          <span>
            <a href="{$product_brand_url}">{$product_manufacturer->name}</a>
          </span>
        {/if}
      </div>
    {/if}

I copied it and placed it in product.tpl (THEME-NAME/templates/catalog/product.tpl) above product-detail-name

 

This is what it looks like now:

              {block name='page_header_container'}
                {block name='page_header'}
    {if isset($product_manufacturer->id)}
      <div class="product-manufacturer">
        {if isset($manufacturer_image_url)}
          <a href="{$product_brand_url}">
            <img src="{$manufacturer_image_url}" class="img img-thumbnail manufacturer-logo" />
          </a>
        {else}
          <label class="label">{l s='Brand' d='Shop.Theme.Catalog'}</label>
          <span>
            <a href="{$product_brand_url}">{$product_manufacturer->name}</a>
          </span>
        {/if}
      </div>
    {/if}
                  <h1 class="h1 product-detail-name" itemprop="name">{block name='page_title'}{$product.name}{/block}</h1>
                {/block}
              {/block}

After that I went back to product-details.tpl and deleted the manufacturer code from there because I don't need the brand logo to be displayed twice in the product page.

 

If the brand logo is too small for you then all you need to do is edit the related css file and change the height there. For me it was theme.css (THEME-NAME/assets/css/theme.css) and change height in .product-manufacturer .manufacturer-logo to what you want.

 

Don't forget to save changes & clear cache after your modifications. I hope this helps everyone  :)

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

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...