Base currency rate is not showing in admin order summary : custom added fee
-
19-02-2021 - |
Question
I have followed below link to add a custom fee to order.
Custom fee is added perfectly and showing in admin order summary without any issue.
Now I Have a different store view for China and I have ordered from it, custom fee is adding and showing in admin but its base rate is not showing or added in order totals, is there something which I forgot to add.
Solution
I was adding extra fee using the below method.
$fee = new DataObject(
[
'code' => 'my_code',
'strong' => true,
'value' => 100,
'label' => __('Import Duty')
]
);
$parent->addTotal($fee, 'doyenhub_codcharges');
I need to pass one more parameter base_value
to $fee Dataobject as below
$fee = new DataObject(
[
'code' => 'my_code',
'strong' => true,
'value' => 100,
'base_value' => 10,
'label' => __('Import Duty')
]
);
$parent->addTotal($fee, 'doyenhub_codcharges');
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange