100% off shippin coupon interfering with TaxCloud plugin


  • Default avatar
    dylan0    
     11 months ago
    0

    Hello Awodev,
    We're experiencing an issue with Awocoupon that appears to be preventing tax from being calculated at all.

    We're running Hikashop 2.5.0 due to a USPS shipping calculation bug in 2.6.0 that has not yet been resolved.

    We have a pickup coupon in Awocoupon that gives a 100% discount on shipping. (We key detect the coupon code and file these orders into a separate status for in person pickup)

    Our problem is with the TaxCloud plugin used to determine WA State sales tax. For a taxable and shippable item, everything works as expected. Tax is applied to taxable items, and shipping is correctly calculated based on the USPS plugin's results.

    When we apply the 100% shipping coupon, we correctly see the 100% discount applied against shipping. However, the TaxCloud determined tax disappears from the cart completely.
    Additionally, if somebody applies the 100% shipping coupon to an item that is virtual (no shipping method at all), it still drops the tax off entirely.

    As best I can tell, something in how Awocoupon applies its shipping discount is preventing the TaxCloud plugin from firing at all.

    This does not happen with discounts on the item prices, (buy X get Y and fixed percentage discounts still work and tax is still applied), so it appears unique to shipping discounts.

    Since we're dealing with 2 separate 3rd party plugins, getting this resolved is a bit difficult. Hikashop suggested we start here.

    Any ideas?
  • Your avatar
    seyi    
     11 months ago
    0

    Hello,

    Ok, can look into this, but would need a copy of the extension, tax cloud.

    Can you email a copy so I can test it? Email address on the contact us page.
  • Default avatar
    dylan0    
     11 months ago
    0

    Thanks for the response. The plugin is bundled with Hikashop, but I can try to extract it. Will get that emailed to you a bit later today.
  • Your avatar
    seyi    
     11 months ago
    0

    Hello,

    Did not realize it was already part of Hikashop, would not have asked for the extension in that case.

    So took a look and found the problem. Here is the solution, you would need ftp access to modify awocoupon:

    in www/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php, around line 964 is this:

    <?php
            $this
    ->order_total =& $cart_total;
            
    $this->cart_products $cart_products;
    ?>


    Right after that add this:
    <?php
            $cart 
    = new stdClass();
            
    $cart->products = &$this->cart_products;
            
    $cart->cart_id = (int)@$cartclass->cart->cart_id;
            
    $cart->cart_type = @$cartclass->cart->cart_type;
            
    $cart->cart_params = @$cartclass->cart->cart_params;
            
    $cart->coupon null;
            
    $cart->shipping null;
            
    $cart->total = &$this->order_total;
            
    $cart->additional = array();
            
            
    JPluginHelper::importPlugin('hikashop');
            
    JPluginHelper::importPlugin('hikashoppayment');
            
    JPluginHelper::importPlugin('hikashopshipping');
            
    $dispatcher JDispatcher::getInstance();
            
    $dispatcher->trigger('onAfterCartProductsLoad', array( &$cart ) );
    ?>


    That should fix it.
  • Default avatar
    dylan0    
     11 months ago
    0

    That did the trick! Thank you very much for the quick help!