Skip to content

Instantly share code, notes, and snippets.

View 404ryannotfound's full-sized avatar

404ryannotfound 404ryannotfound

View GitHub Profile
@404ryannotfound
404ryannotfound / main-account.liquid - Display PDF ICon
Created March 15, 2024 01:24
Shopify - Display a pdf icon on the orders of the main account page
{%- assign show_pdf_icon = false -%}
{%- for line_item in order.line_items -%}
{%- if line_item.product.type == "Pass" or line_item.product.type == "Firewood" or line_item.product.type == "Permit" -%}
{%- assign show_pdf_icon = true -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- if show_pdf_icon -%}
<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512">
@404ryannotfound
404ryannotfound / Shopify - main-order.liquid pass access
Created March 15, 2024 02:21
Shopify - Display a link to a pass or permit if it's still valid, allow customer to update pass details. (URL removed for security)
<!-- Start Passes -->
{% comment %}
Start Park Pass link generation - Check if the pass is within 1 year, wasn't cancelled, and if is a pass.
{% endcomment %}
{% if line_item.product.type == "Pass" and order.cancelled_at == blank %}
{% assign seconds_in_day = 86400 %}
{% assign seconds_in_weekend = 172800 %}
{% assign seconds_in_5days = 432000 %}