• Hi, I’m trying to create a feed for one category but need it to include all subcategories. When I follow the instructions on https://adtribes.io/create-a-product-feed-for-one-specific-category/ I get an empty feed because the parent category does not include any products itself. All products have a child category assigned…

    While a category archive page itself will show all products from child categories, the product feed does not follow this logic.

    How can I include products from child categories? I tried work-arounds like a filter for “category link” / “contains” plus the parent URL slug, or exclude other parent categories but I always end up with an empty feed. Manually selecting each child category is not an option because they are (very) many and they change a lot.

    Is it possible to include child caegories?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Thanks for using our plugin and reaching out to us. Unfortunately our plugin is unaware of category-hierarchy and which subcategory belongs to what main category.

    Perhaps you can use the product tag solution as laid out in this blog post? https://adtribes.io/how-to-include-only-a-couple-of-products-to-your-product-feed/

    Or alternatively create exclude filters on all (sub)categories you would like to exclude?

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Thanks for your response and advise ??

    Excluding other categories is not an option for us for the same reason as including sub-categories is not an option: too many and changing too often.

    I did find a way to make it work via a filter for a dynamic attribute. The custom product attribute has one common term for all products we want to include in the feed. So I tried “contains” and “Include only” in the hopes this would work but got an empty feed again… I finally found that it only works when the box CS (case sensitive) is checked. Without that box selected, it just filters out everything…

    Bug?

    I also ran into another strange issue: when adding a field mapping without actually selecting anything under “CUSTOM FEED ATTRIBUTES”, after saving I got a 500 internal server error on the front end of the site. The admin remained accessible. Turned out it the front-end chocked on an out-of-memory error.

    Even removing the complete feed did not get rid of the problem (WP Cron job/hook?). Adding a WP_MEMORY_LIMIT for 512M to wp-config.php did the trick, after which I could remove the constant again. Then had to recreate the feed…

    Which brings me to another question: is it possible to name the feed xml files instead of the random string?

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    And a third weird issue I started noticing is that during feed regeneration (again: WP Cron job?) I get many many woocommerce error messages on front-end shop pages saying “You cannot add XXXX to the cart because the product is out of stock.”

    All these messages are matching out of stock products but make no sense because NO attempt to add any product to the cart was even made… This appears to only happen during the refresh process, after I have hit the icon “manually refresh productfeed.”

    Here is a PDF screen print of such errors happening on opening a “white wine” archive page: https://carafons.fr/wp-content/uploads/2023/12/Archives-des-Vin-Blanc-Carafons-Cave.pdf

    “I also ran into another strange issue: when adding a field mapping without actually selecting anything under “CUSTOM FEED ATTRIBUTES”, after saving I got a 500 internal server error on the front end of the site. The admin remained accessible. Turned out it the front-end chocked on an out-of-memory error.” –> You can probably solve the issue at hand by enabling this general plugin setting “Show basic attributes in field mapping and filter/rule drop-downs”.

    “Is it possible to name the feed xml files instead of the random string?” –> No unfortunately this is not possible.

    We will have a look at the last issue you reported the upcoming days.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feed for one category plus its subcategories?’ is closed to new replies.