简体   繁体   English

magento产品列表.phtml

[英]magento product list.phtml

If I click on a product from my product overview on the left side, the shop does not load with the list.phtml. 如果我从左侧的产品概览中单击某个产品,则商店不会加载list.phtml。 As soon as I swap view to grid or list, it swaps to the list.phtml file and everything is fine. 只要将视图交换到网格或列表,它就会交换到list.phtml文件,一切都很好。 But as I said, if I click on the products on the sidebar, it doesnt work (it's not even affected by list.phtml at all). 但是正如我所说,如果我单击侧边栏上的产品,则它不起作用(甚至完全不受list.phtml的影响)。 I removed all the code inside it and it still showed (a bit different, that's why I want to change it) the products, but as soon as I swapped mode, everything disappeared -- as it should. 我删除了其中的所有代码,但仍然显示(有些不同,这就是我要更改它的原因)产品的信息,但是,一旦我切换了模式,一切都消失了,应该消失了。 Do you know where I can change that? 你知道我可以在哪里改变吗? Thank you. 谢谢。

It should use list.phtml file. 它应该使用list.phtml文件。 In that file it is defined for both list mode and grid mode. 在该文件中,同时为列表模式和网格模式定义了该文件。

 <?php echo $this->getToolbarHtml() ?>
    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
    <?php $_iterator = 0; ?>

And

<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>

You can see something like above code in your list.phtml file,one is for list mode and another for grid mode. 您可以在list.phtml文件中看到类似上述代码的内容 ,一个用于列表模式,另一个用于网格模式。 This is the default case unless you haven't changed the layout or template code. 这是默认情况,除非您没有更改布局或模板代码。

If you want to know the file location than you can always enable template path hint. 如果您想知道文件位置,则可以始终启用模板路径提示。 If you don't know how to do that you can follow this . 如果您不知道该怎么做,可以按照以下步骤进行

After knowing from which file it is rendering you can fix it. 在知道从哪个文件渲染后,您可以对其进行修复。

Hope this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM