Results 1 to 10 of 10

changes with gift voucher

This is a discussion on changes with gift voucher within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; hola! i have gift voucher discount of 10$. i want to remove it, and give an overall 10% discount on ...

      
  1. #1
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default changes with gift voucher

    hola!
    i have gift voucher discount of 10$.
    i want to remove it, and give an overall 10% discount on the whole shop. (or if easier, change the gv to 10%)
    help appreciated,
    thanks.

  2. #2
    Active Member
    Join Date
    May 2004
    Location
    somewhere above colchester uk
    Posts
    147
    Rep Power
    0


    Default

    altenter,

    Please, like the rest of us have had to, search through the forum before you post, many of the answers are there.

    The answer to yours is here http://oscdox.com/index.php?name=PNp...t=gift+voucher
    Google says be nice!

  3. #3
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default

    i have searched endlessly, but apparently not enough
    thanks battleaxe for the link, but it is not clear in that post (or maybe its me overlooking everything) but to change the $ into % in includes/add_ccgvdc_application_top.php doesnt seem to work. i still get the 10$ voucher emailed after registering....

  4. #4
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    23


    Default

    In add_ccgvdc_application_top.php:
    // The settings below determine whether a new customer receives an incentive when they first signup
    //
    // Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10');
    //
    A POSTIVE number is a DOLLAR OFF
    ZERO - IS NO signup bouns
    A NEGATIVE -is a % off

    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10');
    $10 off next purchase.
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '0');
    Nothing is generated/sent
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '-10');
    -10% (10% off) next purchase.


    Good Luck!

  5. #5
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default

    jpf, thanks for clarifying, but still, as soon as a put a "-" like:
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '-10');
    i recieve no gift voucher upon registering

    other settings seem correct:

    define('FILENAME_GV_FAQ', 'gv_faq.php');
    define('FILENAME_GV_REDEEM', 'gv_redeem.php');
    define('FILENAME_GV_REDEEM_PROCESS', 'gv_redeem_process.php');
    define('FILENAME_GV_SEND', 'gv_send.php');
    define('FILENAME_GV_SEND_PROCESS', 'gv_send_process.php');
    define('FILENAME_PRODUCT_LISTING_COL', 'product_listing_col.php');
    define('FILENAME_POPUP_COUPON_HELP', 'popup_coupon_help.php');

    define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
    define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
    define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
    define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
    define('TABLE_COUPONS', 'coupons');
    define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');


    // Set the length of the redeem code, the longer the more secure
    define('SECURITY_CODE_LENGTH', '10');
    //
    // The settings below determine whether a new customer receives an incentive when they first signup
    //
    // Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '-10');
    //
    // Set the coupon ID that will be sent by email to a new signup, if no id is set then no email
    define('NEW_SIGNUP_DISCOUNT_COUPON', '3');

  6. #6
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    23


    Default

    EDIT : create_account.php on about line 247
    // ICW - CREDIT CLASS CODE BLOCK ADDED ************************************************** ***** BEGIN
    if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
    $coupon_code = create_coupon_code();

    $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;


    CHANGE TO:

    // ICW - CREDIT CLASS CODE BLOCK ADDED ************************************************** ***** BEGIN
    if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT <> 0) {
    $coupon_code = create_coupon_code();


    I think..... Good Luck
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  7. #7
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default

    thanks jpf for your time,

    ok, now the gv is sent, but with a -10$ as amount, and doesnt count it in the total.

    im almost there, i can smell it

  8. #8
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default

    jpf? anyone?

  9. #9
    Anonymous
    Guest


    Default

    not a lot of help but -10 works for me, as does 10 and as does 0

    what version are you running? want to paste the whole file?

  10. #10
    Active Member
    Join Date
    Mar 2004
    Posts
    139
    Rep Power
    16


    Default

    running ms2max1.55

    here's my add_ccgvdc_application_top.php:
    <?php
    define('FILENAME_GV_FAQ', 'gv_faq.php');
    define('FILENAME_GV_REDEEM', 'gv_redeem.php');
    define('FILENAME_GV_REDEEM_PROCESS', 'gv_redeem_process.php');
    define('FILENAME_GV_SEND', 'gv_send.php');
    define('FILENAME_GV_SEND_PROCESS', 'gv_send_process.php');
    define('FILENAME_PRODUCT_LISTING_COL', 'product_listing_col.php');
    define('FILENAME_POPUP_COUPON_HELP', 'popup_coupon_help.php');

    define('TABLE_COUPON_GV_CUSTOMER', 'coupon_gv_customer');
    define('TABLE_COUPON_GV_QUEUE', 'coupon_gv_queue');
    define('TABLE_COUPON_REDEEM_TRACK', 'coupon_redeem_track');
    define('TABLE_COUPON_EMAIL_TRACK', 'coupon_email_track');
    define('TABLE_COUPONS', 'coupons');
    define('TABLE_COUPONS_DESCRIPTION', 'coupons_description');

    // Below are some defines which affect the way the discount coupon/gift voucher system work
    // Be careful when editing them.
    //
    // Set the length of the redeem code, the longer the more secure
    define('SECURITY_CODE_LENGTH', '10');
    //
    // The settings below determine whether a new customer receives an incentive when they first signup
    //
    // Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none
    define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '-10');
    //
    // Set the coupon ID that will be sent by email to a new signup, if no id is set then no email
    define('NEW_SIGNUP_DISCOUNT_COUPON', '3');


    ////
    // Create a Coupon Code. length may be between 1 and 16 Characters
    // $salt needs some thought.

    function create_coupon_code($salt="secret", $length = SECURITY_CODE_LENGTH) {
    $ccid = md5(uniqid("","salt"));
    $ccid .= md5(uniqid("","salt"));
    $ccid .= md5(uniqid("","salt"));
    $ccid .= md5(uniqid("","salt"));
    srand((double)microtime()*1000000); // seed the random number generator
    $random_start = @rand(0, (128-$length));
    $good_result = 0;
    while ($good_result == 0) {
    $id1=substr($ccid, $random_start,$length);
    $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");
    if (tep_db_num_rows($query) == 0) $good_result = 1;
    }
    return $id1;
    }
    ////
    // Update the Customers GV account
    function tep_gv_account_update($customer_id, $gv_id) {
    $customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
    $coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
    $coupon_gv = tep_db_fetch_array($coupon_gv_query);
    if (tep_db_num_rows($customer_gv_query) > 0) {
    $customer_gv = tep_db_fetch_array($customer_gv_query);
    $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];
    $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "'");
    } else {
    $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "')");
    }
    }
    ////
    // Get tax rate from tax description
    function tep_get_tax_rate_from_desc($tax_desc) {
    $tax_query = tep_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_description = '" . $tax_desc . "'");
    $tax = tep_db_fetch_array($tax_query);
    return $tax['tax_rate'];
    }
    ?>

Similar Threads

  1. Gift Voucher Questions
    By alexbranding in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 04-11-2005, 11:18 AM
  2. Gift Voucher checkout
    By harpon in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 07-30-2004, 11:00 AM
  3. Creating a Gift Voucher
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 06-14-2004, 05:55 AM
  4. Updated Gift Voucher mod?
    By DaisyO75 in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 02-17-2004, 05:44 AM
  5. Gift Voucher texts
    By Lynoure in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 11-21-2003, 07:43 AM

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
  •