Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 236 Vote(s) - 3.63 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Manufacturer Image on Prestashop

#1
I'm trying to add manufacturer image on **topmenu** module on prestashop. I'm very new to this CMS.
I added this line to the code (`blocktopmenu.php`) to make some tests:

<img src='.$link->getImageLink((int)$manufacturer['id_manufacturer'], 'img/m').'>

Unfortunately checking the HTML generated code, the link I obtain is the following, and it can't retrieve correctly the image I need:

<img src="abtemplates.altervista.org/1/img/m/2.jpg">

But what I need really is this:

<img src="/1/img/m/2.jpg">

**My Question:** Is there a way to obtain manufacturer image with `getImageLink` method or similar? Thanks in advance
Reply

#2
You can get the manufacturer image with the following code:

<img src="' . __PS_BASE_URI__ . 'img/m/' . (int) $manufacturer['id_manufacturer'] . '.jpg">

It is more elegant to assign the manufacturer ID to a Smarty variable in the `hookDisplayTop` method:

$this->smarty->assign('id_manufacturer', $yourManufacturerId);

Then you can display it in `blocktopmenu.tpl`:

<img src="{$img_manu_dir}{$id_manufacturer}.jpg">
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through