Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Jun 30, 2015 @ 10:58
    Kim Bantz Rasmussen
    0

    Different structure than demo shop - how to list categories for each catalog

    Hi

    In uCommerce I have multiple catalogs with categories. My page structure right now looks like:

    category -> product

    But my goal is to have:

    catalog1 -> category* -> product

    catalog2 -> category* -> product

    ... and so on

    *their can be several categories under each catalog.

    My starting point is the uCommerce Razor Shop, but I'am having trouble showing a list of the categories under the catalog. Should I add a 'Category' document type? and how should I edit the urlRewriting.config?

    Here is a part of the url rewriting file for one catalog:

    <add name="SecondHandCategoryProductRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)/p-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand/product.aspx?catalog=$2&amp;category=$3&amp;product=$4" ignoreCase="true" xmlns="" />
    <add name="SecondHandProductRewrite" virtualUrl="(.*)/c-([0-9]+)/p-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand/product.aspx?catalog=$2&amp;product=$3" ignoreCase="true" xmlns="" />
    <add name="SecondHandCategoryRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand.aspx?catalog=$2&amp;category=$3" ignoreCase="true" xmlns="" />
    <add name="SecondHandCatalogRewrite" virtualUrl="(.*)/c-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand.aspx?catalog=$2" ignoreCase="true" xmlns="" />
    

    Best regards

    Kim

  • Kim Bantz Rasmussen 81 posts 310 karma points
    Jul 09, 2015 @ 13:30
    Kim Bantz Rasmussen
    101

    Okay, I will answer this myself :)

    It is really ease to customize the structure by changing the url rewrites.

    If you want to have a catalog -> category -> product structure, you will have to edit the rewrite to:

    <add name="SecondHandCategoryProductRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)/p-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand/product.aspx?catalog=$2&amp;category=$3&amp;product=$4" ignoreCase="true" xmlns="" />
    <add name="SecondHandProductRewrite" virtualUrl="(.*)/c-([0-9]+)/p-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand/product.aspx?catalog=$2&amp;product=$3" ignoreCase="true" xmlns="" />
    <add name="SecondHandCategoryRewrite" virtualUrl="(.*)/c-([0-9]+)/c-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand/category.aspx?catalog=$2&amp;category=$3" ignoreCase="true" xmlns="" />
    <add name="SecondHandCatalogRewrite" virtualUrl="(.*)/c-([0-9]+)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/2nd-hand.aspx?catalog=$2" ignoreCase="true" xmlns="" />
    

    Notice the "SecondHandCategoryRewrite":

    destinationUrl="~/2nd-hand/category.aspx?catalog=$2&amp;category=$3
    

    And of course you will have to map the structure in Umbraco:

    Then you can choose a different template for catalogs, categories and products

    Best regards

    Kim

Please Sign in or register to post replies

Write your reply to:

Draft