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;
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
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
add a comment |
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
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
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
add a comment |
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
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
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
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
magento2.3 quoteitem
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.
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
add a comment |
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.
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
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%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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
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%2f280540%2fget-data-from-quote-items-table-in-magento-2%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
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