Close

NumberOfProducts

IvanSlater
9 years ago
#8113 Quote
Avatar
  • 89
Is possible to have the NumberOfProducts category information in plugin?

This information comes from the GetCategoryProductNumber function in Catalog Controller and is used only in CategorySimpleModel (side CategoryNavigation Menu).

MegaMenu uses CategoryModel, so this information is not available.

Is there a way to get it?

Thanks!!
Boyko
9 years ago
#8117 Quote
Avatar
  • Moderator
  • 1570
IvanSlater wrote:
Is possible to have the NumberOfProducts category information in plugin?

This information comes from the GetCategoryProductNumber function in Catalog Controller and is used only in CategorySimpleModel (side CategoryNavigation Menu).

MegaMenu uses CategoryModel, so this information is not available.

Is there a way to get it?

Thanks!!


Hi IvanSlater,

Yes, the Mega Menu uses CategoryModel rather than CategorySimpleModel, so this information is not available in the model and there is no way to get it out of the box.

The only way to get it is to resolve and call the IProductService directly in the Mega Menu view and get the number of products in  the categories as you have their IDs from the CategoryModel.

You can suggest adding the number of products information in the model in our UserVoice portal.
Regards,
Nop-Templates.com Team