Skip to content

Instantly share code, notes, and snippets.

View atikju's full-sized avatar

MD. Atiqur Rahman atikju

View GitHub Profile
@atikju
atikju / cartDiscount.liquid
Created October 24, 2018 20:45
Shopify - Apply Discount / Coupon / Promo Code on cart page
<div class="cart-promo">
<h2>ENTER A PROMO CODE</h2>
<input type="text" id="devPromo">
<a href="/checkout?discount=none" id="redemDevPromo">Apply Coupon</a>
</div>
<script>
$(document).ready(function(){
//listen to the promo button click
$('#redemDevPromo').on('click', function(event){
//disable the button event
@atikju
atikju / shopify-video-backgrou-section.liquid
Created April 15, 2020 21:24
Shopify Video Background with Text
<div class="containerX">
<video autoplay id="video" width="100%">
<source src="{{ section.settings.video-url }}" type="video/mp4" />
</video>
<div class="overlay">
<p>{{ section.settings.video-text1 }}</p>
<p>{{ section.settings.video-text2 }}</p>
<p>{{ section.settings.video-text3 }}</p>
</div>
</div>
@atikju
atikju / step-1.txt
Last active September 17, 2025 09:40
NGINX, PHP, MYSQL installation with Amazon Linux 2023
Step 1: Let's start with NGINX installation
sudo dnf update //To Install Latest Update
sudo dnf install -y nginx // Install Nginx
sudo systemctl start nginx.service //Start Nginx Server
sudo systemctl status nginx.service // Check Server Status
sudo systemctl enable nginx.service // Enable Auto Server Start on Reboot
Now you should be able to see the server running by hitting your public ip.
@atikju
atikju / related-articles.liquid
Created February 25, 2021 11:24
Show related articles based on article tags - Shopify
@atikju
atikju / ajax-search-form.liquid
Last active April 3, 2025 07:52
Shopify Ajax Search
{% comment %}
This file can be added as a snippet and add it anywhere you want to display
{% endcomment %}
<div id="pageheader">
<div class="util-area">
<div class="search-box">
<form class="search-form" action="/search" method="get" _lpchecked="1">
<i class="icon-mag"></i>
<input type="text" name="q" placeholder="Search" autocomplete="off">
<input type="submit" value="→">
@atikju
atikju / Additional Scripts.liquid
Created April 24, 2021 10:20
Install Facebook Pixel on Shopify Manually
{% comment %}
Paste these codes in the additional scripts box. Settings > Checkout > Additional Scripts
{% endcomment %}
{% if first_time_accessed %}
{% assign ordered_products = '' %}
{% assign ordered_product_ids = '' %}
{% assign totalItems = line_items.size %}
{% for lineItem in line_items %}
@atikju
atikju / StockChanger.liquid
Created November 15, 2018 17:10
Show Stock Quantity in Product Page - Shopify
{% comment %} this code goes at the footer {% endcomment %}
{% if template.name == 'product' %}
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
<style>
.selector-wrapper {
display: none !important;
}
</style>
<script>
@atikju
atikju / ChangeImageBoldOptionSwatch.js
Last active September 9, 2022 09:48
Shopify - change main image on bold product option swatch click
$(document).ready(function(){
var boldFinder = setInterval(function(){
if($('.bold_option_swatch').length > 0){
$('.bold_option_swatch').eq(0).find('.bold_option_value').on('click', function(){
var clutch_selected = $(this).find('input.sw_607037_276033').attr('data-option_value_key');
console.log(clutch_selected);
//returns url("....");
var imgUrl = $(this).find('span.bold_option_value_swatch span').css('background-image');
//replace the url("
//console.log(imgUrl.toString().slice(5));
@atikju
atikju / product.liquid
Created February 1, 2019 02:09
Shopify - Show variant inventory on swatch click
<div id="variant-inventory" class="devst-variant-inventory">
{% if product.variants.first.inventory_management == "shopify" %}
{% if product.variants.first.inventory_quantity > 0 %}
{% if product.variants.first.inventory_quantity > 10 %}
{% assign hideValue = 'none' %}
{% else %}
{% assign hideValue = 'block' %}
{% endif %}
<span id="qtyLogic" style="display:{{ hideValue }}">
Only <span class="devStock">{{ product.variants.first.inventory_quantity }}</span> left!
@atikju
atikju / collectionLink.liquid
Created October 30, 2018 19:33
Shopify - Get first Collection Link of a product