Jump to content

[Solved] Manufacturer on product-list page - .tpl files don't load


Recommended Posts

http://5.9.94.3/~akademia/en/3_alivar

 

It's quite strange problem. Link above should load manufacturer page, but it looks like only manufacturer.tpl is loaded. All others, including header.tpl and footer.tpl are missing. Core files must be fine cause on default theme this page looks OK, but it can't be my theme's fault  as manufacturer.tpl is exactly the same as the one in default theme and all other pages load just fine.

Presta 1.5.6.0

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

Hi Sharak,

 

This is what I think your problem is not in your manufacture.tpl but product-list.tpl which is being called from manufacturer.tpl.

 

In your product-list.tpl you must have added code to display manufacturer's link. In default theme it does not display manufacturer link. So its most likely that the code you added to display manufacturer link (and image) in the product-list.tpl is causing the problem.

  • Like 1
Link to comment
Share on other sites

<a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.link_rewrite)|escape:'htmlall':'UTF-8'}" class="lnk_img">
        <img src="{$img_manu_dir}{$product.id_manufacturer|escape:'htmlall':'UTF-8'}-medium_default.jpg" alt="" />
</a>

Add this code anywhere within the foreach loop in your product-list.tpl. It should be within the foreach loop because {$product} is available only within the foreach loop.

  • Like 1
Link to comment
Share on other sites

Works like a charm :) Thank you!

Only thing missing is a condition when product doesn't have manufacturer set, so just to get rid of ?-images:

{if $product.id_manufacturer != 0}
	<a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.link_rewrite)|escape:'htmlall':'UTF-8'}" class="lnk_img">
		<img src="{$img_manu_dir}{$product.id_manufacturer|escape:'htmlall':'UTF-8'}-manufacturer.jpg" alt="" />
	</a>
{/if}
Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...
<a href="{$link->getmanufacturerLink($product.id_manufacturer, $product.link_rewrite)|escape:'htmlall':'UTF-8'}" class="lnk_img">
        <img src="{$img_manu_dir}{$product.id_manufacturer|escape:'htmlall':'UTF-8'}-medium_default.jpg" alt="" />
</a>

hi

 

the manufacturer link become www.domain/manufacturerID_productURLreWRITEN  , then when clicked, its redirect to  www.domain/manufacturerID_ManufacutererName

 

why is it like that, any specific reason? i would have been good if manufacturer name is passed in first place is not?

 

 

 

Link to comment
Share on other sites

×
×
  • Create New...