Shortcode module for prestashop allows to automatically build various contents on any part of your website. You can put shortcodes to your theme files and also to contents in your shop back office. This addon will automatically replace these short codes with automatically generated contents.
With shortcodes module you can automatically generate some sets of products, pictures in various positions on your theme with possibility to use shortcodes inside contents defined in back office (like descriptions / contents on cms pages, category pages, product pages). Below you can find a list of currently available shortcodes.
Where you can use these shortcodes?
Really big advantage of this module is fact that you can use these shortcodes everywhere. You can use them in any part of your shop .tpl file and also in your shop back office. You can put these codes into your product description, short description, to contents of your cms pages, category descriptions etc.
List of available codes in ShortCodes module for PrestaShop
Shortcode | Explanation |
[product:9] | This shortcode will display one instance of product with defined ID, in this case product ID numer is 9 |
[products:1,2,3,4] | This shortcode will display list of products with ID 1,2,3,4 - you can define as much products as you want |
[productsByAttributes:1-1,1-2] | You can build list of products that will display selected combniations for exmaple 1-2 means that you will show product with ID 1, and its combination with ID 2 |
[product-description:2] | This shortcode will display description of product with ID 2 |
[product-description-short:2] | This shortcode will display short description of product with ID 2 |
[last-products:12] | This shortcode will display recently added products to shop, the number decides about number of products to display |
[category:7:16:price:desc] | This shortcode will display list of products from category with ID 7, module will get 16 products from this category. Sorting method is set to sort products by PRICE and order way i set to descending. Available sorting methods: random, price, name, id_product, manufacturer, position, date_add, date_upd Available sorting ways: descending [9-0], ascending [0-9] |
[sale:nb:order_way:order_by] | This shortcode gives possibility to display "on sale" products (products that have specific dropped price). nb - is a number of products to display, order_way - is a order method (position, price, id_product, name, date_add, date_upd) order_way - is definition of order way (desc/asc) |
[manufacturer:2:8:price:desc] |
This shortcode will display list od products from selected manufacturer, in this case manufacturer with ID 2. Module will get 8 products from shop database. Sorting method is set to sort products by PRICE and order way i set to descending. Available sorting methods: random, price, name, id_product, manufacturer, position, date_add, date_upd. Available sorting ways: descending [9-0], ascending [0-9] |
[manufacturer:1:name] |
This shortcode will be replaced with manufacturer's name (where ID of manufacturer is 1) |
[manufacturer:1:description] | This shortcode will be replaced with manufacturer's description |
[manufacturer:1:short_description] | This shortcode will be replaced with manufacturer's short description |
[manufacturer:1:picture] | This shortcode will be replaced with manufacturer's picture |
[manufacturer:1:image_link] | This shortcode will be replaced with manufacturer's url to image |
[manufacturer:1:link] | This shortcode will be replaced with manufacturer's link (url to manufacturer page) |
[supplier:1:4:price:desc] | This shortcode will display list od products from selected supplier, in this case supplier with ID 1. Module will get 4 products from shop database. Sorting method is set to sort products by PRICE and order way i set to descending. Available sorting methods: random, price, name, id_product, manufacturer, position, date_add, date_upd. Available sorting ways: descending [9-0], ascending [0-9] |
[productgallery:9:16:home_default] | This shortcode displays list of pictures of selected product. In this case product with ID 9. It will show 16 pictures of products and the size of displayed picture will be imagetype 'home_default' |
[categories:2,3,4,5] | This shortcode gives possibility to display links to category pages (image of category, name) |
Special shortcodes | |
[hpp:9] | This shortcode is a shortcode for module "homepage products pro" - it will display list of products defined in this module with ID 9 |
[rpp:6] | This shortcode is a shortcode for module "related products pro" - it will display list of products defined in this module with ID 6 |
[ExtraTab:2] | This shortcode is a shortcode for a module "extra tabs pro" - it will display extra tab contents. In this case - contents of extra tab with ID 2 |
[htmlboxpro:4] | This shortcode includes box contents created with module "html box pro" |
associatedVariants
variable's JSON formatting caused conflicts, ensuring smoother module operation and data handling.[cms-link:ID]
: Generates a URL to a CMS page using its ID.[category-link:ID]
: Generates a URL to a category page using its ID.[product-link:ID]
: Generates a URL to a product page using its ID.[htmlboxpro:ID]
shortcode to display custom HTML blocks created with the HTMLBoxPro module, offering greater flexibility in content presentation.[sale:LIMIT:ORDER_BY:ORDER_WAY]
shortcode to dynamically display products currently on sale. Control the number of displayed products (LIMIT), the sorting criteria (ORDER_BY, e.g., "id_product", "price"), and the sorting order (ORDER_WAY, e.g., "ASC", "DESC"). Example: [sale:12:id_product:DESC]
displays 12 sale products sorted by product ID in descending order.productsByAttributes
shortcode when used within product descriptions, optimizing the visual layout and presentation of product combinations.[last-products:LIMIT]
shortcode to display recently added products. Specify the number of products to display using the LIMIT parameter. Example: [last-products:12]
displays the 12 most recently added products.[productsByAttributes:ATTRIBUTE_IDS]
shortcode to display specific product combinations as individual product listings. Specify a comma-separated list of attribute IDs. Example: [productsByAttributes:1-1,1-2,1-3,1-4]
displays product combinations matching those attribute IDs.[rpp:ID]
shortcode, optimizing performance and resolving potential conflicts.[product-description:ID]
: Displays the full description of the product with the specified ID.[product-description-short:ID]
: Displays the short description of the product with the specified ID.[manufacturer:ID:name]
: Displays the manufacturer name.[manufacturer:ID:short_description]
: Displays the manufacturer's short description.[manufacturer:ID:description]
: Displays the manufacturer's full description.[manufacturer:ID:link]
: Generates a URL to the manufacturer page.[manufacturer:ID:image_link]
: Generates a URL to the manufacturer's image.[manufacturer:ID:picture]
: Displays the manufacturer's image.