0

I have followed below link to add a custom fee to order.

How to add fee to order totals in Magento 2

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.

enter image description here

0

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');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.