Skip navigation
Currently Being Moderated

Programmatically entering Discount Codes

May 30, 2012 7:15 AM

I am using Adobe business catalyst as Admin control for my shopping cart and I want to put a deal in groupon of my products, where in the customer can buy the deal from groupon and use that discount code that he gets while shopping at my site. So my question is I need to create discount codes for each buy made at groupon of my deal. If say 500 users have bought the deal than I have to create 500 unique discount codes. Can this be done programmatically. If so can anyone explain me how? If not what would be the best way to do this apart from manually entering 500 disocunt codes.

 

Thank You

Sandy

 
Replies
  • mario_gudelj
    1,680 posts
    Oct 13, 2010
    Currently Being Moderated
    May 30, 2012 5:03 PM   in reply to SandySandeep

    Hi Sandy,

     

    The only way to create discount codes is by manually entering them into site admin. There's unfortunately no other way to do it at this stage.

     

    Regards,

     

    -mario

     
    |
    Mark as:
  • Liam Dilley
    6,719 posts
    Feb 28, 2012
    Currently Being Moderated
    May 30, 2012 9:16 PM   in reply to mario_gudelj

    Can back this up, tried a variety of scripts but the BC stuff breaks it.

     

    Only thing you can do is do a peace of content that shows if some conditions based on what is in the cart is matched and shows some text that says "You qualify for a discount, enter xxxx to in the discount area to enter it".

     
    |
    Mark as:
  • Currently Being Moderated
    May 31, 2012 1:45 AM   in reply to Liam Dilley

    Have you used iMacros? It is a free FireFox extension - http://wiki.imacros.net/iMacros_for_Firefox

     

    I used it successfully for working with certain areas of the BC console (cases and forums) and the Partner Portal. Not sure it will work for discount codes but it might be worth a shot.

     
    |
    Mark as:
  • Liam Dilley
    6,719 posts
    Feb 28, 2012
    Currently Being Moderated
    May 31, 2012 4:19 AM   in reply to Mihai_Tica

    That is not viable for a working website.

     
    |
    Mark as:
  • Currently Being Moderated
    May 31, 2012 4:29 AM   in reply to Liam Dilley

    Why not? Take a look at this tutorial - http://wiki.imacros.net/Demo-Loop-Csv-2-Web - that bacically loops through a .csv, copies the values there, pastes them into a webform and submits them.

     

    I am thinking something similar could work for mass importing discount codes too. Of course targeting the various elements of the admin console is more trickyer than filling and submitting a form but in theory it should work, what do you say?

     
    |
    Mark as:
  • Currently Being Moderated
    May 31, 2012 6:37 AM   in reply to Mihai_Tica

    Well I think the biggest problem would be that not everyone uses Firefox?

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 10, 2012 3:30 PM   in reply to Liam Dilley

    Hey! Could you write me an example of this? its just what I am looking to do!

     

    -Haley

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 17, 2013 11:05 AM   in reply to Hales2112

    @Hales2112,

     

    Sorry I didn't your message earlier. I had to write a tutorial on how to import Discount Codes for one of my clients who does this all the time, and it has a complete example and explanation of how to automatically read in discount codes from a CSV file and have iMacros fill that into the BC Admin form. Link to my blog: How To Import Discount Codes

     

    SandySandeep's script above is a very good start, but there is now some code missing from that which is essential to get BC to do this more realiably in the current BC version. Namely...

     

    1) BC renders the discount form within an iframe so your script has to deal with that iframe, as my tutorial shows

    2) Unless you put Wait commands in the script to slow down form submission, BC's server won't keep up with the script and will throw errors.  Even with the wait commands, BC still may drop a few discount codes when you are importing 500, and I explain how to deal with that.

     

    How To Import Discount Codes has a complete iMacro script you can copy, and it also shows how to populate the fields so the Discount Code is limited to certain BC catalogues and how to set the effective and expiry dates for the discount.

     

    I have used iMacros for a long time to not only import data into BC Admin that BC normally can't import, but also to populate forms on the public front ends of websites when there is no way in BC to import it.

     

    iMacros is also handy to read data off existing websites and save it into a data file, so you can import it into BC. It's pretty cool considering it is free. I use the FireFox add-on and haven't tried the IE or Chrome version yet, so can't vouch if they work as well.

     

    Jonathan at AtlantaWebDesignGA.com

     
    |
    Mark as:
  • Liam Dilley
    6,719 posts
    Feb 28, 2012
    Currently Being Moderated
    Jan 17, 2013 4:15 PM   in reply to Brad Lawryk

    Or even understands plugins, as well as a few things. Mihai, I think the 4 things wrong with this should be obvious I will be worried if they not

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points