This hook allows to disable mini cart redrawing to avoid conflicts with another scripts or wrong redrawing. Necessary for some WordPress themes which already do such redrawing.
| add_filter('woocs_redraw_cart', function(){ return 0; }); |
From v.2.3.3/1.3.3
This hook is for shortcode [woocs_price] and allows to manipulate by the price displayed by the shortcode on the fly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | //[woocs_price] from v.2.3.3/1.3.3 public function woocs_price_shortcode($args) { $price = ""; $product_o = null; if (empty($args)) { $args = array(); } if (!isset($args['id']) AND is_product()) { global $product; $product_o = $product; } elseif ($args['id']) { $product_o = wc_get_product($args['id']); } if (is_object($product_o) AND method_exists($product_o, 'get_price_html')) { $price = $product_o->get_price_html(); } return apply_filters('woocs_price_shortcode', $price, $product_o); } |
From v.2.3.3/1.3.3
This hook allows to make compatibility with other plugins. Use it in your own code, as an example: $calc_value = apply_filters(‘woocs_convert_price’, $calc_value ,false);
From version 2.3.1/1.3.1 Allows to add custom currency aggregator. Works only in pair with woocs_announce_aggregator
From version 2.3.1/1.3.1 Allows to add custom currency aggregator. Works only in pair with woocs_add_aggregator_processor
From version 2.3.1/1.3.1 Allows to manipulate with currency rate on the fly or even use it as own currency aggregator.
From v.2.3.1/1.3.1 Allows to select what table-data of the aggregator to use. Default is ‘A’.
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:
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | Array ( [USD] => Array ( [name] => USD [rate] => 1 [symbol] => $ [position] => left [is_etalon] => 1 [hide_cents] => 0 [decimals] => 2 [description] => United States dollar [flag] => '' ) [GBP] => Array ( [name] => GBP [rate] => 0.80 [symbol] => £ [position] => left [is_etalon] => 0 [hide_cents] => 0 [decimals] => 2 [description] => British pound [flag] => '' ) [UAH] => Array ( [name] => UAH [rate] => 26.069684 [symbol] => грн. [position] => left [is_etalon] => 0 [hide_cents] => 0 [decimals] => 2 [description] => Украинская гривна [flag] => '' ) [RUB] => Array ( [name] => RUB [rate] => 62.218399 [symbol] => руб. [position] => left [is_etalon] => 0 [hide_cents] => 0 [decimals] => 2 [description] => Российский рубль [flag] => '' ) ) |
from ver.2.2.4/1.2.4
Hook for fixed prices. Need for compatibility with other plugins, for example: https://currency-switcher.com/woocommerce-extra-product-options-themecomplete/
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; }); |