Jump to content

How to update product price?


alanfalcoski

Recommended Posts

How can I update the products prices?

 

I'm using the webservice to send information to Prestashop from the ERP, I can add a new product, but can't update the price..

 

There's another way to do it?

 

My code:

 

if( ERP information)....{

 

global $webService;
         
         $opt = array('resource' => 'products');
         $opt['id'] = $rowRemota['id_product'];
         $xml = $webService->get($opt);
 
         $resources = $xml -> children() -> children();
         unset($xml->children()->children()->manufacturer_name);
         unset($xml->children()->children()->position_in_category);
         unset($xml->children()->children()->quantity);
         unset($xml->children()->children()->type);
 
         $resources->name->language=$row['description'];
         $resources->price = $row['price'];
 
         $opt = array('resource' => 'products');
         $opt['id'] = $rowRemota['id_product'];
         $opt['putXml'] = $xml->asXML();
         $xml = $webService->edit($opt);
 
      }
 
      else{
         echo "Insert->".$row['description']."</BR>";
...
 
"else" works fine, mas "if" not.
Edited by alanfalcoski (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...