Skip to content

Instantly share code, notes, and snippets.

View CodeBrotha's full-sized avatar

Tineyi CodeBrotha

  • United States
View GitHub Profile
@CodeBrotha
CodeBrotha / check-product-tags.liquid
Created August 12, 2022 00:23
Shopify Liquid - Check if product contains any of a given list of tags
{% assign excludedTags = "some-tag,some-other-tag,another-tag,yet-another-tag" | split :',' %}
{% assign hasExcludedTag = false %}
{% for tag in excludedTags %}
{% if product.tags contains tag %}
{% assign hasExcludedTag = true %}
{% break %}
{% endif %}
{% endfor %}
@CodeBrotha
CodeBrotha / line_item_property_discount.rb
Created November 11, 2021 00:34
Shopify Scripts - Line Item Properties Discount
Input.cart.line_items.each do |item|
# ================================================================
# LINE ITEM PROPERTY DISCOUNT
# ================================================================
# Set the line item property in Shopify theme When adding item to cart
#
# line item property is a key/value pair. Example: {"_someCoolPromo": "1"}
#
# In this example:
# "_someCoolPromo" is the key we look for here and must ALWAYS start with an underscore.
@josephbona
josephbona / main-product.liquid
Last active June 4, 2022 23:40
Dawn Product Gallery
{% comment %}theme-check-disable TemplateLength{% endcomment %}
{{ 'section-main-product.css' | asset_url | stylesheet_tag }}
{{ 'component-accordion.css' | asset_url | stylesheet_tag }}
{{ 'component-badge.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-rte.css' | asset_url | stylesheet_tag }}
{{ 'component-slider.css' | asset_url | stylesheet_tag }}
<link rel="stylesheet" href="{{ 'component-cart-notification.css' | asset_url }}" media="print" onload="this.media='all'">
<link rel="stylesheet" href="{{ 'component-deferred-media.css' | asset_url }}" media="print" onload="this.media='all'">
@CodeBrotha
CodeBrotha / Add SSH key to Keychain (macOS).md
Created May 20, 2021 16:02
Add SSH key to Keychain (macOS)
touch ~/.ssh/config

Open it and modify the file.

Host *
    AddKeysToAgent yes
    UseKeyChain yes
@CodeBrotha
CodeBrotha / Download Assets From Shopify Store Files.md
Last active June 3, 2021 00:03
Download Assets From Shopify Store Files
@CodeBrotha
CodeBrotha / Create Stacks & Bundles on Shopify using Collection
Created September 20, 2020 01:44 — forked from minionmade/Create Stacks & Bundles on Shopify using Collection
Now you can create bundles and product stacks on Shopify using a single collection page to showcase multiple products, allowing multiple products to be added to the cart all at once! Example: https://getapi.com/collections/hustle-hard-stack#
<form action="/cart/add" method="post" enctype="multipart/form-data" id="AddToCartForm">
{% if collection.products_count > 0 %}
{% for product in collection.products %}
{% if product.available %}
<div class="row">
<div class="col-xs-12 col-sm-4">
<img src="{{ product.image | default: product.featured_image | img_url: 'large' }}" alt="{{ variant.title | escape }}" />
</div>
<div class="col-xs-12 col-sm-8" style="padding: 15% 40px 0">
<div class="col-xs-12 col-sm-12">
@CodeBrotha
CodeBrotha / WSL-Ubuntu-oh-my-zsh-setup.md
Last active December 1, 2023 04:28
WSL Ubuntu: oh-my-zsh Setup:

WSL Ubuntu: oh-my-zsh Setup:

Installing Zsh:

sudo apt install zsh

After installing it, type zsh

zsh will ask you to choose some configuration.

@CodeBrotha
CodeBrotha / checkout.liquid
Last active November 19, 2020 19:06
Hide Specific Shipping Rates From Shopify Checkout (Shopify Plus Stores Only)
{% comment %} Hide Secret Shipping Rates From Checkout {% endcomment %}
<script type="text/javascript">
if (Shopify.Checkout.step == 'shipping_method') {
$(window).load(function () {
$(".radio__label__primary").each(function () {
var shipMeth = $(this).data("shipping-method-label-title");
if (shipMeth) {
if (shipMeth.includes("Name Of Secret Shipping Rate Here") || shipMeth.includes("Another Secret Ship Option Rate Here")) {
$(this).closest(".content-box__row").remove();
$(".section__content").each(function () {
@lexthor
lexthor / Download-Shopify-CDN-Assets.md
Last active May 6, 2024 10:58 — forked from ridem/Download-Shopify-CDN-Assets.md
Download all Shopify CDN assets from a store

Instructions

  1. Go to your Shopify admin/settings/files page
  2. Open your browser Dev tools, go to the console
  3. Paste the content of the console_download_list.js file, and press enter
  4. Your browser will automatically fetch each page and download the list with the links of all the files on the CDN.
  5. Using your preffered code editor, edit the HTML file by adding each link in img tag.
  6. Open the HTML file you just edit in a browser then right click-save as. It will download the HTML file again along with all the images in the location you specify.