Recover values from a customer attribute Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraAdding custom attribute to CustomerValues from multiselect attributeerror to add custom attributesSelect the customers logged the last day since an determinated hourStoring multi-value custom product attributeAdmin values of an attribute from filter.phtmlIs it possible to use text swatches as multiselect on category pages? (Magento 2)How to Recover a Customer Custom Attribute?addAttributeToSelect() does not work for newly created attributesRecover Data from Session Timeout

How do I check if a string is entirely made of the same substring?

Seek and ye shall find

Has a Nobel Peace laureate ever been accused of war crimes?

Why did Israel vote against lifting the American embargo on Cuba?

How to avoid introduction cliches

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

Can you stand up from being prone using Skirmisher outside of your turn?

Does Feeblemind produce an ongoing magical effect that can be dispelled?

Married in secret, can marital status in passport be changed at a later date?

What is the ongoing value of the Kanban board to the developers as opposed to management

Additive group of local rings

Are all CP/M-80 implementations binary compatible?

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

The art of proof summarizing. Are there known rules, or is it a purely common sense matter?

How to translate "red flag" into Spanish?

Why isn't everyone flabbergasted about Bran's "gift"?

What is the best way to deal with NPC-NPC combat?

What *exactly* is electrical current, voltage, and resistance?

Expansion//Explosion and Siren Stormtamer

Putting Ant-Man on house arrest

Map material from china not allowed to leave the country

Multiple fireplaces in an apartment building?

Why did C use the -> operator instead of reusing the . operator?

What to do with someone that cheated their way through university and a PhD program?



Recover values from a customer attribute



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraAdding custom attribute to CustomerValues from multiselect attributeerror to add custom attributesSelect the customers logged the last day since an determinated hourStoring multi-value custom product attributeAdmin values of an attribute from filter.phtmlIs it possible to use text swatches as multiselect on category pages? (Magento 2)How to Recover a Customer Custom Attribute?addAttributeToSelect() does not work for newly created attributesRecover Data from Session Timeout



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















hi I use this code to retrieve data from a customer's attribute called "pagamento"



if(Mage::getSingleton('customer/session')->isLoggedIn()) 

$customerId = Mage::getModel('customer/session')->getCustomer()->getId();

$customer = Mage::getModel('customer/customer')->load($customerId);
echo $customer->getpayment();


until now the attribute was a text box and returned the correct value to me.
now I have to change the attribute which will be multiple choice



if I leave the code so I get a number and not the text of the multiple choice
How can I get the text?
Furthermore, if multiple values are selected, how can I get all the results?
Thank you










share|improve this question






























    1















    hi I use this code to retrieve data from a customer's attribute called "pagamento"



    if(Mage::getSingleton('customer/session')->isLoggedIn()) 

    $customerId = Mage::getModel('customer/session')->getCustomer()->getId();

    $customer = Mage::getModel('customer/customer')->load($customerId);
    echo $customer->getpayment();


    until now the attribute was a text box and returned the correct value to me.
    now I have to change the attribute which will be multiple choice



    if I leave the code so I get a number and not the text of the multiple choice
    How can I get the text?
    Furthermore, if multiple values are selected, how can I get all the results?
    Thank you










    share|improve this question


























      1












      1








      1








      hi I use this code to retrieve data from a customer's attribute called "pagamento"



      if(Mage::getSingleton('customer/session')->isLoggedIn()) 

      $customerId = Mage::getModel('customer/session')->getCustomer()->getId();

      $customer = Mage::getModel('customer/customer')->load($customerId);
      echo $customer->getpayment();


      until now the attribute was a text box and returned the correct value to me.
      now I have to change the attribute which will be multiple choice



      if I leave the code so I get a number and not the text of the multiple choice
      How can I get the text?
      Furthermore, if multiple values are selected, how can I get all the results?
      Thank you










      share|improve this question
















      hi I use this code to retrieve data from a customer's attribute called "pagamento"



      if(Mage::getSingleton('customer/session')->isLoggedIn()) 

      $customerId = Mage::getModel('customer/session')->getCustomer()->getId();

      $customer = Mage::getModel('customer/customer')->load($customerId);
      echo $customer->getpayment();


      until now the attribute was a text box and returned the correct value to me.
      now I have to change the attribute which will be multiple choice



      if I leave the code so I get a number and not the text of the multiple choice
      How can I get the text?
      Furthermore, if multiple values are selected, how can I get all the results?
      Thank you







      magento-1.9 php attributes






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Muhammad Anas

      8241322




      8241322










      asked Dec 9 '17 at 18:57









      RiccardoRiccardo

      134




      134




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Three choices:



          1. $attributeText = $customer->getAttributeText('pagamento');

          2. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getValue($customer);

          3. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getAttribute()->getFrontendLabel();





          share|improve this answer

























          • Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

            – Riccardo
            Dec 10 '17 at 10:23











          • The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

            – PЯINCƏ
            Dec 10 '17 at 11:44











          • Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

            – Riccardo
            Dec 10 '17 at 16:17











          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%2f205192%2frecover-values-from-a-customer-attribute%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Three choices:



          1. $attributeText = $customer->getAttributeText('pagamento');

          2. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getValue($customer);

          3. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getAttribute()->getFrontendLabel();





          share|improve this answer

























          • Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

            – Riccardo
            Dec 10 '17 at 10:23











          • The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

            – PЯINCƏ
            Dec 10 '17 at 11:44











          • Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

            – Riccardo
            Dec 10 '17 at 16:17















          0














          Three choices:



          1. $attributeText = $customer->getAttributeText('pagamento');

          2. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getValue($customer);

          3. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getAttribute()->getFrontendLabel();





          share|improve this answer

























          • Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

            – Riccardo
            Dec 10 '17 at 10:23











          • The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

            – PЯINCƏ
            Dec 10 '17 at 11:44











          • Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

            – Riccardo
            Dec 10 '17 at 16:17













          0












          0








          0







          Three choices:



          1. $attributeText = $customer->getAttributeText('pagamento');

          2. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getValue($customer);

          3. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getAttribute()->getFrontendLabel();





          share|improve this answer















          Three choices:



          1. $attributeText = $customer->getAttributeText('pagamento');

          2. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getValue($customer);

          3. $attributeText = $customer->getResource()->getAttribute('pagamento')->getFrontend()->getAttribute()->getFrontendLabel();






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 9 '17 at 20:34

























          answered Dec 9 '17 at 20:21









          PЯINCƏPЯINCƏ

          8,45431147




          8,45431147












          • Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

            – Riccardo
            Dec 10 '17 at 10:23











          • The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

            – PЯINCƏ
            Dec 10 '17 at 11:44











          • Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

            – Riccardo
            Dec 10 '17 at 16:17

















          • Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

            – Riccardo
            Dec 10 '17 at 10:23











          • The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

            – PЯINCƏ
            Dec 10 '17 at 11:44











          • Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

            – Riccardo
            Dec 10 '17 at 16:17
















          Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

          – Riccardo
          Dec 10 '17 at 10:23





          Thanks for the reply the first solution gives no results the second works with the first value of multiple choice the third gives me the name of the attribute I will use the second one. Is there any way to get all the results of multiple choice?

          – Riccardo
          Dec 10 '17 at 10:23













          The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

          – PЯINCƏ
          Dec 10 '17 at 11:44





          The second one should gives you all the attribute values, check your attribute config and the selected values of this customer

          – PЯINCƏ
          Dec 10 '17 at 11:44













          Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

          – Riccardo
          Dec 10 '17 at 16:17





          Thanks for the reply. I checked and only returns the first value of the multiple selection. For example, if I select them all the first one appears, if I remove the first one the second one appears

          – Riccardo
          Dec 10 '17 at 16:17

















          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%2f205192%2frecover-values-from-a-customer-attribute%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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form