magento 中特定客户群的折扣

发布于 2024-10-08 04:23:00 字数 210 浏览 3 评论 0原文

我遇到了我的 magento 项目的要求,根据这个要求,我需要为特定客户群的购买提供特别折扣。如果客户属于该特定组,则该折扣必须显示在客户帐户中,并且当用户想要使用该特定折扣时,该商品的价格必须根据向他们提供的折扣优惠进行折扣。

我知道如何创建客户群,但如何给予他们所需的折扣并使其在购买时显示。以便客户可以使用它。

请建议我任何方法或参考任何文件。

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浴红衣 2024-10-15 04:23:00

由于您希望“购买时”显示折扣,请使用购物车促销菜单中的价格规则。它可以仅限于某些客户群体。

客户组可以通过从客户>编辑他们的帐户来设置。 “管理客户”菜单,然后在“帐户信息”中查找“客户组”控件。

我给出的链接都来自 Magento 用户指南。请全部阅读。
http://www.magentocommerce.com/wiki/welcome_to_the_magento_user_s_guide/welcome_to_the_magento_user_s_guide

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

榕城若虚 2024-10-15 04:23:00
<?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);

?>
<?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);

?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文