neilgee
Forum Replies Created
-
Forum: Plugins
In reply to: [SlickNav Mobile Menu] Use of deprecated jqueryLatest update has addressed the deprecations
Forum: Plugins
In reply to: [SlickNav Mobile Menu] Logo not showing in mobile modeThe OP does have the logo showing – probably was a CSS issue – they where using a SVG with no width set – they overcame it with:
.slicknav_brand { width: 50vw !important; }Perhaps this will work for you? If not provide a link so I can see.
Forum: Plugins
In reply to: [VenoBox Lightbox] The color selector does not workColor picker is fixed in latest version (2.0.4)
Ok that’s great, got it working…..
add_filter('woof_sort_terms_before_out', 'prefix_filter_woof', 99, 2); /** * Use specific taxonomy terms for WOOF filtering * @link https://wordpress.org/support/topic/multiple-woof-shortcodes-diff-categories/ * */ function prefix_filter_woof($terms,$type) { $new_terms=array(); foreach($terms as $term){ if($term['taxonomy']=='product_cat' AND in_array($term['term_id'],array(40,41))){ $new_terms[]=$term; } // Uses a taxonomy with certain terms if (in_array($term['taxonomy'],array('type_category','size_category')) ) { $new_terms[]=$term; } // Uses an array of taxonomies with all terms } if($new_terms) { return $new_terms; } }You can use multiple if blocks depending on needs – in example first if block uses WooCommerce default taxonomy product_cat with specific term ids – second if block uses all terms that belong to 2 custom taxonomies; type_category and size_category
Also my intent is to use the filter based on certain conditions not for the entire site so for example you may want to use the filter based on user login status…
if (! is_user_logged_in() ) { add_filter('woof_sort_terms_before_out', 'prefix_filter_woof', 99, 2); }- This reply was modified 5 years, 6 months ago by neilgee.
I tried it like this..
add_filter('woof_sort_terms_before_out', function($terms,$type){ $new_terms=array(); foreach($terms as $term){ if($term->taxonomy=="product_cat" AND in_array($term->term_id,array(40,41))){ $new_terms[]=$term; } } if($new_terms) { return $new_terms; } },99,2);But output is blank, it would be good if you can illustrate an example how the filter works – then you can reference it in future support requests.
PHP warning from wp-debug is…
PHP Notice: Trying to get property 'taxonomy' of non-object in /Users/neilg/Sites/bdr/wp-content/themes/bdr/functions.php on line 375Ok – just a little more help would be appreciated – how would it work for a taxonomy being
product_catand the terms either as namesRetail,Travelor IDs40,41to be only shown.- This reply was modified 5 years, 7 months ago by neilgee.
$terms = apply_filters('woof_sort_terms_before_out', $terms, 'checkbox');Can you give example using filter please?
I have read docs – it appears you cant have 2 different [woof] shortcodes – so for example going back to my original post, if i have 3 prod cats, 1,2,3 displaying the shortcodes below
[woof]
[woof taxonomies=product_cat:1,2]Will result in all filter labels of prod_cats 1,2 and 3 being displayed.
In this thread the user posts the same question – https://wordpress.org/support/topic/hide-show-specific-categories-in-filter-using-shortcodes/ so it appears not possible.
Ok thanks, yes this works
The ‘message’ field is required.
So you can see if the user fails to fill it in and add to cart – no notification is given back to the user.
In other themes this notification is visible.
Hello,
This is not working if I use [woof taxonomies=product_cat:1,2] it still shows all product categories – https://share.getcloudapp.com/OAuJJJOq
I’m trying to use scrollto after reload but it’s not working, so I tested filter with console message which doesn’t output to console.
Ok here is the example URL
https://dev.envisage.websitelove.com.au/product/gift-voucher/
Try and add to cart and you will see that no WooCommerce Notices appear to the user to prompt them to fill in the required field.
Plugin works fine in other Themes – issue is OceanWP theme – I will create a dev site with the issue visible.
Forum: Plugins
In reply to: [VenoBox Lightbox] The color selector does not workAlso WordPress upcoming update 5.5.1 will also fix this issue – https://make.wordpress.org/core/2020/09/01/deprecated-javascript-globals/