Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Feb 2005
    Posts
    27
    Plugin Contributions
    0

    Default Coupon Code in URL

    Is there any way to attach the coupon code to a URL instead of having the customer enter the code upon checkout? We use codes to track advertising and it would be a lot easier if we could just embed those codes in the URL, then search orders by discount code.

    Please let me know if anyone knows of a way to accomplish this.

    Thanks!!

    Kevin

  2. #2
    Join Date
    May 2005
    Posts
    18
    Plugin Contributions
    0

    Default Re: Coupon Code in URL

    I just popped in here looking for the same thing! I have a programmer working on something similar. The plan is to use sessions to set the code, then input it into the cart during checkout.

    We will be using landing pages to capture the code, then on submit will send them to the main page.

    I'll let you know when he's got it situated.

    ;-) Amanda

  3. #3
    Join Date
    Feb 2005
    Posts
    27
    Plugin Contributions
    0

    Default Re: Coupon Code in URL

    Hey Amanda,

    That's awesome! I'm excited to hear how you guys approach it. I've been trying to figure out a way to add that feature without making it difficult to upgrade zencart when the time comes.

    It would also be nice to have a function that turns certain GET or POST vars into SESSION vars and then appends them to the order data. We use discount codes more for tracking advertising than actually offering discounts. It would be cool to look at an order and see the tracking/discount code as well as being able to track things like keywords from search engine ads.

    Anyway, definitely let me know if you figure out any good tricks!

    Thanks!

    Kevin

  4. #4
    Join Date
    Feb 2005
    Posts
    27
    Plugin Contributions
    0

    Default Re: Coupon Code in URL

    Hey again! Here is a possible, albeit ugly, solution. First, edit index.php and add something like:

    Code:
    if (!empty($_GET['visitor_code']))
        $_SESSION['visitor_code'] = trim(htmlspecialchars($_GET['visitor_code']));
    Then in includes/modules/order_total/ot_coupon.php

    Edit the line:

    Code:
    'field' => zen_draw_input_field('dc_redeem_code', '', 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'),
    change the second value sent to the function so that it looks like this:

    Code:
    'field' => zen_draw_input_field('dc_redeem_code', $_SESSION['visitor_code'], 'id="disc-'.$this->code.'" onchange="submitFunction(0,0)"'),
    OK, I'm not much of a programmer, but if you go to yoursite.com/index.php?visitor_code=whatever it definitely puts 'whatever' in the discount coupon field during checkout :) Mostly, I just wanted to see if it was possible. The only problem with doing it this way is that it will make it difficult to do ZenCart upgrades. I'll keep working a more elegant solution.

    Kevin

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Code in URL

    The email that customers recieve has the Discount Coupon code on it ...

    When they come to the site via the URL in the email ... it is automatically added when they login ...

    If you want to automate this on completion of signup ... you need to only add 1 line of code to the /includes/modules/create_account.php

    This will remain valid until the user logs out or the session times out ...

    If either should happen, they can then apply the code during checkout ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Feb 2005
    Posts
    27
    Plugin Contributions
    0

    Default Re: Coupon Code in URL

    Hey Linda! Thanks for the reply. I'm not quite sure that I understand though. Let me tell you what my goal is and if you get a minute, let me know if it will be easy to accomplish.

    For example, in our Google ads we would like to use a destination URL like "mysite.com/index.php?tracking_code=google&keyword=whatever"

    Then, when they checkout, I would like to put "google" into the discount code box and then append "whatever" to another piece of data, like order notes, before it goes into the database.

    So, basically, whether the customer is new or returning, I want to autofill the coupon code from the URL so that they don't have to think about what code to place in the box.

    I attempted to send myself a discount code from the admin panel, but the link in the email didn't contain the discount code - I would still have to enter it by hand.

    Let me know if the method that I proposed earlier seems salient, or if it could cause conflicts. Thanks again for your help!!

    Kevin

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Code in URL

    What stops me from going to your site and just manually adding &tracking_code=google to get the discount?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Feb 2005
    Posts
    27
    Plugin Contributions
    0

    Default Re: Coupon Code in URL

    Good point Linda. I guess that what I am trying to do is easily track orders. The discount codes that we would use in the URL would have a 0% discount, so I guess that we could avoid the problem of people mis-using them.

    I know, it probably seems a little unorthodox. The only reason that I want to use this method is that it makes the orders easily trackable by sorting the data by discount code. It wouldn't be 100% accurate, but good enough - plus I don't want to really modify the code or the database.

    Another option that I might consider is just adding my own data to a separate database to track things. That way I can sessionize the tracking code, keyword, etc. and then put those into my own db with some ZC data like order total so that I can have completely custom reporting.

    Thanks again!

    Kevin

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Coupon Code in URL

    It can be accomplished ...

    There are several areas where the code would need customization ... but it can be done ...

    How you regulate preventing fake URLs not that it would help anyone with anything would be up to you ...

    Only when the create_account is processed does it have to be managed and handle updating your customers_referral ...

    Or whatever field you want this to be ...

    Capture the get on the hit from the link ... store to a session ... save prior to the session_destroy ... reset ... add to customers account ... make a report ...

    Or, utilize the customers_referral field and have that hidden from the customer ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Jan 2004
    Location
    Reno, NV
    Posts
    123
    Plugin Contributions
    0

    Re: Coupon Code in URL

    I have a need for capturing the Referral code on account creation as well (unless someone has a better solution).

    We are doing direct sales, and now have an independent consultant making sales. She needs the ability to be able to refer customers to our site so they can easily make purchases.

    I then need to be able to easily track the sales, and the Referral Code seems like the most likely method. I cannot guarantee that someone will enter the proper referal, but I could improve my odds of capturing that data if my consultants emails, urls, etc had the referral code in the url.

    Then after initial creation. all sales attributed to that account will result in a commission for my independant consultant.

    Any ideas, or suggestions...

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Redeeming coupon code from URL?
    By Cindy2010 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 13
    Last Post: 2 Sep 2013, 03:58 AM
  2. how can I code in a default coupon code into checkout page redeem, then auto-refresh?
    By lankeeyankee in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 29 Nov 2008, 04:56 AM
  3. Embedding coupon code in URL?
    By thewolf in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 13 Jun 2008, 09:58 PM
  4. Coupon code URL
    By HardNutrition in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 8 May 2008, 12:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR