Jump to content

Automatically add custom HTML code to the "Short description" of every new product


D D

Recommended Posts

Hi everyone! I’m new to Prestashop and I’m currently trying to achieve the following:

 

Our online bookstore should have the following 3 fields right after the Product (Book) Title:

 

1.       Publisher, for example: SAGE Publishing

2.      Year of publication, for example: 1999

3.      ISBN, for example: 123-456-789-1 or 123-456-78-10

 

I already tried to edit the fields accordingly, so that they accept such content, without much success.

 

Then I thought that it would be a better idea to just try to add some HTML code in the Short description field, so that it appears every time a new product is being created in the store. This second idea seemed more easily achievable, mostly because our site is available in two language versions. However, I didn’t manage to implement it.

So, my intention is to have the following code entered in advance (prepopulated) for every short description of every new product:

 

<p id="publisher">Publisher:</p>

<p id="year-of-publication">Year of publication:</p>

<p id="isbn">ISBN:</p>

 

Could you please advise if it is possible to achieve this? And if it is possible, where exactly should I add my custom HTML code?

 

Thank you.

Link to comment
Share on other sites

Hi musicmaster,

 

Yes, my plan is to manually enter the data. All I need is to have that HTML code filled automatically for every new product, so that I can just add the new entries between the tags.

I noticed that the "Short description" box uses TinyMCE for text editing. I'm wondering what would be the correct way to include the HTML code in that field?

P.S.: My PrestaShop version is 1.6.0.9.

Edited by D D (see edit history)
Link to comment
Share on other sites

As far as I understand it TinyMCE is only activated later on (probably by javascript). When you are multishopping in a scope where editing is not allowed you will that TinyMce is not loaded.

So my guess is that you should just change the file

admin\themes\default\template\controllers\products\informations.tpl

and add the desired extra's to the place where the short description field is created. 

  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...