2010-12-14 60 views
4

我遇到了我的magento项目的需求,因此我需要为他们购买的特定客户群提供特殊折扣。这种折扣必须显示在客户账户中,如果他们属于该特定的组,并且当用户想要使用该特定折扣时,该商品的价格必须根据该折扣提供给他们打折。特价客户群在magento的折扣

我知道如何创建一个客户群,但我怎么给他们想要的折扣并在购买时显示。以便客户可以使用它。

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

谢谢!

回答

7

既然您想要折扣显示“购买时”,请使用促销菜单中的Shopping Cart Price Rule。它可以限于某些客户群体。

一个customer's group可以通过从客户编辑自己的帐户设置>管理客户菜单,然后查看帐户信息客户群控制。

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

+0

+1 thanks !!它的工作 – PHP 2010-12-15 04:45:24

+0

这是工作功能明智..但它怎么会通知客户,他们有特别折扣?? – PHP 2010-12-16 06:14:10

+1

我能想到的唯一地方是它显示在购物车页面的总计区域 - 这是一个_shopping购物车价格规则 - 这是在产品被选定之后。要在其他地方显示,请尝试使用_Catalog Price Rule_,或者如果您有特定的位置,请在此处打开一个新问题,即stackoverflow。 – clockworkgeek 2010-12-16 11:13:14

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

?>