Starting with version 3.0, the opencart module Product Table can be displayed using special shortcodes, and some module parameters can be overridden.

This makes it possible to use the same module instance with different sets of goods.

So what parameters can be used in the shortcode:

 

AttributeDescriptionExample
idInteger. Points to an instance of the Product Table module.[product_table id="10"]
limitInteger. Maximum number of products.[product_table id="10" limit="5"]
type

String. Allows you to override the module type. Possible values:

  • latest - new products;
  • bestseller - sales hits;
  • popular - popular products;
  • special - promotions;
  • related - related products (works only on the product page);
  • custom - manually selected goods;
  • filter - products selected by categories, manufacturers and filters.
[product_table id="10" limit="5" type="bestseller"]
productComma-separated list of integers. Allows you to specify the product_id of the products to be displayed. Works only with type="custom".[product_table id="10" limit="5" type="custom" product="56,89,128"]
filter_manufacturer_type

String. Defines the filter type by manufacturer. Possible values:

  • 0 - disable the filter by manufacturer;
  • detect - detect the manufacturer automatically, ignore the filter_manufacturer parameter;
  • select - use the filter_manufacturer value.

Works only with type="filter". If filter_manufacturer_type is not set, but there is a filter_manufacturer parameter, it is assumed that filter_manufacturer_type ="select".

[product_table id="10" limit="5" type="filter" filter_manufacturer_type="detect"]

[product_table id="10" limit="5" type="filter" filter_manufacturer_type="select" filter_manufacturer="8,9,25"]

filter_manufacturerComma-separated list of integers. Allows you to specify the manufacturer_id of manufacturers whose products should be displayed. Can be empty if the module needs to be unconfigured. Works only with type="filter".[product_table id="10" limit="5" type="filter" filter_manufacturer="8,9,25"]
filter_category_type

String. Defines the type of filter by category. Possible values:

  • 0 - disable filter by category;
  • detect - determine the category automatically, ignore the filter_category parameter;
  • select - use the value filter_category.

Works only with type="filter". If filter_category_type is not specified, but there is a filter_category parameter, it is assumed that filter_category_type ="select".

[product_table id="10" limit="5" type="filter" filter_category_type="detect"]

[product_table id="10" limit="5" type="filter" filter_category_type="select" filter_category="152,153"]

filter_categoryComma-separated list of integers. Allows you to specify the category_id of categories whose products should be displayed. Can be empty if the module needs to be unconfigured. Works only with type="filter".[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153"]
filter_filter_type

String. Defines the filter type according to standard filters. Possible values:

  • 0 - disable filter by filter;
  • select - use the filter_filter value.

Only works with type="filter". 

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" filter_filter_type="0"]
filter_filterComma-separated list of integers. Allows you to specify the filter_id of product filters whose products should be displayed. Can be empty if the module needs to be unconfigured. Works only with type="filter".[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" filter_filter="5,10,18"]
sort

String. Allows you to configure the sorting of products. Possible values:

  •     pd.name - by name;
  •     p.model - by model;
  •     p.quantity - by quantity;
  •     p.price - at the price;
  •     p.sort_order - by sort order;
  •     p.date_added - by creation date;
  •     random - randomly;
  •     p.viewed - by number of views (popularity);
  •     orders- by number of sales (sales hits);

Only works with type="filter".

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="random"]
order

String. Allows you to configure the sort order. Possible values:

  • ASC - ascending;
  • DESC - descending;

Only works with type="filter".

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC"]
filter_special

Integer. The parameter means "display promotional items first". Possible values:

  • 0 - disable;
  • 1 - enable;

Only works with type="filter".

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC" filter_special="1"]
filter_stock

Integer. Enables or disables the filter if available. Possible values:

  • 0 - disable;
  • 1 - enable;

Only works with type="filter".

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC" filter_stock="1"]
filter_stock_quantityInteger. Allows you to exclude goods that are in short supply. For example, if filter_stock_quantity="5", only products with a quantity of 6 or more will be displayed. By default, filter_stock_quantity="0".
Works only with type="filter" and filter_stock="1"
[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC" filter_stock="1" filter_stock_quantity="5"]
filter_stock_stock_status

Comma-separated list of integers. This is a list of out-of-stock id statuses. Applies to items with a quantity of 0 or less. Allows you to display, for example, only goods for pre-order

Only works with type="filter" and filter_stock="1"

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC" filter_stock="1" filter_stock_quantity="5" filter_stock_stock_status="6,7"]
cache

Integer. Enables or disables caching of filter results. Possible values:

  • 0 - disable;
  • 1 - enable;

Only works with type="filter".

[product_table id="10" limit="5" type="filter" filter_manufacturer="8" filter_category="152,153" sort="p.price" order="ASC" cache="1"]

Thus, once you have configured the appearance of the module (header, columns, order of their output, etc.), you can use this module in different situations, "on the fly" changing the rules for selecting goods.