Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.76 KB | None | 0 0
  1. <!-- /snippets/ajax-cart-template.liquid -->
  2. {% comment %}
  3.  
  4.   This snippet provides the default handlebars.js templates for
  5.   the ajax cart plugin. Use the raw liquid tags to keep the
  6.   handlebar.js template tags as available hooks.
  7.  
  8. {% endcomment %}
  9.   <script id="CartTemplate" type="text/template">
  10.   {% raw %}
  11.     <form action="/cart" method="post" novalidate class="cart ajaxcart">
  12.       <div class="ajaxcart__inner ajaxcart__inner--has-fixed-footer">
  13.         {{#items}}
  14.         <div class="ajaxcart__product">
  15.           <div class="ajaxcart__row" data-line="{{line}}">
  16.             <div class="grid">
  17.               <div class="grid__item one-quarter">
  18.                 <a href="{{url}}" class="ajaxcart__product-image"><img src="{{img}}" alt="{{name}}"></a>
  19.               </div>
  20.               <div class="grid__item three-quarters">
  21.                 <div class="ajaxcart__product-name--wrapper">
  22.                   <a href="{{url}}" class="ajaxcart__product-name">{{{name}}}</a>
  23.                   {{#if variation}}
  24.                     <span class="ajaxcart__product-meta">{{variation}}</span>
  25.                   {{/if}}
  26.                   {{#properties}}
  27.                     {{#each this}}
  28.                       {{#if this}}
  29.                         <span class="ajaxcart__product-meta">{{@key}}: {{this}}</span>
  30.                       {{/if}}
  31.                     {{/each}}
  32.                   {{/properties}}
  33.                 </div>
  34.  
  35.                 <div class="grid--full display-table">
  36.                   <div class="grid__item display-table-cell one-half">
  37.                     <div class="ajaxcart__qty">
  38.                       <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--minus icon-fallback-text" data-id="{{key}}" data-qty="{{itemMinus}}" data-line="{{line}}" aria-label="{% endraw %}{{ 'cart.general.reduce_quantity' | t }}{% raw %}">
  39.                         <span class="icon icon-minus" aria-hidden="true"></span>
  40.                         <span class="fallback-text" aria-hidden="true">&minus;</span>
  41.                       </button>
  42.                       <input type="text" name="updates[]" class="ajaxcart__qty-num" value="{{itemQty}}" min="0" data-id="{{key}}" data-line="{{line}}" aria-label="quantity" pattern="[0-9]*">
  43.                       <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--plus icon-fallback-text" data-id="{{key}}" data-line="{{line}}" data-qty="{{itemAdd}}" aria-label="{% endraw %}{{ 'cart.general.increase_quantity' | t }}{% raw %}">
  44.                         <span class="icon icon-plus" aria-hidden="true"></span>
  45.                         <span class="fallback-text" aria-hidden="true">+</span>
  46.                       </button>
  47.                     </div>
  48.                   </div>
  49.                   <div class="grid__item display-table-cell one-half text-right">
  50.                     {{#if discountsApplied}}
  51.                       <small class="ajaxcart__price--strikethrough">{{{price}}}</small>
  52.                       <span class="ajaxcart__price">
  53.                         {{{discountedPrice}}}
  54.                       </span>
  55.                     {{else}}
  56.                       <span class="ajaxcart__price">
  57.                         {{{price}}}
  58.                       </span>
  59.                     {{/if}}
  60.                   </div>
  61.                 </div>
  62.                 {{#if discountsApplied}}
  63.                   <div class="grid--full display-table">
  64.                     <div class="grid__item text-right">
  65.                       {{#each discounts}}
  66.                         <small class="ajaxcart__discount">{{this.title}}</small>
  67.                       {{/each}}
  68.                     </div>
  69.                   </div>
  70.                 {{/if}}
  71.               </div>
  72.             </div>
  73.           </div>
  74.         </div>
  75.         {{/items}}
  76.  
  77.         {% endraw %}{% if settings.cart_notes_enable %}{% raw %}
  78.           <div>
  79.             <label for="CartSpecialInstructions" class="ajaxcart__note">{% endraw %}{{ 'cart.general.note' | t }}{% raw %}</label>
  80.             <textarea name="note" class="input-full" id="CartSpecialInstructions">{{note}}</textarea>
  81.           </div>
  82.         {% endraw %}{% endif %}{% raw %}
  83.       </div>
  84.       <div class="ajaxcart__footer ajaxcart__footer--fixed">
  85.         <div class="grid--full">
  86.           <div class="grid__item two-thirds">
  87.             <p class="ajaxcart__subtotal">{% endraw %}{{ 'cart.general.subtotal' | t }}{% raw %}</p>
  88.           </div>
  89.           <div class="grid__item one-third text-right">
  90.             <p class="ajaxcart__subtotal">{{{totalPrice}}}</p>
  91.           </div>
  92.         </div>
  93.         {{#if totalCartDiscount}}
  94.           <p class="ajaxcart__savings text-center">{{{totalCartDiscount}}}</p>
  95.         {{/if}}
  96.  
  97.         <p class="ajaxcart__policies">{% endraw %}
  98.           {%- capture taxes_shipping_checkout -%}
  99.             {%- if shop.taxes_included and shop.shipping_policy.body != blank -%}
  100.               {{ 'cart.general.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
  101.             {%- elsif shop.taxes_included -%}
  102.               {{ 'cart.general.taxes_included_but_shipping_at_checkout' | t }}
  103.             {%- elsif shop.shipping_policy.body != blank -%}
  104.               {{ 'cart.general.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
  105.             {%- else -%}
  106.               {{ 'cart.general.taxes_and_shipping_at_checkout' | t }}
  107.             {%- endif -%}
  108.           {%- endcapture -%}
  109.           {{ taxes_shipping_checkout }}
  110.         {% raw %}</p>
  111.         <button type="submit" class="btn--secondary btn--full cart__checkout" name="checkout">
  112.           {% endraw %}{{ 'cart.general.checkout' | t }}{% raw %} <span class="icon icon-arrow-right" aria-hidden="true"></span>
  113.         </button>
  114.       </div>
  115.     </form>
  116.   {% endraw %}
  117.   </script>
  118.   <script id="AjaxQty" type="text/template">
  119.   {% raw %}
  120.     <div class="ajaxcart__qty">
  121.       <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--minus icon-fallback-text" data-id="{{key}}" data-qty="{{itemMinus}}" aria-label="{% endraw %}{{ 'cart.general.reduce_quantity' | t }}{% raw %}">
  122.         <span class="icon icon-minus" aria-hidden="true"></span>
  123.         <span class="fallback-text" aria-hidden="true">&minus;</span>
  124.       </button>
  125.       <input type="text" class="ajaxcart__qty-num" value="{{itemQty}}" min="0" data-id="{{key}}" aria-label="quantity" pattern="[0-9]*">
  126.       <button type="button" class="ajaxcart__qty-adjust ajaxcart__qty--plus icon-fallback-text" data-id="{{key}}" data-qty="{{itemAdd}}" aria-label="{% endraw %}{{ 'cart.general.increase_quantity' | t }}{% raw %}">
  127.         <span class="icon icon-plus" aria-hidden="true"></span>
  128.         <span class="fallback-text" aria-hidden="true">+</span>
  129.       </button>
  130.     </div>
  131.   {% endraw %}
  132.   </script>
  133.   <script id="JsQty" type="text/template">
  134.   {% raw %}
  135.     <div class="js-qty">
  136.       <button type="button" class="js-qty__adjust js-qty__adjust--minus icon-fallback-text" data-id="{{key}}" data-qty="{{itemMinus}}" aria-label="{% endraw %}{{ 'cart.general.reduce_quantity' | t }}{% raw %}">
  137.         <span class="icon icon-minus" aria-hidden="true"></span>
  138.         <span class="fallback-text" aria-hidden="true">&minus;</span>
  139.       </button>
  140.       <input type="text" class="js-qty__num" value="{{itemQty}}" min="1" data-id="{{key}}" aria-label="quantity" pattern="[0-9]*" name="{{inputName}}" id="{{inputId}}">
  141.       <button type="button" class="js-qty__adjust js-qty__adjust--plus icon-fallback-text" data-id="{{key}}" data-qty="{{itemAdd}}" aria-label="{% endraw %}{{ 'cart.general.increase_quantity' | t }}{% raw %}">
  142.         <span class="icon icon-plus" aria-hidden="true"></span>
  143.         <span class="fallback-text" aria-hidden="true">+</span>
  144.       </button>
  145.     </div>
  146.   {% endraw %}
  147.   </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement