06/11/2023 Franck Bugnet How to

Management of custom fields in Prestashop

Many of you are adding complementary information data, like an HTML block, to the standard PrestaShop product pages and would like to edit its values directly from Merlin Backoffice


Display an HTML block or additional text in PrestaShop

For this you often use an external addon, or a custom made module which will for example allow to add an additional HTML block to the location of your choice, with a different content for each product.

Most of the time, this type of module adds a new table to the database, to store the contents of the field.

In other cases, it just adds a new topic to an already existing PrestaShop table, such as the "product" or "product_shop" table.

The question that you often ask us is: is it possible to display the contents of this type of 
non-standard fields in PrestaPricing or Merlin Backoffice ®, to see and modify its content for each product ? 
The answer is yes, of course, thanks to the "Custom" columns.

For this tutorial, we will take a very concrete case, with the use of a colleague's module: "Products Stock Threshold". This addon does not add a field to the display but a numeric parameter to each product. In this case a quantity threshold, which triggers an alert when it is reached. Once installed, this addon adds a new tab entry in the product listing back office to enter this "Stock threshold":


Stock threshold alert addon

The principle remains the same,  this module has added its own table in the database (pss_products_stock_threshold), and saves the values ​​in a field called "quantity". This information is rarely documented, but most of the time, the name of the added table or tables refers to the name of the module. It is therefore quite easy, in PHPMyAdmin, to find this information. If you do not find this info, simply ask the developer of the module: "What are the names of the table and the field containing the values ​​of the custom field?".

For the module used in this tutorial, here is a cature of PHPMyAdmln, showing the structure of the table found in the database, after its installation:

Tables added by the addon, shown in PHPMyAdmin

How to display this non-standard topic in Merlin Backoffice?

  1. Place yourself in the "Products" view and first open the column configurator by clicking on the "Columns" button in the title of the main window.
  2. Place yourself in the "Products" sub-tab of the table configuration window and right-click in the list on the left, in order to open the custom columns configurator:


Merlin Backoffice tables configurator

  1. You have just two fields to fill, in the columns indicated by arrows in the capture below, the name of the table (1) and the name of the non-standard field to display (2).

UPDATE FROM JANUARY 2023: The screenshot below was made with Merlin Backoffice standard. This configurator has been completely redesigned in Merlin Backoffice Flex. The new version is more ergonomic and especially more powerful. The new configurator allows for example to create automatic joins between tables to manage mass custom data stored in secondary tables. We invite you to consult the new tutorials explaining the mass management of custom fields.


Warning, the name of the table must be entered without its prefix (here I removed the prefix pss_):


CMerlin Backoffice custom columns configurator

  1. Then drag and drop the line "Perso 1" from the left table to the right table in the position (order) of your choice (1) :


Addition of a custom column

You can also (2), give the title you want to your column.

Change of title given to the column:


Change the title of the personnalized column

(3) validate.

  1. The product display automatically refreshes, adding your customized column and displaying the value it contains for each product:


Result, the custome columns is displayed in Merlin backoffice products table

From there, it is possible to:

  • View the values
  • Edit values, cell by cell
  • Filter on this column


BIG NEW 2023 OF MERLIN BACKOFFICE ® FLEX, starting with the PREMIUM formula: all mass management functions, such as copy and paste, MagicEdit or MagicFormula now also work on personal columns !

See also: from version 1.6 of Merlin, it is possible to import csv or xls in custom fields.


Category's other articles Mass management of PrestaShop products

Settings
  • Login
    • £ GBP
    • $ USD
Menu