News:

Looking for documentation? Take a look on our wiki

Main Menu

Order Calc Rules

Started by Arjun Singh, July 25, 2018, 14:44:34 PM

Previous topic - Next topic

Arjun Singh

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

It is just written for the vattax. see order model private function _createOrderCalcRules($order_id, $_cart) and there

if ($calculation_kind == 'VatTax') {
$orderCalcRules->calc_amount =  $_cart->cartPrices[$key]['taxAmount'];
$orderCalcRules->calc_result =  $_cart->cartData['VatTax'][$rule[7]]['result'];
}


I check now with

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 ;-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/