Fecmall

第 2 位会员

会员
个人信息
  • 加入于 2017-05-31 17:38:45
  • 城市 Qingdao
  • GitHub https://github.com/fecshop
  • 最后登录时间 2天前
  • 签名 净化自己,潜心编码
个人简介
Terry,Fecmall开源产品作者,12年电商经验一线程序员开发者,擅长规划产品,架构设计。
个人成就
  • 发表文章次数 744
  • 发布回复次数 5760
  • 个人主页浏览次数 683
Fecyo 中文单商户B2C商城 左侧导航菜单,点击只有一级导航菜单时 点击后 页面没有反应4年前

http://fecyo.fecshop.com/cn/shirts

这个目前,是这个样子,只能点击一级分类下的子分类,如果一级分类下面没有子分类就没法点击了

这个我记录一下吧,后面优化一下这个地方。

fecbbc,请问 订单号:$increment_id 是用哪个函数获取的?4年前

这样就不会走 @fecshop\app\apphtml5\modules\Payment\PaymentController.php 里面的init方法了

fecbbc,请问 订单号:$increment_id 是用哪个函数获取的?4年前

更改下面的两个文件:

@fecshop\app\apphtml5\modules\Payment\controllers\Wxpayh5Controller.php

<?php
/**
 * FecShop file.
 *
 * @link http://www.fecshop.com/
 * @copyright Copyright (c) 2016 FecShop Software LLC
 * @license http://www.fecshop.com/license/
 */

namespace fecshop\app\apphtml5\modules\Payment\controllers;

use Yii;
use fecshop\app\apphtml5\modules\AppfrontController;

/**
 * @author Terry Zhao <2358269014@qq.com>
 * @since 1.0
 */
class Wxpayh5Controller extends AppfrontController
{
    public $enableCsrfValidation = false;
    protected $_increment_id;
    protected $_order_model;
    
    
    public function initFunc()
    {
        $homeUrl = Yii::$service->url->homeUrl();
        $this->_increment_id = Yii::$service->order->getSessionIncrementId();
        if (!$this->_increment_id) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }

        $this->_order_model = Yii::$service->order->GetByIncrementId($this->_increment_id);
        if (!isset($this->_order_model['increment_id'])) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }
    }
    
    /**
     * 支付开始页面.
     */
    public function actionStart()
    {
        $this->initFunc();
        //Yii::$service->page->theme->layoutFile = 'wxpay_jsapi.php';
        $objectxml = Yii::$service->payment->wxpayH5->getScanCodeStart();
        //var_dump($objectxml);
        $returnUrl =  Yii::$service->payment->getStandardReturnUrl(); 
        $return_Url = urlencode($returnUrl);
        $url = $objectxml['mweb_url'] . '&redirect_url=' . $return_Url;
        
        //echo $url;
        return Yii::$service->url->redirect($url);
        
    }
    
    
    public function actionReview()
    {
        $this->initFunc();
        $out_trade_no = Yii::$service->order->getSessionIncrementId();
        $reviewStatus = Yii::$service->payment->wxpay->scanCodeCheckTradeIsSuccess($out_trade_no);
        if($reviewStatus){
            $successRedirectUrl = Yii::$service->payment->getStandardSuccessRedirectUrl();
            return Yii::$service->url->redirect($successRedirectUrl);
        }else{
            $errors = Yii::$service->helper->errors->get('<br/>');
            $data = [
                'errors' => $errors,
            ];
            return $this->render($this->action->id, $data);
        }
    }
    
    /**
     * IPN消息推送地址
     * IPN过来后,不清除session中的 increment_id ,也不清除购物车
     * 仅仅是更改订单支付状态。
     */
    public function actionIpn()
    {
        Yii::$service->payment->wxpay->ipn();
    }

    /** 废弃
     *  成功支付页面.
     */
    public function actionSuccess()
    {
        $this->initFunc();
        $data = [
            'increment_id' => $this->_increment_id,
        ];
        // 清理购物车中的产品。(游客用户的购物车在成功页面清空)
        if (Yii::$app->user->isGuest) {
            Yii::$service->cart->clearCartProductAndCoupon();
        }
        // 清理session中的当前的increment_id
        Yii::$service->order->removeSessionIncrementId();

        return $this->render('../../payment/checkmoney/success', $data);
    }

    
}

@fecshop\app\apphtml5\modules\Payment\controllers\WxpayjsapiController.php

<?php
/**
 * FecShop file.
 *
 * @link http://www.fecshop.com/
 * @copyright Copyright (c) 2016 FecShop Software LLC
 * @license http://www.fecshop.com/license/
 */

namespace fecshop\app\apphtml5\modules\Payment\controllers;

use fecshop\app\apphtml5\modules\AppfrontController;
use Yii;

/**
 * @author Terry Zhao <2358269014@qq.com>
 * @since 1.0
 */
class WxpayjsapiController extends AppfrontController
{
    public $enableCsrfValidation = false;
    protected $_increment_id;
    protected $_order_model;
    
    
    public function initFunc()
    {
        $homeUrl = Yii::$service->url->homeUrl();
        $this->_increment_id = Yii::$service->order->getSessionIncrementId();
        if (!$this->_increment_id) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }

        $this->_order_model = Yii::$service->order->GetByIncrementId($this->_increment_id);
        if (!isset($this->_order_model['increment_id'])) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }
    }
    /**
     * 支付开始页面.
     */
    public function actionStart()
    {
        $this->initFunc();
        Yii::$service->page->theme->layoutFile = 'wxpay_jsapi.php';
        $data = Yii::$service->payment->wxpayJsApi->getScanCodeStart();
        $data['success_url'] = Yii::$service->payment->getStandardSuccessRedirectUrl();
        return $this->render($this->action->id, $data);
        
    }
    
    /**
     * IPN消息推送地址
     * IPN过来后,不清除session中的 increment_id ,也不清除购物车
     * 仅仅是更改订单支付状态。
     */
    public function actionIpn()
    {
        Yii::$service->payment->wxpay->ipn();
    }

    /** 废弃
     *  成功支付页面.
     */
    public function actionSuccess()
    {
        $this->initFunc();
        $data = [
            'increment_id' => $this->_increment_id,
        ];
        // 清理购物车中的产品。(游客用户的购物车在成功页面清空)
        if (Yii::$app->user->isGuest) {
            Yii::$service->cart->clearCartProductAndCoupon();
        }
        // 清理session中的当前的increment_id
        Yii::$service->order->removeSessionIncrementId();

        return $this->render('../../payment/checkmoney/success', $data);
    }

    
}

fecbbc,请问 订单号:$increment_id 是用哪个函数获取的?4年前

我好像清楚你的问题了,稍等我改一下,你测试试试

fecbbc,请问 订单号:$increment_id 是用哪个函数获取的?4年前

废弃,指的是在fecbbc这个扩展里面废弃了

@fecbbc\app\apphtml5\modules\Payment\controllers\Wxpayh5Controller.php

交易订单号,不是这里读取的吗

public function initFunc()
    {
        $homeUrl = Yii::$service->url->homeUrl();
        $this->_trade_no = Yii::$service->order->getSessionTradeNo();
        if (!$this->_trade_no) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }

        $this->_order_models = Yii::$service->order->getOrderModelsByTradeNo($this->_trade_no);
        if (!is_array($this->_order_models) || empty($this->_order_models)) {
            Yii::$service->url->redirect($homeUrl);
            exit;
        }
    }

$this->_trade_no = Yii::$service->order->getSessionTradeNo();

订单编辑报错4年前

代码没有问题,自己去搜索解决

订单编辑报错4年前

@fecshop/app/appadmin/modules/Sales/block/orderinfo/Manageredit.php:26

头部改为

<?php
/**
 * FecShop file.
 *
 * @link http://www.fecshop.com/
 * @copyright Copyright (c) 2016 FecShop Software LLC
 * @license http://www.fecshop.com/license/
 */

namespace fecshop\app\appadmin\modules\Sales\block\orderinfo;

use fec\helpers\CUrl;
use Yii;
use yii\base\BaseObject;

/**
 * block cms\article.
 * @author Terry Zhao <2358269014@qq.com>
 * @since 1.0
 */
class Manageredit extends BaseObject
{
count(): Parameter must be an array or an object that implements Countable4年前

@green945 #3楼 解决了问题,请写明你是怎么解决的。

count(): Parameter must be an array or an object that implements Countable4年前

redis 购物车,是fecmall开源系统的插件

目前fecro还没有redis购物车支持,请自行二开。

去掉redis,试试是否还报错。

count(): Parameter must be an array or an object that implements Countable4年前

1.@fecro/app/appfront/theme/fecro/checkout/onepage/index/coupon.php

将报错的地方改成下面的代码:

<ul class="coupon-tab clearfix">
            <li class="tab-item usable active">
                <?= Yii::$service->page->translate->__('Available'); ?>
                <span> (<?= is_array($coupon_list['coupon_available']) ? count($coupon_list['coupon_available'])  : 0 ?>) </span>
                <span></span>
            </li>
            <li class="tab-item unusable">
                <?= Yii::$service->page->translate->__('Unavailable'); ?>
                <span> (<?= is_array($coupon_list['coupon_unavailable']) ? count($coupon_list['coupon_unavailable']) : 0  ?>) </span>
                <span></span>
            </li>
        </ul>

2.@fecro/app/apphtml5/theme/fecro/checkout/onepage/index/coupon.php

将报错的地方改成下面的代码:

<ul class="coupon-tab clearfix">
            <li class="tab-item usable active">
                <?= Yii::$service->page->translate->__('Available'); ?>
                <span> (<?= is_array($coupon_list['coupon_available']) ? count($coupon_list['coupon_available'])  : 0 ?>) </span>
                <span></span>
            </li>
            <li class="tab-item unusable">
                <?= Yii::$service->page->translate->__('Unavailable'); ?>
                <span> (<?= is_array($coupon_list['coupon_unavailable']) ? count($coupon_list['coupon_unavailable']) : 0  ?>) </span>
                <span></span>
            </li>
        </ul>

apphtml5部分类似的解决方式

facebook login 申请 app_id 和 app_secret 4年前

之前整理了文档

Fecmall facebook login 申请 app_id 和 app_secret

Fecmall google login api 申请 CLIENT_SECRET 和 CLIENT_SECRET

不过,这个文档大致是一年前整理的,可能fb和google界面改版

您参考一下吧。

微信公众号支付4年前

代码在你手里,还感觉个甚,去debug啊,猜个甚!!

不用这怀疑,那猜测,去debug代码

好了,该说的都说了

结帖。

Fecro体验中遇到的问题4年前

@minfans #6楼 后续在说吧,目前先这样。

微信公众号支付4年前

@dream #9楼 您自己debug代码找原因吧。

Your Site Analytics