WooCommerce – display product price in the right currency

With the help of another post here I was able to use this code to display my product’s price using a shortcode:

function wc_price_by_id_shortcode( $  atts ) {     $  atts = shortcode_atts( array( 'id' => null, ), $  atts, 'bartag' );      if( intval( $  atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){          $  _product = wc_get_product( $  atts['id'] );          $  price = wc_price( $  _product->get_price() );       }    return $  price;  }  add_shortcode( 'product_price', 'wc_price_by_id_shortcode' );  

This is great but I am using three different currency variations, USD, GBP and EUR. For some reason this shortcode outputs only the EUR. How might I get it to output the price/currency based on the user’s zone as defined in the plugin?

Thanks in advance.

How much currency in cash for trip to Turkey? [on hold]

How much Turkish lira should I take for two of us?

We will have four nights in Istanbul.

We are planning to visit 2-3 museums and will use public transport. We will a book hotel with breakfast and are planning to dine out once per day along with some light snacks. I am also planning to do a short Bosporus cruise tour and we might do some shopping. Just a rough estimate, will 2000 Turkish lira will be enough?

Note: I don’t want to use my master card there as I am not sure that my card will work internationally and even if it worked I will loose a lot on service charges.

How to earn from building your own encrypted currency?

Supposedly I build my own encrypted currency and I make a nice marketing for it and people start buying it. How would this bring me profit?

The only thing I can think of is that I myself buy like 10,000 coins at the first beginning while it’s cheap. Then if it becomes popular and its value increases, 10,000 coins would worth a lot and here comes my profit.

Or currency creators also earn money from each transaction that takes place?

Language and currency switcher js error

Added language and currency switcher to template using this below layout.

<block class="Magento\Framework\View\Element\Template" name="store.settings" group="navigation-sections" template="Magento_Theme::html/container.phtml">                     <arguments>                         <argument name="title" translate="true" xsi:type="string">Settings</argument>                     </arguments>                     <block class="Magento\Store\Block\Switcher" name="store.settings.language" template="Magento_Store::switch/languages.phtml">                         <arguments>                             <argument name="id_modifier" xsi:type="string">nav</argument>                         </arguments>                     </block>                     <block class="Magento\Directory\Block\Currency" name="store.settings.currency" template="Magento_Directory::currency.phtml">                         <arguments>                             <argument name="id_modifier" xsi:type="string">nav</argument>                         </arguments>                     </block>                 </block>             </block> 

But When I click on dropdown there shows this below error

TypeError: event.target.matches is not a function

This is multistore concept.

Preferred format to display negative currency (US English)? [closed]

Which would be the more readable way to format negative numbers:

  • -$ 99.99
  • ($ 99.99)
  • Some other format I haven’t considered

Details: Most of our user base has finance experience, but some have none at all. We don’t deal with international currencies, and it’s a web application so I don’t know of anyway to get the user’s system settings.

Show base currency price & display currency price at the same time in magento2?

I would like to show product price in both base currency & display currency. I have already enable display currency in frontend – that is i can see “USD / EUR” in header dropdown.

If i want to show 2 price, one in base currency, one in display currency at the same time, what should be the correct way?

The main currency in the USD store, the currency displayed in (frontend) EUR, I just need to print the original price.

Basic currency in the store, USD. Frontend currency displayed in EUR, I just need to add to the current price, the original price.

I tried to change final_price.html

/vendor/magento/module-catalog/view/base/templates/product/price/final_price.html 

This part of the code

<?php /* @escapeNotVerified */ echo $  block->renderAmount($  finalPriceModel->getAmount() , [         'price_id' => $  block->getPriceId('product-price-' . $  idSuffix),         'price_type' => 'finalPrice',         'include_container' => true,         'schema' => $  schema     ]);     ?> 

But I get only the displayed price (EUR) or empty space without any errors.

I can get the main price (USD) using this code,

<?php if ($  priceAmount = $  block->getProduct()->getFinalPrice()):?>     <span> / $   <?= /* @escapeNotVerified */ $  priceAmount ?> </span> <?php endif;?> 

But only in atribute.phtml

/vendor/magento/module-catalog/view/frontend/templates/product/view/atribute.html 

Now: https://i.imgur.com/Fv3FIJA.png

I would like to display: https://i.imgur.com/2UgIdXI.png

Magento 2.2.4