Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.85 KB | None | 0 0
  1. {% include 'bold-product' with product, hide_action: 'break' %}{% if bold_hidden_product %}{% break %}{%endif %}
  2. {% include 'locksmith-variables', locksmith_scope: 'subject', locksmith_subject: product %}
  3. {% assign collection = collections.all-ejuice %}
  4. {% paginate collection.products by 100 %}
  5.  
  6. <form action="/cart" method="post">
  7.  
  8.   {% if collection.products_count > 0 %}
  9.     <div style="left:100px">
  10.       <h1>{% if template contains 'page' %}{{ page.title }}{% else %}{{ collection.title }}{% endif %}</h1>
  11.       <input class="bulkadd" type="submit" value="Add to cart" />
  12.     </div>
  13.   {% else %}
  14.     <h1>{% if template contains 'page' %}{{ page.title }}{% else %}{{ collection.title }}{% endif %}</h1>
  15.   {% endif %}
  16.  
  17.   {% if template contains 'page' and page.content.size > 0 %}
  18.     <div class="rte">
  19.       {{ page.content }}
  20.     </div>  
  21.   {% elsif collection.description.size > 0 %}
  22.     <div class="rte">
  23.       {{ collection.description }}
  24.     </div>
  25.   {% endif %}
  26.  
  27.   {% if collection.products_count > 0 %}
  28.  
  29.   {% for product in collection.products %}
  30.   {% include 'bold-product' with product, hide_action: 'skip' %}
  31.     {% if product.available %}
  32.         <div class="order">
  33.             <div class="accordion">
  34.                     <div>
  35.                     <img src="{{ variant.image | default: product.featured_image | img_url: 'small' }}" alt="{{ variant.title | escape }}" />
  36.                       {{ product.title }}
  37.                     </div>
  38.             </div>
  39.               <div class="container">
  40.                 <table>
  41.                   <tbody>
  42.                   {% for variant in product.variants %}
  43.                   {% if variant.available %}
  44.                     <tr class="{% cycle 'pure-table-odd', '' %}">
  45.                       <td>
  46.                         {{ variant.title }}
  47.                       </td>
  48.                       <td>
  49.                         {% if locksmith_access_granted %}
  50.                         {{ variant.price | money }}
  51.                         {% else %}
  52.                         <p>Please login to see pricing</p>
  53.                         {% endif %}
  54.                       </td>
  55.                       <td style="text-align:right; width:100px">
  56.                         <input name="updates[{{ variant.id }}]" onfocus="this.select()" class="quantity field" min="0" {% unless variant.inventory_management == blank or variant.inventory_policy == 'continue' %} max="{{ variant.inventory_quantity }}" {% endunless %} type="text" value="0" tabindex="1" />
  57.                       </td>
  58.                     </tr>
  59.                   {% endif %}
  60.                   {% endfor %}
  61.                   </tbody>
  62.                 </table>
  63.               </div>
  64.         {% endif %}
  65.       {% endfor %}
  66.    
  67.     <div>
  68.       <input type="submit" value="Add to the cart" />
  69.     </div>
  70.  
  71.   {% else %}
  72.     <p>There are no products in this view.</p>
  73.   {% endif %}
  74.  
  75. </form>
  76.  
  77. {% endpaginate %}
  78.  
  79. {% if collection.products_count > 0 %}
  80. <script>
  81. jQuery(function($) {
  82.   $('table .quantity:first').focus();
  83.   $('[max]').change(function() {
  84.     var max = parseInt($(this).attr('max'), 10);
  85.     var value = parseInt($(this).val(), 10) || 0;
  86.     if (value > max) {
  87.       alert('We only have ' + max + ' of this item in stock');
  88.       $(this).val(max);
  89.     }    
  90.   });
  91. });
  92. </script>
  93. {% endif %}
  94. <script type="text/javascript" src="{{ 'jquery_accordion.js' | asset_url }}"></script>
  95. <script type="text/javascript">
  96. $(document).ready(function() {
  97. $('.accordion').accordion({
  98. defaultOpen: 'section1',
  99. cookieName: 'accordion_nav'
  100. });
  101. });
  102. </script>
  103. <style>
  104. .bulkadd {
  105. width:200px;
  106. font-size:2em;
  107. background:#AD9675;
  108. color:#0D0E20;
  109. border:#0D0E20 2px solid;
  110. height:50px;
  111. position:relative;
  112. text-align: center;
  113. }
  114. .bulkadd input {
  115. margin:auto;
  116. }
  117. .accordion {
  118. width: 75%;
  119. margin: auto;
  120. padding:10px;
  121. border:#0D0E20 2px solid;
  122. background: #AD9675;
  123. text-decoration:none;
  124. color: #0D0E20;
  125. font-size:2em;
  126. position:relative;
  127. }
  128. .accordion-open {
  129. background:#50b3da;
  130. color: #fff;
  131. }
  132. .accordion-open span {
  133. display:block;
  134. position:absolute;
  135. right:3px;
  136. top:25%;
  137. padding:10px;
  138. }
  139. .accordion-open span {
  140. background:url('{{ 'minus.png' | asset_url }}') center center no-repeat;
  141. }
  142. .accordion-close span {
  143. display:block;
  144. position:absolute;
  145. right:3px;
  146. top:25%;
  147. background:url('{{ 'plus.png' | asset_url }}') center center no-repeat;
  148. padding:10px;
  149. }
  150. .accordion div {
  151. position:relative;
  152. margin:auto;
  153. }  
  154. .order div.container {
  155. padding:0;
  156. margin:auto;
  157. }
  158. .order div.container {
  159. max-width:75%;
  160. padding:5px 0;
  161. }
  162. .order div.content {
  163. background:#f0f0f0;
  164. margin: 0;
  165. padding:10px;
  166. font-size:.9em;
  167. line-height:1.5em;
  168. }
  169. .order div.content ul {
  170. padding:0;
  171. margin:0;
  172. padding:3px;
  173. }
  174. .order div.content p {
  175. padding:0;
  176. margin:3px 0 10px;
  177. padding:3px;
  178. }
  179. .order div.content ul li {
  180. list-style-position:inside;
  181. line-height:25px;
  182. }
  183. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement