How can i get card info along customer data? Magento2I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existWhy Getting categories and names on product view page Magento 2 fails?Magento 2 Add new field to Magento_User admin formI have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento 2: Add a product to the cart programmaticallyMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2: I Want to add multiple product using checkboxMagento 2.3 Can't view module's front end page output?Magento2 REST API get all customers details
Is this homebrew life-stealing melee cantrip unbalanced?
Does this article imply that Turing-Computability is not the same as "effectively computable"?
Identifying a transmission to myself
Why do money exchangers give different rates to different bills?
Airbnb - host wants to reduce rooms, can we get refund?
How useful are the AOA Indexers and indicators for jet pilots and civillians?
Do I really need diodes to receive MIDI?
Is it cheaper to drop cargo than to land it?
Why is Arya visibly scared in the library in S8E3?
Upside-Down Pyramid Addition...REVERSED!
What is a "listed natural gas appliance"?
Returning the outputs of a nested structure
Identifying my late father's D&D stuff found in the attic
How to give very negative feedback gracefully?
Theorem won't go to multiple lines and is causing text to run off the page
How did Arya get her dagger back from Sansa?
Unknowingly ran an infinite loop in terminal
I may be a fraud
Roll Dice to get a random number between 1 and 150
Why wasn't the Night King naked in S08E03?
Can Ghost kill White Walkers or Wights?
Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?
Why is ‘eines’ used in the sentence ‘Eines gleich vorweg’?
Should I replace my bicycle tires if they have not been inflated in multiple years
How can i get card info along customer data? Magento2
I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?main.CRITICAL: Plugin class doesn't existWhy Getting categories and names on product view page Magento 2 fails?Magento 2 Add new field to Magento_User admin formI have created an extension to show Customer Company Name in Order grid. But when creating new order, order is not showing in order gridMagento 2: Add a product to the cart programmaticallyMagento 2 Create dynamic array From different Model Collection to use in multi select in gridMagento 2: I Want to add multiple product using checkboxMagento 2.3 Can't view module's front end page output?Magento2 REST API get all customers details
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I get informational cards, but I need to show it to the customer, for example, to show a specific product, name, price, and the customer which bought this product.
Getting cart info
class Index extends MagentoFrameworkViewElementTemplate
public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoCheckoutModelCart $cart,
array $data = []
)
$this->cart = $cart;
parent::__construct($context, $data);
public function getCartInfo()
return $this->cart->getQuote()->getItemsCollection();
Can somebody help?
magento2
add a comment |
I get informational cards, but I need to show it to the customer, for example, to show a specific product, name, price, and the customer which bought this product.
Getting cart info
class Index extends MagentoFrameworkViewElementTemplate
public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoCheckoutModelCart $cart,
array $data = []
)
$this->cart = $cart;
parent::__construct($context, $data);
public function getCartInfo()
return $this->cart->getQuote()->getItemsCollection();
Can somebody help?
magento2
add a comment |
I get informational cards, but I need to show it to the customer, for example, to show a specific product, name, price, and the customer which bought this product.
Getting cart info
class Index extends MagentoFrameworkViewElementTemplate
public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoCheckoutModelCart $cart,
array $data = []
)
$this->cart = $cart;
parent::__construct($context, $data);
public function getCartInfo()
return $this->cart->getQuote()->getItemsCollection();
Can somebody help?
magento2
I get informational cards, but I need to show it to the customer, for example, to show a specific product, name, price, and the customer which bought this product.
Getting cart info
class Index extends MagentoFrameworkViewElementTemplate
public function __construct(
MagentoBackendBlockTemplateContext $context,
MagentoCheckoutModelCart $cart,
array $data = []
)
$this->cart = $cart;
parent::__construct($context, $data);
public function getCartInfo()
return $this->cart->getQuote()->getItemsCollection();
Can somebody help?
magento2
magento2
edited yesterday
Robinio Tor
asked Apr 27 at 11:38
Robinio TorRobinio Tor
30711
30711
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try this
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
foreach($items as $item)
echo 'ID: '.$item->getProductId().'<br />';
echo 'Name: '.$item->getName().'<br />';
echo 'Sku: '.$item->getSku().'<br />';
echo 'Quantity: '.$item->getQty().'<br />';
echo 'Price: '.$item->getPrice().'<br />';
echo "<br />";
/* get customer details */
$customer=$cart->getQuote()->getCustomer();
$Customerid = $customer->getId();
$Customeremail = $customer->getEmail();
$Customer_firstname = $customer->getFirstname();
$Customer_lastname = $customer->getLastname();
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
|
show 6 more comments
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%2f272677%2fhow-can-i-get-card-info-along-customer-data-magento2%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
Try this
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
foreach($items as $item)
echo 'ID: '.$item->getProductId().'<br />';
echo 'Name: '.$item->getName().'<br />';
echo 'Sku: '.$item->getSku().'<br />';
echo 'Quantity: '.$item->getQty().'<br />';
echo 'Price: '.$item->getPrice().'<br />';
echo "<br />";
/* get customer details */
$customer=$cart->getQuote()->getCustomer();
$Customerid = $customer->getId();
$Customeremail = $customer->getEmail();
$Customer_firstname = $customer->getFirstname();
$Customer_lastname = $customer->getLastname();
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
|
show 6 more comments
Try this
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
foreach($items as $item)
echo 'ID: '.$item->getProductId().'<br />';
echo 'Name: '.$item->getName().'<br />';
echo 'Sku: '.$item->getSku().'<br />';
echo 'Quantity: '.$item->getQty().'<br />';
echo 'Price: '.$item->getPrice().'<br />';
echo "<br />";
/* get customer details */
$customer=$cart->getQuote()->getCustomer();
$Customerid = $customer->getId();
$Customeremail = $customer->getEmail();
$Customer_firstname = $customer->getFirstname();
$Customer_lastname = $customer->getLastname();
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
|
show 6 more comments
Try this
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
foreach($items as $item)
echo 'ID: '.$item->getProductId().'<br />';
echo 'Name: '.$item->getName().'<br />';
echo 'Sku: '.$item->getSku().'<br />';
echo 'Quantity: '.$item->getQty().'<br />';
echo 'Price: '.$item->getPrice().'<br />';
echo "<br />";
/* get customer details */
$customer=$cart->getQuote()->getCustomer();
$Customerid = $customer->getId();
$Customeremail = $customer->getEmail();
$Customer_firstname = $customer->getFirstname();
$Customer_lastname = $customer->getLastname();
Try this
$itemsCollection = $cart->getQuote()->getItemsCollection();
// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();
// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
foreach($items as $item)
echo 'ID: '.$item->getProductId().'<br />';
echo 'Name: '.$item->getName().'<br />';
echo 'Sku: '.$item->getSku().'<br />';
echo 'Quantity: '.$item->getQty().'<br />';
echo 'Price: '.$item->getPrice().'<br />';
echo "<br />";
/* get customer details */
$customer=$cart->getQuote()->getCustomer();
$Customerid = $customer->getId();
$Customeremail = $customer->getEmail();
$Customer_firstname = $customer->getFirstname();
$Customer_lastname = $customer->getLastname();
edited Apr 27 at 12:06
answered Apr 27 at 11:44
ARUNPRABAKARAN MARUNPRABAKARAN M
641114
641114
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
|
show 6 more comments
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
How can i get customer name or id for each cart information ?
– Robinio Tor
Apr 27 at 11:49
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
I need to get Customer (name or id )with his cart info
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
In backend, thanks for answer
– Robinio Tor
Apr 27 at 11:51
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
Check my updated code. I have added getting customer details
– ARUNPRABAKARAN M
Apr 27 at 12:07
1
1
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
$customer=$cart->getQuote()->getCustomer();. You can get customer details only for logged in user, otherwise, you can able to get customer details. It's not a bad answer. Kindly check with logged in user. it works fine
– ARUNPRABAKARAN M
yesterday
|
show 6 more comments
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%2f272677%2fhow-can-i-get-card-info-along-customer-data-magento2%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