Support » Plugin: Pinterest for WooCommerce » Missing “condition” for root product with variants

  • Resolved ataub2qf


    My client has variable products with multiple variants, eg

    For the root product you can’t set up the condition, but only for the variants, see screenshot.

    The root product is also included in the feed, see ID 48753 in the current feed.

    Here the excerpt from the feed:

    <![CDATA[ Taufe Gästebuch - blanko 'Tierfamilie' ]]>
    <![CDATA[ Personalisierbares Gästebuch zur Taufe, Babyshower oder 1. Geburstag Sammelt die wertvollen Erinnerungen eures Babys in einem Gästebuch In drei Blattstärken, in Rosa oder Blau, mit Buchecken oder ohne, mit Babynamen und Datum personalisierbar. Das blanko Gästebuch eignet sich perfekt, um euren Gästen Platz für kreative Gedanken zu lassen oder um Fotos und ausgefüllte Gästebuch Karten einzukleben, die du natürlich auch in unserem Shop findest. Möchtest du lieber das Gästebuch mit vorgedruckten Fragen so findest du es hier in rosa oder blau. Möchtest du lieber einen hochwertigen Leinenbuchdeckel mit Gold- oder Silberprägung findest du das hier. Produktdetails: Format: 25x25cm - Wähle zwischen rosa Namen am Cover und blauen Namen am Cover - 30 Blatt (28 Doppeseiten für Gäste); 45 Blatt (43 Doppelseiten) oder 60 Blatt (58 Doppelseiten) - Inlays auf 170g Naturpapier blanko - Stabiler, hochwertiger, hardcover Buchdeckel, matt und kratzfest cellophaniert - Metall Spiralbindung in weiß - Buchecken aus Messing oder Nickel ]]>
    <g:product_type>Gästebuch & -karten > Baby-Geburtstag > Gästebücher</g:product_type>
    <![CDATA[ ]]>
    <![CDATA[ ]]>
    <g:availability>in stock</g:availability>
    <g:mpn>Taufe Gästebuch - blanko - Tierfamilie</g:mpn>
    <![CDATA[,,,,,ästebuch-namen-personalisierbar-wien-1116-500x437.jpg ]]>
    <g:google_product_category>Arts & Entertainment > Party & Celebration > Party Supplies</g:google_product_category>

    Pinterest then throws a warning for those products (german screenshot, telling, that condition for that root product is missing).

    AFAIK there is no way to ever order such a root product. So should it just be excluded from the feed by the plugin? Or do I need to change anything?


    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ataub2qf


    So if product with the product_type “variable” can never be purchased (but only its children variants), then I think the code in ./src/ProductSync.php#582 needs to change from:

    array_splice( $product_ids, $i + 1, 0, $children );


    array_splice( $product_ids, $i, 1, $children );

    to replace the root id (variable base product) with the children (variants).

    Plugin Support Christian


    Hey @ataub2qf ,

    Hope you are doing well!

    On future releases the Parent product of variable products will not be present on the feed file. So is not going to happen this issue

    I will post here when the fix is released.

    I’m going to mark this as resolved – if you have any further questions, you can start a new thread.


    Thread Starter ataub2qf


    Thanks. To get it working in the meantime, I programmed the following snipped, if anyone needs that right now:

    function taubenkorb_filter_root_variable_elements($xml, $product )
    	// Remove variable root element from feed
    	if($product->is_type('variable')) {
    		return '';
        // Return the normal xml item
        return $xml;
    add_filter( 'pinterest_for_woocommerce_feed_item_xml', 'taubenkorb_filter_root_variable_elements', 10, 2);

    FYI – it only filters the output, after all the products have been queued and the code for that xml has been generated, but it was the only solution I found 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing “condition” for root product with variants’ is closed to new replies.