public
Last active

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://fortunecookiesoap.myshopify.com
 
'How much is your discount? for a $15 discount enter 15
SET !VAR2 15
 
'When does your discount expire? yyyy-mm-dd
SET !VAR3 2011-04-05
 
'####################### !!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=TXT:add<SP>a<SP>discount<SP>code
 
'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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.