This hook uses in index.php of the plugin -> public function woocommerce_price_format:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 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 %2$s'; break; case 'right_space' : $format = '%2$s %1$s'; break; } return apply_filters('woocs_price_format', $format, $currency_pos); } |
So if you have any idea about your own price format use this hook with/without any conditions by your own logic:
1 2 3 4 5 6 7 | add_filter('woocs_price_format', 'my_woocs_custom_format', 999, 2); function my_woocs_custom_format($format, $currency_pos) { //do smth with $format here return $format; } |
