PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

How Do I Duplicate the Add Stuff Module?

13 replies to this topic
#1
thriftybeatnik.co.uk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 37 posts
Any help on this would be grand

Cheers x

#2
first1

    PrestaShop Addict

  • Moderators
  • 546 posts
what is add stuff module
If we answered your question, please add [Solved] at the beginning of your topic’s title by editing your first post !
Thanks.

#3
JJBYPC

    PrestaShop Apprentice

  • Members
  • PipPip
  • 54 posts
HI,

You'll need to use a Text editor to change the name.

EG: AddStuff should be changed to MyAddStuff or whatever you like.

You must search all the included files for the word AddStuff and make the change.
Then upload and install.

#4
Paul C

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1005 posts
As of version 0.6.3 I've used my convention for creating configuration values etc. in that module, so actually it's even easier than it was before to create a clone.

In essence the process to create a clone called addstuff2 would be (assuming you've made a copy of the module directory locally):

* Rename the addstuff directory and the files addstuff.php and addstuff.tpl to addstuff2, adstuff2.php and addstuff2.tpl
* In your addstuff2.php change line 2 from:
class AddStuff extends Module

to
class AddStuff2 extends Module

* Again in addstuff2.php change line 9 from:
$this->name = 'addstuff';

to
$this->name = 'addstuff2';

* In addstuff2.tpl replace each occurrence of addstuff to addstuff2 i.e.
<!-- MODULE Addstuff2 -->

{$addstuff2_code}

<!-- /MODULE Addstuff2 -->


And I think that should do it :cheese:

You can get the most recent version from the AddStuff module page

Paul
Free Prestashop modules and developer resources

Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2

Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net

#5
blackandwhite

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts
Hi.

Nice addon. I tried duplicating the addstuff folder according to these instructions, but am getting a parse error on the Admin Panel Modules page for addstuff2.

I tried renaming both just the occurances of 'addstuff' to addstuff2' in the .tpl file that you mentioned here, and then I went back and changed ALL of these occurances throughout that file. Still getting the parsing error though.

Any do this successfully?

Thanks.

#6
erdesignerz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 76 posts
Paul C thanks for this guide. It was very helpful. There is one more thing, if you like to change the name of the module that appears in BO:

You must edit addstuff.php. Go to line 30 and change the name

ORIGNIAL > $this->displayName = $this->l('AddStufftop');

NEW > $this->displayName = $this->l('Put the New Name Here');

ER

#7
jmase

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts
I've tried to do this in 1.4 prestashop and I renamed all the files as stated above.

However, I cant get the module to appear in my back office at all :(

I have addstuff in the right column using mystuff.html but i also want it in the left column with differnt pictures and links, but i cant seem to get the duplicate to work :(

any help?

#8
erdesignerz

    PrestaShop Apprentice

  • Members
  • PipPip
  • 76 posts

From 1296340973:

I've tried to do this in 1.4 prestashop and I renamed all the files as stated above.

However, I cant get the module to appear in my back office at all :(

I have addstuff in the right column using mystuff.html but i also want it in the left column with differnt pictures and links, but i cant seem to get the duplicate to work :(

any help?


I will not work with 1.4 from what I know.

#9
snowmanred2

    PrestaShop Newbie

  • Members
  • Pip
  • 4 posts
when I make the changes suggested by Paul C everything looks great in the back office. But when I put my html code into mystuff.html and load it up on my website I dont get anything. Instead of a box that looks like all my other boxs I just get a message on the screen where the box should have been. It says No Template Found. Any ideas? I would love to hear them. Thanks for the help

#10
nikmagnus

    PrestaShop Apprentice

  • Members
  • PipPip
  • 54 posts
Hi there,

I'm getting addstuff to work in PS1.4
I have duplicated it and it works fine.

Here's what I did:

Quote

Duplicate the addstuff folder
Remame to addstuff2
rename addstuff.php to addstuff2.php


In addstuff2.php:
change
line 2: class AddStuff2 extends Module
line 9: $this->name = 'addstuff2';
line 30: $this->displayName = $this->l('AddStuff2');
line 155: return $this->display(__FILE__, 'addstuff2.tpl');

in addstuff2.tpl
line 3: {$addstuff2_code}


You can also see a (crappy!) video on the topic:


Cheers, Nik

#11
cleatus

    PrestaShop Newbie

  • Members
  • Pip
  • 16 posts

From 1301831374:

Hi there,

I'm getting addstuff to work in PS1.4
I have duplicated it and it works fine.

Here's what I did:

Quote

Duplicate the addstuff folder
Remame to addstuff2
rename addstuff.php to addstuff2.php


In addstuff2.php:
change
line 2: class AddStuff2 extends Module
line 9: $this->name = 'addstuff2';
line 30: $this->displayName = $this->l('AddStuff2');
line 155: return $this->display(__FILE__, 'addstuff2.tpl');

in addstuff2.tpl
line 3: {$addstuff2_code}


You can also see a (crappy!) video on the topic:


Cheers, Nik



i installed addstuff o_6_3 in prestashop 1.4.1 and now no modules are listed under modules in admin. any ideas would be appreciated. how would i go about manually removing addstuff and hoping that does the trick?

#12
nikmagnus

    PrestaShop Apprentice

  • Members
  • PipPip
  • 54 posts
You could remove the addstuff folder from your modules folder.
Your question was a bit off-topic, the issue of duplicating an addstuff module was being talked about.
I'd suggest starting a new topic.
Cheers, Nik

#13
cleatus

    PrestaShop Newbie

  • Members
  • Pip
  • 16 posts
thanks for the reply. sorry. i saw this thread was still active for the old module. didn't want to start a new thread for something so simple. i got it working. renamed suspect modules 1 by one. turned on show errors in config/config.inc.php. got it hooking into home content by looking at other modules php files that are currently hooked into home content and used that as a reference. about a third of the way down a modules php file is a line referring to register hook. then at the bottom of the file around the smarty section may be more regiister hook functions. changing these two areas of the file you can hook a module into any section of your site. (for other people spending hours searching the forums for simple stuff like this)

#14
DaBotta

    PrestaShop Newbie

  • Members
  • Pip
  • 6 posts
Do you have any ideea , how to put in the html file , more java scripts ? I am using 2 trafic monitors , and i can use them in one single html.

I have tryed to add the script code but it only show the first of that. What can i do ?