Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Mapping Variants

  1. #1
    servicedesk is offline Junior Member
    Join Date
    Sep 2009
    Posts
    2

    Default Mapping Variants

    Hello,

    I am new to Aspdotnet, please pardon me if this is very simple thing. I have been looking through the forum, but have not found something that would help me with this.

    I would like to map the variants by departments. We are selling classes which are the "products" and the locations/times are the "variants". We wanted to map the variants to different departments (we have the locations as departments) so people can look for the location closest to them and see all the classes that are available. Can anyone give me some insight or some pointers on what I can do?

    Thanks!

    ~servicedesk

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Welcome to the community

    Think of variants as different sets of properties that a product can have, and therefore a variant belongs explicitly to the product it's created for. The variants are interchangeable pieces of a product that control things like the weight and price, but without the product that cannot exist by themselves (at least not in terms of usability or functionality). Because of the nature of this relationship, a variant can only be shown as part of the product it belongs to and is mapped automatically as part of the product to whichever category or department the product is mapped to. However, with a few xmlpackage modifications you should be able to limit which variant is shown based on which department (location) is being viewed.

    Let's assume that you have 3 locations as Departments, for the sake of this example we'll say the locations are
    1. Cleveland, OH
    2. New York, NY
    3. Orlando, FL
    Now say you have the following 3 products (classes) and each has 2 variants (locations)
    • Class 1 product
      • OH variant
      • NY variant
    • Class 2 product
      • OH variant
      • FL variant
    • Class 3 product
      • NY variant
      • FL variant
    In this case, we would map the Class 1 product to the New York and Ohio departments, the Class 2 product to the Ohio and Florida departments, and the Class 3 product to the New York and Florida departments. Now when browsing to the Ohio department, you would only want to see Class 1 product -> OH variant and Class 2 product -> OH variant...but not Class 1 product -> NY variant or Class 2 product -> FL variant...and we wouldn't want to see Class 3 product at all. Class 3 product isn't mapped to the Ohio department so it won't show by default, but the other two product will show both variants (if you're using a multi-variant xmlpackage) or just the default variant (if you're using a simple variant xmlpackage).

    You can go in two different directions here. You can modify a copy of a simple variant xmlpackage so that it only displays the variant that pertains to department you browsed to the product through. The other option is to change one of the multi-variant xmlpackages to list the variant that matches the location first, and then under it maybe say something like "This class also offered in these other locations" and then list the other variants there. You could use one of the unused field in the variant (like ExtensionData or Summary) to store either the DepartmentID or the Name of the location it should show for, and then in the xmlpackage use that value to determine if it should be shown first (for the location currently being viewed) or in the also offered in these locations area.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>