{"id":587,"date":"2019-09-18T07:15:43","date_gmt":"2019-09-18T07:15:43","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/09\/18\/get-price-range-of-bundle-products-in-magento-2\/"},"modified":"2025-05-22T15:58:52","modified_gmt":"2025-05-22T10:28:52","slug":"get-price-range-of-bundle-products-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/get-price-range-of-bundle-products-in-magento-2\/","title":{"rendered":"How to Get the Price Range of Bundle Products in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-admin\/catalog\/products\/types\/product-create-bundle\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Bundled Product<\/a>&nbsp;is a composite product that has a number of simple or virtual products. The price of bundled products can be either a dynamic or fixed value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a fixed price for a bundle product, you can enter a base price with applied taxes for it.&nbsp;For the dynamic price, enter the price range from least expensive to the most expensive price.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, when you are selling such bundled products on multiple sales channels such as <a href=\"https:\/\/meetanshi.com\/magento-2-facebook-shop-integration.html\" target=\"_blank\" rel=\"noreferrer noopener\">Facebook store<\/a> where you can display only one price. At that time, you either show the minimum or the maximum price for which you need to <strong>get the price range of bundle products in Magento 2<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The below programmatic method gives the code for the same.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Get the Price Range of Bundle Products 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=\"\">&lt;?php\nnamespace [Vendor]\\[Module]\\Helper;\n\nuse Magento\\Framework\\App\\Helper\\Context;\nuse Magento\\Catalog\\Model\\Product;\n\nclass Data extends AbstractHelper\n{\n    protected $product;\n\n    public function __construct(\n        Context $context,\n        Product $product\n    )\n    {\n        $this->product = $product;\n        parent::__construct($context);\n    }\n\n    public function getPrice($productId)\n    {\n     $productObj = $this->product->load($productId);\n\n    $finalPrice   = $productObj->getPriceInfo()->getPrice('final_price')->getValue();\n    $minimumPrice = $productObj->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();\n    $maximumPrice = $productObj->getPriceInfo()->getPrice('final_price')->getMaximalPrice()->getValue();\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s how you get the bundle product price in Magento 2.<\/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>Magento 2 Bundled Product&nbsp;is a composite product that has a number of simple or virtual products. The price of bundled products can be either a&#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-587","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/587","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=587"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/587\/revisions"}],"predecessor-version":[{"id":15267,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/587\/revisions\/15267"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}