Skip to content

Instantly share code, notes, and snippets.

View o-nkar's full-sized avatar
💻
learning new things

Onkar Singh o-nkar

💻
learning new things
View GitHub Profile
{% for collection in collections %}
{% if collection.title == "OMBRONE COLLECTION" %}
<a href="{{collection.url}}">
<div class="cm_colec_title"><span>{{collection.title}}</span></div>
</a>
{% assign products = collection['collection_handle'].products %}
{% for product in products %}
{{ product.image | img_url:'master' | img_tag }}
{% endfor %}
{% endif %}
1. This is the 1st way to do the same
<div class="Images">
{% for i in (1..5) %}
{% assign sec = image | append: i %}
{% if section.settins[sec] != blank %}
<div class="img image{{i}}">
<img src="{{section.settins[sec] | img_url: '120x120'}}"/>
</div>
{% endif %}
{% endfor %}
#headline {
font-size: 38px;
color: #fff;
}
.video-section+h1 {
position: absolute;
bottom: 0;
z-index: 10001;
width: 100%;
}
// trigger a resize event once the window is loaded, it refresh the Flickity slider on resize
window.onload = function(){
window.dispatchEvent(new Event('resize'));
}
function qTyJSCart(){
var d = document.createElement('div');
d.innerHTML = `<input type="text" name="quantity" value="1" size="2" id="Quantity" oninput="updatecartsticky(this.value, this.parentNode.dataset.id)" class="form-control">`;
document.querySelectorAll('#cart .info-item').forEach(ele=>{
var eleId = ele.querySelector('.cart-name').getAttribute('href').split('=');
var id = eleId[eleId.length - 1];
d.setAttribute('data-id', id);
ele.appendChild(d);
});
}
@media only screen and (max-width: 760px),(min-device-width: 768px) and (max-device-width: 1024px){
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
<?php
global $woocommerce;
$items = $woocommerce->cart->get_cart();
$totalquantity = 0;
$category_found = 0;
foreach($items as $item => $values) {
$id = $values['data']->get_id();
$_product = wc_get_product( $id );
$totalquantity += $values['quantity'];
if( has_term( '===category name to check goes here===', 'product_cat', $id ) ){
{% if section.settings.message %}
<style>
{% if section.settings.logo != blank %}
.site-header__logo-image {
max-width: {{ section.settings.logo_max_width | escape }}px;
}
{% endif %}
{% if section.settings.align_logo == 'left' %}
.site-header__logo-image {
//comment the this line into shop.js
//e(".ajax-success-modal").find(".ajax_qty").text(r);
// and add this code below this line
e.ajax({
type: 'GET',
dataType: 'json',
url: '/cart.js',
success: function(cart){
e(".ajax-success-modal").find(".ajax_qty").text(cart.item_count);
}