Question

I met with a requirement for my magento project, according this I need to provide special discount to specific customer group on their purchase. This discount must be shown in customer account,if they belong to that particular group, and when user want to use that particular discount, price of that item must be discounted according to that discount offer to them.

I know how to create a customer group, but how can I give them desired discount and make it show at time of purchase. so that customer can use it.

please suggest me any method or refer any document.

Thanks!

Was it helpful?

Solution

Since you want a discount to show "at time of purchase", use a Shopping Cart Price Rule from the Promotions menu. It can be restricted to certain customer groups.

A customer's group can be set by editing their account from Customers > Manage Customers menu, then look in Account Information for the Customer Group control.

The links I gave are both from the Magento User Guide. Please read it all.
http://www.magentocommerce.com/wiki/welcome_to_the_magento_user_s_guide/welcome_to_the_magento_user_s_guide

OTHER TIPS

<?php
/**
 * Get the resource model
 */
$resource = Mage::getSingleton('core/resource');

/**
 * Retrieve the read connection
 */
$readConnection = $resource->getConnection('core_read');

/**
 * Retrieve current users groupId
 */
$currentUserGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();

/**
 *  Creating the custom query to fetch coupons
 */
$query =    '
                SELECT sr.rule_id, sr.name, sr.is_active, src.code, src.expiration_date
                FROM `salesrule` sr
                JOIN `salesrule_coupon` src ON (sr.`rule_id` = src.`rule_id`)
                JOIN `salesrule_customer_group` scg ON(scg.`rule_id` = src.`rule_id`)
                where scg.customer_group_id = '.$currentUserGroupId.'
                AND sr.is_active = 1
                AND (  ( src.expiration_date is null ) or ( src.expiration_date > now() ) )
            ';
//store result set in $rules
$rules = $readConnection->fetchAll($query);

// $rules will contain the array of all the coupons available to the current user


// This array contains all the data required
print_r($rules);

?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top