public
Created — forked from maliny/Groupon2Shopify.iim

The Goal: I needed a way for us to quickly import the hundreds of Groupon codes into our Shopify site. My Solution: Use iMacros for FireFox to read in the Groupon CSV and automate the process of creating Shopify discount codes.

  • Download Gist
Groupon2Shopify.iim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
VERSION BUILD=7000908
'Use groupon csv to automatically create discount codes in shopify.
'####################### ENTER YOUR SETTINGS BELOW #############################
 
'What is your shopify store name yourshopname.myshopify.com
SET !VAR1 https://thespicygourmet.myshopify.com
 
'How much is your discount? for a $15 discount enter 15
SET !VAR2 20
 
'When does your discount expire? yyyy-mm-dd
SET !VAR3 2011-02-28
 
'####################### !!DON'T NEED TO EDIT BELOW THIS LINE!! ################
 
TAB T=1
TAB CLOSEALLOTHERS
 
'Specify where the groupon csv file is and what it's called
SET !DATASOURCE groupon-coupons.csv
 
'Number of columns in the CSV file.(Coupon No.,Customer Name,Status,Redeemed At)
SET !DATASOURCE_COLUMNS 4
 
'Start at line 2 to skip the header in the file
SET !LOOP 2
 
'Increase the current position in the file with each loop
SET !DATASOURCE_LINE {{!LOOP}}
 
'Go to shopify marketing admin page
URL GOTO={{!VAR1}}/admin/marketing
 
'click on add a discount code link
TAG POS=1 TYPE=A ATTR=ID:add-discount-code-link
 
'set the discount code
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:{{!VAR1}}/admin/discounts ATTR=ID:discount_code CONTENT={{!COL1}}
 
'set the discount amount
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:{{!VAR1}}/admin/discounts ATTR=ID:discount_value CONTENT={{!VAR2}}
 
'set the discount experation date (don't use the calendar popup just set the hidden fireld directly)
TAG POS=1 TYPE=INPUT:HIDDEN FORM=ACTION:{{!VAR1}}/admin/discounts ATTR=ID:discount_ends_at CONTENT={{!VAR3}}
 
'set the discount use limit
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:{{!VAR1}}/admin/discounts ATTR=ID:discount_usage_limit CONTENT=1
 
'create shopify discount code!
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:new-code-form ATTR=NAME:commit&&VALUE:Create<SP>discount
 
'wait 3 seconds, to give things time to process before moving to the next one
WAIT SECONDS=3

line 50 was having an issue... Capital "D" in discount needed to be lowercase

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.