Full service web hosting, great prices and support. Starts at $1.99/month!
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: GV - Coupon repair & setup thread

  1. #1
    ganast
    Guest


    Default GV - Coupon repair & setup thread

    OK, this is in reference to bugtrack bug 122:

    http://bugtrack.oscmax.com/view.php?id=122

    The gv/coupon module has some limitations, and some very specific installation guidelines. If these are not followed strictly the module will appear to give errors in calculation.

    Of course, there are also some actual bugs... so... we can discuss both here.

    The mother thread for this module is here (hint: start at the last page and read backwards...):

    http://forums.oscommerce.com/index.php?showtopic=158518

    --gabe

    PS: one opening question I have is: what version of the module is installed in osCMax 2rc2 + patches? Anyone know? I see notes about 5.13 in the code, but there is a 5.13a, b, c, and d, and a 5.15 or some such on the osC contribs page...

  2. #2
    sirsonic
    Guest


    Default

    Hey ganast, I have been attempting to fix this for some time. For me there is a disconnect on where the tax is actually recalculated. It should basically recalculate PRODUCT - DISCOUNT * TAXRATE. We have free shipping on everything, so shipping is not included. I have searched the forums, and I am pretty sure the following setup is correct.

    **************************

    Display Total - true
    Sort Order - 15
    Include Shipping - false
    Include Tax - false
    Re-calculate Tax - Standard
    Tax Class --none--

    **************************

    Discount Coupons - 15
    Gift Vouchers - 10
    Low Order Fee
    Customer Loyalty Discount
    Shipping - 5
    Sub-Total - 1
    Tax - 25
    Total - 800

    **************************

    Currently:

    Sub-Total: CAD $201.00
    Shipping: CAD $0.00
    Discount Coupons:VISA2006A: -CAD $20.10
    PST 7% + GST 7%: CAD $28.14
    Total: CAD $209.04

    **************************

    Should be:

    Sub-Total: CAD $201.00
    Shipping: CAD $0.00
    Discount Coupons:VISA2006A: -CAD $20.10
    PST 7% + GST 7%: CAD $25.33
    Total: CAD $206.23

    **************************

    I really do appreciate any insight you may have. Thanks!

    Shawn

  3. #3
    ganast
    Guest


    Default

    First try keeping the GV module after the Coupon module. This contrib is pretty "sticky" in parts, and I believe the GV module must be the last module with the exception of "Total," and in some cases "Tax."

    In other words, put GV at 20 and see if things get better...

    --gabe

  4. #4
    sirsonic
    Guest


    Default

    Modules Sort Order Action
    Discount Coupons 15
    Gift Vouchers 20
    Low Order Fee
    Customer Loyalty Discount
    Shipping 5
    Sub-Total 1
    Tax 25
    Total 800

    Same result...

    Sub-Total: CAD $105.00
    Shipping: CAD $0.00
    Discount Coupons:VISA2006A: -CAD $10.50
    PST 7% + GST 7%: CAD $14.70
    Total: CAD $109.20

    I setup the GV the same and changed the sort order to no avail. Maybe I can echo a variable in the coupon ot file?

  5. #5
    ganast
    Guest


    Default

    Do you have "re-calculate" in the Coupon module set to "standard?"

    [edit] Oh, I guess you say that you do... so, this is odd. Is this 2.0rc2?

    --gabe

  6. #6
    sirsonic
    Guest


    Default

    Yes, I am using RC2. I have loaded up a fresh install of it and I have the same result. Were you not able to replicate it?

  7. #7
    sirsonic
    Guest


    Default

    I have a small budget for fixing this problem. If anyone is interested, I'll pay a small $$$ fee for a solution to this issue. Let me know ASAP if you are intested.

  8. #8
    sirsonic
    Guest


    Default

    Special thanks to "Bandwidth" on getafreelancer. He suggested adding some code to ot_coupon.php:

    function process() {
    global $PHP_SELF, $order, $currencies;
    $order_total=$this->get_order_total();
    $od_amount = $this->calculate_credit($order_total);
    $tod_amount = 0.0; //Fred

    $this->deduction = $od_amount;
    if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!
    $tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);
    }
    if ($od_amount > 0) {
    $order->info['total'] = $order->info['total'] - $od_amount;
    $this->output[] = array('title' => $this->title . ':' . $this->coupon_code .':','text' => '<b>-' . $currencies->format($od_amount) . '</b>', 'value' => $od_amount); //Fred added hyphen

    //New code for tax recalculation fix
    if ($tod_amount == 0 || $tod_amount == '') {
    $pct = $order->info['tax'] / $order->info['subtotal'];
    $order->info['tax'] = $order->info['tax'] - ($pct * $od_amount);
    foreach ($order->info['tax_groups'] as $key => $value) {
    $value = $value - ($pct * $od_amount);
    $order->info['tax_groups'][$key] = $value;
    $order->info['total'] -= ($pct * $od_amount);
    }
    }
    //end new code

    }
    }

  9. #9
    osCMax Developer


    GV - Coupon repair & setup thread

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,014
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    594


    Default

    I think the problem is that you changed the sort order for the OT modules. It has to remain in the pre-set order unless you really know what you are doing.

    This is the order they must be in:

    1.Subtotal
    2. Shipping
    3. Tax
    4. Customer Loyalty discount
    5. Low Order Fee
    6. Discount Coupons
    7. Gift Vouchers
    8. Total
    Michael Sasek

    osCmax 2.5.4 is now available via auto-installation using Softaculous!

    Stay Up To Date with everything osCMax:
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  10. #10
    Member
    Join Date
    Jun 2005
    Location
    St Albans, UK
    Posts
    31
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    rjavery     $ 0.00
    Rep Power
    0


    Default

    I am sorry but I am still having issues here, I think I have tried all of the permutations above but still cannot get both the Order Total, Tax and Discount Amounts to Display properly.

    I am only interested in the Discount Coupon at this stage, not gift vouchers.

    My Configuration is :

    Order Total Module Order :
    Sub Total (1)
    Shipping (4)
    Tax (10)
    Discount Coupons (730)
    Gift Vouchers (740)
    Total (800)

    Discount Coupon Setup:
    Include Shipping : False
    Include Tax : True
    Re-Calculate Tax : Standard

    I have applied the new code for tax recalculation as provided by bandwidth but it does not seem to make a difference.

    I have goods at £19.95 including UK VAT and shipping at £4.95 including UK VAT.
    Total VAT on a non-Discounted Order is £3.71

    Applying a 10% discount coupon to the above should get me:
    Sub-Total £19.95
    Shipping £4.95
    Tax £3.41
    Discount £2.00
    Total £22.90

    Instead the system shows me :
    Sub-Total £19.95
    Shipping £4.95
    VAT £3.71
    Discount £2.00
    Total £22.53

    It appears to be taking 10% of the total pre-discount inc-shipping VAT off the price even after having calculated the discount off the Inc VAT cost of goods.

    If I set Include Tax : True then I get the right total (£22.91) but the numbers don't make any sense. Tax is still the pre-discouont inc-shipping amount and the discount displayed is off the ex-vat price of goods even though the SUb-Total is inc-vat.
    Sub-Total £19.95
    Shipping £4.95
    VAT £3.71
    Discount £1.62
    Total £22.91

    Now allowing for rounding the total is OK.
    VAT amount is wrong and this might legally be an issue in the UK.
    The discount does not reflect the true final discount the customer received

    Have I done something obvious wrong?
    Do I need to flush any code cache to ensure that the modified version gets loaded (I have use cache set to false in configuration : cache)?

    Any help much appreciated!

Page 1 of 2 12 LastLast

Similar Threads

  1. creating Coupon
    By jschafer52 in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 11-04-2006, 08:23 PM
  2. Gift Voucher & Coupon
    By auntie22 in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 03-12-2006, 06:55 PM
  3. Coupon Problems
    By kvnband in forum osCMax v2 Features Discussion
    Replies: 5
    Last Post: 01-03-2006, 01:02 PM
  4. Coupon Issues & More
    By auntie22 in forum osCmax v1.7 Discussion
    Replies: 3
    Last Post: 10-02-2005, 03:30 PM
  5. request: change Welcome Discount Coupon Code -> Coupon ID
    By kodersoftware in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 11-13-2004, 01:34 PM

Bookmarks

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
  •