PrestaShop Forums: [SOLVED] How to change settings for Block Advertising? - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


[SOLVED] How to change settings for Block Advertising?


[SOLVED] How to change settings for Block Advertising?

#1 Guest_Paradox_*

  • --
  • Guests

Posted 02 February 2010 - 03:28 PM

How do you change the picture and link for the Block Advertising?

How do you also add more than one with different settings?

Thanks

#2 Guest__*

  • --
  • Guests

Posted 03 February 2010 - 08:28 AM

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.

#3 Guest__*

  • --
  • Guests

Posted 03 February 2010 - 01:46 PM

And is it possible to have several (different) advertisements? So basically is it possible to duplicate the advertisement module?
Thanks a lot in advance!

#4 Guest__*

  • --
  • Guests

Posted 03 February 2010 - 01:54 PM

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.

#5 Guest__*

  • --
  • Guests

Posted 03 February 2010 - 02:58 PM

Rocky, I had been struggling with this for hours. Your solution worked like a charm. Thank you very much!

#6 Guest__*

  • --
  • Guests

Posted 07 March 2010 - 08:57 AM

From 1265201690:

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?

#7 Guest__*

  • --
  • Guests

Posted 07 March 2010 - 10:17 AM

It works fine for me. I'll attach the updated module.

Attached File(s)



#8 Guest__*

  • --
  • Guests

Posted 08 March 2010 - 05:39 AM

From 1267953469:

It works fine for me. I'll attach the updated module.


The module you updated,i uploaded the blockadvertising2 folder and it appeared:

"No template found" in my online shop.

What could be wrong?

Thanks

Regards,
Eileen

#9 Guest__*

  • --
  • Guests

Posted 08 March 2010 - 05:53 AM

Sorry, my mistake. I've updated the above archive.

#10 Guest__*

  • --
  • Guests

Posted 11 March 2010 - 03:19 AM

I had been struggling with this for hours Thanks for the solution

#11 Guest__*

  • --
  • Guests

Posted 01 April 2010 - 12:02 AM

Is it posible to use modules from SP 1.3.1 beta in 1.2.5 like Block advertising v0.1?

#12 Guest__*

  • --
  • Guests

Posted 01 April 2010 - 12:31 AM

Yes, but only the simple ones that don't rely on modified core code. The advertising block is one much module.

#13 Guest__*

  • --
  • Guests

Posted 02 June 2010 - 09:56 AM

Thank you rocky!

I would also rename:
$this->displayName = $this->l('Block advertising');
to:
$this->displayName = $this->l('Block advertising2');

So you can distinguish them in the BO

Regards.

#14 Guest__*

  • --
  • Guests

Posted 09 July 2010 - 07:49 PM

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)

Attached File(s)



#15 Guest__*

  • --
  • Guests

Posted 10 July 2010 - 01:05 AM

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.

#16 Guest__*

  • --
  • Guests

Posted 10 July 2010 - 07:10 AM

Thanks, why haven't I thought about that.
It's so obvious.

It works fine now, thanks thanks thanks!

#17 Guest__*

  • --
  • Guests

Posted 05 August 2010 - 03:30 AM

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!

Attached File(s)



#18 Guest__*

  • --
  • Guests

Posted 05 August 2010 - 05:08 AM

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

The way rocky provided works perfect! Cheers!

#19 Guest__*

  • --
  • Guests

Posted 14 August 2010 - 01:14 PM

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?

#20 Guest__*

  • --
  • Guests

Posted 15 August 2010 - 12:55 PM

Hi webmc,

Have you put the cloned module - blockadvertising02 - in your module file? If you do, you should be able to find it in the module page of your admin section.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users