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;








2















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. enter image description here










share|improve this question
























  • 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


















2















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. enter image description here










share|improve this question
























  • 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














2












2








2








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. enter image description here










share|improve this question
















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. enter image description here







magento-1.9 product-attribute store-view attribute-options






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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


















  • 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











3 Answers
3






active

oldest

votes


















0














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();






share|improve this answer
































    0














    Try This:



    Mage::getResourceSingleton('catalog/product')->load($product_id)
    ->getAttribute('color')
    ->getSource()->getOptionText($customer->getColor());





    share|improve this answer






























      0














      $productAttribute = $product->getResource()->getAttribute('my_attribute');

      $attriuteValue = $productAttribute->setStoreId($store_id)
      ->getSource()
      ->getOptionText($product->getData('my_attribute'));





      share|improve this answer























        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
        );



        );













        draft saved

        draft discarded


















        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









        0














        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();






        share|improve this answer





























          0














          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();






          share|improve this answer



























            0












            0








            0







            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();






            share|improve this answer















            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();







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 17 '17 at 9:05









            Vivek

            17013




            17013










            answered Oct 17 '17 at 8:48









            RanipriyankaRanipriyanka

            38616




            38616























                0














                Try This:



                Mage::getResourceSingleton('catalog/product')->load($product_id)
                ->getAttribute('color')
                ->getSource()->getOptionText($customer->getColor());





                share|improve this answer



























                  0














                  Try This:



                  Mage::getResourceSingleton('catalog/product')->load($product_id)
                  ->getAttribute('color')
                  ->getSource()->getOptionText($customer->getColor());





                  share|improve this answer

























                    0












                    0








                    0







                    Try This:



                    Mage::getResourceSingleton('catalog/product')->load($product_id)
                    ->getAttribute('color')
                    ->getSource()->getOptionText($customer->getColor());





                    share|improve this answer













                    Try This:



                    Mage::getResourceSingleton('catalog/product')->load($product_id)
                    ->getAttribute('color')
                    ->getSource()->getOptionText($customer->getColor());






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Oct 17 '17 at 9:22









                    Yogesh AgarwalYogesh Agarwal

                    717416




                    717416





















                        0














                        $productAttribute = $product->getResource()->getAttribute('my_attribute');

                        $attriuteValue = $productAttribute->setStoreId($store_id)
                        ->getSource()
                        ->getOptionText($product->getData('my_attribute'));





                        share|improve this answer



























                          0














                          $productAttribute = $product->getResource()->getAttribute('my_attribute');

                          $attriuteValue = $productAttribute->setStoreId($store_id)
                          ->getSource()
                          ->getOptionText($product->getData('my_attribute'));





                          share|improve this answer

























                            0












                            0








                            0







                            $productAttribute = $product->getResource()->getAttribute('my_attribute');

                            $attriuteValue = $productAttribute->setStoreId($store_id)
                            ->getSource()
                            ->getOptionText($product->getData('my_attribute'));





                            share|improve this answer













                            $productAttribute = $product->getResource()->getAttribute('my_attribute');

                            $attriuteValue = $productAttribute->setStoreId($store_id)
                            ->getSource()
                            ->getOptionText($product->getData('my_attribute'));






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 21 '18 at 23:45









                            AndrejAndrej

                            1




                            1



























                                draft saved

                                draft discarded
















































                                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.




                                draft saved


                                draft discarded














                                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





















































                                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







                                Popular posts from this blog

                                Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                                Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?