Hello,
You can use data-currency of class wmc-currency to distinguish currencies instead of adding a new class.
E.g:
.woo-multi-currency.wmc-price-switcher > .wmc-currency-wrapper > .wmc-sub-currency > .wmc-currency[data-currency="USD"]{
//css for USD here
}
.woo-multi-currency.wmc-price-switcher > .wmc-currency-wrapper > .wmc-sub-currency > .wmc-currency[data-currency="EUR"]{
//css for EUR here
}
Best regards
Thread Starter
spello
(@spello)
Your solution is to style particular currency. What I asked is to be able to style current currency – the one that is already set.
Ahh, sorry for misunderstanding the question.
We’re about to remove the current currency from the wmc-sub-currency because it’s redundant. Do you still need it then?
Anyway, you can use below snippet to add active-currency-{current_currency} to the class of the body:
add_filter( 'body_class', function ( $classes ) {
if ( class_exists( 'WOOMULTI_CURRENCY_F_Data' ) ) {
$wmc = WOOMULTI_CURRENCY_F_Data::get_ins();
$current_currency = $wmc->get_current_currency();
$classes[] = "active-currency-{$current_currency}";
}
return $classes;
} );
Thread Starter
spello
(@spello)
What I meant writing this topic was to be able to have a class like “wmc-current-currency” added next to “wmc-currency” (inside “wmc-sub-currency”) that is actually current. So we could have ability to use .wmc-sub-currency .wmc-currency.wmc-current-currency to style current currency inside dropdown menu.
If you want to remove current currency from dropdown’s menu at all I think you could add a class with display: none; by default, so you’d actually remove that field and leave posibility to use for those who want to.
Moreover, on my website I’ve changed dropdown menu via css and available currencies are listed below main price as a list, without need to click on it to expand. So if I could style current currency to be displayed in different way than any other it would be great.
-
This reply was modified 4 years, 6 months ago by
spello.
-
This reply was modified 4 years, 6 months ago by
spello.
Thank you for your suggestion.
Yes, the current currency will only be hidden from dropdown, not to be removed completely.
Regarding the behavior of the dropdown menu, we will consider the change in the following updates.
Best regards