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,
];
}