This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react"; | |
import { | |
useCartLineTarget, | |
Text, | |
reactExtension, | |
useApplyCartLinesChange, | |
} from "@shopify/ui-extensions-react/checkout"; | |
// Entry point | |
export default reactExtension("purchase.checkout.cart-line-item.render-after", () => <App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
let productObject = { | |
id: itemInCart.key, // important to use key of type string | |
quantity: 1, | |
properties: { | |
'PropertyName': getCookie(PropertyName) | |
} | |
}; | |
return fetch('{{ routes.cart_change_url }}.js', { | |
method: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- comment -%} Block.repeater is a key feature here {%- endcomment -%} | |
{{ block.repeater.metaobject_metafield_key.value }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Calculate the sequence number of the holidays here: https://miniwebtool.com/day-of-the-year-calculator/ | |
// function to check leap year | |
function checkLeapYear(year) { | |
const isLeap = new Date(year, 1, 29).getDate() === 29; | |
return isLeap; | |
} | |
const currentYear = new Date().getFullYear(); | |
if (checkLeapYear(currentYear)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- 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 -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Variant ID and quantity separated by semicolon + optional discount code as URL parameter -> redirect to checkout --> | |
https://shop-url.com/cart/42417843929345:1?discount=DISCOUNT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://westernrise.com/discount/GIFT22?redirect=%2Fcollections%2Fbottoms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
-webkit-text-size-adjust: 100%; | |
text-rendering: geometricPrecision; | |
-webkit-font-smoothing: antialiased; | |
-webkit-font-smoothing: subpixel-antialiased; | |
-moz-font-smoothing: antialiased; | |
font-smoothing: antialiased; | |
} |
NewerOlder