Below is the text of the page https://currency-switcher.com/use-woocs-api/ stored 2021-04-21 by archive.org.ua. The original page over time could change. View as original html

How to use WOOCS API - WOOCS - WooCommerce Currency Switcher

[/] Home FAQ Codex Video Downloads DEMO Support More LABS Pre-sale questions Compatibility Translations Changelog Sitemap Currency Switcher for WordPress Get More Tools WOOCS - WooCommerce Currency Switcher Home FAQ Question How to use WOOCS API Sometimes site admins wants to wide the logic of currencies behavior on their site, or simply get any data using WOOCS functionality. In such way WOOCS API can be used for it as it have heap of tools which can help you with idea related to the site behavior/logic. Next code is just a primitive example which shows how to get currency data: add_shortcode('my_woocs_sign', 'my_woocs_sign'); function my_woocs_sign(){ global $WOOCS; $currencies = $WOOCS->get_currencies(); return $currencies[$WOOCS->current_currency]['symbol']; } 1 2 3 4 5 6 add_shortcode ( 'my_woocs_sign' , 'my_woocs_sign' ) ; function my_woocs_sign ( ) { global $ WOOCS ; $ currencies = $ WOOCS - > get_currencies ( ) ; return $ currencies [ $ WOOCS - > current_currency ] [ 'symbol' ] ; } Current code example returns sign of the current currency, and this code should be applied in the functions.php file of current wp theme . Look please WOOCS functions and WOOCS filters to understand how to realize your idea(s)! Prev: "How to round price to 50 cents" Next: "Fatal error: Call to undefined function filter_var()" Search FAQ Codex Video Tutorials Hints Information Get Compatibility Get WOOCS on: Questions? Get Answers! Our team specializes in development of WordPress and WooCommerce plugins. Information About us Contact Us Changelog Sitemap Privacy Policy Help Downloads FAQ Support News You may be interested in: © 2012 - 2021 with by PluginUs.NET . All rights reserved. English Français Deutsch Español Русский