{"id":826,"date":"2020-02-16T08:31:54","date_gmt":"2020-02-16T08:31:54","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2020\/02\/16\/load-quote-data-by-id-in-magento-2\/"},"modified":"2025-05-22T14:58:12","modified_gmt":"2025-05-22T09:28:12","slug":"load-quote-data-by-id-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/load-quote-data-by-id-in-magento-2\/","title":{"rendered":"How To Load Quote Data By Id In Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Online businesses have their share of cons and one of them is not able to bargain!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, with Magento 2, the store owner can implement this functionality too. Allow the customers to send a quote of products and negotiate the best prices feasible to both the parties.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, when the store owners do not want to disclose the prices, owing to reasons like competition, personalized product price range, etc. quotation system can be implemented.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The below code can be used in such cases when you need to load quote data by ID in Magento 2 store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a user sends a quote, use this solution to load quote data by quote ID in Magento 2 to decide the price.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method To Load Quote Data By Id In Magento 2:<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use Magento\\Quote\\Model\\QuoteFactory;\n\nprotected $quoteFactory;\n\n\npublic function __construct(QuoteFactory $quoteFactory) \n{\n    $this->quoteFactory = $quoteFactory;\n}\n\npublic function getQuote($quoteId)\n{\n    return $this->quoteFactory->create()->load($quoteId);\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the solution with fellow developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Online businesses have their share of cons and one of them is not able to bargain! However, with Magento 2, the store owner can implement&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-826","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=826"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/826\/revisions"}],"predecessor-version":[{"id":15082,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/826\/revisions\/15082"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}