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 React, { useState } from "react"; | |
import { json } from "@remix-run/node"; | |
import { useLoaderData } from "@remix-run/react"; | |
import { | |
Box, | |
Card, | |
Layout, | |
Link, | |
List, | |
Page, |
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 -%} | |
If the product first varaiant inventory is 0 then find the variant with inventory and load the product page | |
{%- endcomment -%} | |
{%- assign current_variant = product.selected_or_first_available_variant -%} | |
{%- assign availableVariantId = '' -%} | |
{%- assign availableVariantFound = false -%} | |
{%- if current_variant.inventory_quantity <= 0 -%} | |
{%- for variant in product.variants -%} |
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 lang="{{ shop.locale }}"> | |
{% if template contains "wholesale" %} | |
<!-- wholesale Content --> | |
{% unless customer %} | |
{% assign send_to_login = true %} | |
{% endunless %} | |
{% endif %} | |
{% if send_to_login and request.path != "/challenge" %} |
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 gql from 'graphql-tag'; | |
import { useQuery, useMutation } from '@apollo/react-hooks'; | |
import { Button, Card, Layout, Page, ResourceList, Stack } from '@shopify/polaris'; | |
const CREATE_SCRIPT_TAG = gql` | |
mutation scriptTagCreate($input: ScriptTagInput!) { | |
scriptTagCreate(input: $input) { | |
scriptTag { | |
id |
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
{% include 'product-template', | |
description_style: section.settings.description_style, | |
image_container_width: section.settings.image_size, | |
section_id: product.id, | |
social: section.settings.social_enable, | |
thumbnail_position: section.settings.thumbnail_position, | |
thumbnail_arrows: section.settings.thumbnail_arrows | |
%} | |
{% if settings.enable_product_reviews and settings.reviews_layout == 'full' %} |
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
# add this script in product liquid (Just before addtocart form) | |
<!-- Code added for Inventory in Pipeline --> | |
<script> | |
var inv_qty = {}; | |
{% for var in product.variants %} | |
inv_qty[{{- var.id -}}] = {{ var.inventory_quantity | default: 0 }}; | |
{% endfor %} | |
</script> | |
{% if current_variant.inventory_management == "shopify" %} |
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
#=======Save a dict to json file============= | |
import json | |
dict = {'Python' : '.py', 'C++' : '.cpp', 'Java' : '.java'} | |
json = json.dumps(dict) | |
f = open("dict.json","w") | |
f.write(json) | |
f.close() |
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
====Add this block in theme.liquid before closing head </head> ===== | |
{% comment %} ## AGE VERIFICATION -- if user is tagged 'is18', don't load age verification JS. If they aren't, or aren't logged in, load it. {% endcomment %} | |
{% if customer.tags contains 'is18' %} | |
{% else %} | |
{{ 'age-verification.js' | asset_url | script_tag }} | |
{% endif %} | |
======================================= |
NewerOlder