Problem with AwoCoupon Pro


  • Default avatar
    stilpunkt    
     12 years ago
    0

    Hi Seyi,

    I just bought your great AwoCoupon Pro

    Now I have found a problem while testing the new coupon component.

    I created a coupon (5%) for products.
    As you can see in screenshot 2 the coupon amount is 10.46 € instead of 12.45 €
    The total amount of 236.55 € is correct but the tax should be 37.77 € and not 38.09 € as shown.

    http://www.stilpunkt.net/rcn/awo1.jpg

    http://www.stilpunkt.net/rcn/awo2.jpg

    Thanks in advance for your help.

    Greetings Kai
  • Your avatar
    seyi    
     12 years ago
    0

    Hi Kai,

    It looks like you have coupon before tax setup.

    The product price without tax is 249/1.19 = 209.24
    5% of that = 10.46

    Tax should be (209.24-10.46)*.19 = 37.77 (as you mentioned)

    The total should be 209.24-10.46+37.77 = 236.55 (this shows correctly)

    So the only problem I see here is the tax. I have no idea where that number is coming from.

    If you proceed all the way to the confirm screen, is it the same? What version of Virtuemart are you using?
  • Default avatar
    stilpunkt    
     12 years ago
    0

    Hi Seyi,

    please see attached screenshots.

    The button "discount for payment methods before tax and shipping costs" is clicked.

    I updated today to VM 1.1.9 but tested before also in VM 1.1.8

    I'm very confused in the moment because a lot of numbers are not as they should.

    I created a 5 % coupon. For payment method "Vorkasse" we grant 5 % discount.

    In my opinion the price of the product (249,-) should become 249 - 24.90 = 224.10 (10 % off)
    and the tax should be 35.78

    http://www.stilpunkt.net/rcn/tax1.jpg
    http://www.stilpunkt.net/rcn/coupon1.jpg
    http://www.stilpunkt.net/rcn/coupon2.jpg
    http://www.stilpunkt.net/rcn/coupon3.jpg
    http://www.stilpunkt.net/rcn/coupon4.jpg
    http://www.stilpunkt.net/rcn/coupon5.jpg

    Thanks.

    Greetings Kai
  • Your avatar
    seyi    
     12 years ago
    0

    In AwoCoupon configuration screen, is 'Calculate the discount before tax' set to yes?

    I see you have 2 discounts, what is the other discount? And can you test it without it just so we know exactly what the number are with a coupon.
  • Default avatar
    stilpunkt    
     12 years ago
    0

    Hi Seyi,

    sorry, my mistake, 'Calculate the discount before tax' was set.

    Now it isn't set and as you can see on the screenshots, the tax is right but the total amount should be 236.55 and not 234.18
    The coupon discount is 5 %

    http://www.stilpunkt.net/rcn/test1.jpg
    http://www.stilpunkt.net/rcn/test2.jpg
    http://www.stilpunkt.net/rcn/test3.jpg

    Going ahead to checkout step 4 the total amount is corrected automatically to 236.55 and the tax is still 37.77

    In this test order there is no payment discount used.

    Thanks in advance.

    Greetings Kai
  • Your avatar
    seyi    
     12 years ago
    0

    Ok, glad to see we are looking better. After playing around with some numbers, this is what I came up with

    236.55-234.18=2.37 (the problem difference)

    Now if you take the coupon discounts so far and subtract them

    12.45-10.46 = 1.99

    If you apply tax to 1.99
    1.99*1.19 = 2.368 or 2.37

    So in the initial cart, something is not being calculated correctly. This is the php file that needs to be looked at:
    www/administrator/components/com_virtuemart/html/basket.php

  • Default avatar
    stilpunkt    
     12 years ago
    0

    Hi Seyi,

    any ideas what the problem could bei caused by?


    I tested again with VM 1.1.9

    Product in shopping cart:
    http://www.stilpunkt.net/rcn/1.jpg

    Test coupon with 5% discount:
    http://www.stilpunkt.net/rcn/2.jpg
    The discount 12.45 is ok but the total of 234.18 is wrong. The tax is ok.

    I used your modifications to show the discount (5%) for payment with tax (12.35) but it's wrong.
    http://www.stilpunkt.net/rcn/3.jpg

    In the last step of checkout everything seems to be ok:
    http://www.stilpunkt.net/rcn/4.jpg

    When order is done the total is wrong again (234.56):
    http://www.stilpunkt.net/rcn/5.jpg


    Your help is very appreciated.

    Thanks.

    Greetings Kai
  • Your avatar
    seyi    
     12 years ago
    0

    discount before tax is still a problem with vm 119. Take a look at the blog, from scanning the code and comparing it to the blog, at least this solution is not implemented yet:
    https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax#solution2
  • Default avatar
    stilpunkt    
     12 years ago
    0

    Seyi,

    thanks for your reply.

    What do you mean with "In www/administrator/components/com_virtuemart/classes/ps_checkout.php on or around line 1313, replace the equation with this:" ?
    Could you please define exactly what I should replace?

    Thanks.

    Greetings Kai
  • Your avatar
    seyi    
     12 years ago
    0

    Here it is:
    https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax#problem3

    The line numbers are probably different. This was written for virtuemart 1.1.4.