F
F
fominvladyslav2021-03-11 14:32:10
WordPress
fominvladyslav, 2021-03-11 14:32:10

How to add extra currencies in Woocommerce?

All the best!
There is a code:

add_filter('woocommerce_currency', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency ) {
global $post, $product;

if ( has_term( 'cars', 'product_cat' ) ) {

return 'EUR';
}else{
return $currency;
}
}


It displays an additional currency for the "cars" category, the symbol changes in the product card, but does not change in the cart and checkout, please tell me how to add it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Nesterov, 2021-03-11
@cooder

In the cart and order, woo will work with the main currency.
It's not entirely clear - do you just want to change the symbol or are you using a second currency for cars?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question