My name is Denis and I decided to make my developer contribution to BelVG blog. Currently I’m writing modules for Prestashop, and as far as a lot of developers have to deal with the same Prestashop template inconveniences, I want to share some ideas I came out with while working on Subscription module.
With its assistance customers will be able to subscribe to products automatic purchase and delivery (e.g. bottled water for office needs, coffee, magazines, newspapers, etc.). Apparently, each product that is available for subscription, requires its own individual configuration.
Unfortunately, Prestashop Back Office doesn’t offer options of adding new tabs to the editing product page, which will be used to configure products, necessary for the module operation. It turned out that in order to create a new tab, you need to add the following HTML code into DOM structure:
var id_step = $('.tab-page').length+1; //Get ID of a new tab
var belvg_html = 'Tab Content'; //Install tab Content
var belvg_header = 'Tab Header '; //Install Tab Header
‘);//Insert a new tab after existing ones
I placed this code into the script belvg.subscriptions.admin.js
While installing the module, do not forget to register the BackOfficeFooter hook: