Tax displayed incorrectly but final total calculated/displayed properly


  • Default avatar
    esses    
     3 years ago
    0

    Hello,

    I can't figure out if I'm doing something wrong (since i'm sure other's would see it if not)... or if this is a bug.

    It appears when I use the AWO coupon handling, the tax is calculated correctly, but displayed as a large negative amount (the difference between displaying "x" and "1-x") It almost makes it look like the customer should be receiving a bigger discount.

    This problem doesn't appear when using a code handled through Hikashop's coupon handling or if not using a coupon. Only when using a coupon code that's handled by AWO.

    Any ideas what i messed up?

      When using AWO coupon management

    Total $20.00
    Coupon $-20.00
    Shipping $7.18
    Taxes $-18.34
    Final total $8.84

      When not using any coupons

    Total $20.00
    Shipping $7.18
    Taxes $1.66
    Final total $28.84
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    What version of Hikashop is this? And what version of AwoCoupon?

    Also do you have calculate discount before tax set to yes or no? Is this a percent or amount coupon? Any detail that can help get to the cause would be good.
  • Default avatar
    esses    
     3 years ago
    0

    Joomla v 2.5.14
    Hikashop Essential v 2.2.0
    AwoCoupon Pro v 2.2.0 Pro

    Calculate the discount before tax (Gift Certificates) = No
    Calculate the discount before tax (Coupons) = No

    Coupons are all applied as fixed amount ($20).
    Testing as 100% coupons the problem still exists.

    The coupons are restricted to 1 product.
    Discount Type = "Specific"
    Minimum Value = "Specific" 20.000 (Although problem also exists with this blank)

    Exclude Products on Special = Checked
    Exclude Gift Certificate Products = Checked

    Also, I did modify the coupon.php file as another post directed to enable multiple coupon handling with my template. I haven't gone back to see if could have messed something up there (didn't look like i could though)

    I think that's about everything I can think of... but i'd be happy to provide anything else.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    I cannot reproduce it. Can you send me a private message with temporary admin access to your site? I would like to copy use your hikashop configuration screen values.
  • Default avatar
    esses    
     3 years ago
    0

    sent!
  • Your avatar
    seyi    
     3 years ago
    0

    Ok, i think i found a solution. You will need to modify code, so probably ftp access is requires.

    in www/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php, around line 224 is this:
    <?php
            
    if(!empty($price_with_tax) || $this->coupon_discount_before_tax$object->total->prices[0]->price_value -= $object->discount_value_without_tax;
    ?>


    Change it to this:
    <?php
            
    if(version_compare($this->hikashop_version,'2.2.0','>=')) {
                if(
    $this->coupon_discount_before_tax) {
                    
    //if(empty($price_with_tax)) 
                    
    $object->total->prices[0]->price_value -= $object->discount_value_without_tax;
                    
    //else $object->total->prices[0]->price_value -= $object->discount_value;
                
    }
                else {
                    if(!empty(
    $price_with_tax)) $object->total->prices[0]->price_value -= $object->discount_value;
                    else 
    $object->total->prices[0]->price_value -= $object->discount_value_without_tax;
                }
            }
            else {
                if(!empty(
    $price_with_tax) || $this->coupon_discount_before_tax)
                    
    $object->total->prices[0]->price_value -= $object->discount_value_without_tax;
            }
    ?>


    I think that will fix the problem.
  • Default avatar
    esses    
     3 years ago
    0

    Hi there,

    I think i made the changes correctly, but it does not seem to have corrected the behavior. The changes are live right now. If you'd like to test it out, here's some test coupons...

    TEST_BLK
    TEST_BGE
    TEST_ORN
    TEST_RED
    TEST_BLU

    for the black, beige, orange, red, and blue necklaces respectively.

    would it help if i sent you the actual php file? If so, what email address would you like me to send it to?

  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    You can send the file to the email address on the contact us page, or send temporary ftp access to have a look at it directly.
  • Default avatar
    esses    
     3 years ago
    0

    whoops... sent via pm
  • Default avatar
    esses    
     3 years ago
    0

    Any luck figuring out what's wrong? Did I misconfigure something?
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    It is fixed. You added the code correctly, but there was one small part of the code I forgot to give you which is now added and it works.
  • Default avatar
    esses    
     3 years ago
    0

    Thank you seyi!

    Is this something that I need to worry about regressions during future updates?

    Also are all the changes limited to the one file? Just do I know what occurred and how it got fixed.

  • Your avatar
    seyi    
     3 years ago
    0

    This will be fixed on the next update of AwoCoupon, so nothing to worry about moving forward.

    And yes, all the changes were in that one file, couponhandler.php.