Nouveau release

  • Posts: 78
  • Thank you received: 5
11 years 8 months ago #94894

Bonjour

Le prochain release de Hikashop aura un fix pour les taxes du Quebec ( pour les réductions et coupons)

Awocoupon aussi au prochain Release aura ce fix pour l'instant si vous utiliser Awocoupon vous pouvez le faire manuellement avec ce code

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



if(!empty($object->total->prices[0]->taxes)) {
$object->total->prices[0]->taxes_without_discount = array();
foreach($object->total->prices[0]->taxes as $namekey => $tax){ $object->total->prices[0]->taxes_without_discount[$namekey] = clone($tax); }

$coupon_tax_amount = $coupon_session+$coupon_session;
if(!empty($coupon_tax_amount)) {
$tax = reset($object->total->prices[0]->taxes);
$object->total->prices[0]->taxes[$tax->tax_namekey]->tax_amount -= $coupon_tax_amount;

$object->taxes[0]->tax_namekey = $tax->tax_namekey;
$object->taxes[0]->tax_amount = $coupon_tax_amount;
}
}



Please change it to this:



if(!empty($object->total->prices[0]->taxes)) {
$object->total->prices[0]->taxes_without_discount = array();
$coupon_tax_amount = $coupon_session+$coupon_session;
$total_tax_before_discount = 0;
foreach($object->total->prices[0]->taxes as $namekey => $tax){ $total_tax_before_discount += $tax->tax_amount; }

foreach($object->total->prices[0]->taxes as $namekey => $tax){
$object->total->prices[0]->taxes_without_discount[$namekey] = clone($tax);

$current_tax = $object->total->prices[0]->taxes[$namekey]->tax_amount;
$object->total->prices[0]->taxes[$namekey]->tax_amount = empty($total_tax_before_discount) ? 0 : round( $current_tax - ($coupon_tax_amount/$total_tax_before_discount*$current_tax),2);
}

if(!empty($coupon_tax_amount)) {
$tax = reset($object->total->prices[0]->taxes);
//$object->total->prices[0]->taxes[$tax->tax_namekey]->tax_amount -= $coupon_tax_amount;

$object->taxes[0]->tax_namekey = $tax->tax_namekey;
$object->taxes[0]->tax_amount = $coupon_tax_amount;
}
}

en espérant que cela peut vous aider

Merci

Last edit: 11 years 8 months ago by doyen.
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum