Skip to content

Instantly share code, notes, and snippets.

View aaliyan111's full-sized avatar

Aaliyan Gul aaliyan111

  • Codehouse.pk
  • pakistan
View GitHub Profile
@aaliyan111
aaliyan111 / ajax-contact-form.js
Created October 9, 2023 11:06 — forked from callaginn/ajax-contact-form.js
Shopify Ajax Contact Form
// Before implementing this, you'll need to contact Shopify support and ask them to turn off Google's ReCaptcha
// for your Shopify store's contact forms. Otherwise, it will redirect to the captcha's verification page.
// Retrieves input data from a form and returns it as a JSON object:
function formToJSON(elements) {
return [].reduce.call(elements, function (data, element) {
data[element.name] = element.value;
return data;
}, {});
}
@aaliyan111
aaliyan111 / ajax-contact-form.js
Created October 9, 2023 11:05 — forked from rcobiella/ajax-contact-form.js
Shopify Ajax Contact Form
// Before implementing this, you'll need to contact Shopify support and ask them to turn off Google's ReCaptcha
// for your Shopify store's contact forms. Otherwise, it will redirect to the captcha's verification page.
// I'd recommend replacing it with a custom solution like this: https://captcha.cremadesignstudio.com/
// Retrieves input data from a form and returns it as a JSON object:
function formToJSON(elements) {
return [].reduce.call(elements, function (data, element) {
data[element.name] = element.value;
return data;
}, {});
@aaliyan111
aaliyan111 / checkout.liquid
Created October 9, 2023 10:19 — forked from jhanstra/checkout.liquid
Base Checkout.liquid file for non-Shopify Plus stores
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="{{ locale }}" dir="{{ direction }}" class="{{ checkout_html_classes }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">
<title>{{ shop.name }} - {{ page_title }}</title>
{{ content_for_header }}
@aaliyan111
aaliyan111 / shopify_checkout.js
Created October 9, 2023 10:16 — forked from MarioRicalde/shopify_checkout.js
Shopify Checkout.liquid javascript helper to parse product list.
console.clear()
var product_rows = document.querySelectorAll('.sidebar .product-table .product')
var products_main = []
var products_accs = []
var product_main_strings = ["Regex Title"]
var product_accs_strings = ["Regex Title2", "Regex Title3"]
var matchProducts = function(i) { if ( this.product.name.match(i) ) this.array.push(this.product) }
@aaliyan111
aaliyan111 / Shopify Simple Theme - product-grid-item
Created October 9, 2023 09:52 — forked from mirceapiturca/Shopify Simple Theme - product-grid-item
Shopify Simple Theme - product-grid-item.liquid modified to support alternative images
{% unless grid_item_width %}
{% assign grid_item_width = 'medium-up--one-third small--one-half' %}
{% endunless %}
{% unless current_collection == blank %}
{% assign current_collection = collection %}
{% endunless %}
{% assign on_sale = false %}
{% assign sale_text = 'products.product.sale' | t %}
Shopify objects that contain attributes that can be dynamically put on the page. For example, the product object contains an attribute called title that can be used to output the title of a product.
The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Collections & Products
Collection ►
all_types ►
Returns a list of all the product types for a collection
@aaliyan111
aaliyan111 / responsive-video.html
Created October 1, 2023 11:45 — forked from sumonst21/responsive-video.html
Placeholder image for video with button onclick load iframe. You can switch this around between youtube and vimeo or any other thirdparty video player.
<style>
.btn-video {
font-family: 'Montserrat', sans-serif;
@include button-size(20px, 60px, 16px, 14px, 16px);
@include button-variant(#FFF, rgba(0,0,0,0.5), #FFF);
&:visited, &:hover, &:active {
@include button-variant(#FFF, rgba(0,0,0,0.7), #FFF);
-webkit-box-shadow: 0px 1px 7px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 1px 7px -2px rgba(0,0,0,0.75);
@aaliyan111
aaliyan111 / snippet-notify-me.liquid
Created March 24, 2023 06:37 — forked from msmithstubbs/snippet-notify-me.liquid
Integrating Back In Stock with the notify me snippet
{% form 'contact' %}
{% if form.posted_successfully? %}
<p class="accent-text">Thanks! We will notify you when this product becomes available!</p>
{% else %}
<p>Click <a id="notify-me" href="#">here</a> to be notified by email when {{ product.title }} becomes available.</p>
{% endif %}
{% if form.errors %}
<div class="error feedback accent-text">
<p>Please provide a valid email address.</p>
</div>
window.HYPERVISUAL_CALLBACKS = {
afterProductEmbed: function() {
$(this).find('.hypervisual__embed_product-price, .hypervisual__embed_product-compare-at-price').addClass('money');
if(typeof DoublyGlobalCurrency !== 'undefined') { DoublyGlobalCurrency.convertAll($("[name=doubly-currencies]").val()); }
}
}
@aaliyan111
aaliyan111 / shopify-money.js
Created June 22, 2021 21:44 — forked from stewartknapman/shopify-money.js
The Shopify.formatMoney method extracted from option_selection.js for stand-alone purposes.
var Shopify = Shopify || {};
// ---------------------------------------------------------------------------
// Money format handler
// ---------------------------------------------------------------------------
Shopify.money_format = "${{amount}}";
Shopify.formatMoney = function(cents, format) {
if (typeof cents == 'string') { cents = cents.replace('.',''); }
var value = '';
var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/;
var formatString = (format || this.money_format);