Content of the page

woocs_currname_in_option

The hook is applied in file wp-content\plugins\woocommerce-currency-switcher\views\shortcodes\woocs.php for the text manipulation in the switchers drop-down. Example: add_filter(‘woocs_currname_in_option’, function($currency_name){ //return “Hello ” . $currency_name . ‘!!’; return “”; }); Use it by your own logic. Customer request: How can i make sure that there is only a currency symbol in the dropdown without editing the plugin files,… read more

woocs_raw_woocommerce_price

Use this hook to manipulate by price values, for example rounding price by your own logic. Examples: https://currency-switcher.com/how-to-round-price-to-50-cents/ – rounding price to the nearest 50 cents add_filter(‘woocs_raw_woocommerce_price’, function($price) { return round($price * 2, 0) / 2; }); https://currency-switcher.com/round-prices-500/ – How to round prices to 500 add_filter(‘woocs_raw_woocommerce_price’, function($price) { if (($price <= 1000)) { $price = round($price /… read more

woocs_get_approximate_amount_text

Use this hook when you activated ‘Show approx. amount’ option in the plugin settings and you want to change default text on the cart/checkout page generated by this feature ‘(Approx. %s)’ to smth another. Example: add_filter(‘woocs_get_approximate_amount_text’, ‘my_woocs_get_approximate_amount_text’, 999, 2); function my_woocs_get_approximate_amount_text($text, $wc_price) { return sprintf(__(‘(My Approx. %s)’), $wc_price); } $text (string) $wc_price (string) ‘Show approx. amount’  -… read more

woocs_price_html_tail

Use this hook if you want to add any additional information text after a product price on the shop/category page. Example: add_filter(‘woocs_price_html_tail’, function($price_html) { return $price_html . “<strong>Hello World!</strong>”; }); Combine it with CSS (in style.css) code if necessary: .woocs_price_html_tail{ display: none; } body.single-product .woocs_price_html_tail{ display: block; } body.single-product .related .woocs_price_html_tail{ display: none; }  

woocs_price_format

This hook uses in index.php of the plugin -> public function woocommerce_price_format: public function woocommerce_price_format() { $currencies = $this->get_currencies(); $currency_pos = ‘left’; if (isset($currencies[$this->current_currency])) { $currency_pos = $currencies[$this->current_currency][‘position’]; } $format = ‘%1$s%2$s’; switch ($currency_pos) { case ‘left’ : $format = ‘%1$s%2$s’; break; case ‘right’ : $format = ‘%2$s%1$s’; break; case ‘left_space’ : $format = ‘%1$s&nbsp;%2$s’; break;… read more

woocs_currency_data_manipulation

This hook uses in public function get_currencies of the plugin: public function get_currencies() { $default = array( ‘USD’ => array( ‘name’ => ‘USD’, ‘rate’ => 1, ‘symbol’ => ‘&#36;’, ‘position’ => ‘right’, ‘is_etalon’ => 1, ‘description’ => ‘USA dollar’, ‘hide_cents’ => 0, ‘flag’ => ”, ), ‘EUR’ => array( ‘name’ => ‘EUR’, ‘rate’ => 0.89, ‘symbol’… read more