Uncaught Error: Call to a member function get_name() on string in /plugins/facebook-for-woocommerce/includes/Products.php:1115
When lines 1112-1120 are commented out in Products.php sync runs fine.
It looks like strtolower( $attribute->get_name() ) === $key ) the attribute object is not being passed correctly.
Product sync should update all products
PHP Fatal error: Uncaught Error: Call to a member function get_name() on string in /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/Products.php:1115\nStack trace:\n#0 /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/fbproduct.php(674): SkyVerge\WooCommerce\Facebook\Products::get_enhanced_catalog_attribute('color', Object(WC_Product_Variation))\n#1 /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/fbproduct.php(605): WC_Facebook_Product->apply_enhanced_catalog_fields_from_attributes(Array, '672')\n#2 /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(646): WC_Facebook_Product->prepare_product('TTPO01_950', 'feed')\n#3 /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(580): WC_Facebook_Product_Feed->prepare_product_for_feed(Object(WC_Facebook_Product), Array)\n#4 /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(489): WC_Facebook_Product_Feed->write_product_feed_file(Array)\n#5 /var/ww in /var/www/webapp/web/app/plugins/facebook-for-woocommerce/includes/Products.php on line 1115, referer: https://thesette.com/wp/wp-admin/admin-ajax.php?action=as_async_request_queue_runner&nonce=6a985240f8
I'm seeing a similar error when running cron from the console:
wp cron event run --due-now
Fatal error: Uncaught Error: Call to a member function get_name() on string in /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Products.php:1115
Stack trace:
#0 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php(674): SkyVerge\WooCommerce\Facebook\Products::get_enhanced_catalog_attribute('gender', Object(WC_Product_Variation))
#1 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php(605): WC_Facebook_Product->apply_enhanced_catalog_fields_from_attributes(Array, '4943')#2 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(646): WC_Facebook_Product->prepare_product('5060444300277_9...', 'feed')
#3 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(580): WC_Facebook_Product_Feed->prepare_product_for_feed(Object(WC_Facebook_Product), Array)
in /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Products.php on line 1115
I'm seeing a similar error when running cron from the console:
wp cron event run --due-nowFatal error: Uncaught Error: Call to a member function get_name() on string in /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Products.php:1115 Stack trace: #0 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php(674): SkyVerge\WooCommerce\Facebook\Products::get_enhanced_catalog_attribute('gender', Object(WC_Product_Variation)) #1 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php(605): WC_Facebook_Product->apply_enhanced_catalog_fields_from_attributes(Array, '4943')#2 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(646): WC_Facebook_Product->prepare_product('5060444300277_9...', 'feed') #3 /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/fbproductfeed.php(580): WC_Facebook_Product_Feed->prepare_product_for_feed(Object(WC_Facebook_Product), Array) in /home/example.com/public_html/wp-content/plugins/facebook-for-woocommerce/includes/Products.php on line 1115
Issue is solved by this commit https://github.com/facebookincubator/facebook-for-woocommerce/pull/1676/commits/e661a0fd779c5bf7238a81159b51d70ca78330aa
This has been also reported by at least one user in WooCommerce. Hopefully, it can get fixed soon.
Fixed with release 2.1.4:
_2020.11.04 - version 2.1.4_
_* Fix - Ensure product variant attributes are correctly handled when checking for enhanced attribute values._
Most helpful comment
Fixed with release 2.1.4:
_2020.11.04 - version 2.1.4_
_* Fix - Ensure product variant attributes are correctly handled when checking for enhanced attribute values._