Get data from Quote_items table in Magento 2magento 2 - getCreatedAt() returns UTC time and not local timeGet Store Information Magento 2.3.0Magento 2.3.0 Get product attribute name in phtml in CMS BlockMagento 2.3 Readiness Check FailingMagento 2: Snippets for call (get) product attributes incl. helper via if statement in phtml to get the values in custom tab in product pageCall external API on billing step of CheckoutMagento 2 read custom xml file from third party server and load it in our magento siteHow can I have a product attribute with a source model as a swatch?Have no any image and data after install magento 2.3How to display data from 2 tables that already have data on Magento 2.3Display data from Quote_item error

Did the Vulgar Latin verb "toccare" exist?

Keep milk (or milk alternative) for a day without a fridge

How to convert a file with several spaces into a tab-delimited file?

Machine learning and operations research projects

Combining latex input and sed

Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?

Is anyone advocating the promotion of homosexuality in UK schools?

Cracking the Coding Interview — 1.5 One Away

Need help identifying planes, near Toronto

Constructive proof of existence of free algebras for infinitary equational theories

For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?

Is there any word for "disobedience to God"?

How would vampires avoid contracting diseases?

Mysterious Metal Plate on Basement Ceiling?

Integer Lists of Noah

Credit score and financing new car

Terry Pratchett book with a lawyer dragon and sheep

Why are Hobbits so fond of mushrooms?

What is this triple-transistor arrangement called?

Can fluent English speakers distinguish “steel”, “still” and “steal”?

Using Newton's shell theorem to accelerate a spaceship

QGIS Zanzibar how to crop?

Referring to different instances of the same character in time travel

Why do players in the past play much longer tournaments than today's top players?



Get data from Quote_items table in Magento 2


magento 2 - getCreatedAt() returns UTC time and not local timeGet Store Information Magento 2.3.0Magento 2.3.0 Get product attribute name in phtml in CMS BlockMagento 2.3 Readiness Check FailingMagento 2: Snippets for call (get) product attributes incl. helper via if statement in phtml to get the values in custom tab in product pageCall external API on billing step of CheckoutMagento 2 read custom xml file from third party server and load it in our magento siteHow can I have a product attribute with a source model as a swatch?Have no any image and data after install magento 2.3How to display data from 2 tables that already have data on Magento 2.3Display data from Quote_item error






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








0















I am new to Magento 2 so I do not understand much about select data from the table in Localhost also which file I need to create



I want to display data from Quote_item table



enter image description here



in the .phtml file, and What I need to do in Block and xml file



If anyone can help me step by step, it's very useful for me










share|improve this question
























  • where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

    – user4536
    Jul 3 at 4:36











  • I already updated my question. Could you please check it again.

    – Kite Hany
    Jul 3 at 4:40

















0















I am new to Magento 2 so I do not understand much about select data from the table in Localhost also which file I need to create



I want to display data from Quote_item table



enter image description here



in the .phtml file, and What I need to do in Block and xml file



If anyone can help me step by step, it's very useful for me










share|improve this question
























  • where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

    – user4536
    Jul 3 at 4:36











  • I already updated my question. Could you please check it again.

    – Kite Hany
    Jul 3 at 4:40













0












0








0








I am new to Magento 2 so I do not understand much about select data from the table in Localhost also which file I need to create



I want to display data from Quote_item table



enter image description here



in the .phtml file, and What I need to do in Block and xml file



If anyone can help me step by step, it's very useful for me










share|improve this question
















I am new to Magento 2 so I do not understand much about select data from the table in Localhost also which file I need to create



I want to display data from Quote_item table



enter image description here



in the .phtml file, and What I need to do in Block and xml file



If anyone can help me step by step, it's very useful for me







magento2.3 quoteitem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 3 at 4:39







Kite Hany

















asked Jul 3 at 4:24









Kite HanyKite Hany

609 bronze badges




609 bronze badges












  • where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

    – user4536
    Jul 3 at 4:36











  • I already updated my question. Could you please check it again.

    – Kite Hany
    Jul 3 at 4:40

















  • where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

    – user4536
    Jul 3 at 4:36











  • I already updated my question. Could you please check it again.

    – Kite Hany
    Jul 3 at 4:40
















where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

– user4536
Jul 3 at 4:36





where you want to display quote_item data?? and you need item of specific quote or all the item of quote_item table?

– user4536
Jul 3 at 4:36













I already updated my question. Could you please check it again.

– Kite Hany
Jul 3 at 4:40





I already updated my question. Could you please check it again.

– Kite Hany
Jul 3 at 4:40










2 Answers
2






active

oldest

votes


















2














You can get data of quote_item table using MagentoQuoteModelResourceModelQuoteItemCollection collection class like this..



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteItemCollection = $objectManager->create('MagentoQuoteModelResourceModelQuoteItemCollection');

foreach ($quoteItemCollection as $quoteItem)

echo $quoteItem->getName();
echo $quoteItem->getProductId();
......



I am not recommend you to use object manager instead inject this collecton class in block class of this phtml file and use it here.






share|improve this answer























  • Thank you for your comment. But I when I display the time is wrong

    – Kite Hany
    Jul 3 at 6:49











  • Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

    – Kite Hany
    Jul 3 at 7:17












  • yes because you will got localhost time converted into GMT Time.

    – user4536
    Jul 3 at 9:28






  • 1





    this might be help you magento.stackexchange.com/a/221314/66058

    – user4536
    Jul 3 at 9:30



















1














You can get quote item collection by quote id using this below way :



protected $quoteFactory;

public function __construct(
.....
MagentoQuoteModelQuoteFactory $quoteFactory
......
)
$this->quoteFactory = $quoteFactory;


public function yourFunction()

$quote = $this->quoteFactory->create()->load($quoteId);
$items = $quote->getAllItems();
foreach ($items as $item)

echo $item->getId()."<br>";
echo $item->getName()."<br>";
echo $item->getProductId()."<br>";




Now, print $items. You'll get data.
Hope, it will helpful for you.






share|improve this answer























  • Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

    – Kite Hany
    Jul 3 at 6:41











  • Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

    – Rohan Hapani
    Jul 3 at 6:47











  • Yes, I know. But I need your help so I think yes

    – Kite Hany
    Jul 3 at 6:50











  • For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

    – Rohan Hapani
    Jul 3 at 6:55













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%2f280540%2fget-data-from-quote-items-table-in-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














You can get data of quote_item table using MagentoQuoteModelResourceModelQuoteItemCollection collection class like this..



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteItemCollection = $objectManager->create('MagentoQuoteModelResourceModelQuoteItemCollection');

foreach ($quoteItemCollection as $quoteItem)

echo $quoteItem->getName();
echo $quoteItem->getProductId();
......



I am not recommend you to use object manager instead inject this collecton class in block class of this phtml file and use it here.






share|improve this answer























  • Thank you for your comment. But I when I display the time is wrong

    – Kite Hany
    Jul 3 at 6:49











  • Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

    – Kite Hany
    Jul 3 at 7:17












  • yes because you will got localhost time converted into GMT Time.

    – user4536
    Jul 3 at 9:28






  • 1





    this might be help you magento.stackexchange.com/a/221314/66058

    – user4536
    Jul 3 at 9:30
















2














You can get data of quote_item table using MagentoQuoteModelResourceModelQuoteItemCollection collection class like this..



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteItemCollection = $objectManager->create('MagentoQuoteModelResourceModelQuoteItemCollection');

foreach ($quoteItemCollection as $quoteItem)

echo $quoteItem->getName();
echo $quoteItem->getProductId();
......



I am not recommend you to use object manager instead inject this collecton class in block class of this phtml file and use it here.






share|improve this answer























  • Thank you for your comment. But I when I display the time is wrong

    – Kite Hany
    Jul 3 at 6:49











  • Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

    – Kite Hany
    Jul 3 at 7:17












  • yes because you will got localhost time converted into GMT Time.

    – user4536
    Jul 3 at 9:28






  • 1





    this might be help you magento.stackexchange.com/a/221314/66058

    – user4536
    Jul 3 at 9:30














2












2








2







You can get data of quote_item table using MagentoQuoteModelResourceModelQuoteItemCollection collection class like this..



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteItemCollection = $objectManager->create('MagentoQuoteModelResourceModelQuoteItemCollection');

foreach ($quoteItemCollection as $quoteItem)

echo $quoteItem->getName();
echo $quoteItem->getProductId();
......



I am not recommend you to use object manager instead inject this collecton class in block class of this phtml file and use it here.






share|improve this answer













You can get data of quote_item table using MagentoQuoteModelResourceModelQuoteItemCollection collection class like this..



$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteItemCollection = $objectManager->create('MagentoQuoteModelResourceModelQuoteItemCollection');

foreach ($quoteItemCollection as $quoteItem)

echo $quoteItem->getName();
echo $quoteItem->getProductId();
......



I am not recommend you to use object manager instead inject this collecton class in block class of this phtml file and use it here.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jul 3 at 4:55









user4536user4536

3281 silver badge15 bronze badges




3281 silver badge15 bronze badges












  • Thank you for your comment. But I when I display the time is wrong

    – Kite Hany
    Jul 3 at 6:49











  • Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

    – Kite Hany
    Jul 3 at 7:17












  • yes because you will got localhost time converted into GMT Time.

    – user4536
    Jul 3 at 9:28






  • 1





    this might be help you magento.stackexchange.com/a/221314/66058

    – user4536
    Jul 3 at 9:30


















  • Thank you for your comment. But I when I display the time is wrong

    – Kite Hany
    Jul 3 at 6:49











  • Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

    – Kite Hany
    Jul 3 at 7:17












  • yes because you will got localhost time converted into GMT Time.

    – user4536
    Jul 3 at 9:28






  • 1





    this might be help you magento.stackexchange.com/a/221314/66058

    – user4536
    Jul 3 at 9:30

















Thank you for your comment. But I when I display the time is wrong

– Kite Hany
Jul 3 at 6:49





Thank you for your comment. But I when I display the time is wrong

– Kite Hany
Jul 3 at 6:49













Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

– Kite Hany
Jul 3 at 7:17






Look in localhost time like this 08:58:35 but when I display in my .phtml file like this 01:58:35, 08 and 01?? I do not know why

– Kite Hany
Jul 3 at 7:17














yes because you will got localhost time converted into GMT Time.

– user4536
Jul 3 at 9:28





yes because you will got localhost time converted into GMT Time.

– user4536
Jul 3 at 9:28




1




1





this might be help you magento.stackexchange.com/a/221314/66058

– user4536
Jul 3 at 9:30






this might be help you magento.stackexchange.com/a/221314/66058

– user4536
Jul 3 at 9:30














1














You can get quote item collection by quote id using this below way :



protected $quoteFactory;

public function __construct(
.....
MagentoQuoteModelQuoteFactory $quoteFactory
......
)
$this->quoteFactory = $quoteFactory;


public function yourFunction()

$quote = $this->quoteFactory->create()->load($quoteId);
$items = $quote->getAllItems();
foreach ($items as $item)

echo $item->getId()."<br>";
echo $item->getName()."<br>";
echo $item->getProductId()."<br>";




Now, print $items. You'll get data.
Hope, it will helpful for you.






share|improve this answer























  • Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

    – Kite Hany
    Jul 3 at 6:41











  • Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

    – Rohan Hapani
    Jul 3 at 6:47











  • Yes, I know. But I need your help so I think yes

    – Kite Hany
    Jul 3 at 6:50











  • For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

    – Rohan Hapani
    Jul 3 at 6:55















1














You can get quote item collection by quote id using this below way :



protected $quoteFactory;

public function __construct(
.....
MagentoQuoteModelQuoteFactory $quoteFactory
......
)
$this->quoteFactory = $quoteFactory;


public function yourFunction()

$quote = $this->quoteFactory->create()->load($quoteId);
$items = $quote->getAllItems();
foreach ($items as $item)

echo $item->getId()."<br>";
echo $item->getName()."<br>";
echo $item->getProductId()."<br>";




Now, print $items. You'll get data.
Hope, it will helpful for you.






share|improve this answer























  • Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

    – Kite Hany
    Jul 3 at 6:41











  • Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

    – Rohan Hapani
    Jul 3 at 6:47











  • Yes, I know. But I need your help so I think yes

    – Kite Hany
    Jul 3 at 6:50











  • For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

    – Rohan Hapani
    Jul 3 at 6:55













1












1








1







You can get quote item collection by quote id using this below way :



protected $quoteFactory;

public function __construct(
.....
MagentoQuoteModelQuoteFactory $quoteFactory
......
)
$this->quoteFactory = $quoteFactory;


public function yourFunction()

$quote = $this->quoteFactory->create()->load($quoteId);
$items = $quote->getAllItems();
foreach ($items as $item)

echo $item->getId()."<br>";
echo $item->getName()."<br>";
echo $item->getProductId()."<br>";




Now, print $items. You'll get data.
Hope, it will helpful for you.






share|improve this answer













You can get quote item collection by quote id using this below way :



protected $quoteFactory;

public function __construct(
.....
MagentoQuoteModelQuoteFactory $quoteFactory
......
)
$this->quoteFactory = $quoteFactory;


public function yourFunction()

$quote = $this->quoteFactory->create()->load($quoteId);
$items = $quote->getAllItems();
foreach ($items as $item)

echo $item->getId()."<br>";
echo $item->getName()."<br>";
echo $item->getProductId()."<br>";




Now, print $items. You'll get data.
Hope, it will helpful for you.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jul 3 at 4:58









Rohan HapaniRohan Hapani

7,6874 gold badges21 silver badges65 bronze badges




7,6874 gold badges21 silver badges65 bronze badges












  • Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

    – Kite Hany
    Jul 3 at 6:41











  • Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

    – Rohan Hapani
    Jul 3 at 6:47











  • Yes, I know. But I need your help so I think yes

    – Kite Hany
    Jul 3 at 6:50











  • For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

    – Rohan Hapani
    Jul 3 at 6:55

















  • Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

    – Kite Hany
    Jul 3 at 6:41











  • Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

    – Rohan Hapani
    Jul 3 at 6:47











  • Yes, I know. But I need your help so I think yes

    – Kite Hany
    Jul 3 at 6:50











  • For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

    – Rohan Hapani
    Jul 3 at 6:55
















Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

– Kite Hany
Jul 3 at 6:41





Firstly thank you for your comment, but I think I need to create Block, xml file and then I want to display in .phtml file, maybe that is more clear for me. Can you help me that thing?

– Kite Hany
Jul 3 at 6:41













Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

– Rohan Hapani
Jul 3 at 6:47





Object Manager direct use is not good practise. You need to add this answer in your block file and then, need to call function in phtml file. Should I give you all steps?

– Rohan Hapani
Jul 3 at 6:47













Yes, I know. But I need your help so I think yes

– Kite Hany
Jul 3 at 6:50





Yes, I know. But I need your help so I think yes

– Kite Hany
Jul 3 at 6:50













For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

– Rohan Hapani
Jul 3 at 6:55





For that, you can take reference from here. Still, if you have any confusion. Then, you can ask here. rohanhapani.com/create-a-simple-module-in-magento-2

– Rohan Hapani
Jul 3 at 6:55

















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%2f280540%2fget-data-from-quote-items-table-in-magento-2%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