當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Attribute::updateQtyProduct方法代碼示例

本文整理匯總了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']);
     }
 }
開發者ID:raulgimenez,項目名稱:dreamongraphics_shop,代碼行數:32,代碼來源:AdminProducts.php

示例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']);
     }
 }
開發者ID:vincent,項目名稱:theinvertebrates,代碼行數:33,代碼來源:AdminProducts.php


注:本文中的Attribute::updateQtyProduct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。