How to use shortcodes from CMS products addon?

2016-05-01 cms, list, product

In this article I want to introduce you our free products to CMS module . With this absolutely free addon you can build and display product or products lists on your shop CMS pages (created with preferences > cms tool). I want to explain module usage here. It's very easy in use because addon is based on shortcodes. If you're wondering what is shortcode - you can read explanation below:

Shortcode is a specific tiny text that lets you do nifty things. with very little effort. In case of our free cms products module  shortcodes can embed products to your shop CMS pages. Usually - without shortcodes - this kind of feature requires lots of complicated, ugly code. With shortcode you can do it in one line, directly from CMS page editor (preferences > cms tool)

How this free module works?

Module adds shortcodes feature to your CMS editor page. These shortcodes will be replaced with product or products list (depending on shortcode that you will use). With this feature you can easily control what and where will appear. Below i want to explain shortcodes usage. It's very easy. Just take a look on the video and read descriptions - everything will be clear then.

 

Available shortcodes

Free version of this module allows to use 4 types of shortcodes. These shortcodes allow to display one selected product, or lists of selected products that you can create manually or with help of our modules like homepage products pro / related products pro. So. simply saying, cms products module allows to use these shortcodes:

  1. {product:X} shortcode will display one selected product, where X is a product ID to display, for example: {product:12}
  2. {products:X,Y,Z} shortcode will display list od selected products, where X,Y,Z are a ID numbers of products to display, for example: {products:12,29,6}
  3. {rpp:X}  shortcode will display list of products created in related products pro module, where X is an ID of products list created in related products module, for exmaple {rpp:9}
  4. {hpp:X} shortcode will display list of products created in homepage products pro , where X is an ID of products list created in homepage products module, for exmaple {hpp:3}

 

Shortcode Explanation Shortcode object informations
{product:2} This shortcode used in CMS contents editor will display product with ID 2 on your CMS page. {product} shortcode displays single product. Shortcode is build with two things (1) product (2) Id of product. You can use it as many times as you want. So with this feature you can display several single products on one CMS page
{product:9} This shortcode used in CMS contents editor will display product with ID 2 on your CMS page.
{products:2,9,1,3} This shortcode will build list of products. List of products  will contain products with ID: 2,9,1,3 With {products} shortcode you can build and display list of products that will contain various products selected by you. There is no limitations related to number of products, you can use as much products as you want.
{products:2,9,1,3,4,21,198} This shortcode will build list of products that will have 8 products. Of course the number of products that will appear depends on you.
{rpp:5}

This shortcode will build list of products that was build in Related Products Pro . Module will display list of products that has ID 5

With {rpp} shortcode you can build and display list of products that you created in Related Products Pro addon. Shortcode is build with two things: (1) rpp (2) Id of list that you created in related products pro module.
{rpp:29}

This shortcode will build list of products that was build in  Related Products Pro . Module will display list of products built in Related Products Pro that has ID 29

{hpp:11}

This shortcode will build list of products that was build in Homepage Products Pro . Module will display list of products built in Homepage Products Pro that has ID 11

With {hpp} shortcode you can build and display list of products that you created in Homepage Products Pro plugin. Shortcode is based on two things: (1) hpp (2) Id of list that you created in homepage products pro module
{hpp:7}

This shortcode will build list of products that was build in  Homepage Products Pro . Module will display list of products built in Homepage Products Pro that has ID 7

{lastreviews}

This shortcode will build a reviews block that is a part of last product reviews module.

with {lastreviews} shortcode your cms page will show block with recently added reviews.

 

How to display single product on CMS page

To display single product on CMS page you have to use shortcode {product:X} - where X is an ID number of product that yo uwant to display. Use this shortcode inside CMS page editor that is available in PrestaShop by default under preferences > CMS section. Take a look on the video below to see and understand how it works.

 

 

How to display list of selected products on CMS page

To build and display list of products on CMS page you have to use shortcode {products:X,Y,Z}  - where X,Y,Z are an ID numbers of products that you want to display. So, it is a kind of list of products to show that are separated by comma. So, just use this shortcode inside any CMS page you want.

 

 

Display list of products on CMS page that you created in Related products module

To display list of products that you created in another our module called related products - you have to use shortcode {rpp:X}  - where X is an ID number of list of products created in related products addon Just put shortcode into CMS page contents, module will replace shortcode with list of products.

 


 

Display list of products on CMS page that you creted in Homepage products module

To display list of products that you created in another our module called homepage products - you have to use shortcode  {hpp:X}  - where X is an ID number of list of products created in homepage products addon Just put shortcode into CMS page contents, module will replace shortcode with list of products.

 


author milos myszczuk
Article by Milosz Myszczuk PrestaShop expert, official PrestaShop community moderator. PHP developer, specialist in relative and spatial databases management, GIS Analyst, CEO & founder of VEKIA interactive agency. Read more about VEKIA company
If you like my articles and want much more valuable tips, feel free to send me donation
1.4 version 1.4.11 1.6 404 addon admin advertise ahref ajax alpha animation api app application authentication back office backup badge banner basics block bootstrap button cache carrier cart catalog category certificate changelog chat class clear client clip cms code colors columns comments configuration contact container content controller cookie counter country coupon css csv currency customer dashboard database debug default delete delivery desktop developer device disable discount displayNav displayTop download dynamic editor effect empty encrypt engine error exchange exclude export facebook faceshop fade fancoupon fancybox fanpage fatal feature feed field file fix fixed font footer free friendly url front ftp full gallery generate gift global godaddy google google+ gray grid groupon header help hide highlight homefeatured homepage hook hosting hover howto htaccess html html5 ID image import include input instagram installation integration iPhone issue javascript jquery kgb knowhow languages law left likebox link list livingsocial loading log login logo loyality mail mailing maintenance manufacturer marketing marquee mcrypt menu meta mobile modification module movie moving multilanguage multiupload must have mysql news newsletter notification number open graph order override page password performance PHP phpmyadmin picture pinterest plugin popup post prestashop prestashop 1.0 prestashop 1.1 prestashop 1.2 prestashop 1.3 prestashop 1.4 prestashop 1.5 price rules problem product profile promotion proslider purifier quantity query quick tip random rates register reinsurance release reporting reset responsive restore results ribbon rich text right sales search security seo service shadow share shipping shop shopmania slider smarty social networks SQL SSL statistics stock store style subcategory superuser support switcher tab tablet tag tax template text theme tinyMCE tips and tricks tpl tracking translations tree trends trigger tumblr tutorial twitter update upgrade upload variables video visits voucher vulnerability web2print wide widget width window wishlist wysiwyg youtube zip zopim