Creation of a Catalog Page Model/View - Commerce 11

Vote:
 

Is it possible to have a page view/model for the catalog in Commerce?

The documentation here specifically states to not inherit from CatalogContent because "they only exist to show various states in the system".

I've attempted to connect the content type to the metaclass using the [CatalogContentType ( MetaClassName = "Catalog")], but that didn't appear to work.

Has anyone managed to do this? Or got any pointers on how to achieve this?

#190153
Apr 03, 2018 17:51
Vote:
 

It is not possible. What would you want to show in a catalog page? There is nothing prevent you from returning a CMS view in your catalog controller 

#190156
Apr 03, 2018 19:10
Vote:
 

Thanks for your response Quan.

I was hoping to use it for a primary category listing. Ideally our catalog will sit at /products and have urls like /products/cat1, /products/cat1/some-product etc. We had planned to use the url /products to list out the top level categories.

I'll go for the controller route instead and define the content for it elsewhere.

Cheers

Tom

#190163
Apr 03, 2018 21:37
Vote:
 

I think it makes perfect sense to display all top level categories on such a page. The idea is that any segment in the url should be routable.

It can easily be achieved by creating a controller of type ContentController<CatalogContent>. From there you can build any model of your choice, but as you've already found out - should you require additional properties on the catalog you will need to store them elsewhere.

#190169
Apr 04, 2018 2:12
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.