• Resolved Chris Hardie

    (@chrishardie)


    Hi! Do you have a recommended way to exclude certain products from being synced from WooCommerce to MailChimp? Browsing the plugin code and past support history I didn’t immediately see a good option for this.

    It seems like a filter applied within getProductPostsIds() or maybe compile() in MailChimp_WooCommerce_Transform_Products could work well.

    If you don’t currently have this option, would you accept a PR to implement it?

    Thank you for your consideration.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support khungate

    (@khungate)

    Hi @chrishardie, it looks like you’ve been in contact with our developer group over at Github. Thanks again for the PR! https://github.com/mailchimp/mc-woocommerce/pull/844.

    Thread Starter Chris Hardie

    (@chrishardie)

    Thanks for the response @khungate – this was actually meant to be a separate inquiry from the PR/issue mentioned, so if you have any guidance on excluding products that would be great. If not, I can work on a PR to see if it would be useful to other users of the plugin.

    Plugin Author ryanhungate

    (@ryanhungate)

    @chrishardie we’ve talked a few times about this on our end and the only thing I can think of that makes sense is a filter inside our mailchimp_handle_or_queue function – in the bootstrap.php file.

    
    if ($job instanceof \MailChimp_WooCommerce_Single_Order &&
        apply_filters('mailchimp_should_push_order', $job) === false) {
        return null;
    } else if ($job instanceof \MailChimp_WooCommerce_Single_Product &&
        apply_filters('mailchimp_should_push_product', $job) === false) {
        return null;
    }
    

    Then you would just register the filter and return false based on this object and the product ID etc.

    We would need to put this in our next release because we’ve got 2.7 going through QA at the moment… but if you could try that out on your end first and let us know if that’s something that makes sense, we can certainly add this into the next release.

    Thanks again!

    Thread Starter Chris Hardie

    (@chrishardie)

    Thank you. I’ve submitted a PR here to keep the conversation going:

    https://github.com/mailchimp/mc-woocommerce/pull/845

    I’ll close this support request for now.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Filter to exclude certain products?’ is closed to new replies.