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;








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




















          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?