Title Replies Last Post
Introducing Shopify Scripts: Customize the business logic of your Shopif...

Shopify's Script Editor allows you to create Ruby scripts that can change the prices and properties of line items in your store's cart. Using scripts, you can create discounts that will be applied automatically based on the items and properties of a cart. The Script Editor app adds a place to write and store scripts in your Shopify admin. This forum is for questions and discussion surroundin...

Dec 10 2017 by Jason
Shopify Scripts: Read before posting

This category in the forums is dedicated to the Shopify Script Editor. Please ensure your question relates to the Scripts API or the Script Editor app. Documentation: Shopify Scripts API Shopify Script Editor app App store: Script Editor If you have general API questions unlrelated to Shopify Scripts post in the Shopify APIs & SDKs category. If your question is about storefront ...

Feb 7 2017 by Jason
Add to cart button on collections page without going to cart page.

I am using Venture Theme, which I assume uses ajax already as you can add products to the cart within the product template page without moving to the cart page, and would like the same thing to happen on the collections page. <div class="quick-add"> <form method="post" action="/cart/add" enctype="multipart/form-data" class="product-form" id="AddToCartForm"> ...

Feb 23 2018 by Arthur Korniyenko
Rakuten Image Pixel in Shopify + Additional Scripts Section

Not sure if this portion of Shopify eComm addresses the additionals cripts section but I'm hoping someone can answer me nonetheless. We're trying to implement Rakuten's affiliate network tracking pixel with goes onto the order status page in the checkout. However, the pixel as it exists now won't fire. <!-- Rakuten Image Pixel --!> <noscript><img src="https://track.links...

Feb 23 2018 by Renaud Beaupre
Customer Orders on thank you page

Hello, We need to check customer orders history on thank you page hence added some custom scripts under "Settings -> Checkout -> Additional Scripts" Using "customer.orders" object we get recent 20 orders of customer by default. How can we get list of all previous orders for customer? This is required to separate customers.  We have tried "Paginate" but it throws "Liquid File erro...

Feb 22 2018 by Anil V
Suddenly got production error TimeQuotaExceeded

I have a bulk discount script which runs fine, but the store got two production errors TimeQuoteExceeded at unexpected time and I don't know how. Please help me to scan through the script to determine which line might be a potential issue. The script was published: Nov 28, 2017 The error happened the first time: Dec 21, 2017 The error happened the second time: Feb 14, 2018 I had contact...

Feb 19 2018 by Gin
Repeat loop over products and then split line items

Hi All, Trying to work out how to take ever item in the cart and split them into quantity = 3 and quantity = 2 line items Has anyone accomplished this?  

Feb 17 2018 by CarlowSEO
Disable Line Item adjustment based on Payment Gateway

Hello all, I'm looking to disable a line item adjustment based on the currently selected payment gateway. This adjustment is currently being applied inside of a line item script. The use case I have is that we offer a financing option and discounts are not eligible when that financing option is used. I see that during the payment scripts I can read the entire gateway list, but I'm not ...

Feb 16 2018 by Jurgen Feuchter
Error on Shopify Scripts Coupon code.

Hey guys,  I am working on some scripts to filter out certain payment method if a discount coupon is used. But when I test the script it shows me this errors: Discount code requirements not met (Your cart) Discount code requirements not met (Empty cart) Discount code requirements not met (No customer) Any idea why this is? Its only a free shipping coupon with no exception rules. So ho...

Feb 16 2018 by Jurgen Feuchter
Snippet made for a product page but need textfield info on checkout page...

So we needed to insert code for fields to fill out from the customer. Everything for that is formatted and working properly but i have no clue how to send the info in the different fields to the checkout page nor to the order. I essentially need that info to be printed out into the order printer.  Here is the code that i inserted into the product page (it works great) just need to know how t...

Feb 16 2018 by standoutd
Tagged Products not showing in search for tagged customers

Hi, Apologies if this is the incorrect forum for this but cant seem to fing the answer anywhere else. I want to have only tagged products showing in the search bar results for customers who contain the tag.  The products do not show for customers without the tag, however, they are also not showing for the customers who do have the tag? I have edited the search.liquid with the follow...

Feb 15 2018 by Haydn Griggs
Unit/Integration Tests for Scripts

Whats the general recommendation when developing scripts to add some integration/unit tests to show they work?  There doesnt seem to be any obvious way or solutions out there. I generally use rails/rspec for development so thats an aproach I would like to take. As a potential solution I was thinking about using the shopify_app gem and then maybe add my scripts manually as classes and then ju...

Feb 12 2018 by Johnnybutler7
Possible Bug with Price Rules/Discount Codes and Script Editor

For these discounts: https://ep.d.pr/fm5DMs Welcome15 is a price rule generated by klaviyo with 2 discount codes created via the Bulk Discounts API .  LJARTBJ9 was also generated by klaviyo, but only has one code created.  8OrbB was created manually. In the Script Editor app, when you search for a Discount Code, only the manually created code appears as expected: https://ep.d.pr/...

Feb 9 2018 by Allan
SERIOUS BUG: using change_properties results in a broken cart

If you use change_properties, and add a product more than once to cart, that product's line item starts to behave strangely with cart updates: 1. if you add/remove 1 from the quantity, instead of changing by 1 it will increment/decrement by the original quantity. IE, add a product to cart three times, go to cart, set quantity to 4 & submit, quantity will change to 6 2. If you click re...

Feb 9 2018 by rickydazla
Script Reporting in Order Timeline

I created a shipping script that has a conditional along the lines of if customer and customer.tags.include?("Active Subscriber") When the conditional is passed, the customer gets free shipping. The issue I'm having is no matter if the conditional is passed or not, it still reports that this "Free Shipping" was applied in the Order admin timeline report. It's not offering free shipping ...

Feb 8 2018 by eroedig
Get the date of the last order that has a tag

I need to hide something from customers if their last order, with a certain tag, is not older than 30 days. At the moment I have the content hidden by tag only: {% assign used = false %} {% for order in customer.orders %} {% for tag in order.tags %} {% if tag == "Special Discount" %} {% assign used = true %} {% endif %} {% endfor %} {% endfor %} Any hel...

Feb 6 2018 by rickydazla
VUE.js working with NODE.js & Express API??

I am new to app development. I've been working with code for the last 15 years (html, php, etc)... I am trying to create a basic app for reading and working with Shopify's API. I would like to create my own simple web forms for deleting products quickly and other simple tasks. I discovered VUE.js and love it. I am able to take other non-protected APIs and display properties within the APP...

Jan 31 2018 by Jonathan H
Include messages through Script editor

Hey there, I made a really simple code to let know the costumers how much left they have to get free shipping, it goes just like this. price = Input.cart.subtotal_price price_for_freeshipping = Money.new(cents: 5500) if price < price_for_freeshipping resto = price_for_freeshipping - price message1 = "Te quedan #{resto} para que tu pedido sea gratuito" puts "Faltan #{...

Jan 31 2018 by Michael Johnston
Buy Now Script - Variant Title not shown

Hi, I tried to use the Buy Now generated in Shopify and noticed the Variant Title is now shown. Example I have a product balloon, and have variant type with helium or not (value is yes and no). When I use the Buy Now generated code, the variant title (with helium or not) are not showing. Only the value (yes and no) are showing as a drop down box above the add to cart. Any kind help will be m...

Jan 26 2018 by Ed
Getting product.metafields.spec.leadTime when changing selecting differe...

Hello, I am trying to get my product pages to show different lead time values we have stored for each product variant that also updates when a new variant is chosen. They are stored under {{ product.metafields.spec.leadTime }}. Our theme currrently has the script.js file set to display "In stock" or "Out of stock" based on the inventory and settings. Also from what I read it says that Javascrip...

Jan 25 2018 by Adrian