You are here

commerce-cart-flyout-offcanvas-contents-items.html.twig in Commerce Cart Flyout 8

<table class="cart-block--offcanvas-cart-table table">
    <tbody>
    <% _.each(cart.order_items, function(orderItem, key) { %>
        <tr>
            <td class="cart-block--offcanvas-cart-table__title"><%- orderItem.title %></td>
            <td class="cart-block--offcanvas-cart-table__quantity">
                <input type="number" data-key="<% print(key) %>" min="1" value="<% print(parseInt(orderItem.quantity)) %>" style="width: 35px" />
            </td>
            <td class="cart-block--offcanvas-cart-table__price"><%= orderItem.total_price.formatted %></td>
            <td class="cart-block--offcanvas-cart-table__remove">
                <button value="<% print(JSON.stringify([cart.order_id, orderItem.order_item_id]))  %>" class="button btn">x</button>
            </td>
        </tr>
    <% }) %>
    </tbody>
    <tfoot>
    <tr>
      <td></td>
      <td colspan="3">
        <button type="submit" class="cart-block--offcanvas-contents__update button btn btn-primary">{{ 'Update quantities'|t }}</button>
      </td>
    </tr>
    </tfoot>
</table>

File

templates/commerce-cart-flyout-offcanvas-contents-items.html.twig
View source
  1. <table class="cart-block--offcanvas-cart-table table">
  2. <tbody>
  3. <% _.each(cart.order_items, function(orderItem, key) { %>
  4. <tr>
  5. <td class="cart-block--offcanvas-cart-table__title"><%- orderItem.title %></td>
  6. <td class="cart-block--offcanvas-cart-table__quantity">
  7. <input type="number" data-key="<% print(key) %>" min="1" value="<% print(parseInt(orderItem.quantity)) %>" style="width: 35px" />
  8. </td>
  9. <td class="cart-block--offcanvas-cart-table__price"><%= orderItem.total_price.formatted %></td>
  10. <td class="cart-block--offcanvas-cart-table__remove">
  11. <button value="<% print(JSON.stringify([cart.order_id, orderItem.order_item_id])) %>" class="button btn">x</button>
  12. </td>
  13. </tr>
  14. <% }) %>
  15. </tbody>
  16. <tfoot>
  17. <tr>
  18. <td></td>
  19. <td colspan="3">
  20. <button type="submit" class="cart-block--offcanvas-contents__update button btn btn-primary">{{ 'Update quantities'|t }}</button>
  21. </td>
  22. </tr>
  23. </tfoot>
  24. </table>