优惠券使用条件问题

问题咨询 · wooecshop · 于 6年前 发布 · 3658 次阅读

vendor\fancyecommerce\fecshop\services\cart\Coupon.php 下面代码: if ($conditions <= $dc_price) 是不是应该修改成: if ($conditions >= $dc_price)

我看文档: http://www.fecshop.com/doc/fecshop-guide/instructions/cn-1.0/guide-fecshop_coupon.html 表示总价格$dc_price是应该大于多少才使用吧? 而不是小于总价.


protected function actionGetDiscount($coupon_code, $dc_price)
    {
        $discount_cost = 0;
        $this->useCouponInit($coupon_code);
        if ($this->couponIsActive()) {
            $couponModel = $this->getCouponModel();
            $type = $couponModel['type'];
            $conditions = $couponModel['conditions'];
            $discount = $couponModel['discount'];
            //echo $conditions.'##'.$dc_price;;exit;
            if ($conditions <= $dc_price) {
                if ($type == 1) { // 百分比
                    $base_discount_cost = $discount / 100 * $dc_price;
                } elseif ($type == 2) { // 直接折扣
                    $base_discount_cost = $dc_price - $discount;
                }
                $curr_discount_cost = Yii::$service->page->currency->getCurrentCurrencyPrice($base_discount_cost);
            }
        }

        return [
            'baseCost' => $base_discount_cost,
            'currCost' => $curr_discount_cost,
        ];
    }
共收到 3 条回复
Fecmall#16年前 0 个赞

if ($conditions <= $dc_price) {}

1.$conditions是coupon使用最低价

2.$dc_price购物车产品总价

3.coupon使用最低价 <= 购物车产品总价

哪里有问题? 如果改成

修改成: if ($conditions >= $dc_price) 

这不是我一分钱的东西都满足上面的条件?

wooecshop#26年前 1 个赞

是我看错了

Fecmall#36年前 0 个赞

@wooecshop #2楼 Fecshop的优惠券实现的比较简单,优惠券的使用次数没有和具体账号绑定,因此,只要这个人知道优惠卷码,可以在开一个账户使用

不过,对于小站来说,并没有太大影响,原因:

1.优惠券有过期时间,一般做活动很快就不能用了

2.优惠券可以设置最大使用次数(也就是所有人的使用次数),因此使用在总体上可控

3.买家之间,是无法交流的,因此不会做到快速的散播,自能自己用

4.即使买家又开了几个账户使用优惠券,也没啥太大的问题,顶多不赚钱,或者亏一点点。

如果需要强有力的绑定到具体的账户,需要自己扩展了。

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics