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;
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
add a comment |
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
add a comment |
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
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
magento-1.9 php attributes
edited 2 days ago
Muhammad Anas
8241322
8241322
asked Dec 9 '17 at 18:57
RiccardoRiccardo
134
134
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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();
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
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%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
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();
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
add a comment |
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();
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
add a comment |
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();
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();
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
add a comment |
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
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%2f205192%2frecover-values-from-a-customer-attribute%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