Jump to content

Embed Newsletter Module in a PopUp


Recommended Posts

Hi there,

 

I'm almost a newbie in prestashop development. So, for learning purpose and giving away, I'm trying to embed the default newsletter module in a pop up.

I have developed a simple html pop up box so far but really have no idea on how can I use newsletter module with it.

 

Any suggestion would be helpful guys :-)

 

Thanks in advance.

 

 

Vipin

Link to comment
Share on other sites

You will need to edit the root/storeroot/modules/blocknewsletter module. If the changes do not take effect after you clear your cache check to see if you have a blocknewsletter folder in your theme mod folder... /storeroot/themes/themename/modules. 

 

specifically you would need to add code to the /blocknewsletter/views/template/hook/blocknewsletter.tpl

 

If you rework that code you can get it to fire off a popup. Having a button that pops up a hidden <div> would be easy enough. Now you if you wanted to have this automatically pop up on page load you may have to edit /blocknewsletter/blocknewsletter.js file in order to incorporate the correct code to display popups on page load. 

 

Once you make the changes be sure to clear your cache. I would also recommend you, download the blocknewsletter module folder, Rename it to something like mycustonblocknewsletter folder, change all references to blocknewsletter in /blocknewsletter/blocknewsletter.php, make the changes, zip the folder, and install as a new module. 

 

This way when Prestashop sends an update for the blocknewsletter module your changes will not get overwritten. 

Link to comment
Share on other sites

You will need to edit the root/storeroot/modules/blocknewsletter module. If the changes do not take effect after you clear your cache check to see if you have a blocknewsletter folder in your theme mod folder... /storeroot/themes/themename/modules. 

 

specifically you would need to add code to the /blocknewsletter/views/template/hook/blocknewsletter.tpl

 

If you rework that code you can get it to fire off a popup. Having a button that pops up a hidden <div> would be easy enough. Now you if you wanted to have this automatically pop up on page load you may have to edit /blocknewsletter/blocknewsletter.js file in order to incorporate the correct code to display popups on page load. 

 

Once you make the changes be sure to clear your cache. I would also recommend you, download the blocknewsletter module folder, Rename it to something like mycustonblocknewsletter folder, change all references to blocknewsletter in /blocknewsletter/blocknewsletter.php, make the changes, zip the folder, and install as a new module. 

 

This way when Prestashop sends an update for the blocknewsletter module your changes will not get overwritten. 

Hi swcoins,

 

Thanks for your valuable suggestion. Yes this sounds quite meaningful. But Before I try that, Is there anyway to reuse the default newsletter module just by calling it in my module (without re-writing the module). Something like obtaining the output of newsletter module and put it into pop up. May be this way I can see results quickly??

 

Besides, your suggestion will make it independent pro module. I'll definitely definitely try that.

Link to comment
Share on other sites

I am unaware of making the basic newsletter module do what you want it to do without at least editing some of the code. I just suggested you copy and create it as a new module because as soon as you get it to work Prestashop will come out with an update and you will update and then realize all your work has been overwritten. ;) 

Link to comment
Share on other sites

I am unaware of making the basic newsletter module do what you want it to do without at least editing some of the code. I just suggested you copy and create it as a new module because as soon as you get it to work Prestashop will come out with an update and you will update and then realize all your work has been overwritten. ;)

Yes, you are absolutely correct. The newer prestashop version will overwrite if I change the original core module-files etc. And that's why I only want to use an instance or "make a placeholder" for original newsletter module so that, my module works in conjunction with original module and admin can manage subscribers at one place.

My module will be installed separately and will just have a checkbox option whether to include newsletter option in popup. If it is checked, the module will see original module with the theme styling in the popup. Just the placeholder will be enabled-disabled by the option.

Please suggest if this makes any sense.

Else, I have to provide backoffice funtionality to export the subscribers through pop up separately (considering, original module updated and no longer support the mysql tables and my module just created a separate newsletter module entries in database).

Link to comment
Share on other sites

Yes, you are absolutely correct. The newer prestashop version will overwrite if I change the original core module-files etc. And that's why I only want to use an instance or "make a placeholder" for original newsletter module so that, my module works in conjunction with original module and admin can manage subscribers at one place.

My module will be installed separately and will just have a checkbox option whether to include newsletter option in popup. If it is checked, the module will see original module with the theme styling in the popup. Just the placeholder will be enabled-disabled by the option.

Please suggest if this makes any sense.

Else, I have to provide backoffice funtionality to export the subscribers through pop up separately (considering, original module updated and no longer support the mysql tables and my module just created a separate newsletter module entries in database).

Hello Cotoko,

 

Thanks for the module but I have already seen it. I just want to create a freebie as I feel there's no free module available like this and even a little may help those who need it. I'm sure a lot of people need anything like this.

 

But anyways, your module is really awesome as I have seen it in action.

Link to comment
Share on other sites

  • 5 weeks later...

Hi Vipin,

 

Do you open for a new way to implement this function in your site?

If yes, i believe that this third party extension matches your expectation completely: WisePops

 

I tried it some months ago and really happy with it. Everything can be done by drag and drop only. I don't have to know about coding. And it links with my MailChimp account too.

 

Hope that it can helps you.

 

Brian 

Link to comment
Share on other sites

×
×
  • Create New...