Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems not to work in Woocommerce 3.0 #22

Open
DrunkenButGreat opened this issue May 21, 2017 · 3 comments
Open

Seems not to work in Woocommerce 3.0 #22

DrunkenButGreat opened this issue May 21, 2017 · 3 comments

Comments

@DrunkenButGreat
Copy link

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.

@judgej
Copy link
Owner

judgej commented May 31, 2017

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.

judgej added a commit that referenced this issue May 31, 2017
@ravimallya
Copy link

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.

@xinxo7
Copy link

xinxo7 commented Jul 31, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants