shopify

Needing help trying to Format DateTime

徘徊边缘 提交于 2021-01-29 20:11:48
问题 So for my assignemtn,I am instructed to create unit tests for Shopify integration. One of my assert methods require me to format the date a certain way. My assert method is this and the following trace is as follows. It's really difficult trying to keep up with the documentations. assertEquals((new Date(2020, 7, 23)),order.getCreatedAt()); java.lang.AssertionError: expected:<Mon Aug 23 00:00:00 EDT 3920> but was:<2020-07-23T11:47:45.000-04:00> 回答1: I suggest you switch from the outdated and

Shopify Customer's Order Page keeps redirecting back account page

浪尽此生 提交于 2021-01-29 16:38:41
问题 I am developing a Shopify theme. But when I want to navigate to customer's order pages, but I keep getting redirected back to the account page. Here is the link https://website.myshopify.com/account/orders. My order.liquid is placed under the customers folder in theme template folder. Does anyone knows whats causing this? 回答1: Make sure customers accounts are enabled on your store. 来源: https://stackoverflow.com/questions/62348535/shopify-customers-order-page-keeps-redirecting-back-account

Customize Shopify by integrating with a 3rd party gift card API

与世无争的帅哥 提交于 2021-01-29 07:57:01
问题 We are looking to integrate Shopify with a 3rd party gift card service. We want users to be able to buy a gift card provided by the 3rd party, and then when checking out on Shopify, to be able to use that gift card to pay for the purchase. The 3rd party gift card has APIs we can use. How could we do this with Shopify? 回答1: For this you will need to build an Private Shopify App. Using Shopify API you take the gift card details on the CART PAGE (not checkout unless you are a plus store)... the

Allow shopify cart to checkout only if all cart items have same specific tag

房东的猫 提交于 2021-01-28 19:55:36
问题 Here’s my situation: I have products set up with 2 major collections/tags: day(example: monday-product) and location (example: location-vegas). All day tags have the same "-product" suffix and each location tag has the same "location-" prefix All products can be tagged with one day tag "monday-product" and one location tag “location-vegas”. If a person buys a product with the tags “location-vegas” and another product with the tag “location-la”, the checkout doesn’t work because it doesn’t

Shopify trigger function on variant selection but don't override existing functionality

只愿长相守 提交于 2021-01-28 06:34:55
问题 I am using the 'Loft' theme on Shopify. When I select a variant on the product page, the them updates the SKU and the price to that variant I need more functionality than this, as I would like to show the dimensions of each variant using metafields. I have created a function and called it on variant select like this: jQuery(function($) { new Shopify.OptionSelectors('productSelect', { product: {{ product | json }}, onVariantSelected: selectCallback, enableHistoryState: true }); }); My function

Date comparison Logic / in Liquid Filter

◇◆丶佛笑我妖孽 提交于 2021-01-28 05:10:08
问题 I'm trying to add 30 days to a pre-order date and if today's date is later, display a text string and if not display another text string. Any ideas where I'm going wrong? {% assign assign pre_date = 259200 | plus: order.created_at | date: '%s' %} {% assign today_date = 'now' | date: '%s' %} {% if pre_date > today_date %} disply this {% else %} this {% endif %} 回答1: The date filter returns a string, even when you're using %s to get a number of seconds, so Shopify may be running into situations

Shopify API how to do a search query with like

白昼怎懂夜的黑 提交于 2021-01-27 22:23:06
问题 Hey guys I try to do some searching functions but it is not possible with shopifyAPI gem ShopifyAPI::Product.find(:all, conditions: ["title LIKE ?", "%#search%"], params: {limit: 20, page: 1}) With this function I got all products. ShopifyAPI::Product.find(:all, conditions: ["title LIKE ?", "%#search%"]) The same I got all products ShopifyAPI::Product.search(parameters) I found this function in this example but it is not a function anymore => ecommerce.shopify.com/c/shopify-apis-and

Getting Collection Names Of Products in Shopify

空扰寡人 提交于 2021-01-27 12:01:20
问题 In Shopify how do I fetch names of custom collection that a particular product belongs to ? Like for example to get SKU I can use {{ line_item.sku }} or to get Price I can use {{ line_item.line_price }} 回答1: From the API docs, to list all custom collections for a certain product_id: GET /admin/custom_collections.json?product_id=632910392 Response: HTTP/1.1 200 OK { "custom_collections": [ { "body_html": "<p>The best selling ipod ever</p>", "handle": "ipods", "id": 841564295, "published_at":

Getting Collection Names Of Products in Shopify

折月煮酒 提交于 2021-01-27 11:58:24
问题 In Shopify how do I fetch names of custom collection that a particular product belongs to ? Like for example to get SKU I can use {{ line_item.sku }} or to get Price I can use {{ line_item.line_price }} 回答1: From the API docs, to list all custom collections for a certain product_id: GET /admin/custom_collections.json?product_id=632910392 Response: HTTP/1.1 200 OK { "custom_collections": [ { "body_html": "<p>The best selling ipod ever</p>", "handle": "ipods", "id": 841564295, "published_at":

Quicken google apps script so I can return success response within Shopify 5 second limit

浪尽此生 提交于 2021-01-20 11:21:17
问题 I have this google apps script I wrote that I'm using as a web app as an endpoint for a Shopify webhook. The issue I'm having is that Shopify has a 5 second limit to receive a success response otherwise the webhook will fire again to ensure you don't miss it. The problem is my script takes too long to finish triggering a duplicate webhook which runs my code multiple times which I don't want. Is there a way to respond quicker or clean up my script to finish quicker? PLEASE NOTE: I need my