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 3 of 3

Thread: Variants Question

  1. #1
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default Variants Question

    I need to have a category that displays the second variant rather than the default variant. Any one know how this can be achieved?

    Thanks!
    MSX

  2. #2
    Dusty is offline Member
    Join Date
    Jun 2009
    Posts
    176

    Default

    There's no way to configure a category to to adhere to that behavior but a relatively simple SQL query like the following could likely accomplish what you're looking for.

    Code:
     
    SELECT PV.VariantID, PV.ProductID, PV.[Name] AS VariantName, CAT.[Name] AS CategoryName
    	INTO #TEMP
    FROM 
    Product AS P 
    INNER JOIN ProductVariant AS PV 
    	ON P.ProductID = PV.ProductID
    INNER JOIN ProductCategory AS PC
    	ON P.ProductID = PC.ProductID
    INNER JOIN Category AS Cat
    	ON PC.CategoryID = Cat.CategoryID
    WHERE Cat.[Name] = 'YourCategory'
    Order By PV.VariantID Desc
    
    UPDATE ProductVariant SET IsDefault = 0 WHERE VariantID IN (SELECT VariantID FROM #TEMP)
    UPDATE ProductVariant SET IsDefault = 1 WHERE VariantID IN (SELECT TOP 1 VariantID FROM #TEMP)
    Dusty
    AspDotNetStorefront Staff
    Last edited by Dusty; 11-10-2009 at 11:59 AM.

  3. #3
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    I was thinking along the lines that I would have a custom XML package for the category. for what you sent is that something I would need the source code for?
    MSX