- Support forum for the Product XML Feeds for WooCommerce.
- This topic has 7 replies, 3 voices, and was last updated 3 years, 9 months ago by Greg.
February 13, 2020 at 10:03 pm #105689
I have a custom field (advanced custom fields) that I want to filter the products by. The field is accessible and shows up in the XML feed when I use [alg_product_custom_field name=”sample_custom_field”].
However, how can I filter the products that have values for “sample_custom_field”? I’ve tried putting that in the ‘custom taxonomy’ field to include, but no luck.
I need to filter by this custom field for this plugin to work for us, thanks!
February 13, 2020 at 11:24 pm #105690
- This topic was modified 6 months, 1 week ago by Omar.
I tried creating a new taxonomy, since that what it seems to really want. Not just a custom field. I was certain this would work… but it’s not.
I registered a custom taxonomny:
I’m then using advanced custom fields to use that taxonomy to show fields on WooCommerce products. I populated 1 product with a ‘gundealtax’ taxonomy. I then place ‘gundealtax’ (without quotes) in the Custom taxonomy to include field, and it returns a list of all products, instead of 1.February 13, 2020 at 11:50 pm #105691
Darn, I updated my taxonomy code to:
register_taxonomy( ‘gundealtaxonomy’, ‘product’, $args );
register_taxonomy_for_object_type( ‘gundealtaxonomy’, ‘product’ );
Seems to save the taxonomy values correctly through ACF. But placing neither the ACF field name “gun_deals_taxonomy” nor “gundealtaxonomny” works for filtering. So either I’m doing something very wrong… or the filtering by custom taxonmy doesn’t seem to wrok.February 14, 2020 at 5:38 pm #105692WPWhaleModerator
Hello Thrive Team,
Sorry to know you’re having a trouble using this feature.
To create a feed based on a taxonomy (named color for example), you will need something like this:
So now let’s assume you have 3 values for the size (S,M,L), and you want the XML feed to contain the products that have a value of S or M for the size taxonomy, you will need to enter ‘size’ (without quotes) in “Custom Taxonomy to Include”, and then enter ‘s,m’ in “Custom Taxonomy Slug” field.
I’ve just applied the same exact steps and here is the XML file generated.
The store has other products of course, but these two (appearing in the XML) are the only ones with small & medium values for that taxonomy (there is a product with large value, but not included in custom tax slugs so it’s not in the feed).
I’ve used WCK plugin to create the taxonomy, while you used ACF, not sure if it could be an issue.
If possible, grant me access to your store ([email protected]) I can take a look at the settings you have.
OmarFebruary 14, 2020 at 7:00 pm #105693
Hello, thanks for the reply but- I’ve already done exactly as you suggested- I placed the custom taxonomy field to include. I shouldn’t need to do anything further based on your documentation.
In your example, you shouldn’t need to put in “M” or “S”. If you put in “size” as the attribute, it should grab all products WITH a size attribute. But nevertheless, I have put in the exact name of the attribute, it still doesn’t work.
I’m not using ACF to create a custom taxonomy. I’ve created a custom taxonomy through standard WordPress register functions. The only thing ACF is being used for is to create an easy interface to select taxonomies. (You could add them in the sidebar via the standard wordpress method- makes no difference. The taxonomy is being saved correctly on the post, but the plugin cannot filter by it.)
In my scenario, the custom taxonomy name is ‘gundealtaxonomy ‘and the attribute is ‘Ammunition’. When I put both of those into the settings as you have suggested like Size and S/M- it still produces an XML document with every product, whereas it should only be returning a single product since that’s all that is entered in the backend so far.
How did you create the custom taxonomny Size, how did you populate it with data?
I could give you access to a clone of the site, but i’ll need to create it first and I’ll also need a secure method of communication.February 14, 2020 at 7:01 pm #105694
Just saw you included your e-mail- I’ll get a clone set up so I can grant access.February 14, 2020 at 7:04 pm #105695WPWhaleModerator
I used WCK to create the taxonomy, and it allows you to create values from the product page itself.
For communications, yes please contact me at that email .
OmarFebruary 17, 2020 at 9:42 pm #105696GregGuest
Omar- just sent you an email with Clone access and associated details!
- You must be logged in to reply to this topic.