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

Thread: Images associated with kit items

  1. #1
    wroyal is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default Images associated with kit items

    Hello,
    I run a website which allows users to create a highly personalized order - a custom figurine of themself or a friend. There are certain items which the customer must be allowed to select from a list, such as eye color, hair color, skin color, etc. I would like to do this in AspDotNetStorefront but I'm not sure if it's possible.

    I have configured a kit to allow for these various parameters to be selected. However, I am only able to present the customer with a list of options - such as blue, green, hazel, dark brown, light brown for eyes. But what I really need is to be able to present a color swatch with each option so that the color can determine which is the closest match.

    Here's an example of how this works in a different shopping cart product:

    Last edited by George the Great; 06-17-2009 at 10:35 AM.

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

    Default

    Our current kit implementation won't do this out of box, but is simple enough to do with source code (for a specific instance is really simple...can be done with a bit more control - eg. adding images from admin section, supporting image filename override, etc... - if you're willing to build the scaffolding but in this case I think it will suit you just fine).

    First, create a new directory in the images/product/ folder called "kititems" (the naming convention in this example will be kititemid.jpg...1.jpg, 2.jpg, 393.jpg).

    Next, you'll need to open the XSLTExtensionBase.cs file in the AspDotNetStorefrontCore project. Find the GetKitItemOptions method, and there you'll find the section where kit items are rendered for kit products. In case 2
    Code:
    case 2: // Single Select Radio List
    you'll find the radio button generation section. Add the following lines of code (new code is red):
    Code:
    else
    {
        if (AppLogic.KitContainsItem(ThisCustomer.CustomerID, ProductID, ShoppingCartRecID, DB.RSFieldInt(rsi, "KitItemID")))
        {
            IsSelected = " checked=\"checked\" ";
        }
    }
    if (CommonLogic.FileExists("images/product/kititems/" + DB.RSFieldInt(rsi, "KitItemID").ToString() + ".jpg"))
    {
        results.Append("<img src=\"images/product/kititems/" + DB.RSFieldInt(rsi, "KitItemID").ToString() + ".jpg" + "\" width=\"30\" height=\"30\"/>");
    }
    results.Append("<input type=\"radio\" name=\"KitGroupID_" + ThisGroupID.ToString() + "\" value=\"" + DB.RSFieldInt(rsi, "KitItemID").ToString() + "\" " + IsSelected + "/>" + IName);
    results.Append("</td>");
    Then recompile and deploy the new AspDotNetStorefrontCore.dll to your site. Upload the images that you need to the images/product/kititems directory and that's all there is to it
    Attached Images Attached Images  
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    wroyal is offline Junior Member
    Join Date
    Aug 2008
    Posts
    11

    Default

    Wow, this is a great answer. Thanks so much!

    I guess I need the source code to do this - right?

    Thanks!
    Warren

  4. #4
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    You would need source yes, for this kind of detailed mod. Again, not hard, but needs source yes.
    AspDotNetStorefront
    Shopping Cart