0

I am updating the cataloginventory_stock_item custom quanty values based on stock ids by using custom api.

I written a update table query in custom api module model file:

Like below:

 public function hello() {

$new_quantity='586';
$id='5949';
$stock_id='3';
$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "UPDATE cataloginventory_stock_item SET qty = '{$new_quantity}' WHERE stock_id = '{$stock_id}' and product_id = $id";
$update=$conn->query($sql);
return true;
  }
}

But here in this file iam passing the values in this file only, but I want to pass the values from api file which is running from root folder.

How to pass the values from api file which is in root folder.

Root folder api file:

<?php

$soap = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl=1', array('exceptions' => 0));
$sessionId = $soap->login('test','test@123');

$result = $soap->call($sessionId, 'customapi.hello',array($myhellomsg));

?>

Thanks

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.