<?php
require dirname ( __FILE__ ) . "/TopSdk.php";
class Product {
public static function get_by_id($pid) {
$c = new TopClient ();
$c->format = "json";
$c->appkey = "**";
$c->secretKey = "***";
$req = new ItemGetRequest ();
$req->setFields ( "detail_url,title,nick,pic_url,price,has_discount" );
$req->setNumIid ( $pid );
$resp = $c->execute ( $req );
$temp = json_encode ( $resp );
$result = json_decode ($temp, true );
if(isset($result['item']) && isset($result['item']['price'])) {
return $result;
}
return false;
}
}
require dirname ( __FILE__ ) . "/TopSdk.php";
class Product {
public static function get_by_id($pid) {
$c = new TopClient ();
$c->format = "json";
$c->appkey = "**";
$c->secretKey = "***";
$req = new ItemGetRequest ();
$req->setFields ( "detail_url,title,nick,pic_url,price,has_discount" );
$req->setNumIid ( $pid );
$resp = $c->execute ( $req );
$temp = json_encode ( $resp );
$result = json_decode ($temp, true );
if(isset($result['item']) && isset($result['item']['price'])) {
return $result;
}
return false;
}
}