Ayeom Posted June 17, 2013 Share Posted June 17, 2013 Hello all. I have a fair amount of products I have imported with combinations, the combinations data I imported looks like this: 33,Ramps;Select,No Ramps,0 33,Wireless Remote;Select,No Remote,0 The intent is to create a combination for this product with selections for optional ramps/no ramps and/or wireless remote/no wireless remote. After the CSV import I get this in the combinations section of the Product back office: Ramps - No Ramps $0.00 0.000000lb Wireless Remote - No Remote $0.00 0.000000lb Wireless Remote - W/ Wireless Remote $95.00 0.000000lb Ramps - 7000Lb Ramps $225.00 0.000000lb This looks good in the front, but it does not work. the selection buttons do not change the price, not adding the 95.00 or the 225.00 when either or both options are selected. I have found that running the "Combinations Generator" fixes the selection buttons problem mentioned above, and thats great. TLDR: My question is, can I somehow batch all of my products with combinations to run through the "combinations generator"? I only need the default settings selected. I have about 3k products with combinations and clicking through just seems like a nightmare. Any help appreciated! Link to comment Share on other sites More sharing options...
Ayeom Posted June 18, 2013 Author Share Posted June 18, 2013 Hi all, I just wanted to share the "Solution" I came up with for this problem. I have created a text file from a db query which contains the link directly to a products "combination generator" page, specifically, the text file contains a link to every one of the 3k+ products I have which have combinations. I then created an applescript to loop through all of the links in that text file one by one, open/activate safari, tab three times to get into the form fields, and then send the return key. I will post this applescript below. Link to comment Share on other sites More sharing options...
Ayeom Posted June 18, 2013 Author Share Posted June 18, 2013 tell application "Finder" set Names to paragraphs of (read (choose file with prompt "Pick text file containing track names")) repeat with nextLine in Names if length of nextLine is greater than 0 then tell application "Safari" activate end tell tell application "Safari" to set the URL of the front document to nextLine tell application "System Events" tell application process "Safari" delay 35 -- need to allow enough time for the web page to load; adjust as necessary tell application "Safari" activate end tell keystroke tab keystroke tab keystroke tab keystroke tab keystroke tab keystroke tab keystroke tab keystroke tab keystroke return delay 80 -- need to allow enough time for the web page to load; adjust as necessary end tell end tell end if end repeat end tell 2 Link to comment Share on other sites More sharing options...
Recommended Posts