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
Google Adwords Conversion Tracking

Hello, I'm on Venture theme. I created a "Buy" Google Adwords Conversion. I got a code to setup on all pages. I installed it between <head> in theme.liquid. I also have a code to setup on the page "Order Confirmation": <!-- Event snippet for Achat conversion page --> <script> gtag('event', 'conversion', { 'send_to': 'xxxxxxxxxxxxxxxxxxxxxxx', ...

Apr 24 2018 by Happydog
Image load issue

For the better SEO, I have replaced Shopify CDN url by proxy url. Now the format of the url is www.domain.com/app/cdn/s/files/1/1394/5993/products/ergonomic-ratchet-chair.jpg . But the page speed of proxy url is comparatively slower than CDN url. Please see screen shot. https://prnt.sc/j98pj4 Is there any way out to make the speed of proxy url as CDN url ?

Apr 24 2018 by Jason
Shopify Scripts amount off total.

I've been trying to find a Shopify script that simply removes a set amount from `Input.cart.subtotal_price`. Every one I've come across seems to remove the set amount from each line item, which doesn't really make a whole lot of sense. For example - https://gist.github.com/dylanjhunt/a0e4352d9f69174b46ef2962574cd7f6 Is this even possible? The only "change" item I see on the API page is .chan...

Apr 19 2018 by Patrick Hughes
Reorder Minimums

hello, I am trying to add in a script for a reorder minimum for our customers. We have a minimum order for first time customers that is $250, and we want a reorder minimum for returning customers to be $100. How can I do this?

Apr 19 2018 by Elliot
Buy one get one within collection

Hi there, I've found several BOGO scripts on the forum but have been unable to find one that will provide this functionality: buy one product in a collection, get 1 free product within that collection.  I found this script on github and it does seem to work - discounts items with a "bogo" tag, however i need to modify it to discount only once. Any ideas?   class TagSelector def ...

Apr 17 2018 by Nikolas Alexander
How to insert discount code into URL so discount is auto-applied to all ...

I want to inject a discount code into a URL. Beyond just filling in on the checkout page, I want the discounted prices to be shown while the user browses the site. How do I code something like this?

Apr 16 2018 by Elliot
Inventory Display

Hi Folks, I've spent much of the day setting up a new shopify site - my first experience with shopify.  Most of it has been pretty straightfoward, but I've found myself somewhat stumped when it comes to showing inventory on the product pages.  Browsing the docs, I've added the following; {% comment %} Inventory tracking on product page {% endcomment %} <div id="variant-i...

Apr 12 2018 by Lee
Calculate percentage of total cart

I'm trying to convert a discount with a total amount into the corresponding percentage of the whole cart. Afterwards i want to apply this percentage to each item of the cart - so the total discount on the cart will be the same as the initial discount (total amount). a = Money.new(cents: 100) puts (a.cents / 2) # works # => 50 puts (50 / a.cents) # doesn't work: [Error] non float valu...

Apr 5 2018 by Elliot
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...

Mar 8 2018 by Jurgen Feuchter
Error - There is an error with the discount: Id can't be found

I'm trying to create tiered discount here. In the script I reject the discount code if the discount from the script is applicable. To test the script from the app, I input a discount code which is already available in the store. Running the script throws me this error  "here is an error with the discount: Id can't be found" Is this a problem with Shopify?

Mar 8 2018 by K&J Web Productions
Discount code requirements not met error

I'm working on a script that applies free shipping on specific shipping methods if the code "FREESHIP" is used. When I try to write this script I get an error that says:   Discount code requirements not met (Your cart) Discount code requirements not met (Empty cart) Discount code requirements not met (No customer) The code I'm using: Input.shipping_rates.each do |shipping_ra...

Mar 8 2018 by K&J Web Productions
How to add a third-party array to cart

Hi, I need to add an array to my cart.liquid, but am not sure where to put it. I know it needs to be a <form>, but if I add it above or below the default <form> it does not work. It is basically an app that configures a product, then adds it to the cart. Their instructions say to add it as a form to the /cart page. Here is what the code looks like that I am supposed to add:...

Mar 8 2018 by Sue Wilkerson
Can we Access collection or liquid object on script editor (line items)

Actually i am using the script for "BUY X QUANTITY OF A PRODUCT, GET $Y OFF for multiple products" and want to get the all products of collection in this script. In the below code i am using the static array of product id with variable products_needed. We would like to get these product id from particular collections. Script Code: DISCOUNTS_BY_QUANTITY = {   3 => 10, }  products_n...

Mar 8 2018 by Jason
Specific discount code for free specific shipping method

I searched high and low for documentation on this and couldn't find anything. I'm posting what I came up with on here for anyone that may find this useful.  Define the specific code in the 1st line, then define the name of the shipping method in the 6th line. The code needs to be setup in Shopify as a percentage discount code, set to 0% off the entire order.  discountCode = 'FreeSeco...

Mar 7 2018 by Nikolas Alexander
When discount code is used get free shipping

Is it possible to grant free shipping when a certain discount code has been used?

Mar 7 2018 by Nikolas Alexander
Script errors not consistent

I have two Shopify stores. I've created a script to apply a 25% discount if the customer is tagged with "employee". The script works on one of the stores, but generates an error on the other. part of my script: customer = Input.cart.customer CAMPAIGNS = [ if customer.tags.include? "employee" ItemCampaign.new( AndSelector.new( ExcludeGiftCardSelector.new, ...

Mar 6 2018 by George
Handle paginatable object

Hi, I'm not sure about the pagination in liquid. If I want to create an object which is paginatable, which requirements need to be fulfilled? In principle I like to loop the search results and filter these. For furher processing I need to assign the filtered results but this new object is always not paginatable. Simply creating an array does not seem to do the job. {% capture results...

Mar 5 2018 by QnavWhat
Change Selector Wrapper Label

Hello, I am trying to find where i would change the label of the selctor wrapper from 'Color" to something else. I am not at all fluent in HTML or the liquid editor. I've been searching around for hours now just to change a label and have gottren nowhere. Any help would be greatly appreciated as i am willing to learn. Thanks Brad

Mar 5 2018 by rickydazla