There is a special customer group named A which has it's own special catalog rules and group prices. I am going to display final price of another customer group named B for A users. How can I get final price of another customer group which is not for the current user?
1 Answer
$now = Mage::getSingleton('core/date')->timestamp(time());
$websiteId = Mage::app()->getStore()->getWebsiteId();
$customerGroup = 4;
$new = Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);
var_dump($new);
Or :
$product = Mage::getModel('catalog/product')->load($id);
$group = Mage::getModel('customer/group')->load($code, 'customer_group_code');
//get group price
$product->setCustomerGroupId($group->getId());
$price = $product->getGroupPrice();
//get main price
$product->setCustomerGroupId(null);
$price = $product->getPrice();
-
Thanks. My answer was in the link you mentioned. I should call setCustomerGroupId for product object and get another customer group price. Mar 2, 2020 at 9:34
-