Author Topic: Order Calc Rules  (Read 568 times)

Arjun Singh

  • Beginner
  • *
  • Posts: 3
  • Joomla/VirtueMart Developer
Order Calc Rules
« on: July 25, 2018, 14:44:34 pm »
Hello,

While developing extension for VirtueMart I notice that for some Type of Arithmetic Operation such as 'tax per product' or 'price modifier for profit markup' calc amount is not stored in order_calc_rules table can anyone explain why it is ? so that I can understand the flow properly.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9853
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Order Calc Rules
« Reply #1 on: July 25, 2018, 19:57:14 pm »
It is just written for the vattax. see order model private function _createOrderCalcRules($order_id, $_cart) and there
Code: [Select]
if ($calculation_kind == 'VatTax') {
$orderCalcRules->calc_amount =  $_cart->cartPrices[$key]['taxAmount'];
$orderCalcRules->calc_result =  $_cart->cartData['VatTax'][$rule[7]]['result'];
}

I check now with
Code: [Select]
if ($calculation_kind == 'VatTax') {
$orderCalcRules->calc_amount =  $_cart->cartPrices[$key]['taxAmount'];
$orderCalcRules->calc_result =  $_cart->cartData['VatTax'][$rule[7]]['result'];
} else {
vmdebug('_createOrderCalcRules',$key,$rule,$_cart->cartPrices[$key]['taxAmount'],$_cart->cartData['VatTax'][$rule[7]]['result']);
}

How to implement the other, you may help ;-)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/