Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
33135acbcab2a4b6e334ae24657e6cd76733f21c
1 parent
5cfd01eb
添加当购物车商品为空时不能进入购物车结算页的逻辑
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
3 deletions
template/m.yohobuy.com/actions/index/shoppingcart/gift-advance.phtml → template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
template/m.yohobuy.com/actions/index/shoppingcart/index.phtml → template/m.yohobuy.com/actions/cart/index/index.phtml
template/m.yohobuy.com/actions/index/shoppingcart/order-ensure.phtml → template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/actions/index/shoppingcart/select-address.phtml → template/m.yohobuy.com/actions/cart/index/select-address.phtml
template/m.yohobuy.com/actions/index/shoppingcart/select-coupon.phtml → template/m.yohobuy.com/actions/cart/index/select-coupon.phtml
yohobuy/m.yohobuy.com/application/controllers/ShoppingCart.php
template/m.yohobuy.com/actions/
index/shoppingcart
/gift-advance.phtml → template/m.yohobuy.com/actions/
cart/index
/gift-advance.phtml
View file @
33135ac
template/m.yohobuy.com/actions/
index/shoppingcart
/index.phtml → template/m.yohobuy.com/actions/
cart/index
/index.phtml
View file @
33135ac
template/m.yohobuy.com/actions/
index/shoppingcart
/order-ensure.phtml → template/m.yohobuy.com/actions/
cart/index
/order-ensure.phtml
View file @
33135ac
template/m.yohobuy.com/actions/
index/shoppingcart
/select-address.phtml → template/m.yohobuy.com/actions/
cart/index
/select-address.phtml
View file @
33135ac
template/m.yohobuy.com/actions/
index/shoppingcart
/select-coupon.phtml → template/m.yohobuy.com/actions/
cart/index
/select-coupon.phtml
View file @
33135ac
yohobuy/m.yohobuy.com/application/controllers/ShoppingCart.php
View file @
33135ac
...
...
@@ -10,6 +10,20 @@ use Plugin\Helpers;
*/
class
ShoppingcartController
extends
AbstractAction
{
/**
* 通过当前用户审判是否跳到登录
*
* @param boolean $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
protected
function
auditJumpLogin
(
$useSession
=
true
)
{
$uid
=
$this
->
getUid
(
$useSession
);
if
(
!
$uid
)
{
$this
->
go
(
Helpers
::
url
(
'/signin.html'
,
array
(
'refer'
=>
$this
->
server
(
'HTTP_REFERER'
,
SITE_MAIN
))));
}
}
/*
* 购物车首页
*/
...
...
@@ -221,17 +235,28 @@ class ShoppingcartController extends AbstractAction
*/
public
function
orderEnsureAction
()
{
// 审判跳转登录页
$this
->
auditJumpLogin
();
$this
->
setTitle
(
'购物车'
);
$this
->
setNavHeader
(
'购物车'
);
$cartType
=
$this
->
post
(
'cartType'
,
'ordinary'
);
// 购物车商品为空跳转到购物车页面
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$uid
=
$this
->
getUid
(
true
);
$cartGoods
=
CartModel
::
getCartData
(
$uid
,
$shoppingKey
);
if
(
empty
(
$cartGoods
)
||
isset
(
$cartGoods
[
'isEmptyCart'
]))
{
$this
->
go
(
Helpers
::
url
(
'/shoppingcart'
));
}
$cartType
=
$this
->
get
(
'cartType'
,
'ordinary'
);
$cookieData
=
$this
->
getCookie
(
'order-info'
,
null
);
$uid
=
$this
->
getUid
(
true
);
$data
=
array
(
'orderEnsurePage'
=>
true
,
'orderEnsure'
=>
CartModel
::
cartPay
(
$uid
,
$cartType
,
$cookieData
)
);
// var_dump($data);
$this
->
_view
->
display
(
'order-ensure'
,
$data
);
}
...
...
@@ -288,7 +313,6 @@ class ShoppingcartController extends AbstractAction
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
true
);
$page
=
$this
->
get
(
'page'
,
1
);
$result
=
CartModel
::
getCouponList
(
$uid
);
}
...
...
@@ -304,6 +328,9 @@ class ShoppingcartController extends AbstractAction
*/
public
function
selectAddressAction
()
{
// 审判跳转登录页
$this
->
auditJumpLogin
();
// 设置网站标题
$this
->
setTitle
(
'选择地址'
);
$this
->
setNavHeader
(
'选择地址'
,
Helpers
::
url
(
'/shoppingCart/orderEnsure'
));
...
...
@@ -323,9 +350,13 @@ class ShoppingcartController extends AbstractAction
*/
public
function
selectCouponAction
()
{
// 审判跳转登录页
$this
->
auditJumpLogin
();
// 设置网站标题
$this
->
setTitle
(
'选择优惠券'
);
$this
->
setNavHeader
(
'选择优惠券'
,
Helpers
::
url
(
'/shoppingCart/orderEnsure'
));
$this
->
_view
->
display
(
'select-coupon'
,
array
(
'selectCouponPage'
=>
true
,
'pageFooter'
=>
true
...
...
Please
register
or
login
to post a comment