How to generate feeds with different data structures?

Created on 1 December 2022, about 2 years ago
Updated 1 March 2023, almost 2 years ago

Hi,

Is it possible to have various feeds based on a Drush command parameter? From what I've seen, it doesn't look like it.

By adding an event listener to commerce_product_feeds.product_variation_normalize, we can already add/modify fields. It would be great to conditionally generate the feed based on some parameter.

Thanks!

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇵🇹Portugal introfini

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom AndyF

    Hi @introfini, thanks for your work! I'd expect the code as-is to experience caching issues connected with #3240612: Allow extra cache keys per feed . Eg. in a contrived example if you preprend G to the variation title in a google feed, and F to a Facebook feed title, and run the following two commands one after the other, I'd expect all product titles in both feeds to have G at the start due to cached normalizations.

    drush product-feed:generate google.xml --tag=google
    drush product-feed:generate facebook.xml --tag=facebook
    

    Separately, note it's already possible to "alter in" custom options to existing drush commands, which is how I've added a similar option to feed generation in the past (we needed an --assume-in-stock option for feeds that weren't automatically updated). But it's a bit of a bother altering a drush command, so I can see the case for a tag option.

    Setting to NW due to expected caching issues. Thanks again!

Production build 0.71.5 2024