Gme Abdullah Posted May 29, 2011 Share Posted May 29, 2011 i need to duplicate my advrtising block on my website? how i have to do it? i have a google on internet,youtube,prestashop forum but still did not find the answer. pls help me operators,tq Link to comment Share on other sites More sharing options...
rtmemory Posted May 30, 2011 Share Posted May 30, 2011 Passing through study and look forward to expert answers Link to comment Share on other sites More sharing options...
shokinro Posted May 30, 2011 Share Posted May 30, 2011 please check my blog here. There is a detailed instructions there. Link to comment Share on other sites More sharing options...
Gme Abdullah Posted May 30, 2011 Author Share Posted May 30, 2011 thanks for reply..im sory im still did not catch up you instruction.. i have read already but still cant catch up.. i understand about the copier and rename the blok.. but where is it the places i have to do that? where i need to copy and where i need to paste? is it at inspect element? if not where is it? Link to comment Share on other sites More sharing options...
shokinro Posted May 30, 2011 Share Posted May 30, 2011 each module must have its own folder.the module folder is under YourSiteRoot/modules/ Link to comment Share on other sites More sharing options...
juanv Posted June 23, 2011 Share Posted June 23, 2011 HiThank you for the blog instructions but iam still a bit stuck, iam using prestashop 1.4.2.5 and i want to duplicate my advertisingblock. I get to the point where i can see both my blocks active on the front page but iam struggling with the different images, if i change one then both blocks images change, can you direct me to the right direction to seperate the block images from each other or if possible can you please share your advertisingblock2 file? Link to comment Share on other sites More sharing options...
Jenny Ledd Posted June 23, 2011 Share Posted June 23, 2011 Interesting post. Link to comment Share on other sites More sharing options...
shokinro Posted June 23, 2011 Share Posted June 23, 2011 check your image URL from your browser and see if they are pointing to the same images.what is path and see if you need to change theme TPL file or PHP file.I guess you didn't change the module name in PHP file in the constructor $this->name = 'blockadvertising'; You have to set to different name. Link to comment Share on other sites More sharing options...
juanv Posted June 24, 2011 Share Posted June 24, 2011 check your image URL from your browser and see if they are pointing to the same images.what is path and see if you need to change theme TPL file or PHP file.I guess you didn't change the module name in PHP file in the constructor $this->name = 'blockadvertising'; You have to set to different name. Thank you for the reply ☺I made sure that I changed that attribute.... I eventually got the images sorted out (dont ask how since iam still unsure) but now its the same issue with the image link, if i change one link.... then both block links change so they both have the same links.... any ideas? Link to comment Share on other sites More sharing options...
Andy1 Posted August 16, 2011 Share Posted August 16, 2011 check your image URL from your browser and see if they are pointing to the same images.<br/>what is path and see if you need to change theme TPL file or PHP file.<br/> <br/>I guess you didn't change the module name in PHP file in the constructor<br/><br/> $this->name = 'blockadvertising';<br/> <br/><br/>You have to set to different name. <br/><br/>Thank you for the reply ☺<br/><br/>I made sure that I changed that attribute.... I eventually got the images sorted out (dont ask how since iam still unsure) but now its the same issue with the image link, if i change one link.... then both block links change so they both have the same links.... any ideas? I am also having problems with the link. If I have a link on one advert, it also happens on the other one. Does anyone know how to solve this? Link to comment Share on other sites More sharing options...
shokinro Posted August 17, 2011 Share Posted August 17, 2011 Sorry for late response. I am also having problems with the link. If I have a link on one advert, it also happens on the other one. if you still have not figured the problem, please check if you are using the same configuration parameter "PS_BLOCKLINK_URL" in the two modules. You need to change to use different name, for example, for the 2nd module you created, use "PS_BLOCKLINK_URL2" instead of "PS_BLOCKLINK_URL". This is Steps 5 of my instructions on how to duplicate modules. http://alvinjiang.blogspot.com/2011/01/prestashop-tips-how-to-duplicate.html Hope this helps Link to comment Share on other sites More sharing options...
Andy1 Posted August 17, 2011 Share Posted August 17, 2011 Sorry for late response. I am also having problems with the link. If I have a link on one advert, it also happens on the other one. if you still have not figured the problem, please check if you are using the same configuration parameter "PS_BLOCKLINK_URL" in the two modules. You need to change to use different name, for example, for the 2nd module you created, use "PS_BLOCKLINK_URL2" instead of "PS_BLOCKLINK_URL". This is Steps 5 of my instructions on how to duplicate modules. http://alvinjiang.blogspot.com/2011/01/prestashop-tips-how-to-duplicate.html Hope this helps I have changed the name of the module to "block advertising2" so should I always change things in this module so they have the '2' at the end? Where do I change "PS_BLOCKLINK_URL"? I've had a look in the "Block Advertising2" folder but can't find it. Or is this code in the TPL file? If it is, how do I know which bit of code is foe the second advertising block? Thank you for your help with this. Link to comment Share on other sites More sharing options...
shokinro Posted August 17, 2011 Share Posted August 17, 2011 Where do I change "PS_BLOCKLINK_URL"? I've had a look in the "Block Advertising2" folder but can't find it. It is not a file name. It is parameter name. it is inside of following files /modules/blockadvertising2.php (you created) I suggest read the instructions and following the instructions here http://alvinjiang.blogspot.com/2011/01/prestashop-tips-how-to-duplicate.html Link to comment Share on other sites More sharing options...
Andy1 Posted August 17, 2011 Share Posted August 17, 2011 Where do I change "PS_BLOCKLINK_URL"? I've had a look in the "Block Advertising2" folder but can't find it. It is not a file name. It is parameter name. it is inside of following files /modules/blockadvertising2.php (you created) I suggest read the instructions and following the instructions here http://alvinjiang.blogspot.com/2011/01/prestashop-tips-how-to-duplicate.html Hi shokinro, thank you for the reply. I have been through the instructions and have looked in the blockadvertising2.php file, but there is nothing called PS_BLOCKLINK_URL. There is this: Configuration::updateValue('BLOCKADVERT_LINK', 'http://www.prestashop.com') Could this be the bit that needs changing? Thank you again for your help. Link to comment Share on other sites More sharing options...
shokinro Posted August 17, 2011 Share Posted August 17, 2011 Configuration::updateValue('BLOCKADVERT_LINK', 'http://www.prestashop.com') Maybe we are look at different version. Yes, you have to change this. You have to change all occurrence of the same, not just one place. Link to comment Share on other sites More sharing options...
Andy1 Posted August 18, 2011 Share Posted August 18, 2011 Configuration::updateValue('BLOCKADVERT_LINK', 'http://www.prestashop.com') Maybe we are look at different version. Yes, you have to change this. You have to change all occurrence of the same, not just one place. It works. I changed all instances of 'BLOCKADVERT_LINK' to''BLOCKADVERT_LINK2'. Thank you! Link to comment Share on other sites More sharing options...
shokinro Posted August 18, 2011 Share Posted August 18, 2011 It works. I changed all instances of 'BLOCKADVERT_LINK' to''BLOCKADVERT_LINK2'. Thank you! You are welcome and thanks for feedback! 1 Link to comment Share on other sites More sharing options...
umamishop Posted February 9, 2012 Share Posted February 9, 2012 Hi shokinro, Great advice, thanks! I am also duplicating the blockadvertising module - I have followed all the instructions, and now one of my modules doesn't link at all; The image and text appear fine, but the linked URL doesn't work. The other blockadvertising module works fine. Do you know what could be causing this? thanks! Link to comment Share on other sites More sharing options...
bellini13 Posted February 9, 2012 Share Posted February 9, 2012 for those having difficulty duplicating this block, i have created a simple block that will allow you to place whatever content you choose, either in the left or right block. You configure the content in the modules configuration page. It supports text, html, javascript and css. http://www.bellini-services.com/shop/prestashop-modules/22-block-random.html Link to comment Share on other sites More sharing options...
shokinro Posted February 9, 2012 Share Posted February 9, 2012 Great advice, thanks! I am also duplicating the blockadvertising module - I have followed all the instructions, and now one of my modules doesn't link at all; The image and text appear fine, but the linked URL doesn't work. The other blockadvertising module works fine. Do you know what could be causing this? thanks! Sorry for my late response. I think you need to change configuration item names to make it different for different module. I guess you are still using the same configuration item. that's the only thing I can imagine. Configuration::updateValue('BLOCKADVERT_IMG_EXT','jpg'); Pleae also check if the image you uploaded is under the module folder. make sure you have chnaged the module name correctly. $this->name = 'blockadvertising'; by the way, I have module Agile Rotating Banners module allows you to display different advertising banners at different locations of your PrestaShop concurrently. If you are interested, you can check this thread Link to comment Share on other sites More sharing options...
JDub1337 Posted March 28, 2013 Share Posted March 28, 2013 (edited) I know this thread is old but for anyone looking to duplicate the advertising block (ie: Advertising Block 2) you need to follow Shokinro's tutorial but there are a few added steps. I followed the tutorial to a "t" and was having a similar issue with both blocks mimicing each other with the title, image, and link. Here is what I did. In your duplicated blockadvertising(x).php file (where (x) indicates your duplicated number) you need to find and replace all "BLOCKADVERT_" with an updated number on the end (ie: 2,3,4,etc.). This includes all code types such as: -BLOCKADVERT_TITLE -BLOCKADVERT_LINK -BLOCKADVERT_IMG_EXT Find all of these bits of code and simply put your new numerical update on the end of ALL (ie: BLOCKADVERT_TITLE2), save the file, re-upload it and try it out. I hope this helps as I spent some time trying to figure it out and this worked for me. Cheers! Josh Edited March 28, 2013 by JDub1337 (see edit history) Link to comment Share on other sites More sharing options...
JohnADK Posted September 20, 2013 Share Posted September 20, 2013 Just wanted to add my appreciation to Shokinro for the great info on duplicating the block advertising. I have also followed his instructions with success, figuring out myself the excellent addtions from JDub1337 (which I just now read). Thanks for sharing this info. Great help! Link to comment Share on other sites More sharing options...
Jon T Posted May 4, 2014 Share Posted May 4, 2014 Many thanks for the contributions in this thread. I have PS 1.5.4.1. I followed the instructions and was able to create an extra occurrence of the module. The only problem is that although the two modules use identically sized banners they display in two different sizes. See algoclear.com on the right hand column. It seems that the second one's dimensions are overided somehow. I have checked the code and they appear to be identical in function. I can't figure out how to fix this. Can anyone shed any light on this? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now