This file contains hidden or 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
| customer = Input.cart.customer | |
| puts(customer) | |
| if customer | |
| if customer.tags.include? 'TEST' | |
| Output.payment_gateways = Input.payment_gateways | |
| else | |
| Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway| | |
| payment_gateway.name == 'Pay on pickup' | |
| end | |
| end |
This file contains hidden or 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
| function validateEmail(email) { | |
| const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
| return re.test(String(email).toLowerCase()); | |
| } |
This file contains hidden or 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
| const updates = {} | |
| updates['line'] = cart_line | |
| updates['quantity'] = quantity | |
| updates['properties'] = properties | |
| const response = await fetch("/cart/change.js", { | |
| method: "POST", | |
| headers: { | |
| "Content-Type": "application/json", |
This file contains hidden or 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 type="text/javascript">console.debug("PATH: {{request.path}}")</script> |
This file contains hidden or 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 method="post" action="/cart/add" id="product_form_6149192941727" accept-charset="UTF-8" class="shopify-product-form" enctype="multipart/form-data"><input type="hidden" name="form_type" value="product"><input type="hidden" name="utf8" value="✓"> | |
| <label for="upload">Upload Your Logo</label> | |
| <input id="upload" type="file" name="properties[_upload]" class="product-form__input"> | |
| </form> |
This file contains hidden or 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 type="application/javascript" src="http://ipinfo.io/?format=jsonp&callback=getIP"></script> | |
| <script> | |
| function getIP(data) { | |
| console.log(data.ip); | |
| } | |
| </script> |
This file contains hidden or 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
| async function renderSections(sectionsIDs: Array, targetElement){ | |
| const response = await fetch("/?sections=" + sectionsIDs.toString()) | |
| const sections = await response.json() | |
| targetElement.innerHTML = "" | |
| for(const section in sections){ | |
| targetElement.innerHTML += sections[section] | |
| } | |
| } |
This file contains hidden or 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 onsubmit="validateZipCode(); return false;"> | |
| <input type="text" id="zipcode" placeholder="Enter zipcode here ..." /> | |
| <input type="submit" value="Go" /> | |
| </form> | |
| <script type="text/javascript"> | |
| function validateZipCode(e) { | |
| const zipcode = document.getElementById('zipcode').value; | |
| if (typeof window.Zapiet === 'undefined' || typeof window.ZapietCachedSettings === 'undefined' || |
This file contains hidden or 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
| /* Shadow 0dp */ | |
| box-shadow: none; | |
| /* Shadow 1dp */ | |
| box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20); | |
| /* Shadow 2dp */ | |
| box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20); | |
| /* Shadow 3dp */ |
This file contains hidden or 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
| const fetchProductJSON = async (product_id) => { | |
| const id = parseInt(product_id) | |
| const since_id = id - 1 | |
| try { | |
| const baseURL = | |
| "https://powerkitchen.ca/products.json?since_id=" + since_id; | |
| const res = await fetch(baseURL); | |
| const data = await res.json(); | |
| const product = data.products.filter(p=>p.id == id)[0] | |
| return product; |