BLOG

Collection page filter shopify 2.0

Doc ulr: Support storefront filtering (shopify.dev)   <form class="filter-form"> {%- for filter in collection.filters -%} <details class="filter-group"> <summary class="filter-group-summary"> <div> <span>{{ filter.label }}</span> {%- if filter.active_values.size > 0 -%} <span>({{ filter.active_values.size }})</span> {%- endif -%} </div> </summary> <div class="filter-group-display"> <div class="filter-group-display__header"> <span class="filter-group-display__header-selected">{{ filter.active_values.size }} selected</span>...

Based on cart total amount display specific message on cart drawer shopify

<!-- start Geo location --> <script> $.get("https://ipinfo.io", function(response) { console.log(response.city, response.country); if(response.country == "GB"){ $(document).on('click', 'form[data-product-form], .product__submit__add, .cart__quantity-plus, .cart__quantity-minus, .cart-item__remove', function (e) { setTimeout(function() { jQuery.getJSON('/cart.js', function(cart) { var totprs = (cart.total_price/100).toFixed(2); if (cart.total_price >= 13500){ // alert('There are now ' + totprs + '...

GA4 SHopify

Youtube link to create GA4 account and connect it to shopify: Shopify Google Analytics 4 Setup (Official Integration) - Simple Tutorial - YouTube Github link:  GitHub - ruturajjadeja/GA4-Shopify-DataLayer Code: <script>if(!window.jQuery){ var jqueryScript = document.createElement('script'); jqueryScript.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js'); document.head.appendChild(jqueryScript); }__DL__jQueryinterval = setInterval(function(){ // wait for jQuery to load & run...

Cart page recommended product section Shopify

{%- for item in cart.items -%} {%- assign product_rec = item.product -%}{%- endfor -%} {%- assign tagn = section.settings.tag_name %} <div class="page-width"> <div class="product-recommendations__inner"> {%- if section.settings.heading != blank -%} <div class="section-header text-center"> <h2>{{ section.settings.heading | escape }}</h2> </div> {%- endif -%} <ul class="grid grid--uniform...

Display all blog post using handle

{% assign blog_handles = 'blog-1,blog-2' | split:',' %} {% for handle in blog_handles %} {% for article in blogs[handle].articles %} {% assign article_handles = article_handles | concat:blogs[handle].articles %} {% endfor %} {% endfor %} {% for article in article_handles limit: 3 %} <h2>{{ article.title }}</h2>...

Git command

Shopify CLI Login 1>shopify version 2> shopify login --store tierliebhaber-animagus.myshopify.com or shopify theme dev --store [store url] 3> to download theme file use command >> shopify theme pull 1>https://github.com/blicksolutions/tierliebhaber.git 2> git remote set-url origin https://yourusername@github.com/user/repo.git Example:  git remote set-url origin https://ShahnawazRock@github.com/blicksolutions/tierliebhaber.git >to get remote permission...

Display Selected icons on the product page

<!--Ali Code Start --> {%- capture payment_methods -%} {%- for type in shop.enabled_payment_types -%} {%- if type contains 'amazon' or type == 'google_pay' or type == 'paypal' or type == 'klarna' or type == 'apple_pay' -%} <div class="t_Footer_Paymentlist_element">{{ type | payment_type_svg_tag }}</div> {%- endif -%}...

Ajax Cart count Shopify

 <span class="count">{{ cart.item_count }}</span>   jQuery(document).ready(function() {   jQuery("#addToCart").click(function() {     setTimeout(function() {       jQuery.getJSON('/cart.js', function(cart) {           console.log(cart);           jQuery("span.count").html(cart.item_count);        });      }, 200);   }); });