当前位置: 首页>>代码示例>>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;未经允许,请勿转载。