Skip to content

Instantly share code, notes, and snippets.

View ihorduchenko's full-sized avatar
💭
Working

Ihor Duchenko ihorduchenko

💭
Working
View GitHub Profile
@ihorduchenko
ihorduchenko / cart-line-items-properties-attributes.liquid
Created April 16, 2024 20:55
How to add line item properties and cart attributes in Shopify product form markup
{%- form 'product', product, id: form_id, class: 'product-single-form' -%}
<!-- Line item property -->
<input type="hidden" name="properties[Field]" value="Field value">
<!-- Cart attribute -->
<input type="hidden" name="attributes[Vendor]" value="Livom">
{%- endform -%}
@ihorduchenko
ihorduchenko / Amount of flex-items per row
Last active April 13, 2024 14:06
How to adjust the amount of flex-items per row
@mixin max-width($width) {
@media screen and (max-width: $width) {
@content;
}
}
.container {
position: relative;
display: flex;
flex-flow: row wrap;
@ihorduchenko
ihorduchenko / Shopify Script Discounting
Created January 21, 2024 16:09 — forked from jimmijazz/Shopify Script Discounting
Shopify Script Discounting example
# ================================ Customizable Settings ================================
# ================================================================
# Tiered Discounts by Quantity
#
# A list of discount tier offers where:
# - 'product_selector_match_type' determines whether we look for
# products that do or don't match the entered selectors. Can
# be:
# - ':include' to check if the product does match
# - ':exclude' to make sure the product doesn't match
@ihorduchenko
ihorduchenko / bulk-volume-pricing.rb
Created January 20, 2024 19:14
Shopify Scripts: Bulk volume pricing
# ================================ Customizable Settings ================================
# ================================================================
# Tiered Product Discount by Quantity
#
# If the total quantity of matching items is greater than (or
# equal to) an entered threshold, the associated discount is
# applied to each matching item.
#
# - 'product_selector_match_type' determines whether we look for
# products that do or don't match the entered selectors. Can
@ihorduchenko
ihorduchenko / add-to-cart-link.liquid
Created January 5, 2024 13:23
Shopify: link for automatically adding product to cart
@ihorduchenko
ihorduchenko / auto-applied-discount-url-example.txt
Created December 18, 2023 23:45
Shopify: example of a shareable link to apply the discount code in cart with redirection to the target page
https://westernrise.com/discount/GIFT22?redirect=%2Fcollections%2Fbottoms
@ihorduchenko
ihorduchenko / swiper.js
Last active December 11, 2023 17:54
Get instance of Swiper from DOM
// This example shows us how to update broken swiper after Fancybox carousel closing
if (typeof fancyboxInit !== undefined) {
// Main approach here is the next row
$.fancybox.defaults.backFocus = false;
let showCaseSlider = $('.showCaseSlider .swiper-container');
$('[data-fancybox]').fancybox({
afterClose: function() {
if (showCaseSlider) {
let showCaseSliderInstance = showCaseSlider[0].swiper;
showCaseSliderInstance.update();
@ihorduchenko
ihorduchenko / recommended-font-settings.css
Created October 11, 2023 06:52
Recommended setting for correct fonts displaying
@ihorduchenko
ihorduchenko / square-circle-substracts.html
Created October 5, 2023 10:08
A square cut by a sector of a circle (outer and inner parts)
<!-- Outer part or a circle -->
<svg width="100" height="100" viewBox="0 0 215 215" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M214.5 214.5H0V0C0 118.465 96.0349 214.5 214.5 214.5Z" fill="black"/>
</svg>
<!-- Inner part of a circle (sector) -->
<svg height="100" width="100" viewBox="0 0 512 512" fill="#000" xmlns="http://www.w3.org/2000/svg">
<path d="M0,0v512h512C512,229.2,282.8,0,0,0z"/>
</svg>
@ihorduchenko
ihorduchenko / template-redirect-ablyft.js
Created August 18, 2023 19:49
Set URL parameter for template redirect on ABLyft
var url = new URL(window.location.href);
url.searchParams.set('view', 'upsell-bundle');
ablyftTools.redirect(url.toString());