PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

wrong currency symbol when retrieving product price

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi there,

I have you plugin installed on my site, it has 4 currency options the the default one is"INS".

for some reason when I pull the order details and product price using the relevant function :

$_product->get_price();
I always get the"NIS" currency simple while my woorommerce order is in EURO

 

also when inside my order scope i try to use this to check the correct currency of the order:

$WOOCS->current_currency;

 

i always get"NIS" even my order was in EURO

 

How can I retrieve the order currency and make sure the data i pull is in the right currency?

 

Thank you!

Hello

Paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png

$_product->get_price(); -  It has nothing to do with the order(WC_Order).

To  get  order currency -  get_post_meta($order_id, '_order_currency', true);

The reason i was trying to use the $_product->get_price(); is because the current plugin template always retunes the same currency symbol regardless to the actual order currency.

 

In the print template (woocommerce-delivery-notes\templates\print-order\print-content.php) all functions sauce as:

<span><?php echo wp_kses_post( wcdn_get_formatted_item_price( $order, $item ) ); ?> </span>

OR

<span><?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?></span>

return NIS currency symbol when in woocommerce orders screen I see Euro or USD as the order currency .

I do see the relevant converted price yet the currency symbol is wrong.

 

 

first get the currency of the order

get_post_meta($order_id, '_order_currency', true);

and  set  this currency:

https://currency-switcher.com/function/woocs-set_currency/

then create  object of the  order

Thank you Pablo,

that was very helpful and help me fix the issue :)

Welcome;)