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;








1















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










share|improve this question






























    1















    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










    share|improve this question


























      1












      1








      1








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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




















          1 Answer
          1






          active

          oldest

          votes


















          1














          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.






          share|improve this answer























          • 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













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









          1














          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.






          share|improve this answer























          • 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















          1














          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.






          share|improve this answer























          • 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













          1












          1








          1







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          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%2f279908%2fgetting-null-on-quote-collection-by-reserved-order-id%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

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?