Skip to content

Instantly share code, notes, and snippets.

View enamhasan's full-sized avatar

EnamHasan enamhasan

View GitHub Profile
@enamhasan
enamhasan / Shopify_Private_App
Created May 4, 2019 12:42
Shopfy Private App using PythonAPI 5.0.1
import shopify
API_KEY = 'api_key_from_shopify_adimin'
PASSWORD = 'app password'
SHOP_NAME = 'xyz'
shop_url = "https://SHOP_NAME.myshopify.com/admin"
shopify.ShopifyResource.set_user(API_KEY)
shopify.ShopifyResource.set_password(PASSWORD)
shopify.ShopifyResource.set_site(shop_url)
shop = shopify.Shop.current()
@enamhasan
enamhasan / Country-redirect-popup-shopify
Last active May 2, 2023 03:18
Country Redirect Popup for Shopify
<script>
$(document).ready(function () {
//alert (tt);
$.getJSON('http://api.db-ip.com/v2/free/self', function (data) {
if (data.countryCode === 'CA') {
//alert("BD");
jQuery.fancybox.open(jQuery('#message'));
@enamhasan
enamhasan / shopify-query-string
Created February 15, 2019 19:49
Get the querystring values with liquid in shopify
{%- capture contentForQuerystring -%}{{ content_for_header }}{%- endcapture -%}
{% comment %} Use string splitting to pull the value from content_for_header and apply some string clean up {% endcomment %}
{%- assign pageUrl = contentForQuerystring | split:'"pageurl":"' | last | split:'"' | first | split:'.myshopify.com' | last |
replace:'\/','/' |
replace:'%20',' ' |
replace:'\u0026','&'
-%}
{%- assign pageQuerystring = pageUrl | split:'?' | last -%}
@enamhasan
enamhasan / contac-us-modal-shopify
Last active June 4, 2018 20:30
Contact us modal
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<div id="ContactUs-modal" class="contact-modal-block">
<div class="contact_success">
</div>
<div class="contact-modal grid-uniform">
<header class="section-header">
<span class="close2" onclick="closemodal()">×</span>
@enamhasan
enamhasan / Shopify cheat sheet
Created August 17, 2017 11:50
Shopify cheat sheet
=======#1. Check if a product contain a specific tag ===============
{% assign productTags = product.tags | join:',' %}
{% if productTags contains 'limit' %}
<!-- Do something here -->
{% endif %}
====== #2 Comming Soon==========================================
@enamhasan
enamhasan / order-template.liquid
Created March 23, 2016 11:12
Shopify Order Printer Template with product image, variations and line item properties
<p style="float: right; text-align: right; margin: 0;">
{{ "now" | date: "%m/%d/%y" }}<br />
Invoice for {{ order_name }}
</p>
<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
@enamhasan
enamhasan / gist:53f054c5e8cf251fddc0
Created June 5, 2015 20:51
Shopify Product Image Reveal
/* ===============================================
// Reveal module CSS
// =============================================== */
.reveal .hidden { display: block !important; visibility: visible !important;}
.product:hover .reveal img { opacity: 0.3; }
.reveal { position: relative; }
.reveal .hidden {
@enamhasan
enamhasan / Shopify-Cart-item-related-products.liquid
Created April 12, 2015 19:12
Shopify-Cart-item-related-products