Jump to content

[SOLVED] How to change settings for Block Advertising?


Recommended Posts

In Prestashop v1.3, you can go to Modules > Blocks section > Block advertising v0.1 > Configure and then select an image and change the URL. In Prestashop v1.2.5 and earlier, you must manually modify modules/blockadvertising/blockadvertising.tpl to change the URL and overwrite modules/blockadvertising/advertising.jpg to change the image.

Link to comment
Share on other sites

Unfortunately, simply transplanting the advertising module in multiple locations will just display the same ad, not different ads. You'll need to copy the blockadvertising module and change the folder name to blockadvertising2 and blockadvertising.php to blockadvertising2.php and in that file, change:

class BlockAdvertising extends Module



to:

class BlockAdvertising2 extends Module



and:

$this->name = 'blockadvertising';



to:

$this->name = 'blockadvertising2';



You can do the same with number 3, for example, if you need three advertising modules.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
Unfortunately, simply transplanting the advertising module in multiple locations will just display the same ad, not different ads. You'll need to copy the blockadvertising module and change the folder name to blockadvertising2 and blockadvertising.php to blockadvertising2.php and in that file, change:

class BlockAdvertising extends Module



to:

class BlockAdvertising2 extends Module



and:

$this->name = 'blockadvertising';



to:

$this->name = 'blockadvertising2';



You can do the same with number 3, for example, if you need three advertising modules.



I tried to follow the process above but there were no new advertising block appear. Am i missing something?
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 1 month later...

Hi folks,

I followed the workaround and now I have four different folders:
blockadvertising, blockadvertising2, blockadvertising3, blockadvertising4
so far so good.
All four ads have different pictures but the links are all the same. I cant find a reason why all four ads link to the same site.
What am i doing wrong?

Can anyone help me.
If you need more info, just tell me.
Thanks in advance.

I included blockadvertising"1" and blockadvertising3 (zip folders)

blockadvertising3.zip

blockadvertising.zip

Link to comment
Share on other sites

The problem is that you forgot to change the BLOCKADVERT_LINK setting to BLOCKADVERT3_LINK so that they are writing to different database keys. At the moment, both the modules are sharing the same database key and overwriting each other's values.

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

I have followed the workaround and made blockadvertising02.php. I got the new module kinda working and have it show an image. But same as eileensiow, blockadvertising02 is linked to the same website as the original blockadvertising module, even after I have changed the BLOCKADVERT_LINK setting to BLOCKADVERT02_LINK as rocky instructed. And I checked both of the files which eileensiow and rocky shared, they are quite a bit different from mine, even though mine states as version =0.1 as well.

I have attached my file here. Would someone please give me some hint here. Thanks much!

blockadvertising02.php

Link to comment
Share on other sites

  • 2 weeks later...

Before I found this topic I had already cloned this module. It works perfectly on my local host but doesnt show up in the admin section or front page on live site. I also tried downloading this module off this thread and trying it - the same thing happened. Does anyone know what the problem can be?

Link to comment
Share on other sites

hi SandyW,

funnily enough i had actually tried that! :)

I just installed this insead.

SotEW's Adds v0.4
Displays advertising files


and added this in the tpl:

{if $page_name == 'index'}

because i only want to show it on the index page.....

It would be good if there was a module you could upload adds to for each individual category at the time of creating it.....

(the site is ragamuffyns.co.uk - not finished)

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...

Hi

Can anyone help me please, iam running prestashop ver 1.4.2.5 using Block advertising v0.2 by PrestaShop, i have tried some of the other zip files but with no success! Can someone please share a Block advertising.zip file, Thank you

Link to comment
Share on other sites

  • 9 months later...

Sorry, everyone! I have solved my problem now! It was just something stupid that I have done.

 

The way rocky provided works perfect! Cheers!

 

Just curious, what was it that you did? I'm having the same problem. I've changed the occurrences of BLOCKADVERT_LINK in the new php, however they still all go to the same link

Link to comment
Share on other sites

  • 3 months later...

Dear Rocky;

 

I would like to ask about how to add multiple links to advertisement blocks. In my website (www.mgsmarket.com), I have 5 ads banners and also I have 3 language options. For current structure of ads blocks, for any language option, when user clicks to a ads block, she/he is forwarded to the link on ads and hence, if she/he uses let's say Turkish language and link is forwarded to English, she/he will open an English page from ads and then she/he will need to change language again and again. Is there any code, which we can use for ads blocks to give them multiple links? In Turkish, it will open Turkish Link, in English it will open English link and in Greek it will open greek link when user click on ads block pictures.

 

If there is any possibility, or way to do this please lead us.

 

Looking forward to hearing from you soon

Link to comment
Share on other sites

  • 2 weeks later...

Hi Rocky,

I saw your how-to about adding more than one advertising block. I even downloaded the folder you provided. However, I seen the added module on the back end, but it gives me a black screen for my home page with the error...

 

"Fatal error: Call to undefined method BlockAdvertising2::hookrightColumn() (it gives the directory name) on line 198

 

Any suggestions you may have will help. I am using version 1.4.

Thanks!

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...