Jump to content

[TUTORIAL] Adding a second image for Prestashop categories


NemoPS

Recommended Posts

  • 2 years later...
On 29. 10. 2014 at 11:59 AM, NemoPS said:

Howdy!
I just published a tutorial on how to add a secondary image for categories (but applies to other entities as well)

 

http://nemops.com/prestashop-categories-second-image/#.VFDHzvmjOr1

 

Cheers!

Fabio

Hello.

I would like to use it for categories not for subcategories. So I would like to make the second image show next to the default category image. How can I achieve that?  I was following tutorial but I am not sure what to do in last steps when you are overriding getSubCategories method... 
Thanks!

Link to comment
Share on other sites

  • 1 year later...

Hi NemoPS, 
I use that code, but cant get to work that if NO Second Image was uploaded -> I want NO image to show.
Now in standard It always shows the default image.
How can I achieve that? (in categroy.tpl, when I comment out the {else} for the subcategorie images, it does not affect, still showing the standard)
Thx for help,
 

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

{if $subcategory.id_image2}
							<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image2, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

						{else}
							<img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{/if}

If I would delete the default image in the {else}, the default would not shown.
But with the changes from your tutorial it does not work. Any help would be nice :)

Edited by idee (see edit history)
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...