How do you create your text field in the Admin part of OpenCart?



  • Target. OpenCart 2.2.x
    There's Categoria in the administrative part of Catalogue.

    введите сюда описание изображения

    In the editing of the Categories, there is a form of editing where names, category descriptions, etc. can be indicated. Normal <form></form> page.

    We need to add a new user field on the category editing page <input type="text" name="custom_field">♪ To maintain it, edited, etc.

    It's easy enough to run the site core, the controllers, the modules, etc. Tutorial: http://www.php-dev-zone.com/2015/01/how-to-add-custom-product-field-in.html

    How do you do that as a module? For example, set up the module, inserted it through the Adminku (Additional - Moduli) and a user field. No, I deleted the module. PlugpressPlay in general.
    For editing and adding, there is an idea to create separate tables. And to get data from the form, there's an idea to connect in your module to the event. $this->event->trigger('pre.admin.category.edit', $data);I don't want to modify the core.

    But how do you get the P.R. to look in shape? You still have to modify the category.tpl template? Нужно добавить свое редактируемое поле



  • I added the fields: (1) One of the fields copied in the template, went to the Language File, added new variables, recorded values. And he replaced it for the right in the vein. (2) Then he went to the controller, added variables that were added in the language file. (3) We need to create a field in the database where the data will be stored. (4) Let's go to a model that processes data, finishes the field we created. (5) If necessary, we'll be drinking the counteroler again (mainly there, retrieval of default data, if any, and shipment for processing)




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2