shopify

Shopify counts per tags

只谈情不闲聊 提交于 2019-12-02 08:22:06
I am new to shopfiy.I have addded tags like Black, Blue, Green etc. Now i want to show count like Black(12) Blue(1) Green(4) Does anybody help me out Thanks Steph Sharp My answer to a similar question might help you with this: Shopify Tags total items To get a count of all the products with a given tag you need to loop over the products and manually count them. For example: {% assign collection = collections.all %} {% for tag in collection.all_tags %} {% assign products_count = 0 %} {% for product in collection.products %} {% if product.tags contains tag %} {% assign products_count = products

Shopify.onItemAdded update #cart and cart.item.count

吃可爱长大的小学妹 提交于 2019-12-02 08:16:32
I'm trying to make a ajaxed shopping cart in Shopify. I have made the product page add an item to cart without refreshing or going to the cart page. To see cart, you can click on an input or link with .cart-show, so I added this to the 'add to cart' input: <input style="margin-top: 40px; width: 50%;" type="submit" value="Add to cart" class="button cart-show" onclick=" Shopify.addItemFromForm('add-item-form'); return false" /> What that does, is simply add the item to cart and display the cart div #menu. Of course cart doesn't get updated when a new item is added, and the question is: how can I

How to add multiple product to cart by on click in shopify

给你一囗甜甜゛ 提交于 2019-12-02 08:10:21
I want to add multiple products to cart in a single click in Shopify. to apply the algorithm of frequently bought together products. Please help if anyone know about the Shopify API or related to above. Please guide with your knowledge. There is plenty of documentation online for that. https://help.shopify.com/en/themes/development/getting-started/using-ajax-api 来源: https://stackoverflow.com/questions/51245063/how-to-add-multiple-product-to-cart-by-on-click-in-shopify

Error Creating Shopify Webhook through the API

寵の児 提交于 2019-12-02 06:41:18
I am trying to create a Webhook through the API. When the Customer installs the app (Controller): def init_webhooks topics = ["products/create", "products/update", "products/delete"] topics.each do |topic| webhook = ShopifyAPI::Webhook.create(format: "json", topic: topic, address: "http://#{@current_host}/webhooks/#{topic}") raise "Webhook invalid: (#{topic}) #{webhook.errors}" unless webhook.valid? end end Here is the error from the log: RuntimeError (Webhook invalid: (products/create) #<ActiveResource::Errors:0x00000003bd7358>): EDIT: I have even tried just creating one webhook without the

Shopify Liquid: If Statement

对着背影说爱祢 提交于 2019-12-02 05:06:50
问题 I am trying to enable a div class based on when a user views certain web page eg: blog, index or ../page/webpage The code is like this: {% unless template contains "index" and settings.slideshow_enabled %} <div class="container main content"> {% endunless %} That "container main content" shows an image behind the nav bar. On other pages, the image starts from below the nav bar. A clear example here: http://retina-theme.myshopify.com/ I want to have that same homepage, link the link above, on

Pulling <s:variant> from atom feed with simple pie

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:39:41
问题 How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here. 回答1: You can read the

Tag count automatically changing while clicking on the product tag

核能气质少年 提交于 2019-12-02 04:21:32
I am using Shopify. I am in collection page where I am getting all the filter with tag count something like, All Products Apple(4) Banana(2) Orange(1) Mango(8) Now when I click on any of the tag(For example I clicked on Banana) then It will display the banana products. Now my issue is by clicking on the tag it's changing the tag count. All Products Apple(0) Banana(2) Orange(0) Mango(4) I am using below code {% for tag in collection.all_tags %} {% assign products_count = 0 %} {% for product in collection.products %} {% if product.tags contains tag %} {% assign products_count = products_count |

Uploading new products with multiple variant options

▼魔方 西西 提交于 2019-12-02 02:14:05
问题 I am trying to upload products via ruby (not with rails). I have uploaded 100 + products via API, although I cannot upload a product with more than one option value. Even if I assign three option values, it will not populate the other two. Here is the script: require 'shopify_api' require 'open-uri' require 'json' begin_time = Time.now shop_url = "*https*(yes I know the * are their)://-YouWish-:-I'dShareNakedPics-@dev-tactical.myshopify.com/admin/products.json" include ShopifyAPI ShopifyAPI:

Shopify Liquid: If Statement

自作多情 提交于 2019-12-02 00:35:49
I am trying to enable a div class based on when a user views certain web page eg: blog, index or ../page/webpage The code is like this: {% unless template contains "index" and settings.slideshow_enabled %} <div class="container main content"> {% endunless %} That "container main content" shows an image behind the nav bar. On other pages, the image starts from below the nav bar. A clear example here: http://retina-theme.myshopify.com/ I want to have that same homepage, link the link above, on selected pages or template: {% if template == "index" and template == "page" and settings.slideshow

Pulling <s:variant> from atom feed with simple pie

谁说胖子不能爱 提交于 2019-12-01 23:21:56
How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here . You can read the xml namespace for s from the <feed> tag. <feed xmlns:s="http://jadedpixel.com/-/spec/shopify" xml:lang="en