本文整理匯總了PHP中Warehouse::getSkuInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Warehouse::getSkuInfo方法的具體用法?PHP Warehouse::getSkuInfo怎麽用?PHP Warehouse::getSkuInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Warehouse
的用法示例。
在下文中一共展示了Warehouse::getSkuInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load
/**
* Load existing SKU
*
* @param int SKU ID
* @return bool true on success, exception otherwise
*/
public function load($sId)
{
$warehouse = new Warehouse();
$skuInfo = $warehouse->getSkuInfo($sId);
//print_r($skuInfo); die;
if ($skuInfo) {
$this->setId($sId);
$this->setProductId($skuInfo['info']->pId);
$this->setName($skuInfo['info']->sSku);
$this->setPrice($skuInfo['info']->sPrice);
$this->setAllowMultiple($skuInfo['info']->sAllowMultiple);
$this->setTrackInventory($skuInfo['info']->sTrackInventory);
$this->setInventoryLevel($skuInfo['info']->sInventory);
$this->setEnumerable($skuInfo['info']->sEnumerable);
$this->setActiveStatus($skuInfo['info']->sActive);
// Set meta
if (!empty($skuInfo['meta'])) {
foreach ($skuInfo['meta'] as $key => $val) {
$this->addMeta($key, $val);
}
}
} else {
throw new \Exception(Lang::txt('Error loading SKU'));
}
}
示例2: getInstance
public static function getInstance($sId)
{
$warehouse = new Warehouse();
$skuInfo = $warehouse->getSkuInfo($sId);
if (!$skuInfo) {
return false;
}
$productType = $warehouse->getProductTypeInfo($skuInfo['info']->ptId)['ptName'];
$sku = self::getProperInstance($productType, $sId);
return $sku;
}