nam797 Posted February 9, 2017 Share Posted February 9, 2017 (edited) Hello All, I am creating a script that will update the status of a product through the PrestaShop web service. It works but is very slow. Has anyone here done this before? When I update the qty of a product it is really fast. Below is the code I am using to update the status. I am also using the PrestaShopWebservice class. $xml = $this->prestaShop->get(['resource' => 'products', 'id' => $productId]);$resources = $xml->children()->children();// Unset fields that may not be updatedunset($resources->manufacturer_name);unset($resources->quantity);$resources->id = $productId;$resources->active = 0;//echo $xml->asXML();die;try { $opt = array('resource' => 'products'); $opt['putXml'] = $xml->asXML(); $opt['id'] = $productId ; $xml = $this->prestaShop->edit($opt);}catch (PrestaShopWebserviceException $ex) { echo $ex->getMessage();} Thanks, Nathan Edited February 9, 2017 by nam797 (see edit history) 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