Get the tire price of a product in magento2

For each product could be possible to set the price level in magento2. It is called tire prices. If need to get a product tire price based on the customer. We could use this method

$tireItem = $objectManager->create('Magento\Catalog\Api\ScopedProductTierPriceManagementInterface');
                                $customer = $objectManager->create('Magento\Customer\Model\Session');
                                $customerGroupId = $customer->getCustomer()->getGroupId();
                                $tierPrice = $tireItem->getList($_product->getSku(), $customerGroupId);
                                $quoteBlock = $block->getLayout()->createBlock('Sibonne\Quote\Block\Quote');

                                if (count($tierPrice)) {
                                    foreach ($tierPrice as $item) {
                                        $specialPrice = $item->getValue();
                                    }
                                }

Here we are fetching the tire price based on the customer.

Thank you.

Leave a comment

Your email address will not be published. Required fields are marked *