php - 更改描述顺序或类别页面

标签 php magento magento-1.4

我想知道是否可以将一个类别的描述更改为紧接在产品之后。 这里的例子: http://www.theprinterdepo.com/refurbished-printers/monochrome-laser-refurbished-printers

我想某处有一个 phtml 文件,我可以为此轻松更改

我找到了这个文件,代码如下

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
    <div class="category-description std">

         <?php 
         //$currentPage = $this->getCollection()->getCurPage();
         echo $_helper->categoryAttribute($_category, $_description, 'description') 
         ?>

    </div>
<?php endif; ?>

然而 getCurPage 给出了错误

最佳答案

// get category id
$category = $category->load($category_id);


// get collection    
$category->getProductCollection()->addCategoryFilter($category)->addAttributeToSelect('*');    

// print out the description
echo $category->getDescription();


// get current page
$currentPage = $this->getCollection()->getCurPage();
if($currentPage = 1) {
   // show Description Here
   echo $category->getDescription();
} else {
   // Show category name instead of description
   echo $category->getName();

-- 编辑 -- 尝试这个而不是上面

$currentPage->getSelect()->getCurPage();

关于php - 更改描述顺序或类别页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8983793/

相关文章:

php - 将日期结构从 datetime 更改为 VARCHAR 时出现 mysql 错误 1064

php - 如何通过 PHP 将照片从 Flutter App 上传到服务器?

Magento 工具栏不呈现寻呼机

mysql - 在 magento 中大量更新价格

apache - Magento 结帐页面 - 没有 SSL 也很好,但 HTTPS 返回 403 您无权访问此服务器上的/index.php

mysql - 如何在 magento 中加载客户的总地址集合

php - 在 Yii2 中将数据从一个 Controller Action 转发到另一个 Controller Action

php - 如何将 composer autoloader 与 __autoload 一起使用?

php - Magento 订单 ID 重新排序

PHP Magento 获取客户最后订单总数