Getting Null on Quote Collection by Reserved Order IdMagento 2 : How to Save Quote Data after order placedUnit Test for overwrite collection class in magento2How to add filtering to custom table field column in Customers admin grid in Magento2?Magento 2.1 Create a filter in the product grid by new attributeGet item collection by sku Magento 2Having trouble exporting products from Magento 2.x. Fatal error: Uncaught Error: Call to a member function getName()Magento 2: Add a product to the cart programmaticallyMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?Magento 2 : Only dependency assignment operations are allowed in constructor. No other operations are allowedMagento 2.3 email attachment not working while sending custom email
Chilling juice in copper vessel
What is the highest level of accuracy in motion control a Victorian society could achieve?
Why do most airliners have underwing engines, while business jets have rear-mounted engines?
Do I need transit visa for Dublin?
What's the difference between a type and a kind?
I'm feeling like my character doesn't fit the campaign
How would a sea turtle end up on its back?
How to deal with a Murder Hobo Paladin?
How to factor a fourth degree polynomial
Alternative to Willpower in Fighting Cravings
As a supervisor, what feedback would you expect from a PhD who quits?
Can I Ready an attack action to trigger when the target Blinks back to the Material plane?
Why would "dead languages" be the only languages that spells could be written in?
Multi-user CRUD: Valid, Problem, or Error?
Why is there paternal, for fatherly, fraternal, for brotherly, but no similar word for sons?
Do grungs have a written language?
How do I check that users don't write down their passwords?
What is the meaning of "prairie-dog" in this sentence?
Did Stalin kill all Soviet officers involved in the Winter War?
Better random (unique) file name
How to delete multiple process id of a single process?
Wouldn't putting an electronic key inside a small Faraday cage render it completely useless?
Why does this function pointer assignment work when assigned directly but not with the conditional operator?
Is this car delivery via Ebay Motors on Craigslist a scam?
Getting Null on Quote Collection by Reserved Order Id
Magento 2 : How to Save Quote Data after order placedUnit Test for overwrite collection class in magento2How to add filtering to custom table field column in Customers admin grid in Magento2?Magento 2.1 Create a filter in the product grid by new attributeGet item collection by sku Magento 2Having trouble exporting products from Magento 2.x. Fatal error: Uncaught Error: Call to a member function getName()Magento 2: Add a product to the cart programmaticallyMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?Magento 2 : Only dependency assignment operations are allowed in constructor. No other operations are allowedMagento 2.3 email attachment not working while sending custom email
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to get quote data By
reserved_order_id
I tried this code
protected $_quoteFactory;
public function __construct(
MagentoQuoteModelResourceModelQuoteCollectionFactory $quoteFactory
)
$this->_quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->_quoteFactory->create()->addFieldToFilter('reserved_order_id', $orderId);
$quote = $this->_quoteFactory->create()->addFieldToFilter('entity_id', 12);
$quote = $this->_quoteFactory->create()->addFieldToFilter('base_subtotal_with_discount', 20.0000);
the first filter is returning null while entity_id
and base_subtotal_with_discount
is returning me the correct result
I tried all of them separately
magento2 php magento2.3
add a comment |
I am trying to get quote data By
reserved_order_id
I tried this code
protected $_quoteFactory;
public function __construct(
MagentoQuoteModelResourceModelQuoteCollectionFactory $quoteFactory
)
$this->_quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->_quoteFactory->create()->addFieldToFilter('reserved_order_id', $orderId);
$quote = $this->_quoteFactory->create()->addFieldToFilter('entity_id', 12);
$quote = $this->_quoteFactory->create()->addFieldToFilter('base_subtotal_with_discount', 20.0000);
the first filter is returning null while entity_id
and base_subtotal_with_discount
is returning me the correct result
I tried all of them separately
magento2 php magento2.3
add a comment |
I am trying to get quote data By
reserved_order_id
I tried this code
protected $_quoteFactory;
public function __construct(
MagentoQuoteModelResourceModelQuoteCollectionFactory $quoteFactory
)
$this->_quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->_quoteFactory->create()->addFieldToFilter('reserved_order_id', $orderId);
$quote = $this->_quoteFactory->create()->addFieldToFilter('entity_id', 12);
$quote = $this->_quoteFactory->create()->addFieldToFilter('base_subtotal_with_discount', 20.0000);
the first filter is returning null while entity_id
and base_subtotal_with_discount
is returning me the correct result
I tried all of them separately
magento2 php magento2.3
I am trying to get quote data By
reserved_order_id
I tried this code
protected $_quoteFactory;
public function __construct(
MagentoQuoteModelResourceModelQuoteCollectionFactory $quoteFactory
)
$this->_quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->_quoteFactory->create()->addFieldToFilter('reserved_order_id', $orderId);
$quote = $this->_quoteFactory->create()->addFieldToFilter('entity_id', 12);
$quote = $this->_quoteFactory->create()->addFieldToFilter('base_subtotal_with_discount', 20.0000);
the first filter is returning null while entity_id
and base_subtotal_with_discount
is returning me the correct result
I tried all of them separately
magento2 php magento2.3
magento2 php magento2.3
edited Jun 30 at 2:02
Raj Mohan R
1,3983 silver badges12 bronze badges
1,3983 silver badges12 bronze badges
asked Jun 27 at 11:11
Waqar AliWaqar Ali
13612 bronze badges
13612 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
First of all, check this below collection and make sure that your reserved order should be unique.
If your if condition will be true then, records available othervise, records not available :
protected $quoteFactory;
public function __construct(
MagentoQuoteModelQuoteFactory $quoteFactory
)
$this->quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->quoteFactory->create()->getCollection()->->addFieldToFilter('reserved_order_id', 'Your Order id')->getFirstItem();
if($quote->getId())
// quote id found
else
// quote id not found
Hope, It will be helpful for you.
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
thank you its working fine now
– Waqar Ali
yesterday
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%2f279908%2fgetting-null-on-quote-collection-by-reserved-order-id%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
First of all, check this below collection and make sure that your reserved order should be unique.
If your if condition will be true then, records available othervise, records not available :
protected $quoteFactory;
public function __construct(
MagentoQuoteModelQuoteFactory $quoteFactory
)
$this->quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->quoteFactory->create()->getCollection()->->addFieldToFilter('reserved_order_id', 'Your Order id')->getFirstItem();
if($quote->getId())
// quote id found
else
// quote id not found
Hope, It will be helpful for you.
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
thank you its working fine now
– Waqar Ali
yesterday
add a comment |
First of all, check this below collection and make sure that your reserved order should be unique.
If your if condition will be true then, records available othervise, records not available :
protected $quoteFactory;
public function __construct(
MagentoQuoteModelQuoteFactory $quoteFactory
)
$this->quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->quoteFactory->create()->getCollection()->->addFieldToFilter('reserved_order_id', 'Your Order id')->getFirstItem();
if($quote->getId())
// quote id found
else
// quote id not found
Hope, It will be helpful for you.
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
thank you its working fine now
– Waqar Ali
yesterday
add a comment |
First of all, check this below collection and make sure that your reserved order should be unique.
If your if condition will be true then, records available othervise, records not available :
protected $quoteFactory;
public function __construct(
MagentoQuoteModelQuoteFactory $quoteFactory
)
$this->quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->quoteFactory->create()->getCollection()->->addFieldToFilter('reserved_order_id', 'Your Order id')->getFirstItem();
if($quote->getId())
// quote id found
else
// quote id not found
Hope, It will be helpful for you.
First of all, check this below collection and make sure that your reserved order should be unique.
If your if condition will be true then, records available othervise, records not available :
protected $quoteFactory;
public function __construct(
MagentoQuoteModelQuoteFactory $quoteFactory
)
$this->quoteFactory = $quoteFactory;
public function execute(Observer $observer)
$quote = $this->quoteFactory->create()->getCollection()->->addFieldToFilter('reserved_order_id', 'Your Order id')->getFirstItem();
if($quote->getId())
// quote id found
else
// quote id not found
Hope, It will be helpful for you.
answered Jun 30 at 9:24
Rohan HapaniRohan Hapani
7,5664 gold badges19 silver badges65 bronze badges
7,5664 gold badges19 silver badges65 bronze badges
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
thank you its working fine now
– Waqar Ali
yesterday
add a comment |
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
thank you its working fine now
– Waqar Ali
yesterday
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
i checked my database there was a quote with reserved_order_id 0000082 i excuted following code having order_id = 82 i am still getting null
– Waqar Ali
Jul 1 at 10:05
1
1
thank you its working fine now
– Waqar Ali
yesterday
thank you its working fine now
– Waqar Ali
yesterday
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%2f279908%2fgetting-null-on-quote-collection-by-reserved-order-id%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