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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form