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;








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?










share|improve this question






























    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?










    share|improve this question


























      0












      0








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday







      Robinio Tor

















      asked Apr 27 at 11:38









      Robinio TorRobinio Tor

      30711




      30711




















          1 Answer
          1






          active

          oldest

          votes


















          -2














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





          share|improve this answer

























          • 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











          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%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









          -2














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





          share|improve this answer

























          • 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















          -2














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





          share|improve this answer

























          • 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













          -2












          -2








          -2







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





          share|improve this answer















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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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

















          • 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

















          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%2f272677%2fhow-can-i-get-card-info-along-customer-data-magento2%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