我只需要属性的总数和它们的值的总和...通过传递产品ID,我已经尝试过此代码,但是它给了我很少的属性,我需要分配给该产品的所有属性(下面给出了代码)。
<?php
require_once('../app/Mage.php');
Mage::app();
$client = new SoapClient('http://localhost/project/api/soap/?wsdl');
$user_name = $_POST["user_name"];
$password = $_POST["password"];
$prod_id = $_POST["prod_id"];
$response = array();
$session = $client->login($user_name, $password);
//$product = $client->call($session,"catalog_product.info" ,$prod_id);
$listAttributes = $client->call($session,'product.listOfAdditionalAttributes',array('simple',$prod_id));
$response = array(
"status" => "1",
"message" => "suceess",
"products" => $listAttributes
);
ob_start();
header('Content-type: application/json');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');
echo json_encode($response);
exit;
?>