Aegidius Posted November 5, 2013 Share Posted November 5, 2013 Hello I created an instance of Product class and using it in this way $product->active = 0; $product->save(); but when the product is still active. Why? Link to comment Share on other sites More sharing options...
AndriusS Posted November 5, 2013 Share Posted November 5, 2013 Hey, I'd say, you should be using update() instead of save() but it should do the same if the product is present. Anyways, if you want to set active/inactive, you might want to try toggleStatus(). Link to comment Share on other sites More sharing options...
vekia Posted November 5, 2013 Share Posted November 5, 2013 hello example of working code: $product = new Product(21); $product->active=0; $product->update(); Link to comment Share on other sites More sharing options...
Aegidius Posted November 8, 2013 Author Share Posted November 8, 2013 (edited) I tried with update()/add() but it still not working. I think there is a bug in the PS APIs cause I get another strange error. When I fetch a product with $product = new Product(8100); and then I save it with $product->update(); when I read the id var_dump($product->id); I found the it has become 1. Edited November 8, 2013 by Aegidius (see edit history) Link to comment Share on other sites More sharing options...
Aegidius Posted November 8, 2013 Author Share Posted November 8, 2013 Can you please help me? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now