how to export product Advance pricing in Magento 2 Currently, I am using profiler to export product price but I didn't get Advance pricing so how can I export Advance pricing store wise in Magento 2 If any programmatically script and any tool then let me know fast. Thank you.
1 Answer
Hii Please use this code to get tier price
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_obj = $objectManager->create('Magento\Catalog\Model\Product')->load(1);
$tier_price = $product_obj->getTierPrice();
if(count($tier_price) > 0){
foreach($tier_price as $pirces){
foreach ( array_reverse($pirces) as $k => $v ) {
if($k == "price"){
$tp = number_format($v, 2, '.', '');
echo $tp;
}
}
}
}
-
Thank you I use this code it's working but multiple customer group price can't get and when tire price is empty in product then print price so how can i sorted it.. Jan 9, 2020 at 11:58