Jump to content

getManufacturerLink breaks pagination


Ben

Recommended Posts

Hi everyone ! 

I try to add a link to the manufacturer on the product listing, thanks to a bit of code I found on the web : 

{block name='manufacturer_block'}
     {if isset($product.id_manufacturer) && $product.id_manufacturer!= null}
         <a href="{$link->getManufacturerLink($product.id_manufacturer)}" class="lien">
             {Manufacturer::getnamebyid($product.id_manufacturer)}
         </a>
     {/if}
{/block }

 

It seems to work well, except it breaks the pagination (nothing happens when clicking on any link button). After a lot of tests, it seems that the function getManufacturerLink is the cause of the bug. We tried to chek if the $id_manufacturer wasn't null or empty by adding a couple of conditions, but to no avail. 

We use a Prestashop 1.7.1 with a theme bought on the store, but I cannot give the URL given that it's on a developement server right now... 

 

Any help or tip would be very welcome  :)

Link to comment
Share on other sites

  • 2 weeks later...

Okay, so after several tests, I still don't know the reason behind this conflict between getManufacturerLink and the pagination, but it seems that the function product_brand_url allows to get the manufacturer link, without breaking the pagination. 

So problem solved 

 

Well, acutally not : it seems that this function doesn't return anything when used outside the product page (in this case in a product list).

Edited by Ben (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...