Just another WordPress.com weblog

// Add the attribute code here.
// Checking if the attribute is either select or multiselect type.
// Getting all the sources (options)
$options = $attribute->getSource()->getAllOptions(false);
// print as label-value pair
echo '<pre>'. print_r($options) .'</pre>';

– Bijal Bhavsar 🙂


Comments on: "Get Attribute options and values" (2)

  1. Anupama said:

    Hi Bijal..

    Its useful to me .. thanks .. keep writing

  2. This will get the option value and is much simpler:


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: