Skip to content

Instantly share code, notes, and snippets.

@candice-womp
Created April 30, 2018 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save candice-womp/e060dae7296db0ebdc7bc9648ac6ae83 to your computer and use it in GitHub Desktop.
Save candice-womp/e060dae7296db0ebdc7bc9648ac6ae83 to your computer and use it in GitHub Desktop.
<amp-list layout="fill" src="https://mysite.com/productID.json" template="addToCart" items="." single-item>
<template type="amp-mustache" id="addToCart">
<div class="productCard">
<div class="productImg">
<amp-img layout="responsive" height="16" width="9" src="{{Img}}"></amp-img>
</div>
<h2 class="productName">{{ProductName}}</h2>
<div class="productInfo">
{{#InStock}}
<div class="productPrice">{{ProductPrice}}</div>
<div class="productSavings">{{ProductSavingPercentage}}</div>
{{/InStock}}
{{^InStock}}
<h4 class="productOutOfStock">Sorry. This item is out of stock.</h4>
{{/InStock}}
</div>
<div class="addToCart">
{{#InStock}}
{{#HasBulk}}
<a href="#">Add 3 to Cart</a>
<a href="#">Add 6 to Cart</a>
<a href="#">Add 9 to Cart</a>
{{/HasBulk}}
{{^HasBulk}}
<a href="#">Add to Cart</a>
{{/HasBulk}}
{{/InStock}}
{{^InStock}}
<a href="#">Email Me When In Stock</a>
{{/InStock}}
</div>
</div>
</template>
</amp-list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment