I have changed the price scheme based on customer group by percentage. So here I do the trick for the product

if ($group->getCode() == "High ST. Shops") {

    $percent = 100 - $_product->getHighstshopPerc();
    $percent = "0." . $percent;
    $srrp = $_product->getPrice() * $percent;
    echo "Your Price £" . number_format($srrp, 2, '.', '');

Now I need getPrice() to come from price.php already with my new scheme so it adds to cart correctly. I tried the code below but i cant get getCode() to give me customer group so I can calculate/override getPrice

public function getPrice($product)
//$groupId    = Mage::getSingleton('customer/session')->getCustomerGroupId();
//$group      = Mage::getModel('customer/group')->load($groupId);

    //return $product->getData('price');
    //return $product->getTradePerc();
    //echo $product->getCode(); exit();
    if ($product->getCode() == "NOT LOGGED IN")
    return 1;
    else return 2;

Did you think about, to just create a cart rule to give customer groups discount?

  • will have a look into it, it may do what I need. Cheers Sep 27 '14 at 16:45

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.