{"_id":"560ae8871d85af0d007d0a5a","project":"55a6e72e8cc73e0d00096635","version":{"_id":"55a6e72f8cc73e0d00096638","project":"55a6e72e8cc73e0d00096635","hasReference":false,"__v":29,"hasDoc":true,"createdAt":"2015-07-15T23:05:19.125Z","releaseDate":"2015-07-15T23:05:19.125Z","categories":["55a6e7308cc73e0d00096639","55b7ed07aea7c8190058badb","5604567c0c78b00d0039b191","5605e6f23a93940d002b3e4a","5605f2bba4574a0d00811365","5605f309a4574a0d00811366","5608e3b98aedf50d0004cf8f","5608e4318aedf50d0004cf90","5608e6b5a7cc2f0d00d9754d","5608e6d331beb60d001b6560","5608f879a7cc2f0d00d97580","560b097887b71d0d000d3bd9","560b13cbafa0990d00979545","560b5cbec341310d00de2a01","560b5cd0c341310d00de2a02","566a35b81e08750d00a0c49b","566a3e8503b4b20d00d02a4a","567889d307bf6a0d0083edc8","569c8b7c15bb390d00db6f9d","56b254dc65ddf50d0076ba8f","57a8ebc4cdeea20e001d2a63","57e48a4000c8680e00fae6e7","5808216773557d0f00a1e428","58105ad54a8aa50f00aa4cba","58105bf298aea40f00afa3ba","58105f548a4aed0f00d67536","581061b898aea40f00afa3be","584b3de7e5f3a42300df6ef7","596839a75965d400155bb750"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":32,"category":{"_id":"5808216773557d0f00a1e428","version":"55a6e72f8cc73e0d00096638","__v":0,"project":"55a6e72e8cc73e0d00096635","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-10-20T01:44:07.096Z","from_sync":false,"order":10,"slug":"stencil-object-model-reference","title":"Stencil Object Model Reference"},"parentDoc":null,"user":"55a6caa022cfa321008e01d6","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-29T19:37:43.350Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":34,"body":"[block:html]\n{\n  \"html\": \"<a name=\\\"Stencil-Cart-ref\\\"></a>Cart objects map to the storefront’s shopping cart:<br>\\n\\n<ul>\\n <li><a href=\\\"#Cart\\\">Cart</a></li>\\n <li><a href=\\\"#Cart_Items\\\">Cart Items</a></li>\\n <li><a href=\\\"#strikeout\\\">Strikeout Pricing Example</a></li>  \\n <li><a href=\\\"#Cart_Status\\\">Cart Status Message</a></li>\\n <li><a href=\\\"#Suggested\\\">Suggested Products</a></li>\\n <!-- <li><a href=\\\"#Suggestive\\\">Suggestive Cart Content</a></li> -->\\n</ul>\\n\\nThese objects are called on the default <NOBR><span class=\\\"inline-code\\\">&lt;theme-name&gt;/templates/pages/cart.html</span></nobr> template, and on several partials in the <NOBR><span class=\\\"inline-code\\\">&lt;theme-name&gt;/templates/components/</span></nobr> subdirectory: <NOBR><span class=\\\"inline-code\\\">cart/content.html</span></nobr>, <NOBR><span class=\\\"inline-code\\\">cart/preview.html</span></nobr>, <NOBR><span class=\\\"inline-code\\\">cart/totals.html</span></nobr>, <NOBR><span class=\\\"inline-code\\\">common/cart-preview.html</span></nobr>, and <NOBR><span class=\\\"inline-code\\\">common/navigation.html</span></nobr>. <br>\\n\\n<h2> <A NAME=\\\"Cart\\\"></a>Cart</h2>\\n\\n<b>Description:</b> The cart-specific properties for the current session<br>\\n\\n<b>Handlebars Expression:</b> <span class=\\\"inline-code\\\">{{cart}}</span><br>\\n\\n<b>Object Properties:</b><br><br>\\n\\n<table>\\n  <tr>\\n    <td>Property</td>\\n    <td>Description</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">quantity</td>\\n    <td class=\\\"\\\">Total number of items in the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">additional_checkout_buttons</td>\\n    <td class=\\\"\\\">Generates checkout buttons for third-party payments (PayPal, Google Checkout, etc.)</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">show_primary_checkout_button</td>\\n    <td class=\\\"\\\">Boolean that determines whether to show a checkout button</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">show_multiple_address_shipping</td>\\n    <td class=\\\"\\\">Boolean: If >1 physical items are in the cart, and checkout button is displayed: whether to also display the \\\"Ship to multiple addresses\\\"/\\\"Multiple Shipping Addresses” user option</td>\\n  </tr>\\n  \\n  <tr>\\n    <td class=\\\"\\\">discount</td>\\n    <td class=\\\"\\\">Discount being applied to the cart in the current session</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">gift_wrapping_cost</td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the cost associated with adding gift wrapping to the items in the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">sub_total</td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the total cost of all the items in the cart. Might or might not include tax, based on the tax display settings the merchant has configured. Excludes shipping, discounts, and gift wrapping.</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">grand_total</td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the total cost of all the items in the cart. <NOBR>Incorporates estimated</nobr> shipping, discounts, taxes, and gift wrapping.</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">shipping_handling</td>\\n    <td class=\\\"\\\">Current configuration of the shipping estimator for this session’s current cart; will be null/undefined if the cart contains no physical products</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">handling_cost</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the handling cost for the carted items (if any)</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">show_estimator</span></td>\\n    <td class=\\\"\\\">Boolean indicating whether the merchant wants to show the shipping estimator to customers</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> countries</span></td>\\n    <td class=\\\"\\\">Countries available to ship to</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> states</span></td>\\n    <td class=\\\"\\\">List of states/provinces/regions for the country</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> selected_state</span></td>\\n    <td class=\\\"\\\">The state/province/region that the customer selected for the shipping estimate</td>\\n  </tr>\\n\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> selected_zip</span></td>\\n    <td class=\\\"\\\">The ZIP/postal code that the customer selected for the shipping estimate</td>\\n  </tr>\\n  \\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> selected_city</span></td>\\n    <td class=\\\"\\\">The city/town that the customer selected for the shipping estimate</td>\\n  </tr>\\n  \\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> shipping_cost</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines shipping cost</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> provider</span></td>\\n    <td class=\\\"\\\">Shipping provider associated with this shipping estimate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">coupons</td>\\n    <td class=\\\"\\\">List of coupons applied to the cart; default sorting is by coupon <span class=\\\"inline-code\\\">id</span>, from lowest to highest</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> id</span></td>\\n    <td class=\\\"\\\">Unique ID of the coupon</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> code</span></td>\\n    <td class=\\\"\\\">Code associated with the coupon</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> discount</span></td>\\n    <td class=\\\"\\\">Discount associated with the coupon</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> type</span></td>\\n    <td class=\\\"\\\">Coupon type</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">gift_certificates</td>\\n    <td class=\\\"\\\">List of gift certificates applied to the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> id</span></td>\\n    <td class=\\\"\\\">Unique system ID for the gift certificate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> code</span></td>\\n    <td class=\\\"\\\">Customer code used to identify the gift certificate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> remaining</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the amount remaining on the gift certificate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> used</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the amount already used on the gift certificate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> remove_url</span></td>\\n    <td class=\\\"\\\">URL to remove gift certificate from the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">taxes</td>\\n    <td class=\\\"\\\">List of all applicable taxes for the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> name</span></td>\\n    <td class=\\\"\\\">Name of the applied tax</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> cost</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the cost of the applied tax</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> included</span></td>\\n    <td class=\\\"\\\">Boolean that indicates whether taxes are included in the total price for the cart’s contents</td>\\n  </tr>\\n</table>\\n\\n<h2> <A NAME=\\\"Cart_Items\\\"></a>Cart Items</h2>\\n\\n<b>Description:</b> A list of items added to the cart in the current session<br>\\n\\n<b>Handlebars Expression:</b> <span class=\\\"inline-code\\\">{{cart.items}}</span><br>\\n\\n<b>Object Properties:</b><br><br>\\n\\n<table>\\n  <tr>\\n    <td>Property</td>\\n    <td>Description</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">id</td>\\n    <td class=\\\"\\\">Unique system ID for the item in the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">quantity</td>\\n    <td class=\\\"\\\">Quantity of the item being ordered</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">type</td>\\n    <td class=\\\"\\\">String indicating the type of purchase: either \\\"Item\\\" or \\\"GiftCertificate\\\"</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">can_modify</td>\\n    <td class=\\\"\\\">Boolean indicating whether the customer may modify the quantity of, or remove, this cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">remove_url</td>\\n    <td class=\\\"\\\">URL to remove this item from the cart</td>\\n  </tr>\\n  \\n  <tr>\\n    <td class=\\\"\\\">sku</td>\\n    <td class=\\\"\\\">SKU for this cart item</td>\\n  </tr>\\n  \\n  <tr>\\n    <td class=\\\"\\\">If type == Item</td>\\n    <td class=\\\"\\\">If the item in the cart is a purchasable product, these properties are available:</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">product_id</span></td>\\n    <td class=\\\"\\\">Product ID for the cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">name</span></td>\\n    <td class=\\\"\\\">Product name of the cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">url</span></td>\\n    <td class=\\\"\\\">Link to the product page for the cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">availability</span></td>\\n    <td class=\\\"\\\">An optional availability message set by the merchant</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">image</span></td>\\n    <td class=\\\"\\\">Product image for the cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">event_date</span></td>\\n    <td class=\\\"\\\">Chosen event date for event-based products</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">show_wrapping_options</span></td>\\n    <td class=\\\"\\\">Boolean indicating whether the wrapping options are shown</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">rrp</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the cart item's list price (MSRP); can be used to display struck-out list prices, as explained <a href=\\\"#strikeout\\\">here</a></td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">price</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the unit price of the cart item, after discounts; to see how this and the next three price properties relate to each other, please see <a href=\\\"/docs/cart-price-properties\\\">Cart Price Properties</a></td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">price_discounted</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the unit price, after all cart discounts and promotions</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">total</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the total price (price * quantity) of the cart item</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">total_discounted</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the total price (price * quantity), after all cart discounts and promotions</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">brand</span></td>\\n    <td class=\\\"\\\">Brand properties</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent2\\\"> name</span></td>\\n    <td class=\\\"\\\">The product’s brand name</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\">release_date</span></td>\\n    <td class=\\\"\\\">If a pre-order product was added to the cart,  displays a message about when the item is expected to ship to the customer</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">gift_wrapping</td>\\n    <td class=\\\"\\\">Gift-wrapping options</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> name</span></td>\\n    <td class=\\\"\\\">Name of the gift-wrapping option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> price</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the price of the gift-wrapping option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> message</span></td>\\n    <td class=\\\"\\\">Customer-defined message for the gift wrapping </td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> remove_url</span></td>\\n    <td class=\\\"\\\">URL to remove the gift-wrapping option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">options</td>\\n    <td class=\\\"\\\">Options chosen when product was added to cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> name</span></td>\\n    <td class=\\\"\\\">Name of the option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> value</span></td>\\n    <td class=\\\"\\\">Value of the option</td>\\n  </tr>\\n  \\n  <tr>\\n<td class=\\\"\\\"><a name=\\\"bulk_pricing\\\"></a>bulk_pricing</td>\\n    <td class=\\\"\\\">Properties for applying bulk-pricing discounts to cart items</td>\\n  </tr>\\n\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> base_price </span></td>\\n    <td class=\\\"\\\">Price per item before any bulk discount applied</td>\\n  </tr>\\n\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> discount_amount </span></td>\\n    <td class=\\\"\\\">Bulk-discount amount per item, if applicable; otherwise, null</td>\\n  </tr>  \\n\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> discount_percentage </span></td>\\n    <td class=\\\"\\\">Bulk-discount percentage per item, if applicable; otherwise, null</td>\\n  </tr>  \\n   \\n  <tr>\\n    <td class=\\\"\\\">configurable_fields</td>\\n    <td class=\\\"\\\">Custom product fields set when product was added to cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> name</span></td>\\n    <td class=\\\"\\\">Name of the custom option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> value</span></td>\\n    <td class=\\\"\\\">Value of the custom option</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">If type == GiftCertificate</td>\\n    <td class=\\\"\\\">If the item in the cart is a gift certificate, these properties are available:</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> name</span></td>\\n    <td class=\\\"\\\">Sender’s name </td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> edit_url</span></td>\\n    <td class=\\\"\\\">URL to edit the gift certificate</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> recipient</span></td>\\n    <td class=\\\"\\\">Recipient’s name</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> price</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the gift certificate’s basic price</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\"><span class=\\\"indent1\\\"> total</span></td>\\n    <td class=\\\"\\\"><a href=\\\"/docs/price-common-object\\\">Price object</a> that defines the gift certificate’s total cost, with applicable taxes included</td>\\n  </tr>\\n</table>\"\n}\n[/block]\n## <span id=\"strikeout\"> Strikeout Pricing Example </span>\n\nAs a theme developer, you can use the `{{cart.items.rrp}}` property to display strike-out pricing in the Cart context. Here is the general approach:\n\nIn your `<theme-name>/templates/components/cart/content.html` file, as you iterate over the list of items in the cart, you would check each item's `type`. (No `rrp` property is available where the `type` is `GiftCertificate`.)\n\nIf the type is `Item`, then you would check the {{cart.items.rrp}} value. If the value is _not_ `null`, then you would know that you can display a strike-out price for the item. Below is a sample code skeleton:\n\n```\n{{#each cart.items}}\n   ...\n  {{#if type '==' 'GiftCertificate'}}\n      {{#if rrp}}\n          ... /* your code to display strike-thru pricing */\n      {{else}}\n          ... /* your code to display normal pricing */\n      {{/if}}\n  {{/if}}\n ```\n\nFor further details about catalog price properties, please see [Catalog Price Object: How Properties Interact](/docs/price-object-properties). For usage examples of the `{{cart.items}}` `price` and `total` properties, please see [Cart Price Properties](/docs/cart-price-properties).\n[block:html]\n{\n  \"html\": \"<h2> <A NAME=\\\"Cart_Status\\\"></a>Cart Status Message</h2>\\n\\n<b>Description:</b> A list of relevant messages for the cart in the current session<br>\\n\\n<b>Handlebars Expression:</b> <span class=\\\"inline-code\\\">{{cart.status_messages}}</span><br>\\n\\n<b>Object Properties:</b><br><br>\\n\\n<table>\\n  <tr>\\n    <td>Property</td>\\n    <td>Description</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">message</td>\\n    <td class=\\\"\\\">System-generated messages for the cart</td>\\n  </tr>\\n  <tr>\\n    <td class=\\\"\\\">type</td>\\n    <td class=\\\"\\\">Type of message: error, info, or success</td>\\n  </tr>\\n</table>\\n\\n\\n<h2> <A NAME=\\\"Suggested\\\"></a>Suggested Products </h2>\\n\\n<b>Description:</b> A list of suggested products, based on cart contents; displays only if enabled by the <span class=\\\"inline-code\\\">cart.suggestions</span> <nobr><a href=\\\"https://stencil.bigcommerce.com/docs/front-matter-variables#Front-ref-cart\\\">front-matter attribute</a></nobr>, and only immediately after a product is added to the cart<br>\\n\\n<b>Handlebars Expression:</b> <span class=\\\"inline-code\\\">{{cart.suggested_products}}</span><br>\\n\\n<b>Object Properties:</b> References standard  <a href=\\\"/docs/common-product-card-model\\\">product card model</a>.\\n\\n<!-- <br><br>\\n<h2> <A NAME=\\\"Suggestive\\\"></a>Suggestive Cart Content</h2>\\n\\n<b>Description:</b> A list of suggested products based on the contents of the cart in the current session<br>\\n\\n<b>Handlebars Expression:</b> <span class=\\\"inline-code\\\">{{cart.suggestive_content}}</span><br>\\n\\n<b>Object Properties:</b> References standard <a href=\\\"/docs/common-product-card-model\\\">product card model</a>. -->\"\n}\n[/block]","excerpt":"","slug":"cart-resources","type":"basic","title":"Cart Objects"}
[block:html] { "html": "<a name=\"Stencil-Cart-ref\"></a>Cart objects map to the storefront’s shopping cart:<br>\n\n<ul>\n <li><a href=\"#Cart\">Cart</a></li>\n <li><a href=\"#Cart_Items\">Cart Items</a></li>\n <li><a href=\"#strikeout\">Strikeout Pricing Example</a></li> \n <li><a href=\"#Cart_Status\">Cart Status Message</a></li>\n <li><a href=\"#Suggested\">Suggested Products</a></li>\n <!-- <li><a href=\"#Suggestive\">Suggestive Cart Content</a></li> -->\n</ul>\n\nThese objects are called on the default <NOBR><span class=\"inline-code\">&lt;theme-name&gt;/templates/pages/cart.html</span></nobr> template, and on several partials in the <NOBR><span class=\"inline-code\">&lt;theme-name&gt;/templates/components/</span></nobr> subdirectory: <NOBR><span class=\"inline-code\">cart/content.html</span></nobr>, <NOBR><span class=\"inline-code\">cart/preview.html</span></nobr>, <NOBR><span class=\"inline-code\">cart/totals.html</span></nobr>, <NOBR><span class=\"inline-code\">common/cart-preview.html</span></nobr>, and <NOBR><span class=\"inline-code\">common/navigation.html</span></nobr>. <br>\n\n<h2> <A NAME=\"Cart\"></a>Cart</h2>\n\n<b>Description:</b> The cart-specific properties for the current session<br>\n\n<b>Handlebars Expression:</b> <span class=\"inline-code\">{{cart}}</span><br>\n\n<b>Object Properties:</b><br><br>\n\n<table>\n <tr>\n <td>Property</td>\n <td>Description</td>\n </tr>\n <tr>\n <td class=\"\">quantity</td>\n <td class=\"\">Total number of items in the cart</td>\n </tr>\n <tr>\n <td class=\"\">additional_checkout_buttons</td>\n <td class=\"\">Generates checkout buttons for third-party payments (PayPal, Google Checkout, etc.)</td>\n </tr>\n <tr>\n <td class=\"\">show_primary_checkout_button</td>\n <td class=\"\">Boolean that determines whether to show a checkout button</td>\n </tr>\n <tr>\n <td class=\"\">show_multiple_address_shipping</td>\n <td class=\"\">Boolean: If >1 physical items are in the cart, and checkout button is displayed: whether to also display the \"Ship to multiple addresses\"/\"Multiple Shipping Addresses” user option</td>\n </tr>\n \n <tr>\n <td class=\"\">discount</td>\n <td class=\"\">Discount being applied to the cart in the current session</td>\n </tr>\n <tr>\n <td class=\"\">gift_wrapping_cost</td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the cost associated with adding gift wrapping to the items in the cart</td>\n </tr>\n <tr>\n <td class=\"\">sub_total</td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the total cost of all the items in the cart. Might or might not include tax, based on the tax display settings the merchant has configured. Excludes shipping, discounts, and gift wrapping.</td>\n </tr>\n <tr>\n <td class=\"\">grand_total</td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the total cost of all the items in the cart. <NOBR>Incorporates estimated</nobr> shipping, discounts, taxes, and gift wrapping.</td>\n </tr>\n <tr>\n <td class=\"\">shipping_handling</td>\n <td class=\"\">Current configuration of the shipping estimator for this session’s current cart; will be null/undefined if the cart contains no physical products</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">handling_cost</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the handling cost for the carted items (if any)</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">show_estimator</span></td>\n <td class=\"\">Boolean indicating whether the merchant wants to show the shipping estimator to customers</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent2\"> countries</span></td>\n <td class=\"\">Countries available to ship to</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent2\"> states</span></td>\n <td class=\"\">List of states/provinces/regions for the country</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent2\"> selected_state</span></td>\n <td class=\"\">The state/province/region that the customer selected for the shipping estimate</td>\n </tr>\n\n <tr>\n <td class=\"\"><span class=\"indent2\"> selected_zip</span></td>\n <td class=\"\">The ZIP/postal code that the customer selected for the shipping estimate</td>\n </tr>\n \n <tr>\n <td class=\"\"><span class=\"indent2\"> selected_city</span></td>\n <td class=\"\">The city/town that the customer selected for the shipping estimate</td>\n </tr>\n \n <tr>\n <td class=\"\"><span class=\"indent2\"> shipping_cost</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines shipping cost</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent2\"> provider</span></td>\n <td class=\"\">Shipping provider associated with this shipping estimate</td>\n </tr>\n <tr>\n <td class=\"\">coupons</td>\n <td class=\"\">List of coupons applied to the cart; default sorting is by coupon <span class=\"inline-code\">id</span>, from lowest to highest</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> id</span></td>\n <td class=\"\">Unique ID of the coupon</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> code</span></td>\n <td class=\"\">Code associated with the coupon</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> discount</span></td>\n <td class=\"\">Discount associated with the coupon</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> type</span></td>\n <td class=\"\">Coupon type</td>\n </tr>\n <tr>\n <td class=\"\">gift_certificates</td>\n <td class=\"\">List of gift certificates applied to the cart</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> id</span></td>\n <td class=\"\">Unique system ID for the gift certificate</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> code</span></td>\n <td class=\"\">Customer code used to identify the gift certificate</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> remaining</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the amount remaining on the gift certificate</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> used</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the amount already used on the gift certificate</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> remove_url</span></td>\n <td class=\"\">URL to remove gift certificate from the cart</td>\n </tr>\n <tr>\n <td class=\"\">taxes</td>\n <td class=\"\">List of all applicable taxes for the cart</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> name</span></td>\n <td class=\"\">Name of the applied tax</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> cost</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the cost of the applied tax</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> included</span></td>\n <td class=\"\">Boolean that indicates whether taxes are included in the total price for the cart’s contents</td>\n </tr>\n</table>\n\n<h2> <A NAME=\"Cart_Items\"></a>Cart Items</h2>\n\n<b>Description:</b> A list of items added to the cart in the current session<br>\n\n<b>Handlebars Expression:</b> <span class=\"inline-code\">{{cart.items}}</span><br>\n\n<b>Object Properties:</b><br><br>\n\n<table>\n <tr>\n <td>Property</td>\n <td>Description</td>\n </tr>\n <tr>\n <td class=\"\">id</td>\n <td class=\"\">Unique system ID for the item in the cart</td>\n </tr>\n <tr>\n <td class=\"\">quantity</td>\n <td class=\"\">Quantity of the item being ordered</td>\n </tr>\n <tr>\n <td class=\"\">type</td>\n <td class=\"\">String indicating the type of purchase: either \"Item\" or \"GiftCertificate\"</td>\n </tr>\n <tr>\n <td class=\"\">can_modify</td>\n <td class=\"\">Boolean indicating whether the customer may modify the quantity of, or remove, this cart item</td>\n </tr>\n <tr>\n <td class=\"\">remove_url</td>\n <td class=\"\">URL to remove this item from the cart</td>\n </tr>\n \n <tr>\n <td class=\"\">sku</td>\n <td class=\"\">SKU for this cart item</td>\n </tr>\n \n <tr>\n <td class=\"\">If type == Item</td>\n <td class=\"\">If the item in the cart is a purchasable product, these properties are available:</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">product_id</span></td>\n <td class=\"\">Product ID for the cart item</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">name</span></td>\n <td class=\"\">Product name of the cart item</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">url</span></td>\n <td class=\"\">Link to the product page for the cart item</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">availability</span></td>\n <td class=\"\">An optional availability message set by the merchant</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">image</span></td>\n <td class=\"\">Product image for the cart item</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">event_date</span></td>\n <td class=\"\">Chosen event date for event-based products</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">show_wrapping_options</span></td>\n <td class=\"\">Boolean indicating whether the wrapping options are shown</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">rrp</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the cart item's list price (MSRP); can be used to display struck-out list prices, as explained <a href=\"#strikeout\">here</a></td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">price</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the unit price of the cart item, after discounts; to see how this and the next three price properties relate to each other, please see <a href=\"/docs/cart-price-properties\">Cart Price Properties</a></td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">price_discounted</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the unit price, after all cart discounts and promotions</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">total</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the total price (price * quantity) of the cart item</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">total_discounted</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the total price (price * quantity), after all cart discounts and promotions</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">brand</span></td>\n <td class=\"\">Brand properties</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent2\"> name</span></td>\n <td class=\"\">The product’s brand name</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\">release_date</span></td>\n <td class=\"\">If a pre-order product was added to the cart, displays a message about when the item is expected to ship to the customer</td>\n </tr>\n <tr>\n <td class=\"\">gift_wrapping</td>\n <td class=\"\">Gift-wrapping options</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> name</span></td>\n <td class=\"\">Name of the gift-wrapping option</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> price</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the price of the gift-wrapping option</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> message</span></td>\n <td class=\"\">Customer-defined message for the gift wrapping </td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> remove_url</span></td>\n <td class=\"\">URL to remove the gift-wrapping option</td>\n </tr>\n <tr>\n <td class=\"\">options</td>\n <td class=\"\">Options chosen when product was added to cart</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> name</span></td>\n <td class=\"\">Name of the option</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> value</span></td>\n <td class=\"\">Value of the option</td>\n </tr>\n \n <tr>\n<td class=\"\"><a name=\"bulk_pricing\"></a>bulk_pricing</td>\n <td class=\"\">Properties for applying bulk-pricing discounts to cart items</td>\n </tr>\n\n <tr>\n <td class=\"\"><span class=\"indent1\"> base_price </span></td>\n <td class=\"\">Price per item before any bulk discount applied</td>\n </tr>\n\n <tr>\n <td class=\"\"><span class=\"indent1\"> discount_amount </span></td>\n <td class=\"\">Bulk-discount amount per item, if applicable; otherwise, null</td>\n </tr> \n\n <tr>\n <td class=\"\"><span class=\"indent1\"> discount_percentage </span></td>\n <td class=\"\">Bulk-discount percentage per item, if applicable; otherwise, null</td>\n </tr> \n \n <tr>\n <td class=\"\">configurable_fields</td>\n <td class=\"\">Custom product fields set when product was added to cart</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> name</span></td>\n <td class=\"\">Name of the custom option</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> value</span></td>\n <td class=\"\">Value of the custom option</td>\n </tr>\n <tr>\n <td class=\"\">If type == GiftCertificate</td>\n <td class=\"\">If the item in the cart is a gift certificate, these properties are available:</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> name</span></td>\n <td class=\"\">Sender’s name </td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> edit_url</span></td>\n <td class=\"\">URL to edit the gift certificate</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> recipient</span></td>\n <td class=\"\">Recipient’s name</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> price</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the gift certificate’s basic price</td>\n </tr>\n <tr>\n <td class=\"\"><span class=\"indent1\"> total</span></td>\n <td class=\"\"><a href=\"/docs/price-common-object\">Price object</a> that defines the gift certificate’s total cost, with applicable taxes included</td>\n </tr>\n</table>" } [/block] ## <span id="strikeout"> Strikeout Pricing Example </span> As a theme developer, you can use the `{{cart.items.rrp}}` property to display strike-out pricing in the Cart context. Here is the general approach: In your `<theme-name>/templates/components/cart/content.html` file, as you iterate over the list of items in the cart, you would check each item's `type`. (No `rrp` property is available where the `type` is `GiftCertificate`.) If the type is `Item`, then you would check the {{cart.items.rrp}} value. If the value is _not_ `null`, then you would know that you can display a strike-out price for the item. Below is a sample code skeleton: ``` {{#each cart.items}} ... {{#if type '==' 'GiftCertificate'}} {{#if rrp}} ... /* your code to display strike-thru pricing */ {{else}} ... /* your code to display normal pricing */ {{/if}} {{/if}} ``` For further details about catalog price properties, please see [Catalog Price Object: How Properties Interact](/docs/price-object-properties). For usage examples of the `{{cart.items}}` `price` and `total` properties, please see [Cart Price Properties](/docs/cart-price-properties). [block:html] { "html": "<h2> <A NAME=\"Cart_Status\"></a>Cart Status Message</h2>\n\n<b>Description:</b> A list of relevant messages for the cart in the current session<br>\n\n<b>Handlebars Expression:</b> <span class=\"inline-code\">{{cart.status_messages}}</span><br>\n\n<b>Object Properties:</b><br><br>\n\n<table>\n <tr>\n <td>Property</td>\n <td>Description</td>\n </tr>\n <tr>\n <td class=\"\">message</td>\n <td class=\"\">System-generated messages for the cart</td>\n </tr>\n <tr>\n <td class=\"\">type</td>\n <td class=\"\">Type of message: error, info, or success</td>\n </tr>\n</table>\n\n\n<h2> <A NAME=\"Suggested\"></a>Suggested Products </h2>\n\n<b>Description:</b> A list of suggested products, based on cart contents; displays only if enabled by the <span class=\"inline-code\">cart.suggestions</span> <nobr><a href=\"https://stencil.bigcommerce.com/docs/front-matter-variables#Front-ref-cart\">front-matter attribute</a></nobr>, and only immediately after a product is added to the cart<br>\n\n<b>Handlebars Expression:</b> <span class=\"inline-code\">{{cart.suggested_products}}</span><br>\n\n<b>Object Properties:</b> References standard <a href=\"/docs/common-product-card-model\">product card model</a>.\n\n<!-- <br><br>\n<h2> <A NAME=\"Suggestive\"></a>Suggestive Cart Content</h2>\n\n<b>Description:</b> A list of suggested products based on the contents of the cart in the current session<br>\n\n<b>Handlebars Expression:</b> <span class=\"inline-code\">{{cart.suggestive_content}}</span><br>\n\n<b>Object Properties:</b> References standard <a href=\"/docs/common-product-card-model\">product card model</a>. -->" } [/block]