Magento – Get tiered price by customer group id

customer-groupmagento-1.9tierprice

I'm writing a maintenance script to tidy up unused customer group tiered prices. How can I programatically get either:
All products that have a tiered price for the selected customer group and then delete the tiered price for that group
OR
Check if a product has a tiered price for the selected customer group and then delete the tiered price for that group.

Bear in mind I don't know the quantity, only the group id so I can't use getTierPrice() as that needs a quantity.

How do I delete the tiered price? Can I just use setTierPrice() and set the price and quantity to 0?

Best Answer

$roleId = Mage::getSingleton('customer/session')->getCustomerGroupId();
$TierPrice = $product->getData('tier_price');
$customer_grouptier = array_column($TierPrice, 'price','cust_group');
$customer_tier = $customer_grouptier[$roleId]; 

$product is the product Object.

More information click below. Getting Current Customer Group Price, and Tier Price

Related Topic