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
How to reclaim personal item I've lent to the office without burning bridges?
How to delete multiple process id of a single process?
Why does mean tend be more stable in different samples than median?
Is this car delivery via Ebay Motors on Craigslist a scam?
Any way to meet code with 40.7% or 40.44% conduit fill?
How predictable is $RANDOM really?
Do grungs have a written language?
Why would "dead languages" be the only languages that spells could be written in?
What is the shape of the upper boundary of water hitting a screen?
Attach a visible light telescope to the outside of the ISS
How to get the speed of my spaceship?
How to say "just a precision" properly in English?
Can a USB hub be used to access a drive from two devices?
Taking advantage when HR forgets to communicate the rules
Removing polygon holes in OpenLayers
Shipped package arrived - didn't order, possible scam?
Passwordless authentication - how invalidate login code
Can I Ready an attack action to trigger when the target Blinks back to the Material plane?
What are some bad ways to subvert tropes?
Possibility to correct pitch from digital versions of records with the hole not centered
Is reasonable to assume that the 食 in 月食/日食 can be interpreted as the sun/moon being "eaten" during an eclipse?
How to deal with a Murder Hobo Paladin?
Multi-user CRUD: Valid, Problem, or Error?
How do I talk to my wife about unrealistic expectations?
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,3963 silver badges12 bronze badges
1,3963 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