Support » Plugin: ExportFeed - Create Product Feeds For 40+ Merchants » error php at the feed moment

  • Hello,

    i get multiple error at the moment of feed

    PHP Warning: Invalid argument supplied for foreach() in /home/bestinterio/public_html/bestinterior/wp-content/plugins/purple-xmls-google-product-feed-for-woocommerce/core/feeds/basicfeed.php on line 722

    can you correct this error for the next update.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ExportFeed.com

    (@purpleturtlepro)

    Hi,

    Thank you for contacting us.

    Please provide us the login to your WP-dashboard and we will help you solve your issue. Alternatively, visit us through live chat from our site(www.exportfeed.com).

    Regards,
    ExportFeed Support

    umm,

    only change it please :

    from /purple-xmls-google-product-feed-for-woocommerce/core/feeds/basicfeed.php

    line 719

            if (isset($this_product->attributes['tag'])) {
                $tags  = null;
                $terms = get_the_terms($this_product->id, 'product_tag');
                foreach ($terms as $key => $value) {
                    if ($tags !== null) {
                        $tags .= ',' . $value->name;
                    } else {
                        $tags = $value->name;
                    }
                }
                $this_product->attributes['tag'] = $tags;
    
            }
    

    to

            if (isset($this_product->attributes['tag'])) {
                $tags  = null;
                $terms = get_the_terms($this_product->id, 'product_tag');
    
    		if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
    		     foreach ($terms as $key => $value) {
    	                if ($tags !== null) {
    	                    $tags .= ',' . $value->name;
    	                } else {
    	                    $tags = $value->name;
    	                }
    	            }
    		}
                $this_product->attributes['tag'] = $tags;
    
            }
    • This reply was modified 1 year, 5 months ago by WebMat.
    • This reply was modified 1 year, 5 months ago by WebMat.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘error php at the feed moment’ is closed to new replies.