Jump to content

[SOLVED] Manufacturer logos in featured products


Recommended Posts

Hi All,

I was just wondering if there is any way of having the manufacturers logo appear in the content on the Featured products block along with that item?

I can seem to find any code in there that will help achieve this but if anyone was able to help out on this I would greatly appreciate it.

Richard.

Link to comment
Share on other sites

Hi, Richard.
The code actually already has everything that is needed to display it.
Open your homefeatured.tpl and find the place where you want manufacturer's logo to appear (make sure it's between {foreach from=$products item=product name=homeFeaturedProducts} AND {/foreach} lines).
And place there:



You can now style it as you wish:

#featured-products_block_center img.featuredProductManufacturer {
   border: 1px #333 dashed;
}


How it works


This part is obvious, but some might not know that: Prestashop uses manufacturer id to name their logo images (actually, for any image you upload from your backend).
When you add a manufacturer, this id gets incremented: 1,2,3,4, etc.
And if your manufacturer with an id of 5 has the image in the first place, you can be sure that it's name is:
5.jpg — original size
5-large.jpg — large size (300x300px by default)
5-medium.jpg — (80x80px)
5-small.jpg — (45x45px)
And that it's in your img/m folder.

UPD:
If your product doesn't have manufacturer assigned the code above will still try to display it's image (and will display that ugly cross for "No image found"). To avoid this use:
{if $product.id_manufacturer ne 0}

{/if}


Cheers!
George.

Link to comment
Share on other sites

  • 1 year later...

Hi everyone!

Is there any way to insert an automatic "alt text" to the image, so it shows the manufacturer name when going with the mouse over them?

Im already using it in the product page but I think it would be great for SEO purposes.

Thanks and regards

Link to comment
Share on other sites

  • 6 months later...

And place there:

[img={$img_manu_dir}{$product.id_manufacturer|escape:]

You can now style it as you wish:

#featured-products_block_center img.featuredProductManufacturer {
border: 1px #333 dashed;
}

 

Hi, George

i 'm sorry, i know it's a old post but i don't understand... i need to do this modification and i can't see the code that i need to put...

 

Please, can you give us again the modification ?

 

Regards, Boris

Link to comment
Share on other sites

Ok all my apologizes !

I don't understand, now i can see the code in my reply...

 

And i found the solution by myself, here is the code to put the manufacturer's image :

 

<img src="{$img_manu_dir}{$product.id_manufacturer|escape:'htmlall':'UTF-8'}.jpg" class="logo_manufacturer" title="{$product_manufacturer->name}" alt="{$product_manufacturer->name}" />

 

Boris

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