How to add a new tab to the product card in OpenCart 3.x

0
116

In this article, we will consider how to add new tabs in the product card with editing them from the admin panel. Let’s get started, add a field to the admin panel, and then to the site itself.

 

First, add a new field a DB, open the database in phpmyadmin and make a request

As a result, a new sostav field will be added, where the text of the tab will be stored. Next, edit the site files.

 

Admin panel, file \admin\view\template\catalog\product_form.twig

 

after

paste

(new tab is call SOSTAV)

 

file \admin\controller\catalog\product.php

 

before

paste

file \admin\model\catalog\product.php

 

in the request, around 12 stroke

add

get such a request:

further below, in the region of 146 lines, in the request

add the same entry as above, we get:

and below around 435 lines, after

add


 

Now we’ll display a tab on the site,

 

file \catalog\view\theme\*\template\product\product.twig

 

after

add

and below, after

add

Next, the file\catalog\controller\product\product.php

 

after

add

File \catalog\model\catalog\product.php

 

after

add

and below after

add


 

We update modificators. As a result, in the admin panel we have a new field in the GENERAL tab

 

 

And a new tab appears on the site:

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here