如何让我的所有产品项目显示在 magento 1.3.2 的主页上?

发布于 2024-08-02 04:16:27 字数 302 浏览 5 评论 0原文

我安装了 Magento v1.3.2.3 并添加了大部分产品库存。 但是,我只能在主页上显示 5 个项目。 我需要我的所有产品都出现在那里。 如何?

这是我当前正在使用的代码。

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

我在 magento 社区论坛上找到了这个。

I installed Magento v1.3.2.3 and added most of my product inventory. However, I can only get 5 items to display on the homepage. I need all my products to show up there. How?

This is currently the code I am using.

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

I found this on the magento community forum.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾听心声的旋律 2024-08-09 04:16:27

此链接解释了如何在主页上显示特定类别的产品。您只需从那里给出的代码中删除类别过滤器即可获取所有产品。

$products   = $product->setStoreId($storeId)  
                      ->getCollection()  
    ->addAttributeToFilter(‘visibility’, $visibility)  
    ->addCategoryFilter($category)  
    ->addAttributeToSelect(array(‘name’), ‘inner’) //you need to select “name” or you won’t be able to call getName() on the product 
    ->setOrder(‘name’, ‘asc’)
;  

将其更改为

$products   = $product->setStoreId($storeId)  
                      ->getCollection()  
    ->addAttributeToFilter(‘visibility’, $visibility)   
    ->addAttributeToSelect(array(‘name’), ‘inner’)
    ->setOrder(‘name’, ‘asc’)
;  

“这应该会让您走上正确的轨道”。祝你好运!

This link explains how to display products in a particular category on the homepage. You just have to remove the category filter from the code given there to get all the products.

$products   = $product->setStoreId($storeId)  
                      ->getCollection()  
    ->addAttributeToFilter(‘visibility’, $visibility)  
    ->addCategoryFilter($category)  
    ->addAttributeToSelect(array(‘name’), ‘inner’) //you need to select “name” or you won’t be able to call getName() on the product 
    ->setOrder(‘name’, ‘asc’)
;  

change this to

$products   = $product->setStoreId($storeId)  
                      ->getCollection()  
    ->addAttributeToFilter(‘visibility’, $visibility)   
    ->addAttributeToSelect(array(‘name’), ‘inner’)
    ->setOrder(‘name’, ‘asc’)
;  

That should set you on the right track. Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文