{module_shoppingcartsummary}

Description

Displays the summary of the cart on the current catalogue page or web page. It will display Shopping cart is empty. when the cart is empty and something like this when you have a product in it - 1 item(s), Total: $12.00 View Cart.

Pressing "View Cart" will direct the user to the Shopping Cart that renders with the Shopping cart layout.

Syntax

{module_shoppingcartsummary render="collection" direction=“vertical” 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 the value of this parameter can only be collection (if no value is specified the default will be collection). 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
  • direction - values are vertical or horizontal. Default is that the output is displayed horizontally.
  • collection - use this if you need to access the module's Liquid output tags
  • template - render the module using a custom template. You can leave the value of the template parameter blank to suppress the original output and use Liquid output tags instead

This module can be rendered using:

  • your custom layout - take a look at the Shopping cart summary layout article for the exact steps you need to take
  • Liquid collections - here are the Liquid output tags you can use:
Liquid tag Legacy tag Description
{{cartUrl}} {tag_cartUrl} renders the URL to the cart summary page, which can be either OrderRetrievev2.aspx or OrderRetrieve.aspx (the old, legacy v1 version)
{{itemCount}} {tag_itemCount} renders the number of the items in the cart or 0 if none.
{{totalAmount}} {tag_totalAmount} renders the total money amount of the items (with two decimals) or 0.00 if the items don't have prices or there are no items in the cart
{{currencyFormat}} {tag_currency} renders the coin of the current country, which is either the site country or the country of the order (if set)
{tag_totalAmountWithCurrency} renders both coin and total amount (this is only for the sake of convenience, you might want to use it instead of {tag_currency}{tag_totalAmount})
{tag_isEmpty} renders 0 or 1 (for when the cart is empty - used to display a different message when there are no items)
{{countryCode}} {tag_countryCode} renders the country code (of the site or of the order, if set)
{{items}} displays the array of items contained in the shopping cart. Each product item has the following properties:
  • id
  • productId
  • catalogId
  • name
  • code
  • description
  • price
  • quantity
  • totalPrice
  • smallImage
  • url

Examples

  • {module_shoppingcartsummary direction="vertical"} - this module will display the output vertically.
  • {module_shoppingcartsummary collection="collection1" template=""} - in this case nothing will be displayed, however the module's Liquid tags will become available in the collection1 collection.
    
        "collection1": {
        "moduleName": "shoppingcartsummary",
        "moduleDescriptor": {
          "templatePath": "",
          "parameters": "",
          "apiEndpoint": "/api/v3/shoppingcartsummary",
          "objectType": "-1",
          "objectId": "-1",
          "adminUrl": ""
        },
        "editableFieldTypes": {
          "price": "Number",
          "quantity": "Number",
          "totalPrice": "Number"
        },
        "cartUrl": "/OrderRetrievev2.aspx?CatalogueID=0",
        "itemCount": "5",
        "totalAmount": "54.95",
        "currencyFormat": "$",
        "countryCode": "US",
        "items": [
          {
            "id": 281509,
            "productId": 9008560,
            "catalogId": 176691,
            "name": "Panda World T-Shirt",
            "code": "SHDA9ZVVWY",
            "description": "M",
            "price": "10.99",
            "quantity": 3,
            "totalPrice": "32.97",
            "smallImage": "/shop/tshirt2.jpg",
            "url": "/mens-t-shirts/panda-world-t-shirt"
          },
          {
            "id": 281511,
            "productId": 9008559,
            "catalogId": 176854,
            "name": "Doomsday T-Shirt",
            "code": "HOONI2M83X",
            "description": "S",
            "price": "10.99",
            "quantity": 2,
            "totalPrice": "21.98",
            "smallImage": "/shop/tshirt3.jpg",
            "url": "/womens-t-shirts/doomsday-t-shirt"
          }
        ]
      }
      

Syntax

{module_shoppingcartsummary,Vertical}

Parameters

  • Vertical - renders details vertically. Possible values are vertical or horizontal. Default is that the output is displayed horizontally.

This module can be rendered using a custom layout

In order to customize the output of this module you will first need to create the layout, please take a look at the Shopping cart summary layout article for the exact steps you need to take.

Examples

  • {module_shoppingcartsummary,vertical} - this module will display the output vertically.