Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Automatic Coupon from session var

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › Automatic Coupon from session var

Tagged: coupon, estore

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 5 months ago by TJ.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 25, 2011 at 12:18 pm #4610
    TJ
    Member

    I’d like to pre-fill coupon codes based on the entry page a customer is using. For example, they use a link to a landing page from an ad that promises 10% discount. When the user gets to the landing page, I write the coupon code into a session variable (easy so far).

    Now, when the same user checks out, I’d like to have the coupon code applied (pre-filled) into the coupon field. How could I best achieve this in eStore?

    October 25, 2011 at 10:42 pm #37906
    admin
    Keymaster

    When the customer goes to your “Checkout page” you can call the following function and pass in the coupon code value from the session var which will apply the discount in the cart.

    eStore_apply_discount($coupon_code)

    So before calling this function your code should check that the current page is the checkout page and that there is a coupon code saved in the session.

    October 26, 2011 at 9:51 am #37907
    TJ
    Member

    Thanks, that works great!

    However, when the customer clicks on the checkout page again, I get the ESTORE_DISCOUNT_LIMIT. Makes sense, since the coupon can only be applied once. How can I check in PHP if a coupon code has been applied or reset the coupon code?

    I just couldn’t find a reference of available eStore functions, great if you can point me to it (similar to your eStore shortcodes).

    October 26, 2011 at 1:46 pm #37908
    TJ
    Member

    I used if ($_SESSION['discount_applied_once'] != 1) before applying the discount code. Seems to resolve the issue.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ