0

my site is running in multi-store view using store code in url .
now
1 > product price in GBP = 20
2 > exchange rate for USD = 1.4
3 > for usd store i want to get price including exchange rate
4 > so the price will in usd = 20*1.4 = 28

Note:- But when I get the price programmatically in custom.phtml file for USD store it shows GBP price

so how to get USD price.

  • Have you setup curreny conversation rate from admin? – Dhiren Vasoya Aug 23 '18 at 6:34
  • yes it is working on product page but i want to get it in custom phtml file – Roshan Yadav Aug 23 '18 at 6:46
  • In your custom file, you can get product price by magento way. So you get proper price. – Dhiren Vasoya Aug 23 '18 at 6:55
  • share the code which you try to get product price on custom page. – Dhiren Vasoya Aug 23 '18 at 6:56
  • $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $products = $objectManager->get('Magento\Framework\Registry')->registry('current_product'); $products->getPrice(); – Roshan Yadav Aug 23 '18 at 6:59
0

You need to use code like this.

$OM = \Magento\Framework\App\ObjectManager::getInstance();
$priceHelper = $OM->create('Magento\Framework\Pricing\Helper\Data');
$productprice = $priceHelper->currency($products->getFinalPrice(), true, false);
echo $productprice;
  • If my answer help you, accept it, So it help other in community as well. – Dhiren Vasoya Aug 23 '18 at 11:00

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.