D
D
drboom21112021-02-12 17:12:38
opencart
drboom2111, 2021-02-12 17:12:38

How to add a new field and display it?

You need to add a new field in the administrative part of the product editing page
: "Alternative name", which will contain just
text.
Display the value of the new field in the user part, under the name of the
product on the category and product page. Preferably in detail)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serge Tkach, 2021-02-18
@SergeTkach

If it is very detailed, then you need to read - https://forum.opencart-russia.ru/threads/rukovodst...
If not very detailed, then cling to the line:
"entry_name" in the file admin/view/template/catalog/product_form .tpl (admin/view/template/catalog/product_form.twig)
And then, examine all the variables that refer to this field and find them in the files:

  • admin/language/ru-ru/catalog/product.php
  • admin/controller/catalog/product.php

Then in the file admin/model/catalog/product.php see the methods:
  • addProduct()
  • editProduct()
  • getProductDescriptions()

On the showcase in catalog/controller/product/product.php
"$data['heading_title']"
and "heading_title" in the view
"catalog/model/catalog/product.php" - getProduct()
"catalog/controller/product/ category.php" - $data['products'][] = array(
Well, the product and category views on the storefront also need to be corrected.
+
Also, do not forget that if you work with the source files of the system, and some module change these files, then update the modifier cache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question