本文整理汇总了PHP中Attribute::updateQtyProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Attribute::updateQtyProduct方法的具体用法?PHP Attribute::updateQtyProduct怎么用?PHP Attribute::updateQtyProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attribute
的用法示例。
在下文中一共展示了Attribute::updateQtyProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
$orderByPriceFinal = empty($orderBy) ? Tools::getValue($this->table . 'Orderby', 'id_' . $this->table) : $orderBy;
$orderWayPriceFinal = empty($orderWay) ? Tools::getValue($this->table . 'Orderway', 'ASC') : $orderWay;
if ($orderByPriceFinal == 'price_final') {
$orderBy = 'id_' . $this->table;
$orderWay = 'ASC';
}
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit);
/* update product quantity with attributes ...*/
if ($this->_list) {
$nb = count($this->_list);
for ($i = 0; $i < $nb; $i++) {
Attribute::updateQtyProduct($this->_list[$i]);
}
/* update product final price */
for ($i = 0; $i < $nb; $i++) {
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], $usetax = true, $id_product_attribute = NULL, $decimals = 6, $divisor = NULL, $only_reduc = false, $usereduc = true, $quantity = 1, $forceAssociatedTax = true);
}
}
if ($orderByPriceFinal == 'price_final') {
if (strtolower($orderWayPriceFinal) == 'desc') {
uasort($this->_list, 'cmpPriceDesc');
} else {
uasort($this->_list, 'cmpPriceAsc');
}
}
for ($i = 0; $this->_list and $i < $nb; $i++) {
$this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp'];
unset($this->_list[$i]['price_tmp']);
}
}
示例2: getList
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL)
{
global $cookie;
$orderByPriceFinal = empty($orderBy) ? $cookie->__get($this->table . 'Orderby') ? $cookie->__get($this->table . 'Orderby') : 'id_' . $this->table : $orderBy;
$orderWayPriceFinal = empty($orderWay) ? $cookie->__get($this->table . 'Orderway') ? $cookie->__get($this->table . 'Orderby') : 'ASC' : $orderWay;
if ($orderByPriceFinal == 'price_final') {
$orderBy = 'id_' . $this->table;
$orderWay = 'ASC';
}
parent::getList($id_lang, $orderBy, $orderWay, $start, $limit);
/* update product quantity with attributes ...*/
if ($this->_list) {
$nb = count($this->_list);
for ($i = 0; $i < $nb; $i++) {
Attribute::updateQtyProduct($this->_list[$i]);
}
/* update product final price */
for ($i = 0; $i < $nb; $i++) {
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, NULL, 6, NULL, false, true, 1, true);
}
}
if ($orderByPriceFinal == 'price_final') {
if (strtolower($orderWayPriceFinal) == 'desc') {
uasort($this->_list, 'cmpPriceDesc');
} else {
uasort($this->_list, 'cmpPriceAsc');
}
}
for ($i = 0; $this->_list and $i < $nb; $i++) {
$this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp'];
unset($this->_list[$i]['price_tmp']);
}
}