0

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
$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();

source

| improve this answer | |
  • Thanks. My answer was in the link you mentioned. I should call setCustomerGroupId for product object and get another customer group price. – Alee Rezaee Mar 2 at 9:34
  • I updated my answer, thanks – PЯINCƏ Mar 2 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.