Authored by Rock Zhang

添加购物车未登录用户的登陆链接地址,修复未登录用户添加商品时设置shopping_key错误的bug

Code Review By Rock Zhang
... ... @@ -31,7 +31,7 @@
<p class="login-info">
<span class="iconfont">&#xe628;</span>
请您先
<a class="btn btn-login">登录</a>
<a class="btn btn-login" href="{{signurl}}">登录</a>
可以同步电脑和手机中的商品
</p>
{{/if}}
... ...
... ... @@ -54,6 +54,7 @@ class CartModel
// 用户是否登录
if (empty($uid)) {
$result['signurl'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/cart/index/index')));
$result['showLoginInfo'] = true;
}
... ... @@ -63,7 +64,7 @@ class CartModel
// 处理普通购物车和预售购物车的数据
do {
if (!isset($cartData['data']) || empty($cartData['data'])) {
$result['isEmptyCart'] = true;
// $result['isEmptyCart'] = true;
break;
}
... ...
... ... @@ -464,7 +464,7 @@ class IndexController extends AbstractAction
// 设置加入购物车凭证到客户端浏览器
if (isset($result['data']['shopping_key'])) {
$this->setCookie('_spk', $shoppingKey);
$this->setCookie('_spk', $result['data']['shopping_key']);
}
}
... ...