The ability to display HTML in the attributes of Opencart
The ability to display HTML in the attributes of Opencart
πŸ’Ό Creation of modern websites of any complexity. | πŸ‘Œ WEB-UKRAINE.COM

The ability to display HTML in the attributes of Opencart

5/53 ratings

Kind time of the day dear visitor of our site.

Most recently, we wrote about how you can make display the attributes in the category, and today we want to continue the topic about the attributes in the goods.

Sometimes there are cases that you want to display some HTML code in the attribute parameters, that is, we need to make HTML display support in the attributes.

By default, Opencart from the box does not allow you to display your html code in the attributes and everything you write in the attribute field will be displayed exactly as text.

But what if you want to insert a link or a photo, or any other html code? Today we will describe here the solution of this issue.

And so we have the task of making it possible to output any html code in the attribute points, for this we will add the code editor to the product card when editing the code editor and make it possible to support the html code in the goods display in the card, which will enable us to add anything for the attribute values , As well as be able to add any of your css styles.

An example of what we will get you can see in the photo below:

And so let's get down to our task and make html support in the opencart attributes.

Changes will be made in only three files:

1. Open the file of your active theme (I use the default template in the example).

We find in it a line of code:

And immediately before it we add a few styles:

Well, or you can directly add these styles to the stylesheet of your template, in fact there is no difference.



2. Go to the administrator folder and open the file:

Find the line:

After which we add:

3. Finally, open the last file:

We find at the bottom of the line:

And before it, again, add some styles and JS code:

In the same place we search for a line:

Before which we add:

Next, we need to find the line:

And before it add:

That's basically all that was required for the ability to write HTML code in the attributes field.

In the Attributes section, now you have added a little text with a hint and an example of the base code for review, and the attribute field is initially displayed as a regular textarea, that is, as it was initially, but if you need to enable the ckeditor HTML editor, just double-click In the textarea field.

Well, in fact, everything, try and comment, good luck to you in our not easy business! :)

You may also like

No Comment

You can post first response comment.

Leave a Reply

Π’ΠΈΠ±Π΅Ρ€Ρ–Ρ‚ΡŒ спосіб спілкування
Звязатися Π· Π½Π°ΠΌΠΈ!
Ми Π³ΠΎΡ‚ΠΎΠ²Ρ– Π΄ΠΎ Π΄Ρ–Π°Π»ΠΎΠ³Ρƒ.