Welcome to Mediachase Community Sign in | Join | Help    
in Search   

How to get the values for corresponding attribute form multiple select meta attribute

Last post Tue, Aug 19 2008, 11:48 PM by Nadya. 3 replies.
Sort Posts: Previous Next
  •  Fri, Aug 08 2008, 8:44 AM 10044

    How to get the values for corresponding attribute form multiple select meta attribute

    Hello,

    I have a meta field attribute, let's say "Color", and "Size" defined as Dictionary, with the "color" having multiple-selection checked. When I retrieve the value for a product in the front, it gives me all the values for multiple selection for “Color”(I am using following code for this). When I select first multiple selection value for Color from drop down it populates the corresponding "Size" value. It happens only for FIRST, multiple select option for "Color".
    If we select any other multiple select option for "Color" it does not populate corresponding  "Size" value in front store.

    Please let me know how can I get ?

    public string GetMetaField(string name, Item item)
        {
            ItemAttribute attr = ClientHelper.GetAttributeByName(name, item.ItemAttributes);
            string returnString = null;
            if (attr != null && attr.Value != null && attr.Value.Length > 0)
            {

                int i=0;
                for (i=0; i < attr.Value.Length; i++) {
                    if (i>0) {
                        returnString = returnString + ", " + attr.Value[i].ToString();
                    } else {
                        returnString += attr.Value[i].ToString();
                    }
                }
                return returnString;
            }
            return String.Empty;
        }

    Thanks in advance

  •  Tue, Aug 19 2008, 2:14 AM 10073 in reply to 10044

    Re: How to get the values for corresponding attribute form multiple select meta attribute

    Hi,
    sorry for late reply. Your question is not quite clear. As I understand you have two attributes (metafields) for product or sku: "Color" and "Size". They are defined as dictionaries. If it is so how your "Size" attribute is connected with "Color"? Metafields are not connected to each other. So you should keep your connection between size and color somewhere.
  •  Tue, Aug 19 2008, 9:26 AM 10075 in reply to 10073

    Re: How to get the values for corresponding attribute form multiple select meta attribute

    The standard behavior is:
    I have a Product with three SKUs. Each SKU ihas different Sizes and Colors. Now on Product details page (Purchase Module) if I select Red color, It populates 'Medium' size only. Because there is only one SKU having Red Color and Medium Size.

    This is what you are talking about and it is working fine.

    The problem is, suppose I have a product say Mobile Cover. Which has two attributes. One is Color and the other is Mobile model. Here Mobile Cover (SKU) can be used for different Mobile models. So the attrbiute - Mobile Model has multiple values configured for single SKU in manager panel using multi-dictionary metadata type.

    Now the expectation is when I select Red Color for Mobile Cover, it should populate all possible Mobile Models available for that SKU in a multi-select list box on Purchase Module.

    Please let me know if this is not clear.
  •  Tue, Aug 19 2008, 11:48 PM 10086 in reply to 10075

    Re: How to get the values for corresponding attribute form multiple select meta attribute

    Hello,

       The implementation of dependent dropdowns is in client_scripts\DynamicOptionList.js file. This script was taken from here: http://www.javascripttoolbox.com/lib/dynamicoptionlist/ 
       On that page, if you click Examples tab, you'll see example of how to use the multiple-select option list with this script.
       The code for initial filling in dropdowns is located in PurchaseModule (\PublicLayer\PublicStore\SharedModules\PurchaseModule.ascx.cs) - you'll need to adapt it to your case.

View as RSS news feed in XML
Site Terms | Privacy Policy | About Us | Contact Us
Running on Mediachase eCommerce Framework 4.0.
  Copyright © Mediachase, LTD. 1997-2006. All Rights Reserved

E-commerce, HelpDesk, Service Desk & Project Management Software, alternatives to Microsoft Project Server & Sharepoint Collaboration Server
project management software | microsoft project server | sharepoint collaboration server | issues management, helpdesk & service desk
Powered by Community Server, by Telligent Systems