我想要一个脚本或想法,通过它我可以获得锚定类别的产品数量。
我尝试loadProductCount()
了类中的方法,Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection
但它没有返回产品计数,而是返回一个数组。请查看下面给出的数组:
Array
(
[0] => Array
(
[entity_id] => 1
[entity_type_id] => 3
[attribute_set_id] => 0
[parent_id] => 0
[created_at] => 0000-00-00 00:00:00
[updated_at] => 2011-10-31 16:14:51
[path] => 1
[position] => 0
[level] => 0
[children_count] => 163
)
[1] => Array
(
[entity_id] => 2
[entity_type_id] => 3
[attribute_set_id] => 3
[parent_id] => 1
[created_at] => 2011-10-31 16:14:51
[updated_at] => 2012-09-07 20:51:21
[path] => 1/2
[position] => 1
[level] => 1
[children_count] => 163
)
[2] => Array
(
[entity_id] => 117
[entity_type_id] => 3
[attribute_set_id] => 0
[parent_id] => 2
[created_at] => 2012-09-07 16:51:28
[updated_at] => 2012-09-10 07:55:24
[path] => 1/2/117
[position] => 13
[level] => 2
[children_count] => 15
)
……