Get values of your attribute option text from productgetAttributeText() use default value regardless what store view the user is onCustom Option text field value from order idGet store view attribute value from collectionAdmin values of an attribute from filter.phtmlUnable to get product attribute value store wise,Get multiple select attribute valuesHow to get custom product attributeMagento 2: How to get value from attribute from store_id 0 (admin/unique)?how to get catalog products filtering attribute code magento 1.9?Change store attribute option value to display in product edit magento 1
What happens to the Time Stone
How could a planet have most of its water in the atmosphere?
Missed the connecting flight, separate tickets on same airline - who is responsible?
Why wasn't the Night King naked in S08E03?
Should one double the thirds or the fifth in chords?
How can I support myself financially as a 17 year old with a loan?
Where can I go to avoid planes overhead?
What are the differences between credential stuffing and password spraying?
Transpose of product of matrices
Is it cheaper to drop cargo than to land it?
Is induction neccessary for proving that every injective mapping of a finite set into itself is a mapping onto itself?
Quoting Yourself
Is there a term for the words whose stress is on the first syllable?
Identifying a transmission to myself
In Endgame, why were these characters still around?
For a benzene shown in a skeletal structure, what does a substituent to the center of the ring mean?
Identifying my late father's D&D stuff found in the attic
Manager is threatning to grade me poorly if I don't complete the project
How useful are the AOA Indexers and indicators for jet pilots and civillians?
Can fracking help reduce CO2?
Pressure inside an infinite ocean?
In a vacuum triode, what prevents the grid from acting as another anode?
60s (or earlier) SF short story with FTL Travel using electron psychology aka addiclenendar technology
SQL Server Management Studio SSMS 18.0 General Availability release (GA) install fails
Get values of your attribute option text from product
getAttributeText() use default value regardless what store view the user is onCustom Option text field value from order idGet store view attribute value from collectionAdmin values of an attribute from filter.phtmlUnable to get product attribute value store wise,Get multiple select attribute valuesHow to get custom product attributeMagento 2: How to get value from attribute from store_id 0 (admin/unique)?how to get catalog products filtering attribute code magento 1.9?Change store attribute option value to display in product edit magento 1
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option.
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id,'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
$attributeText = $product->getAttributeText('my_attribute');
I am always getting value of default store view.
magento-1.9 product-attribute store-view attribute-options
add a comment |
I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option.
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id,'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
$attributeText = $product->getAttributeText('my_attribute');
I am always getting value of default store view.
magento-1.9 product-attribute store-view attribute-options
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41
add a comment |
I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option.
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id,'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
$attributeText = $product->getAttributeText('my_attribute');
I am always getting value of default store view.
magento-1.9 product-attribute store-view attribute-options
I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option.
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id,'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
$attributeText = $product->getAttributeText('my_attribute');
I am always getting value of default store view.
magento-1.9 product-attribute store-view attribute-options
magento-1.9 product-attribute store-view attribute-options
edited Oct 16 '17 at 9:43
user00247
asked Oct 16 '17 at 9:28
user00247user00247
344219
344219
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41
add a comment |
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41
add a comment |
3 Answers
3
active
oldest
votes
Create a function getAttributeAdminLabel() in your block and call this on page where you want.
$storeId = 1; //add you store id
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
echo $attributeText = $this->getAttributeAdminLabel('my_attribute', $product);
function getAttributeAdminLabel($attributeCode, $product)
$entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, $attributeCode);
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setAttributeFilter($attributeModel->getId())
->setStoreFilter(0)
->load();
foreach ($_collection->toOptionArray() as $_cur_option)
if ($_cur_option['value'] == $product->getMyAttribute())
return $_cur_option['label'];
return $item->getLabel();
add a comment |
Try This:
Mage::getResourceSingleton('catalog/product')->load($product_id)
->getAttribute('color')
->getSource()->getOptionText($customer->getColor());
add a comment |
$productAttribute = $product->getResource()->getAttribute('my_attribute');
$attriuteValue = $productAttribute->setStoreId($store_id)
->getSource()
->getOptionText($product->getData('my_attribute'));
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f197403%2fget-values-of-your-attribute-option-text-from-product%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Create a function getAttributeAdminLabel() in your block and call this on page where you want.
$storeId = 1; //add you store id
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
echo $attributeText = $this->getAttributeAdminLabel('my_attribute', $product);
function getAttributeAdminLabel($attributeCode, $product)
$entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, $attributeCode);
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setAttributeFilter($attributeModel->getId())
->setStoreFilter(0)
->load();
foreach ($_collection->toOptionArray() as $_cur_option)
if ($_cur_option['value'] == $product->getMyAttribute())
return $_cur_option['label'];
return $item->getLabel();
add a comment |
Create a function getAttributeAdminLabel() in your block and call this on page where you want.
$storeId = 1; //add you store id
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
echo $attributeText = $this->getAttributeAdminLabel('my_attribute', $product);
function getAttributeAdminLabel($attributeCode, $product)
$entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, $attributeCode);
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setAttributeFilter($attributeModel->getId())
->setStoreFilter(0)
->load();
foreach ($_collection->toOptionArray() as $_cur_option)
if ($_cur_option['value'] == $product->getMyAttribute())
return $_cur_option['label'];
return $item->getLabel();
add a comment |
Create a function getAttributeAdminLabel() in your block and call this on page where you want.
$storeId = 1; //add you store id
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
echo $attributeText = $this->getAttributeAdminLabel('my_attribute', $product);
function getAttributeAdminLabel($attributeCode, $product)
$entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, $attributeCode);
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setAttributeFilter($attributeModel->getId())
->setStoreFilter(0)
->load();
foreach ($_collection->toOptionArray() as $_cur_option)
if ($_cur_option['value'] == $product->getMyAttribute())
return $_cur_option['label'];
return $item->getLabel();
Create a function getAttributeAdminLabel() in your block and call this on page where you want.
$storeId = 1; //add you store id
$attribute_option_id = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'my_attribute', $storeId);
$product = Mage::getModel('catalog/product')
->setStoreId($storeId)
->setData('my_attribute', $attribute_option_id);
echo $attributeText = $this->getAttributeAdminLabel('my_attribute', $product);
function getAttributeAdminLabel($attributeCode, $product)
$entityType = Mage::getModel('eav/config')->getEntityType('catalog_product');
$attributeModel = Mage::getModel('eav/entity_attribute')->loadByCode($entityType, $attributeCode);
$_collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
->setAttributeFilter($attributeModel->getId())
->setStoreFilter(0)
->load();
foreach ($_collection->toOptionArray() as $_cur_option)
if ($_cur_option['value'] == $product->getMyAttribute())
return $_cur_option['label'];
return $item->getLabel();
edited Oct 17 '17 at 9:05
Vivek
17013
17013
answered Oct 17 '17 at 8:48
RanipriyankaRanipriyanka
38616
38616
add a comment |
add a comment |
Try This:
Mage::getResourceSingleton('catalog/product')->load($product_id)
->getAttribute('color')
->getSource()->getOptionText($customer->getColor());
add a comment |
Try This:
Mage::getResourceSingleton('catalog/product')->load($product_id)
->getAttribute('color')
->getSource()->getOptionText($customer->getColor());
add a comment |
Try This:
Mage::getResourceSingleton('catalog/product')->load($product_id)
->getAttribute('color')
->getSource()->getOptionText($customer->getColor());
Try This:
Mage::getResourceSingleton('catalog/product')->load($product_id)
->getAttribute('color')
->getSource()->getOptionText($customer->getColor());
answered Oct 17 '17 at 9:22
Yogesh AgarwalYogesh Agarwal
717416
717416
add a comment |
add a comment |
$productAttribute = $product->getResource()->getAttribute('my_attribute');
$attriuteValue = $productAttribute->setStoreId($store_id)
->getSource()
->getOptionText($product->getData('my_attribute'));
add a comment |
$productAttribute = $product->getResource()->getAttribute('my_attribute');
$attriuteValue = $productAttribute->setStoreId($store_id)
->getSource()
->getOptionText($product->getData('my_attribute'));
add a comment |
$productAttribute = $product->getResource()->getAttribute('my_attribute');
$attriuteValue = $productAttribute->setStoreId($store_id)
->getSource()
->getOptionText($product->getData('my_attribute'));
$productAttribute = $product->getResource()->getAttribute('my_attribute');
$attriuteValue = $productAttribute->setStoreId($store_id)
->getSource()
->getOptionText($product->getData('my_attribute'));
answered Nov 21 '18 at 23:45
AndrejAndrej
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f197403%2fget-values-of-your-attribute-option-text-from-product%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try again with remove $storeid from your script.
– Aasim Goriya
Oct 16 '17 at 9:36
I tried using below snippet but still receiveing default store view value: $product = Mage::getModel('catalog/product')->load($product_id); $attributeText=$product->getAttributeText('my_attribute');
– user00247
Oct 16 '17 at 9:41