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

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

          Paypal Express Checkout without shipping addressHow to handle payment through Paypal without collecting the shipping infromation?Magento 2: Paypal Express Checkout: We can't place the orderIf Free Shipping selected then don't pass shipping address to Paypal in magento2Paypal Express Checkout redirects to cart for United StatesOpening Credit Card Tab by default using PayPal Express CheckoutPaypal express bug with country?Disable address validation for PayPal Express CheckoutPayPal Guest CheckoutMagento 1.9 - PayPal Express mixes Magento's country with PayPal's addressMagento 2: Paypal Express Checkout: We can't place the order1.9 Paypal Express get order review before redirect to paypalPaypal express checkout address fields emptyPayflow not showing PayPal Express Checkout

          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