wc-api-custom-meta
wc-api-custom-meta copied to clipboard
Seems not to work in Woocommerce 3.0
As described in https://wordpress.org/support/topic/does-not-work-for-woo-3-0/ it seem not to work in Woo 3.x (in my case 3.0.7). Setting custom_meta but saves nothing.
Sorry, not had time to look at this yet.
Solution posted by Hinzaldi looks like a fix:
line 109:
replace $product_id = $product->id;
with: $product_id = $product->get_id();
In WC 3.0 you need to call an other method to get the ID
I'll try to get that released today.
Hi.
The solution that you provided not working when retrieving a product though. I've not tested by setting a custom meta attribute. Here's https://pastebin.com/N8pWMSFM the output of:
WooCommerce.get('products/14426', function(err, data, res) { console.log(res); });
Replaced the id with get_id as described. Please suggest.
I have the same issue, with Woocommerce 3.1.1. I have applied the fix but it still doesn’t work. When I try to create a product with more than one variation, only one is created and I get the error ‘Fatal error: Uncaught Error: Cannot use object of type WC_Product_Variation as array…’
Any ideas?
Thanks in advance!