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- Cleveland, OH
- New York, NY
- Orlando, FL
Now say you have the following 3 products (classes) and each has 2 variants (locations)- Class 1 product
- Class 2 product
- Class 3 product
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>