Content of the page


Allows to manipulate with currencies before showing their drop-downs on the front, example: add_filter(‘woocs_currency_manipulation_before_show’, function($currencies) { $any_conditions = true; if ($any_conditions) { unset($currencies[‘RUB’]); unset($currencies[‘GBP’]); } return $currencies; }); Structure of the data in variable $currencies in the example above is: Array ( [USD] => Array ( [name] => USD [rate] => 1 [symbol] => $… read more


Hook for fixed prices. Need for compatibility with other plugins, for example:    


Allows to cut from cart and checkout page ‘format of price’ provided by ‘Custom price format’ plugin option. By default return TRUE, but its possible return FALSE add_action( ‘woocs_cut_cart_price_format’, function(){ return FALSE; });    


Allows to change WOOCS form method from POST to GET add_action( ‘woocs_form_method’, function(){ return ‘get’; }); From 2.2.0/1.20  


Works in index.php -> public function woocommerce_variation_prices -> can be used for any manipulations with variable prices, for example rounding of them. Add next code in functions.php of your current wp theme: Example: add_filter(‘woocs_woocommerce_variation_prices’, function($price) { return round($price * 2, 0) / 2; });      


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


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


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


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; }  


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