Orchard Product Detail

Jan 20, 2013 at 8:20 PM
Edited Jan 20, 2013 at 10:06 PM

Slowly figuring out how to configure things as I work with this module.

Can't seem to figure the following out though:

I have added a Catalogs And Categories widget to a layer. I also added a Product List widget to a layer and I'm trying to configure the option:

Automatically display a list of products based on the choice of a catalog or category in the Magelia WebStore Catalogs and Categories component.

when I select this option, however, nothing appears in the dropdown. Is adding the Catalogs And Categories widget not what this option is looking for? What would I need to add to use this option?

UPDATE: I discovered that the reason it wasn't available in the dropdown is because I had checked the option on the Catalogs And Categories to generate URLs for the Categories and Categories. 

Jan 20, 2013 at 9:45 PM
Edited Jan 20, 2013 at 10:07 PM

Also,

on the Catalogs And Categories widget, I'm trying to figure out how to configure the URL for the Category pattern.

~/Gear?category={Category.Code}

doesn't seem to give me the Category Code. I also tried Category.Name and that didn't work either.

Using ~/Gear?catalog={Catalog.Code}&category={Category.Code}

gives me the Catalog Code of Default, so it appears to be connecting in some sense to at least give me that. What is the correct terminology to get the Category?

Thanks

UPDATE: All fixed...the problem from above resolved the whole thing. I see how it automatically sends those options in an AJAX call to display the products.

Mar 23, 2013 at 12:31 PM
Could you post for category pattern you used?

I would also liek to get this working.
Apr 8, 2013 at 9:53 PM
Edited Apr 8, 2013 at 9:54 PM
When you're entering the URL Pattern(s) on a Catalog And Categories widget, it's understood that the tokens available to the URL are scoped to the item type you're trying to generate a URL for. So a Catalog URL pattern would be something like ~/products?catalog={Code} and a Catagory URL like ~/products?category={Code}. If you wanted a full catalog and category parameters for the Category URL, it would look like this ~/products?catalog={Catalog.Code}&category={Code}

That make sense?

However that being said, while that gives a URL you would expect, I'm still trying to get the actual Product List to filter to a specific category...
Coordinator
Apr 10, 2013 at 6:31 AM
Edited Apr 10, 2013 at 12:56 PM
Answer to cja100

The “Catalogs and Categories” and “Product List” widgets can function in two different ways:


Automatic Mode:

First you must configure a “Catalogs and Categories” widget in Automatic Mode and note the ID of this widget:

Image

Next, to link the display of a products list to the selection of a category or catalog in the “Catalogs and Categories” widget, you must specify during the creation of the “Product List” the “Catalogs and Categories” widget to which it needs to correspond. To do so, you must check the box: “Automatically display a list of products based on the choice of a catalog or category in the Magelia WebStore Catalogs and Categories component,” and have already configured a “Catalogs and Categories” widget in Automatic Mode, which we did earlier.

By checking the box “Automatically display a list of products based on the choice of a catalog or category in the Magelia WebStore Catalogs and Categories component,” a DropDownList will be displayed and list the IDs of the “Catalogs and Categories” widgets in Automatic Mode that are already configured. The only thing left to do is to choose the one that needs to launch the products list, which in our example we had named “Catalogs and Categories”:

Image


In Automatic Mode, the “Catalogs and Categories” widget is going to add parameters to the current URL so that the associated “Product List” widget can filter the products according to the selection made in the first widget:
Image

Download here a configured orchard instance with the that implements the "catalogs and categories" and "Product list" widgets in automatic mode._
Download Code - Automatic Mode

Specific Mode:

This second operating mode allows the administrator to manually configure within Orchard the URL and the pages of its categories.

We are going to start by creating a widget “Catalogs and Categories” in order to generate specific URLs for each category:
Image


All the categories’ attributes are available at the pattern level, we could have specified: ~/MyPath/{Name} in the field “Category URL pattern.”

Next, to display a list of products with regards to the specific URL of a category, we are going to create a page with the URL in question and add to it a “Product List” widget configured to display the products of the category (in the demo services, there is only one catalog configured, whose code is: Default Catalog):

Creation of the page:
Image

Addition of the layer to enable adding the “Product List” widget :
Image

Image

Addition of the “Product List » widget to the layer of the page URL “MyPath/Downloads”:
Image

During the selection of the category “Downloads” in the “Catalogs and Categories” widget, the user is going to be redirected to the URL “MyPath/Downloads,” which corresponds to the page that we have just created:
Image

Thus, every category can be manually constructed in Orchard with specific URLs and content.
Download here a configured orchard instance with the that implements the "catalogs and categories" and "Product list" widgets in specific mode._
Download Code Specific Mode
Coordinator
Apr 10, 2013 at 12:56 PM
Edited Apr 10, 2013 at 12:57 PM
Answer to yarx. Please read the answer above we just posted to ansswer cja100 question.

To answer your question more precisely, YES, in custom mode, you should use the "Catalog" property of the current catalog in order to indicate the catalog and category in the URLs generated by the "Catalogs and Categories" widget.
Examples : « ~/products?catalog={Catalog.Code}&category={Code} » or « ~/{Catalog.Code}/{Code} » or « ~/MyPath/{Catalog.Name}-{Name} »
You can set up any URL pattern you wish. The only thing you have to do is to match each url with a page that lists the products of the desired catalog and category.

Best regards
Apr 17, 2013 at 5:18 PM
Thank you for the very detailed walk through.

I've created a new page and layer for every category, which is a very good feature if you want different content for each category. It would be good if you could have seo friendly urls without having to do this though.

Anyway I've come across a couple of issues, categories with spaces in do not work with dashes (orchard default), so I had to add dashs to them in the webstore (not ideal). Also the category code appears to be case sensitive in the category widget, so there is no active menu item when the url is case sensitive.
Coordinator
Apr 20, 2013 at 6:13 PM
Edited Apr 20, 2013 at 6:14 PM
Thank you for your e-mail and suggestions. We will try to improve the features of the Magelia module for orchard in future releases. As the Orchard module is a community project, we warmly welcome contributions and if you improve the code or provide new features, we will be happy to integarte your codes in the future releases of the Magelia module for Orchard.

Best regards,

Yves-Alain