我不知道是否有Ubercart Guru在这里,但这是我的问题:

我想为订购更多相同产品的订购更多的客户折扣。

可以说价格如下:

1个产品 - 每个产品$ 5
<10产品 - 每种$ 4.50
<100种产品 - 每种$ 4

有人知道如何意识到这一点吗?我想到了添加自己的自定义价格字段,但我想知道如何在购物车 /结帐中呼吁它们。

有帮助吗?

解决方案

怎么样 uc_bulk_discount 模块?

其他提示

我不是大师,但是有些谷歌搜索我指向hook_uc_uc_price_handler。

您可以设置一个处理程序来处理价格。

如果您有一个称为“示例”的自定义模块,则可以执行以下操作;

function example_uc_price_handler() {
  return array(
    'alter' => array(
      'title' => t('Quantity price discount handler'),
      'description' => t('Discounts the price based on quantity ordered'),
      'callback' => 'example_price_alterer',
    ),
  );
}

function example_price_alterer(&$price_info, $context, $options = array()){

    if($price_info['qty'] > 200){
        $price_info['price'] *= 0.8;  //we're reducing the price by 20% as a demo - add your logic here 
    }

}

这是我的消息来源;

http://www.ubercart.org/docs/developer/11375/price_api http://www.ubercart.org/forum/development/14381/price_alteration_hook http://api.ubercart.org/api/function/hook_uc_uc_price_handler/2

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top