且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Magento:在类别列表页面上显示等级价格

更新时间:2023-11-30 15:08:40

Magento中的所有对象都可能在不同的页面上以不同的方式创建,并且其中包含不同的数据.乍一看似乎不合常理.碰巧,将数据加载到项目"页面上的$ _product对象中的db查询中几乎包含了所有数据.但是出于优化目的,类别页面上使用的$ _product仅包含一些数据-如果我没记错的话,它甚至是从不同的数据库表中提取的.例如,类别页面上的查询与catalogindex *表联接,以获取通常从常规eav表中检索到的某些数据.

All objects in Magento can potentially be created differently on different pages, and have different data in them. It might seem unintuitive at first. It happens that the db query that loads the data into the $_product object on the Item page has pretty much "all" the data in it. But for optimization purposes the $_product used on the category page only has some of the data - and if I remember correctly, it even pulls from different db tables. For example, the the query on the category page joins against the catalogindex* tables for some of the data that would normally be retrieved from the regular eav table.

我没有任何要提供的详细信息,但是您可以直接根据具有所有层级定价的catalog_product_entity_tier_price表进行查询.至少那是我的magento版本中的表格名称,不是1.5.副作用是由于额外的查询/查询,类别页面的加载时间会更长.

I don't have any specifics to give to you but you can look at querying directly against the catalog_product_entity_tier_price table, which has all the tier pricing. At least that is the table name in my version of magento, which isn't 1.5. Side effect would be that the category page will take longer to load due to the extra query/queries.