Skip to content

Instantly share code, notes, and snippets.

View svaustin66's full-sized avatar

Scott Austin svaustin66

View GitHub Profile
@svaustin66
svaustin66 / klaviyo-code.txt
Last active May 2, 2024 22:36
Code to Add to Klaviyo emails for Recent Judge.me Reviews
<div>
<h3 style="text-align: center; font-style: normal; margin-bottom: 32px;"><strong>Customer Reviews</strong></h3>
{% for testimonial in feeds.JudgemeReviewTestimonialsFeed.testimonials %}
{% if testimonial.rating == 5 %}
<div style="margin-bottom: 32px;">
<div style="text-align: center; font-style: normal; font-weight: normal; margin-bottom: 8px;">{{ testimonial.content|truncatewords:140 }}</div>
<div style="text-align: center; color: #FFBA00; margin-bottom: 8px;">★★★★★</div>
<div style="text-align: center; font-style: normal; font-weight: normal; margin-bottom: 4px;"><strong>{{ testimonial.author_name }}</strong></div>
<div style="text-align: center;"><a style="font-weight: normal; text-decoration: underline;" href="{{ testimonial.product_url }}" target="_blank" rel="noopener"> {{ testimonial.product_name }} </a></div>
</div>
<!-- Tracking Klaviyo Sign-ups in GA4 -->
<script>
window.addEventListener("klaviyoForms", function(e) {
if (e.detail.type == 'open' || e.detail.type == 'embedOpen') {
gtag('event', 'klaviyo_form_open', {'form': 'Klaviyo form', 'form_id': e.detail.formId});
}
if (e.detail.type == 'submit') {
gtag('event', 'klaviyo_form_submit', {'form': 'Klaviyo form', 'form_id': e.detail.formId});
}
if (e.detail.type == 'stepSubmit') {
@svaustin66
svaustin66 / cart__free-gift-promo.liquid
Created July 4, 2023 00:17
cart__free-gift-promo.liquid
{% comment %}
Custom section added by JadePuma
Instructions - https://jadepuma.com/blogs/shopify-tutorials/free-gift-with-purchase-cart-promo
Last editted - 3Jul23
{% endcomment %}
<div style="opacity: 0;">-</div>
{% if section.settings.enable_free_gift_promo %}
@svaustin66
svaustin66 / index__featured-articles.liquid
Created August 14, 2022 23:17
index__featured-articles.liquid
@svaustin66
svaustin66 / page.article-photos.json
Created July 30, 2022 22:12
Page template for reviewing article images
{
"sections": {
"main": {
"type": "page-content__main",
"disabled": true,
"settings": {
"show_heading": true,
"heading_alignment": "left",
"width": "standard",
"padding_top": 40,
@svaustin66
svaustin66 / page__article-photos.liquid
Created July 30, 2022 22:10
Section for the Flex Theme to review Article Images
{%- assign id = section.id -%}
{% comment %} Section specific CSS {% endcomment %}
{%- capture section_css -%}
.photos { display: flex; flex-direction: row; padding: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.photo { display: flex; flex-direction: column; margin: 10px; }
.photo div { color: {{ section.settings.text-color }}; }
{%- endcapture -%}
@svaustin66
svaustin66 / cart__main.liquid
Created July 20, 2022 19:16
Example of placement of the snippet in the cart files.
<div class="cart__subtotal-container cart__row">
<div class="cart__row-description">
<p class="h3">{{ 'cart.general.subtotal' | t }}:</p>
</div>
<p class="h3 cart__subtotal">
<span class="money">
{%
render 'price-element',
price: cart.total_price
%}
@svaustin66
svaustin66 / cart-automatic-discounts.liquid
Created July 20, 2022 19:07
Flex theme snippet to display savings in cart from Automatic Discounts & Gifts app
{% comment %} * * * Automatic Discounts & Gifts App * * * {% endcomment %}
<div data-tbnadhide='NO_DISCOUNT'>
<div class="cart__subtotal-container cart__row">
<div class="cart__row-description">
<p class="h3">Savings:</p>
</div>
<p class="h3 money cart__subtotal savings">
-<span class="h3 money savings" data-tbnadfield='CART_DISCOUNT' data-tbnaddefault=''></span>
@svaustin66
svaustin66 / jadepuma.css.liquid
Created July 15, 2022 20:20
Show / Hide elements between desktop and mobile
.show-mobile { display: none; }
.show-desktop { display: block; }
@media screen and (max-width: 798px) {
.show-mobile { display: block; }
.show-desktop { display: none; }
}
@svaustin66
svaustin66 / page.product-photos.json
Created May 23, 2022 00:28
Code for Product Photo Review Template
{
"sections": {
"main": {
"type": "page-content__main",
"disabled": true,
"settings": {
"show_heading": true,
"heading_alignment": "left",
"width": "standard",
"padding_top": 40,