如何在soap / v1 Magento 1.9中过滤带有自定义属性的product.list

时间:2019-07-03 07:54:10

标签: api soap magento-1.9

Magento 1.9-如何使用soap / v1中的自定义属性过滤product.list 因此,我想要的是通过自定义属性过滤产品的任何方法...

<?php

$client     = new SoapClient('http://localhost/project/api/soap/?wsdl');

$user_name  = $_POST["user_name"];
$password   = $_POST["password"];

$response = array();

$session    = $client->login($user_name, $password);

$products = $client->call($session, 'product.list');

foreach($products as $products_details){
    $result = $client->call($session,"catalog_product.info" ,$products_details["product_id"] );

    if($result["is_featured"] == "1"){
        echo "<pre>"; print_r($result["product_id"]); echo "</pre>"; exit;
    }
}

$response = array(
    "status" => 1,
    "message" => "suceess",
    "featute_products" => $result
);

ob_start();
header('Content-type: application/json');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');

echo json_encode($response);
exit;
?>

此代码需要更多时间

0 个答案:

没有答案