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


PHP ShopFunctionsF::getLastVisitedManuId方法代碼示例

本文整理匯總了PHP中ShopFunctionsF::getLastVisitedManuId方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShopFunctionsF::getLastVisitedManuId方法的具體用法?PHP ShopFunctionsF::getLastVisitedManuId怎麽用?PHP ShopFunctionsF::getLastVisitedManuId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ShopFunctionsF的用法示例。


在下文中一共展示了ShopFunctionsF::getLastVisitedManuId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setPaginationLimits

 /**
  * Override
  *
  * @see VmModel::setPaginationLimits()
  */
 public function setPaginationLimits()
 {
     $app = JFactory::getApplication();
     $view = JRequest::getWord('view', 'virtuemart');
     $cateid = JRequest::getInt('virtuemart_category_id', -1);
     $manid = JRequest::getInt('virtuemart_manufacturer_id', 0);
     $limitString = 'com_virtuemart.' . $view . 'c' . $cateid . '.limit';
     $limit = (int) $app->getUserStateFromRequest($limitString, 'limit');
     $limitStartString = 'com_virtuemart.' . $view . '.limitstart';
     if ($app->isSite() and ($cateid != -1 or $manid != 0)) {
         $lastCatId = ShopFunctionsF::getLastVisitedCategoryId();
         $lastManId = ShopFunctionsF::getLastVisitedManuId();
         //vmdebug('setPaginationLimits is site and $cateid,$manid ',$cateid,$lastCatId,$manid);
         if (!empty($cateid) and $cateid != -1) {
             $gCatId = $cateid;
         } else {
             if (!empty($lastCatId)) {
                 $gCatId = $lastCatId;
             }
         }
         if (!empty($gCatId)) {
             $catModel = VmModel::getModel('category');
             $category = $catModel->getCategory($gCatId);
         } else {
             $category = new stdClass();
         }
         if (!empty($lastCatId) and $lastCatId != $cateid or !empty($manid) and $lastManId != $manid) {
             //We are in a new category or another manufacturer, so we start at page 1
             $limitStart = JRequest::getInt('limitstart', 0);
         } else {
             //We were already in the category/manufacturer, so we take the value stored in the session
             $limitStartString = 'com_virtuemart.' . $view . 'c' . $cateid . 'm' . $manid . '.limitstart';
             $limitStart = $app->getUserStateFromRequest($limitStartString, 'limitstart', JRequest::getInt('limitstart', 0), 'int');
         }
         if (empty($limit) and !empty($category->limit_list_initial)) {
             $suglimit = $category->limit_list_initial;
         } else {
             if (!empty($limit)) {
                 $suglimit = $limit;
             } else {
                 $suglimit = VmConfig::get('llimit_init_FE', 20);
             }
         }
         if (empty($category->products_per_row)) {
             $category->products_per_row = VmConfig::get('products_per_row', 3);
         }
         $rest = $suglimit % $category->products_per_row;
         $limit = $suglimit - $rest;
         if (!empty($category->limit_list_step)) {
             $prod_per_page = explode(",", $category->limit_list_step);
         } else {
             //fix by hjet
             $prod_per_page = explode(",", VmConfig::get('pagseq_' . $category->products_per_row));
         }
         if ($limit <= $prod_per_page['0'] && array_key_exists('0', $prod_per_page)) {
             $limit = $prod_per_page['0'];
         }
         //vmdebug('Calculated $limit  ',$limit,$suglimit);
     } else {
         $limitStart = $app->getUserStateFromRequest('com_virtuemart.' . $view . '.limitstart', 'limitstart', JRequest::getInt('limitstart', 0), 'int');
     }
     if (empty($limit)) {
         if ($app->isSite()) {
             $limit = VmConfig::get('llimit_init_FE');
         } else {
             $limit = VmConfig::get('llimit_init_BE');
         }
         if (empty($limit)) {
             $limit = 30;
         }
     }
     $this->setState('limit', $limit);
     $this->setState($limitString, $limit);
     $this->_limit = $limit;
     //There is a strange error in the frontend giving back 9 instead of 10, or 24 instead of 25
     //This functions assures that the steps of limitstart fit with the limit
     $limitStart = ceil((double) $limitStart / (double) $limit) * $limit;
     $this->setState('limitstart', $limitStart);
     $this->setState($limitStartString, $limitStart);
     $this->_limitStart = $limitStart;
     return array($this->_limitStart, $this->_limit);
 }
開發者ID:aldegtyarev,項目名稱:stelsvelo,代碼行數:87,代碼來源:product.php


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