cancel
Showing results for 
Search instead for 
Did you mean: 

Set custom exchange rate instead of current exchange rate while create order in Magento 2.3.5

Set custom exchange rate instead of current exchange rate while create order in Magento 2.3.5

Hi,

 

We have set euro as base currency and PLN as store currency.We have fetched order from third party marketplace and create order using our custom code.

 

We need to set the PLN exchange rate for order price for the order placed date in marketplace not as current exchange rate in magento 2 admin.

 

we have created order using quote object. Even though we have set custom exchange rate, default order events replaces the current exchange rate and set item price based on current exchange rate.

 

 

$quote = $this->cartRepositoryInterface->get($cart_id);
$quote->setBaseToQuoteRate($custom_rate);
$quote->save();

 

 

Any way to set our custom exchange rate for order price ?

1 REPLY 1

Re: Set custom exchange rate instead of current exchange rate while create order in Magento 2.3.5

Thanks for the information!