Showing
1 changed file
with
3 additions
and
2 deletions
@@ -295,12 +295,13 @@ class IndexController extends AbstractAction | @@ -295,12 +295,13 @@ class IndexController extends AbstractAction | ||
295 | // 返回地址 | 295 | // 返回地址 |
296 | $returnUrl = Helpers::url('/cart/index/index'); | 296 | $returnUrl = Helpers::url('/cart/index/index'); |
297 | 297 | ||
298 | - $cartType = $this->get('cartType', ''); | 298 | + $cartType = $this->get('cartType', 'ordinary'); |
299 | $cookieData = $this->getCookie('order-info', null); | 299 | $cookieData = $this->getCookie('order-info', null); |
300 | $orderInfo = array(); | 300 | $orderInfo = array(); |
301 | if (!empty($cookieData)) { | 301 | if (!empty($cookieData)) { |
302 | $orderInfo = json_decode($cookieData, true); | 302 | $orderInfo = json_decode($cookieData, true); |
303 | - $cartType = $orderInfo['cartType']; | 303 | + //如果为空,获取默认 |
304 | + $cartType = empty($orderInfo['cartType']) ? $cartType : $orderInfo['cartType']; | ||
304 | } | 305 | } |
305 | 306 | ||
306 | // 如果传递了code, sku,skn,buy_number就代表是限购商品 | 307 | // 如果传递了code, sku,skn,buy_number就代表是限购商品 |
-
Please register or login to post a comment