测试下单过程中,优惠券问题

bug问题 · Chen · 于 3年前 发布 · 1738 次阅读

 in E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\View.php at line 257 – yii\base\View::renderPhpFile('E:\phpStudy\PHPTutorial\WWW\fecs...', ['shippings' => [['method' => 'free_shipping', 'label' => 'Free shipping( 7-20 work days)', 'name' => 'HKBRAM', 'cost' => '0.00', ...], ['method' => 'middle_shipping', 'label' => 'middle shipping( 6-15 work days)', 'name' => 'HKBRAM', 'cost' => '2.52', ...]], 'cart_info' => ['coupon_available' => null, 'coupon_unavailable' => null, 'coupon_selected' => null, 'cart_id' => '1', ...], 'currency_info' => ['code' => 'CNY', 'rate' => '6.3', 'symbol' => '¥'], 'default_address' => fecyo\models\mysqldb\customer\Address, ...]) 

后台菜单:商城管理》用户》用户优惠券

Http status: 500 Internal Server Error
ajaxOptions: error
thrownError: Internal Server Error

Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'Child Service [coupon_type_percent] is not find in fecyo\services\Coupon, you must config it! ' 

in E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\fancyecommerce\fecshop\services\Service.php:79

Stack trace:
#0 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\fancyecommerce\fecshop\services\Service.php(38): fecshop\services\Service->getChildService('coupon_type_per...')
#1 E:\phpStudy\PHPTutorial\WWW\fecshop\addons\fecmall\fecyo\app\appadmin\modules\Customer\block\coupon\Manager.php(43): fecshop\services\Service->__get('coupon_type_per...')
#2 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\BaseObject.php(109): fecyo\app\appadmin\modules\Customer\block\coupon\Manager->init()
#3 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\fancyecommerce\fecshop\app\appadmin\modules\AppadminController.php(167): yii\base\BaseObject->__construct()
#4 E:\phpStudy\PHPTutorial\WWW\fecshop\addons\fecmall\fecyo\app\appadmin\modules\Customer\controllers\CouponController.php(25): fecshop\app\appadmin\modules\AppadminController->getBlock()
#5 [internal function]: fecyo\app\appadmin\modules\Customer\controllers\CouponController->actionManager()
#6 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#7 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#8 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\Module.php(528): yii\base\Controller->runAction('manager', Array)
#9 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('customer/coupon...', Array)
#10 E:\phpStudy\PHPTutorial\WWW\fecshop\vendor\yiisoft\yii2\base\Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#11 E:\phpStudy\PHPTutorial\WWW\fecshop\appadmin\web\index.php(50): yii\base\Application->run()
#12 {main}

另外:安装fecmall时的初始密码最小数量不是六位,虽然问题不大,但还是反馈下,嘻嘻

共收到 6 条回复 fecshop
Fecmall#13年前 0 个赞

1.报错信息写道标题里面

2.多个报错,分开发帖,方便搜索

3.count($cart_info['coupon_available']),这个本身就是个数组,demo测试无报错,检查代码也是个数组, 你是不是开启了游客下单导致的?fecyo不能开启游客下单。

出现问题,先自行debug找找原因,追踪下代码。

4.fecyo后台优惠券,你使用的是fecmall的优惠券,在fecyo的那个废弃掉了,下个版本将隐藏掉这个菜单,请使用Fecyo开发的优惠券,菜单位置:后台菜单管理 用户上面的优惠券菜单

Chen#23年前 0 个赞

@Fecmall #1楼 哈哈,谢谢你的指点,但是真的十分抱歉,有心无力,能力不够啊。。 我没有开启游客购买哦。

Fecmall#33年前 0 个赞

你加个断点,var_dump()打印一下看看这个值是什么类型。

count()函数里面的参数,只能是array或者支持的object对象

Chen#43年前 0 个赞

@Fecmall #3楼 上面不是显示为null么

Chen#53年前 0 个赞

@Fecmall #3楼

老哥,你下午可能没看到我2楼的贴图,我刚刚debug下了流程代码,发现如果用户在优惠券里无任何领取记录,会返回Null,贴上修改代码,以供参考。

fecshop\addons\fecmall\fecyo\services\coupon\Customer.php 534行 取消返回null

// 得到用户可用的优惠券列表。
        $customerActiveCoupons = $this->getCustomerActiveCouponList($customerId);
        if (!is_array($customerActiveCoupons) || empty($customerActiveCoupons)) {
            
         //   return null;
        }
Fecmall#63年前 0 个赞

1.论坛回帖,只给大概的思路方向,发帖子的时候,如果debug一下,找出来核心点,一开始发帖子就把这个贴出来,问题会更容易发现。

本人不可能去细致的去看每个点,基本就是半分钟扫帖子内容,你可能不理解,一年365天论坛回帖子后,可能就理解了

2.多谢提交该bug,已经修复,已经发版,fecmall后台应用管理部分,升级一下fecyo即可.

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