本文整理汇总了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;
}