{module_productresults}

Description

This module can only be used in conjuction with a product search form. Whenever you insert a product search form into a page the system also adds the {module_productresults} module right after the form. When viewed in the front end this module does not render anything until the form's "Search" button is presed and a search is triggered. This module and the product search form can also be placed on different pages, take a look at this article for more details on this particular setup.

Syntax

{module_productresults render="items" rowCount="3" targetFrame="_blank" resultPerPage="6" sortType="Weight" hideEmptyMessage="true" useLi="false" emptySearchResultString="not found" hideSecuredItems="true" collection="my_custom_collection_name" template="/folder/template.tpl"}

Note: When using named parameters always wrap the individual parameters in double quotes. Also, do note that modules using named parameters do not work for campaigns just yet.

Parameters

  • render - for this module this can only be item. For more information on how to use this parameter take a look at the render parameter's article for more details on how to use it
  • rowCount - will limit the number of items per row when items are displayed as a list. Default is 1 item per row.
  • targetFrame - possible values are _blank, _self and _top. This parameter is used to specify the frame you want the item to open in.
  • resultPerPage - specifies the number of results the search will display per page.
  • sortType - sortType can be alphabetical, price, date, or weight. Do note the sortType is ignored if the "Sort By" field is present in the product search form.
  • hideEmptyMessage - specify true if you don't want the No Items Found message to be displayed
  • useLi - specify true to render the output in Li's instead of tables
  • hideSecuredItems - do not show items that are in a secure zone
  • collection - use this if you need to access the module's Liquid output tags
  • template - optional, for this module this can either represent the path of the custom template you want to use, or use a blank value (template="") if you need to suppress the original output and use Liquid output tags instead

Layouts

  • the individual product layout - on this layout you can use either the legacy tags or Liquid output tags. Here is a list of all the tags you can use: Individual Product - Small reference page
  • your own custom layout - take a look at the custom templates article for more details
  • Liquid collections - here are the Liquid output tags you can use:
Liquid tag Legacy tag Description
{{title}} The product's title
{tag_addtocart}Ability to add products to the shopping cart (vertical layout)
{tag_addtocartinputfield}Input field to enter product quantity
{tag_addtofavorites,add_Image, remove_Image}Add product to favorites list. Optionally customize to display your own custom image for adding and removing.
For additional information on how to render the output of this tag using Liquid take a look at the Enable other Liquid tags article.
{{attributes}} {tag_attributes, horizontal, hideDisabledVariations, autoSelectFirstVariation}

Renders attribute dropdowns for a given product:

  • horizontal - display attributes horizontally
  • hideDisabledVariations - true or false
  • autoSelectFirstVariation - true or false

The Liquid tag renders an object, use json filter to see it's properties like so: null

{tag_button,Your Text}Replace Your Text with your own text; for example, Click for more information
{tag_buynow}Add to cart and redirects to check out
{{countryCode}} {tag_countrycode}Display the country code; for example, AU
{{countryCurrencyFormat}} {tag_countrycurrencyformat}Display the country currency code; for example, AUD
{{currencyFormat}} {tag_currencyformat}Display the currency format; for example, $
{{custom1}} {tag_custom1}Custom field #1. Use to display any information about a product
{{custom2}} {tag_custom2}Custom field #2. Use to display any information about a product
{{custom3}} {tag_custom3}Custom field #3. Use to display any information about a product
{{custom4}} {tag_custom4}Custom field #4. Use to display any information about a product
{{description}} {tag_description}Description of the product (Editor content)
{{discountPrice}} {tag_discountprice}The price if a discount applies to the current customer otherwise the normal sale price.
{{expiryDate}} {tag_expirydate}Expiration date of product
{tag_grouping}Pop-up menu of product attributes used to select a product to add to cart
{{groupingList}} {tag_groupinglist}List of product attributes used to switch between products
{{inStock}} {tag_instock, syncWithAttributes, noSelectionMessage, disabledSelectionMessage} Number of units in stock.

Parameters:

  • syncWithAttributes – true or false
  • noSelectionMessage – specify the message displayed when site customer has not selected a variation
  • disabledSelectionMessage – specify the message displayed when site customer has selected a variation that is disabled
{{url}} {tag_itemurl_nolink}URL to the item referred, without host
{{urlWithHost}} {tag_itemurl_withhost}URL to the item referred, with host
{tag_largeimage}Large image for product
{{largeImageUrl}} {tag_largeimage_path}Outputs the file path of the image; for example /images/imagename.jpg
{{maxUnits}} {tag_maxunits}Maximum units
{{minUnits}} {tag_minunits}Minimum units
{tag_name_nolink}Name of product (does not link to product details)
{{name}} {tag_name}Name of product
{{onOrder}} {tag_onorder, syncWithAttributes, noSelectionMessage, disabledSelectionMessage} Number of units on order.

Parameters:

  • syncWithAttributes – true or false
  • noSelectionMessage – specify the message displayed when site customer has not selected a variation
  • disabledSelectionMessage – specify the message displayed when site customer has selected a variation that is disabled
{{isOnSale}} {tag_onsale}Renders 1 if product on sale, otherwise 0. If page elements need to be altered for products on sale, then embed tag in relevant javascript.
{{productCode}} {tag_productcode, syncWithAttributes, noSelectionMessage, disabledSelectionMessage} Product code. With variations enabled, tg product will render the variation code instead of the product codes in all layouts where this is used.

Parameters:

  • syncWithAttributes – true or false
  • noSelectionMessage – specify the message displayed when site customer has not selected a variation
  • disabledSelectionMessage – specify the message displayed when site customer has selected a variation that is disabled
{{releaseDate}} {tag_releasedate}Release date of item
{{reorder}} {tag_reorder}Number of units to reorder threshold
{{retailPrice}} {tag_retailprice}Retail price of the product
{{salePrice}} {tag_saleprice}Sale price of the product (the amount that customers are charged)
{{wholesalerPrice}} {tag_wholesalerprice} Wholesaler price of the product (the amount "wholesale" type customers are charged)
{{smallImage}} {tag_smallimage_nolink}Small image for product (does not link to product details)
{tag_smallimage}Small image for product
{{smallImageUrl}} {tag_smallimage_path}Outputs the file path of the image; for example /images/imagename.jpg
{{tags}} {tag_tags}Product tags (you can use field for anything)
{{tax}} {tag_tax}Tax amount for the product
{{taxCode}} {tag_taxcode}Tax code name used for item
{{taxRate}} {tag_taxrate}Tax rate used for item (%)
{{totalDiscountPrice}} {tag_totaldiscountprice}Total discounted price of the product: Discount Price + Tax.
{{totalPrice}} {tag_totalprice}Total price of the productT: Sale Price + Tax
{{totalRetailPrice}} {tag_totalretailprice}Total retail price of the product: Retail Price + Tax
{{unitType}} {tag_unittype}Product unit type: Single, by the dozen
{tag_volumeprices}Displays volume pricing for product
{{id}} {tag_productid}Displays product system id
{{catalogId}} {tag_catalogueid}Displays catalog system id the product is currently displayed in
{{inventoryByAttributes}} Renders a JSON object that containsthe following parameters:
  • id
  • sku
  • inStock
  • onOrder
  • enabled
  • attributeString
  • attributes
{{pagination}} Pagination controls:
  • currentPage
  • itemsPerPage
  • numberOfPages
  • totalItemsCount
  • previousPageUrl (null if empty)
  • nextPageUrl (null if empty)

Examples

  • {module_productresults rowCount="4" targetFrame="_blank" resultPerPage="10" hideEmptyMessage="true"} - displays the products that match the search criteria 4 per rotw, 10 per page and hides the "No products found matching your query." if no products are found. The structure rendered is a table. When clicking the product name the detail view (rendered using the Individual Product - Large layout) opens up in a new tab.
  • {module_productresults targetFrame="_self" resultPerPage="2" hideEmptyMessage="true"} - displays the products that match the search criteria 2 per page and renders "No products found matching your query." if no products are found. The structure rendered is an unordered list. When clicking the product name the detail view (rendered using the Individual Product - Large layout) opens up in the same tab.
  • {module_productresults rowCount="2" targetFrame="_self" resultPerPage="2" hideEmptyMessage="true" template="/layouts/custom/moduleproductresults.tpl"} - displays the products that match the search criteria 2 per page and renders "No products found matching your query." if no products are found. The structure is no longer an unordered list as it is in the example above, the custom template is used instead.
  • {module_productresults collection="collection1" template=""} - in this case nothing will be displayed, however the module's Liquid tags will become available in the collection1 collection.

Syntax

{module_productresults, rowLength, targetFrame, resultPerPage, sortType, hideEmptyMessage, useLi}

Parameters

  • rowLength - will limit the number of items per row when items are displayed as a list. Default is 1 item per row.
  • targetFrame - possible values are _blank, _self and _top. This parameter is used to specify the frame you want the item to open in.
  • resultPerPage - specifies the number of results the search will display per page.
  • sortType - sortType can be alphabetical, price, date, or weight. Do note the sortType is ignored if the "Sort By" field is present in the product search form.
  • hideEmptyMessage - specify true if you don't want the No Items Found message to be displayed
  • UseLi - specify true to render the output in Li's instead of tables
  • hideSecuredItems - do not show items that are in a secure zone
  • template - specify the custom template you want to render this module with

Layouts

Examples

  • {module_productresults,4,_blank,10,,true} - displays the products that match the search criteria 4 per rotw, 10 per page and hides the "No products found matching your query." if no products are found. The structure rendered is a table. When clicking the product name the detail view (rendered using the Individual Product - Large layout) opens up in a new tab.
  • {module_productresults,,_self,2,,,true} - displays the products that match the search criteria 2 per page and renders "No products found matching your query." if no products are found. The structure rendered is an unordered list. When clicking the product name the detail view (rendered using the Individual Product - Large layout) opens up in the same tab.
  • {module_productresults,2,_self,2,,,true template="/layouts/custom/moduleproductresults.tpl"} - displays the products that match the search criteria 2 per page and renders "No products found matching your query." if no products are found. The structure is no longer an unordered list as it is in the example above, the custom template is used instead.