Hook for manipulation of the data for such shortcodes data as: [woot_variations], [woot_upsells], [woot_cross_sells], [woot_grouped], [woot_related]. Very handy if necessary change for example per_page value in popup for variations:
| add_filter('woot_vurgc_shortcode_data', function($args) { if ($args['filter_provider'] === 'woot_variations') { $args['per_page'] = 2; } return $args; }); |
VURGC – Variations, Upsells, Related, Grouped, Cross sells From v.2.0.3/1.0.3
Global disabling link on product thumbnail.
| add_filter('woot_disable_all_links_on_thumbs', function($as_text) { return true; }); |
Global disabling link on product title.
| add_filter('woot_disable_all_links_on_titles', function($as_text) { return true; }); |
This hook filter all arguments of shortcode [woot], and allows to manipulate with them on the fly.
For column ‘Quantity’, if content of the product sells individually. For example you can set there link where user can read your shop conditions to explain customer why you selling this product individually. Code example:
| add_filter('woot_quantity_individually', function() { return WOOT_HELPER::draw_html_item('a', [ 'href' => '__PAGE_LINK_HERE__', 'target' => '_blank' ], WOOT_Vocabulary::get(esc_html__('individually 1', 'woot-products-tables'))); }); |
This hooks allows to make compatible a woocommerce filters plugins with WOOT. Lets review filter adaptation for WOOF (as an example): into the file functions.php of the current wordpress theme add next code:
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 55 56 57 58 59 60 | add_filter("woot_profile_extend", function($profile, $action, $shortcode_args) { if ('woot_woocommerce_tables' === $action) { if (isset($shortcode_args['filter_provider'])) { if ($shortcode_args['filter_provider'] === 'woof') { if (array_key_exists('WOOF', $GLOBALS)) { global $WOOF; $profile[0]['filter_provider'] = 'woof'; $profile[0]['filter_data'] = $WOOF->get_request_data(); add_action('woot_filter_provider_woof', function ($args, $filter_data) { if (!is_array($filter_data)) { $filter_data = json_decode($filter_data, true); } if (!empty($filter_data) AND is_array($filter_data)) { foreach (array_keys($filter_data) as $key) { if (is_integer($key)) { unset($filter_data[$key]); } } } //*** //here is clean WOOF functionality global $WOOF; if ((isset($filter_data[$WOOF->get_swoof_search_slug()]) OR isset($filter_data['min_price'])) AND count($filter_data) > 1) { unset($filter_data['paged']); $_GET = $filter_data; $_REQUEST['perpage'] = -1; //for getting all products ids in WOOF predict filtration if (isset($filter_data['post_title']) AND!empty($filter_data['post_title'])) { woot()->filter->provider($filter_data); } $WOOF->woof_products_ids_prediction(true); $ids = $_REQUEST['woof_wp_query_ids']; if ($ids) { $args['post__in'] = $ids; } else { unset($args['post__in']); } } return $args; }, 10, 2); } } } } return $profile; }, 10, 3); |
After this WOOT will be listening query arguments from WOOF As you can see main thing there is define array $args […]
This hook allows to set text or icon to the “Single” button:
This is for thumbnail column and allows to replace default empty thumbnail image
| apply_filters('woot_no_img_found', $thumb, $table_id, $post_id) |
This hook allows to add custom “Add to Cart” button for custom products types, see file \profiles\woocommerce\views\add_to_cart.php
By this hook it is possible to change text for “Load More” button. Also it is possible by: WOOT_Vocabulary::get($word)