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: Bug - Clicking the Color Swatch Map when SKU Modifier Is Used ML 9.3.1

  1. #1
    stevewest9 is offline Junior Member
    Join Date
    Nov 2012
    Posts
    15

    Default Bug - Clicking the Color Swatch Map when SKU Modifier Is Used ML 9.3.1

    I have setup a store where I am using SKU modifiers for colors.

    So I entered colors like this "Red,Blue,Black" in the colors box in the admin. I added SKU modifiers like this "-Red,Blue,Black". When a user selects a different color in the color swatch, it's supposed to automatically select the colors in the drop down, but it doesn't because of a weird bug in the JS.

    The selected values of the drop down is <option value="Red,-Red">Red</option>

    I presume this is to tell the cart how to modify the SKU when added to the cart.

    Well the JavaScript function "setcolorlisttoactiveitem" (built in ProductImageGallery.cs line #538 ends up comparing the value of

    listColor == matchColor

    Well list color after going through the "clean" function comes out as "redred" instead of just "red" since there is a second value there.

    tmpS.Append(" if (lstColor == matchColor)\n"); //line #548 about

    This leads to the drop down not being changed when it should.

    A workaround might be to change the function cleansizecoloroption to only look at the left side of the comma to split on "," and then take the left side so that the clean operation only brings over that value.

  2. #2
    stevewest9 is offline Junior Member
    Join Date
    Nov 2012
    Posts
    15

    Default

    Here is the fix for this bug apply in ProductImageGallery.cs

    in the function setcolorlisttoactiveitem JS function:


    tmpS.Append("for (var i=0; i < lst.length; i++)\n");
    tmpS.Append(" {\n");

    //fix for SKU modifiers on color swatch
    tmpS.Append(" var value = lst[i].value;\n");
    tmpS.Append(" var array = value.split(',');\n");
    tmpS.Append(" var lstColor = cleansizecoloroption" + suffix + "(array[0]);\n");
    //end fix

    tmpS.Append(" if (lstColor == matchColor)\n");