hurray Posted July 17, 2010 Share Posted July 17, 2010 I have prestashop 1.2.5 and do not have the configure option for block advertising.Right now I have a white monitor screen linked to prestashop website. I would like to change both the image and the link. How can I do that? And would it be possible to have two small images linked to two different pages of the site under this block? Following is the code from blockadvertising.tpl.<!-- MODULE Block advertising --> <!-- /MODULE Block advertising --> Link to comment Share on other sites More sharing options...
rocky Posted July 18, 2010 Share Posted July 18, 2010 You can copy the advertising block from v1.3.1 into v1.2.5, since it doesn't depend on any changes to PrestaShop's code. Otherwise, you'll need to modify modules/blockadvertising/blockadvertising.tpl to change the image URL and link. Link to comment Share on other sites More sharing options...
hurray Posted July 18, 2010 Author Share Posted July 18, 2010 Can you tell me where in the blockadvertising.tpl do I need to make the change?I have the code on my first message. Link to comment Share on other sites More sharing options...
rocky Posted July 18, 2010 Share Posted July 18, 2010 In the PrestaShop v1.2.5 advertising module, you'll need to edit line 3 of modules/blockadvertising/blockadvertising.tpl to change the link: <a href="http://www.prestashop.com" title="{l s='Advertising' mod='blockadvertising'}"> Change http://www.prestashop.com to the link you want.To change the image, you can simply overwrite modules/blockadvertising/advertising.jpg, or if you want to link to another image, you'll need to edit line 36 of modules/blockadvertising/blockadvertising.php to change the image filename: $smarty->assign('image', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising.jpg'); You can change 'advertising.jpg' to another image in the module's directory, or you could replace the whole parameter with an external URL. Link to comment Share on other sites More sharing options...
hurray Posted July 19, 2010 Author Share Posted July 19, 2010 Hi Rocky,Thanks for your suggestion. What about if I want to add two images under this module, each one linked to different pages of the site.For example, under this module, I would like to have a text image "Silver Rings" which will be linked to my silver ring page and another text image "Metal Rings" which will be linked to my metal rings page of the site. Link to comment Share on other sites More sharing options...
domino internet Posted July 19, 2010 Share Posted July 19, 2010 Hi,I'm trying to modify the advertising module so it gets displayed on the top of the images (see the attached image).I've changed the PHP to this: class BlockAdvertising_top extends Module { public $adv_link; public $adv_img; public $adv_imgname; function __construct() { $this->name = 'blockadvertising_top'; $this->tab = 'Blocks'; $this->version = 0.1; It gets displayed in BO > Modules > Blocks, so I installed and configured it, then I out it in the "Top of Pages" from Modules > Position, but it doesn't get displayed anywhere.I guess I need to modify the install () line with the right hook but I tried with the following and still got nothing: function install() { if (!parent::install()) return false; if (!$this->registerHook('top')) return false; return true; } Note: if I move it to the left or right columns then it gets displayed fine... weird, isn't it?Thanks in advance for your help! Link to comment Share on other sites More sharing options...
rocky Posted July 20, 2010 Share Posted July 20, 2010 @hurrayYou'll need to copy the line in my first code snippet above and change the link and image URL.@domino internetYou must add a hookTop function to your class that returns the template code. Link to comment Share on other sites More sharing options...
hurray Posted July 20, 2010 Author Share Posted July 20, 2010 Hi Rocky,Ok I have added an extra line to my blockadvertising.tpl. Now I have two images linked to two different pages on my site. The problem is, instead of 2 different images, the images are the same. The text image saying "Silver Rings" is linked to Silver Rings page and the other text image which is also Silver Rings and should have been "Metal Rings" is linked to metal rings page. I am not being able to change the image to "Metal Rings". What do I now need to do in blockadvertising.php? Link to comment Share on other sites More sharing options...
rocky Posted July 20, 2010 Share Posted July 20, 2010 I forgot about that. You'll need to change line 36 from: $smarty->assign('image', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising.jpg'); to: $smarty->assign('image', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising.jpg'); $smarty->assign('image2', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising2.jpg'); Then you've have two different images advertising.jpg and advertising2.jpg in the modules/blockadvertising directory. You'll then need to change the line you added to blockadvertising.tpl to: <a href="http://www.prestashop.com" title="{l s='Advertising' mod='blockadvertising'}"> Link to comment Share on other sites More sharing options...
hurray Posted July 20, 2010 Author Share Posted July 20, 2010 Thank you again or your help. It worked.But can you please go to my website http://shop.ametibetaine.com/ and scroll all the way down and take a look at the left hand side (navigation menu). You will see that the advertising block (blinking texts) seems to have appeared there as well. I wanted them on top (which they are). But why are they there as well?Thank you in advance. Link to comment Share on other sites More sharing options...
rocky Posted July 20, 2010 Share Posted July 20, 2010 I can't see any advertisements on your site, but my guess would be that you've got the "Advertising block" hooked multiple times. Go to Modules > Positions and delete the "Advertising block" from any sections you don't want it in. Link to comment Share on other sites More sharing options...
hurray Posted July 20, 2010 Author Share Posted July 20, 2010 Yes you were right. I had two advertisement module hooked with different names. Thanks again. Link to comment Share on other sites More sharing options...
Vicodin Posted November 18, 2010 Share Posted November 18, 2010 Hello,How can i change the picture on the block advertising module with a flash animation?Thanks in advance Link to comment Share on other sites More sharing options...
Recommended Posts