Skip to content

Instantly share code, notes, and snippets.

var $cartLineItems = checkout.lineItems.map(function (lineItem, index) {
var $lineItemTemplate = $(lineItemEmptyTemplate);
var itemImage = lineItemImages[lineItem.variant_id];
$lineItemTemplate.find('.cart-item__img').css('background-image', 'url(' + itemImage + ')');
$lineItemTemplate.find('.cart-item__title').text(lineItem.title);
$lineItemTemplate.find('.cart-item__variant-title').text(lineItem.variant_title);
$lineItemTemplate.find('.cart-item__price').text(formatAsMoney(lineItem.line_price));
$lineItemTemplate.find('.cart-item__quantity').attr('value', lineItem.quantity);
$lineItemTemplate.find('.quantity-decrement').attr('data-variant-id', lineItem.variant_id);
$lineItemTemplate.find('.quantity-increment').attr('data-variant-id', lineItem.variant_id);
function openCart() {
$('.cart').addClass('js-active');
}
function closeCart() {
$('.cart .btn--close').click(function () {
$('.cart').removeClass('js-active');
});
}
<table> <!--“Desktop” width: 600px - 300*2-->
<tr>
<td class=”col” width=”300”>...</td>
<td class=”col” width=”300”>...</td>
</tr>
</table>
@media only screen and (max-width: 600px) {
table, tr, td {
display: block; /* table-cell -> block */
width: 100%;
}
}
<table> <!--“Desktop” width — 600px - 300*2-->
<tr>
<td class=”sub-col” width=”300”>...</td>
<td class=”main-col” width=”300”>...</td>
</tr>
</table>
@media only screen and (max-width: 500px) {
table, tr, td {
display: block; /* table-cell -> block */
width: 100%;
}
.main-col {
display: table-header-group;
}
{{ 'logo.png' | asset_url }}
{{ product.vendor | url_for_vendor }}
{{ "Shop winter boots" | link_to_tag: 'Boots' }}
//cdn.shopify.com/s/files/1/0087/0462/t/394/assets/logo.png?34423/collections/vendors?q=Burton
<a title="Show products matching tag Boots" href="/collections/frontpage/boots">Shop winter boots</a>
<td class="wrapper"><!--Nested tables...-->
<table class="header">Header</table>
<table class="nav">Navigation</table>
<table class="content">Content</table>
<table class="footer">Footer</table>
</table>
@media only screen and (max-width: 500px) {
.wrapper {
display: table;
}
.header {
display: table-caption;
}
.nav {
// Liquid
<h1>{{ product.title }}</h1>
<p>{{ product.description }}</p>
// HTML returned
<h1>Snowboard Product Title</h1>
<p>The snowboard product description.</p>