Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
2ab4dd65
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
17
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2ab4dd65
编写于
1月 16, 2017
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
从购物车中读取货运地址,在下单页面自动初始化
上级
b96e66a5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
146 addition
and
86 deletion
+146
-86
app/appfront/modules/Checkout/block/onepage/Index.php
app/appfront/modules/Checkout/block/onepage/Index.php
+11
-3
app/appfront/theme/base/front/checkout/onepage/index.php
app/appfront/theme/base/front/checkout/onepage/index.php
+1
-0
app/appfront/theme/base/front/checkout/onepage/index/address.php
...front/theme/base/front/checkout/onepage/index/address.php
+9
-13
app/appfront/theme/base/front/checkout/onepage/index/address_select.php
...heme/base/front/checkout/onepage/index/address_select.php
+9
-13
services/cart/Quote.php
services/cart/Quote.php
+104
-53
services/customer/Address.php
services/customer/Address.php
+12
-4
未找到文件。
app/appfront/modules/Checkout/block/onepage/Index.php
浏览文件 @
2ab4dd65
...
...
@@ -19,10 +19,11 @@ class Index {
protected
$_address_view_file
;
protected
$_address_id
;
protected
$_address_list
;
protected
$_custom_info
;
protected
$_country
;
protected
$_state
;
protected
$_stateHtml
;
protected
$_cartAddress
;
protected
$_cart_address
;
public
function
getLastData
(){
$cartInfo
=
$this
->
getCartInfo
();
...
...
@@ -33,6 +34,7 @@ class Index {
$this
->
initAddress
();
$this
->
initCountry
();
$this
->
initState
();
return
[
'payments'
=>
$this
->
getPayment
(),
'shippings'
=>
$this
->
getShippings
(),
...
...
@@ -40,10 +42,9 @@ class Index {
'cart_info'
=>
$cartInfo
,
'currency_info'
=>
$currency_info
,
'address_view_file'
=>
$this
->
_address_view_file
,
'cart_address'
=>
$this
->
_address
,
'cart_address_id'
=>
$this
->
_address_id
,
'address_list'
=>
$this
->
_address_list
,
'customer_info'
=>
$this
->
_custom_info
,
'country_select'
=>
$this
->
_countrySelect
,
//'state_select' => $this->_stateSelect,
'state_html'
=>
$this
->
_stateHtml
,
...
...
@@ -56,6 +57,8 @@ class Index {
* 2. 如果是登录用户,而且
*/
public
function
initAddress
(){
//$this->_cart_address = Yii::$service->cart->quote->getCartAddress();
$cart
=
Yii
::
$service
->
cart
->
quote
->
getCart
();
$address_id
=
$cart
[
'customer_address_id'
];
...
...
@@ -108,6 +111,7 @@ class Index {
}
$this
->
_address
=
$address_info
;
$this
->
_address_list
=
Yii
::
$service
->
customer
->
address
->
currentAddressList
();
//var_dump($this->_address_list);
# 如果购物车存在customer_address_id,而且用户地址中也存在customer_address_id
# 则执行if{}内代码。
if
(
$address_id
&&
isset
(
$this
->
_address_list
[
$address_id
])
&&
!
empty
(
$this
->
_address_list
[
$address_id
])){
...
...
@@ -143,6 +147,10 @@ class Index {
}
}
else
{
$this
->
_address_view_file
=
'checkout/onepage/index/address.php'
;
# 从购物车里面取出来数据。 $_cartAddress
$cart_info
=
Yii
::
$service
->
cart
->
getCartInfo
();
}
if
(
!
$this
->
_country
){
$this
->
_country
=
Yii
::
$service
->
helper
->
country
->
getDefaultCountry
();
...
...
app/appfront/theme/base/front/checkout/onepage/index.php
浏览文件 @
2ab4dd65
...
...
@@ -22,6 +22,7 @@
'customer_info'
=>
$customer_info
,
'country_select'
=>
$country_select
,
'state_html'
=>
$state_html
,
//'cart_address' => $cart_address,
//'payments' => $payments,
//'current_payment_mothod' => $current_payment_mothod,
];
...
...
app/appfront/theme/base/front/checkout/onepage/index/address.php
浏览文件 @
2ab4dd65
...
...
@@ -2,11 +2,7 @@
<?php
$cart_address_id
=
$parentThis
[
'cart_address_id'
];
?>
<?php
$country_select
=
$parentThis
[
'country_select'
];
?>
<?php
$state_html
=
$parentThis
[
'state_html'
];
?>
<?php
$customer_info
=
$parentThis
[
'customer_info'
];
$email
=
isset
(
$customer_info
[
'email'
])
?
$customer_info
[
'email'
]
:
''
;
$first_name
=
isset
(
$customer_info
[
'first_name'
])
?
$customer_info
[
'first_name'
]
:
''
;
$last_name
=
isset
(
$customer_info
[
'last_name'
])
?
$customer_info
[
'last_name'
]
:
''
;
?>
<?php
$cart_address
=
$parentThis
[
'cart_address'
];
?>
<div
id=
"billing_address"
>
<ul>
...
...
@@ -20,17 +16,17 @@
<li
class=
"clearfix"
>
<div
class=
"input-box input-firstname"
>
<label
for=
"billing:firstname"
>
First Name
<span
class=
"required"
>
*
</span></label>
<input
value=
"
<?=
$
first_name
?>
"
id=
"billing:firstname"
name=
"billing[first_name]"
class=
"required-entry input-text"
type=
"text"
>
<input
value=
"
<?=
$
cart_address
[
'first_name'
]
?>
"
id=
"billing:firstname"
name=
"billing[first_name]"
class=
"required-entry input-text"
type=
"text"
>
</div>
<div
class=
"input-box input-lastname"
>
<label
for=
"billing:lastname"
>
Last Name
<span
class=
"required"
>
*
</span></label>
<input
value=
"
<?=
$
last_name
?>
"
id=
"billing:lastname"
name=
"billing[last_name]"
class=
"required-entry input-text"
type=
"text"
>
<input
value=
"
<?=
$
cart_address
[
'last_name'
]
?>
"
id=
"billing:lastname"
name=
"billing[last_name]"
class=
"required-entry input-text"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
<div
style=
"width:100%;"
class=
" input-box input-email"
>
<label
for=
"billing:email"
>
Email Address
<span
class=
"required"
>
*
</span></label>
<input
style=
"width:83%;"
value=
"
<?=
$
email
?>
"
class=
"validate-email required-entry input-text"
title=
"Email Address"
id=
"billing:email"
name=
"billing[email]"
type=
"text"
>
<input
style=
"width:83%;"
value=
"
<?=
$
cart_address
[
'email'
]
?>
"
class=
"validate-email required-entry input-text"
title=
"Email Address"
id=
"billing:email"
name=
"billing[email]"
type=
"text"
>
<div
class=
"customer_email_validation"
>
</div>
...
...
@@ -39,15 +35,15 @@
<li>
<div
style=
"width:100%;"
class=
"input-box input-telephone"
>
<label
for=
"billing:telephone"
>
Telephone
<span
class=
"required"
>
*
</span></label>
<input
style=
"width:83%;"
value=
""
id=
"billing:telephone"
class=
"required-entry input-text"
title=
"Telephone"
name=
"billing[telephone]"
type=
"text"
>
<input
style=
"width:83%;"
value=
"
<?=
$cart_address
[
'telephone'
]
?>
"
id=
"billing:telephone"
class=
"required-entry input-text"
title=
"Telephone"
name=
"billing[telephone]"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
<div
class=
"input-box input-address"
>
<label
for=
"billing:street1"
>
Address
<span
class=
"required"
>
*
</span></label>
<input
value=
""
class=
"required-entry input-text onestepcheckout-address-line"
id=
"billing:street1"
name=
"billing[street1]"
title=
"Street Address 1"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'street1'
]
?>
"
class=
"required-entry input-text onestepcheckout-address-line"
id=
"billing:street1"
name=
"billing[street1]"
title=
"Street Address 1"
type=
"text"
>
<br>
<input
value=
""
class=
"input-text onestepcheckout-address-line"
id=
"billing:street2"
name=
"billing[street2]"
title=
"Street Address 2"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'street2'
]
?>
"
class=
"input-text onestepcheckout-address-line"
id=
"billing:street2"
name=
"billing[street2]"
title=
"Street Address 2"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
...
...
@@ -62,7 +58,7 @@
<li
class=
"clearfix"
>
<div
class=
"input-box input-city"
>
<label
for=
"billing:city"
>
City
<span
class=
"required"
>
*
</span></label>
<input
value=
""
id=
"billing:city"
class=
"required-entry input-text"
title=
"City"
name=
"billing[city]"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'city'
]
?>
"
id=
"billing:city"
class=
"required-entry input-text"
title=
"City"
name=
"billing[city]"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
...
...
@@ -76,7 +72,7 @@
<li
class=
"clearfix"
>
<div
class=
"input-box input-zip"
>
<label
for=
"billing:zip"
>
Zip Code
<span
class=
"required"
>
*
</span></label>
<input
value=
""
class=
"validate-zip-international required-entry input-text"
id=
"billing:zip"
name=
"billing[zip]"
title=
"Zip Code"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'zip'
]
?>
"
class=
"validate-zip-international required-entry input-text"
id=
"billing:zip"
name=
"billing[zip]"
title=
"Zip Code"
type=
"text"
>
</div>
</li>
...
...
app/appfront/theme/base/front/checkout/onepage/index/address_select.php
浏览文件 @
2ab4dd65
...
...
@@ -2,11 +2,7 @@
<?php
$cart_address_id
=
$parentThis
[
'cart_address_id'
];
?>
<?php
$country_select
=
$parentThis
[
'country_select'
];
?>
<?php
$state_html
=
$parentThis
[
'state_html'
];
?>
<?php
$customer_info
=
$parentThis
[
'customer_info'
];
$email
=
isset
(
$customer_info
[
'email'
])
?
$customer_info
[
'email'
]
:
''
;
$first_name
=
isset
(
$customer_info
[
'first_name'
])
?
$customer_info
[
'first_name'
]
:
''
;
$last_name
=
isset
(
$customer_info
[
'last_name'
])
?
$customer_info
[
'last_name'
]
:
''
;
?>
<?php
$cart_address
=
$parentThis
[
'cart_address'
];
?>
<div
id=
"billing_address"
>
<ul>
...
...
@@ -34,17 +30,17 @@
<li
class=
"clearfix"
>
<div
class=
"input-box input-firstname"
>
<label
for=
"billing:firstname"
>
First Name
<span
class=
"required"
>
*
</span></label>
<input
value=
"
<?=
$
first_name
?>
"
id=
"billing:firstname"
name=
"billing[first_name]"
class=
"required-entry input-text"
type=
"text"
>
<input
value=
"
<?=
$
cart_address
[
'first_name'
]
?>
"
id=
"billing:firstname"
name=
"billing[first_name]"
class=
"required-entry input-text"
type=
"text"
>
</div>
<div
class=
"input-box input-lastname"
>
<label
for=
"billing:lastname"
>
Last Name
<span
class=
"required"
>
*
</span></label>
<input
value=
"
<?=
$
last_name
?>
"
id=
"billing:lastname"
name=
"billing[last_name]"
class=
"required-entry input-text"
type=
"text"
>
<input
value=
"
<?=
$
cart_address
[
'last_name'
]
?>
"
id=
"billing:lastname"
name=
"billing[last_name]"
class=
"required-entry input-text"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
<div
style=
"width:100%;"
class=
" input-box input-email"
>
<label
for=
"billing:email"
>
Email Address
<span
class=
"required"
>
*
</span></label>
<input
style=
"width:83%;"
value=
"
<?=
$
email
?>
"
class=
"validate-email required-entry input-text"
title=
"Email Address"
id=
"billing:email"
name=
"billing[email]"
type=
"text"
>
<input
style=
"width:83%;"
value=
"
<?=
$
cart_address
[
'email'
]
?>
"
class=
"validate-email required-entry input-text"
title=
"Email Address"
id=
"billing:email"
name=
"billing[email]"
type=
"text"
>
<div
class=
"customer_email_validation"
>
</div>
...
...
@@ -53,15 +49,15 @@
<li>
<div
style=
"width:100%;"
class=
"input-box input-telephone"
>
<label
for=
"billing:telephone"
>
Telephone
<span
class=
"required"
>
*
</span></label>
<input
style=
"width:83%;"
value=
""
id=
"billing:telephone"
class=
"required-entry input-text"
title=
"Telephone"
name=
"billing[telephone]"
type=
"text"
>
<input
style=
"width:83%;"
value=
"
<?=
$cart_address
[
'telephone'
]
?>
"
id=
"billing:telephone"
class=
"required-entry input-text"
title=
"Telephone"
name=
"billing[telephone]"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
<div
class=
"input-box input-address"
>
<label
for=
"billing:street1"
>
Address
<span
class=
"required"
>
*
</span></label>
<input
value=
""
class=
"required-entry input-text onestepcheckout-address-line"
id=
"billing:street1"
name=
"billing[street1]"
title=
"Street Address 1"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'street1'
]
?>
"
class=
"required-entry input-text onestepcheckout-address-line"
id=
"billing:street1"
name=
"billing[street1]"
title=
"Street Address 1"
type=
"text"
>
<br>
<input
value=
""
class=
"input-text onestepcheckout-address-line"
id=
"billing:street2"
name=
"billing[street2]"
title=
"Street Address 2"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'street2'
]
?>
"
class=
"input-text onestepcheckout-address-line"
id=
"billing:street2"
name=
"billing[street2]"
title=
"Street Address 2"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
...
...
@@ -75,13 +71,13 @@
<li
class=
"clearfix"
>
<div
class=
"input-box input-city"
>
<label
for=
"billing:city"
>
City
<span
class=
"required"
>
*
</span></label>
<input
value=
""
id=
"billing:city"
class=
"required-entry input-text"
title=
"City"
name=
"billing[city]"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'city'
]
?>
"
id=
"billing:city"
class=
"required-entry input-text"
title=
"City"
name=
"billing[city]"
type=
"text"
>
</div>
</li>
<li
class=
"clearfix"
>
<div
class=
"input-box input-zip"
>
<label
for=
"billing:zip"
>
Zip Code
<span
class=
"required"
>
*
</span></label>
<input
value=
""
class=
"validate-zip-international required-entry input-text"
id=
"billing:zip"
name=
"billing[zip]"
title=
"Zip Code"
type=
"text"
>
<input
value=
"
<?=
$cart_address
[
'zip'
]
?>
"
class=
"validate-zip-international required-entry input-text"
id=
"billing:zip"
name=
"billing[zip]"
title=
"Zip Code"
type=
"text"
>
</div>
<div
class=
"input-box input-state"
><label
for=
"billing:state"
class=
"required"
>
State
<span
class=
"required"
>
*
</span></label>
<div
class=
"state_html"
>
...
...
services/cart/Quote.php
浏览文件 @
2ab4dd65
...
...
@@ -23,6 +23,10 @@ class Quote extends Service
protected
$_cart_id
;
protected
$_cart
;
protected
$_shipping_cost
;
/**
* 存储购物车的信息。
*/
protected
$cartInfo
;
/**
* @return Int 得到cart_id
...
...
@@ -272,6 +276,49 @@ class Quote extends Service
return
true
;
}
}
/**
* 得到购物车中的用户地址信息
*
*/
public
function
getCartAddress
(){
$email
=
''
;
$first_name
=
''
;
$last_name
=
''
;
if
(
!
Yii
::
$app
->
user
->
isGuest
){
$identity
=
Yii
::
$app
->
user
->
identity
;
$email
=
isset
(
$identity
[
'email'
])
?
$identity
[
'email'
]
:
''
;
$first_name
=
isset
(
$identity
[
'first_name'
])
?
$identity
[
'first_name'
]
:
''
;
$last_name
=
isset
(
$identity
[
'last_name'
])
?
$identity
[
'last_name'
]
:
''
;
}
$cart
=
$this
->
getCurrentCart
();
$customer_email
=
isset
(
$cart
[
'customer_email'
])
?
$cart
[
'customer_email'
]
:
''
;
$customer_firstname
=
isset
(
$cart
[
'customer_firstname'
])
?
$cart
[
'customer_firstname'
]
:
''
;
$customer_lastname
=
isset
(
$cart
[
'customer_lastname'
])
?
$cart
[
'customer_lastname'
]
:
''
;
$customer_telephone
=
isset
(
$cart
[
'customer_telephone'
])
?
$cart
[
'customer_telephone'
]
:
''
;
$customer_address_country
=
isset
(
$cart
[
'customer_address_country'
])
?
$cart
[
'customer_address_country'
]
:
''
;
$customer_address_state
=
isset
(
$cart
[
'customer_address_state'
])
?
$cart
[
'customer_address_state'
]
:
''
;
$customer_address_city
=
isset
(
$cart
[
'customer_address_city'
])
?
$cart
[
'customer_address_city'
]
:
''
;
$customer_address_zip
=
isset
(
$cart
[
'customer_address_zip'
])
?
$cart
[
'customer_address_zip'
]
:
''
;
$customer_address_street1
=
isset
(
$cart
[
'customer_address_street1'
])
?
$cart
[
'customer_address_street1'
]
:
''
;
$customer_address_street2
=
isset
(
$cart
[
'customer_address_street2'
])
?
$cart
[
'customer_address_street2'
]
:
''
;
$customer_email
=
$customer_email
?
$customer_email
:
$email
;
$customer_firstname
=
$customer_firstname
?
$customer_firstname
:
$first_name
;
$customer_lastname
=
$customer_lastname
?
$customer_lastname
:
$last_name
;
return
[
'first_name'
=>
$customer_firstname
,
'last_name'
=>
$customer_lastname
,
'email'
=>
$customer_email
,
'telephone'
=>
$customer_telephone
,
'country'
=>
$customer_address_country
,
'state'
=>
$customer_address_state
,
'city'
=>
$customer_address_city
,
'zip'
=>
$customer_address_zip
,
'street1'
=>
$customer_address_street1
,
'street2'
=>
$customer_address_street2
,
];
}
/**
* @property $shipping_method | String 传递的货运方式
...
...
@@ -285,64 +332,68 @@ class Quote extends Service
*/
public
function
getCartInfo
(
$shipping_method
=
''
,
$country
=
''
,
$region
=
'*'
){
//echo 333;exit;
$cart_id
=
$this
->
getCartId
();
if
(
!
$cart_id
){
return
false
;
}
$cart
=
$this
->
getCart
();
$items_qty
=
$cart
[
'items_count'
];
if
(
$items_qty
<=
0
){
return
false
;
}
$coupon_code
=
$cart
[
'coupon_code'
];
if
(
!
$shipping_method
){
$shipping_method
=
$cart
[
'shipping_method'
];
}
$cart_product_info
=
Yii
::
$service
->
cart
->
quoteItem
->
getCartProductInfo
();
if
(
is_array
(
$cart_product_info
)){
$product_weight
=
$cart_product_info
[
'product_weight'
];
$products
=
$cart_product_info
[
'products'
];
$product_total
=
$cart_product_info
[
'product_total'
];
$base_product_total
=
$cart_product_info
[
'base_product_total'
];
if
(
$products
&&
$product_total
){
$shippingCost
=
$this
->
getShippingCost
(
$shipping_method
,
$product_weight
,
$country
,
$region
);
$currShippingCost
=
$shippingCost
[
'currCost'
];
$baseShippingCost
=
$shippingCost
[
'baseCost'
];
//echo 333;
//var_dump([$base_product_total,$product_total]);
//exit;
//echo $coupon_code;exit;
$couponCost
=
$this
->
getCouponCost
(
$base_product_total
,
$coupon_code
);
$baseDiscountCost
=
$couponCost
[
'currCost'
];
$currDiscountCost
=
$couponCost
[
'baseCost'
];
$curr_grand_total
=
$product_total
+
$currShippingCost
-
$currDiscountCost
;
$base_grand_total
=
$base_product_total
+
$baseShippingCost
-
$baseDiscountCost
;
return
[
'store'
=>
$cart
[
'store'
],
# store nme
'items_count'
=>
$cart
[
'items_count'
],
# 购物车中的产品总数
'coupon_code'
=>
$coupon_code
,
# coupon卷码
'grand_total'
=>
$base_grand_total
,
# 当前货币总金额
'shipping_cost'
=>
$currShippingCost
,
# 当前货币,运费
'coupon_cost'
=>
$currDiscountCost
,
# 当前货币,优惠券优惠金额
'product_total'
=>
$product_total
,
# 当前货币,购物车中产品的总金额
$cartInfoKey
=
$shipping_method
.
'-shipping-'
.
$country
.
'-country-'
.
$region
.
'-region'
;
if
(
!
isset
(
$this
->
cartInfo
[
$cartInfoKey
])){
$cart_id
=
$this
->
getCartId
();
if
(
!
$cart_id
){
return
false
;
}
$cart
=
$this
->
getCart
();
$items_qty
=
$cart
[
'items_count'
];
if
(
$items_qty
<=
0
){
return
false
;
}
$coupon_code
=
$cart
[
'coupon_code'
];
if
(
!
$shipping_method
){
$shipping_method
=
$cart
[
'shipping_method'
];
}
$cart_product_info
=
Yii
::
$service
->
cart
->
quoteItem
->
getCartProductInfo
();
if
(
is_array
(
$cart_product_info
)){
$product_weight
=
$cart_product_info
[
'product_weight'
];
$products
=
$cart_product_info
[
'products'
];
$product_total
=
$cart_product_info
[
'product_total'
];
$base_product_total
=
$cart_product_info
[
'base_product_total'
];
if
(
$products
&&
$product_total
){
$shippingCost
=
$this
->
getShippingCost
(
$shipping_method
,
$product_weight
,
$country
,
$region
);
$currShippingCost
=
$shippingCost
[
'currCost'
];
$baseShippingCost
=
$shippingCost
[
'baseCost'
];
//echo 333;
//var_dump([$base_product_total,$product_total]);
//exit;
//echo $coupon_code;exit;
$couponCost
=
$this
->
getCouponCost
(
$base_product_total
,
$coupon_code
);
'base_grand_total'
=>
$base_grand_total
,
# 基础货币总金额
'base_shipping_cost'
=>
$baseShippingCost
,
# 基础货币,运费
'base_coupon_cost'
=>
$baseDiscountCost
,
# 基础货币,优惠券优惠金额
'base_product_total'
=>
$base_product_total
,
# 基础货币,购物车中产品的总金额
$baseDiscountCost
=
$couponCost
[
'currCost'
];
$currDiscountCost
=
$couponCost
[
'baseCost'
];
$curr_grand_total
=
$product_total
+
$currShippingCost
-
$currDiscountCost
;
$base_grand_total
=
$base_product_total
+
$baseShippingCost
-
$baseDiscountCost
;
'products'
=>
$products
,
#产品信息。
'product_weight'
=>
$product_weight
,
#产品的总重量。
];
$this
->
cartInfo
[
$cartInfoKey
]
=
[
'store'
=>
$cart
[
'store'
],
# store nme
'items_count'
=>
$cart
[
'items_count'
],
# 购物车中的产品总数
'coupon_code'
=>
$coupon_code
,
# coupon卷码
'grand_total'
=>
$base_grand_total
,
# 当前货币总金额
'shipping_cost'
=>
$currShippingCost
,
# 当前货币,运费
'coupon_cost'
=>
$currDiscountCost
,
# 当前货币,优惠券优惠金额
'product_total'
=>
$product_total
,
# 当前货币,购物车中产品的总金额
'base_grand_total'
=>
$base_grand_total
,
# 基础货币总金额
'base_shipping_cost'
=>
$baseShippingCost
,
# 基础货币,运费
'base_coupon_cost'
=>
$baseDiscountCost
,
# 基础货币,优惠券优惠金额
'base_product_total'
=>
$base_product_total
,
# 基础货币,购物车中产品的总金额
'products'
=>
$products
,
#产品信息。
'product_weight'
=>
$product_weight
,
#产品的总重量。
];
}
}
}
return
$this
->
cartInfo
[
$cartInfoKey
];
}
/**
...
...
services/customer/Address.php
浏览文件 @
2ab4dd65
...
...
@@ -91,8 +91,15 @@ class Address extends Service
];
}
protected
function
actionCurrentAddress
(){
}
/**
*
*
*/
protected
function
actionCurrentAddressList
(){
$arr
=
[];
if
(
!
Yii
::
$app
->
user
->
isGuest
){
...
...
@@ -121,13 +128,14 @@ class Address extends Service
$street2
=
$one
[
'street2'
];
$is_default
=
$one
[
'is_default'
];
$city
=
$one
[
'city'
];
$state
=
Yii
::
$service
->
helper
->
country
->
getStateByContryCode
(
$one
[
'country'
],
$one
[
'state'
]);
//$state = $one['state'];
//$state = Yii::$service->helper->country->getStateByContryCode($one['country'],$one['state']);
$state
=
$one
[
'state'
];
$zip
=
$one
[
'zip'
];
$country
=
Yii
::
$service
->
helper
->
country
->
getCountryNameByKey
(
$one
[
'country'
]);
$str
=
$first_name
.
' '
.
$last_name
.
' '
.
$email
.
' '
.
$street1
.
' '
.
$street2
.
' '
.
$city
.
' '
.
$state
.
' '
.
$country
.
' '
.
$zip
;
$zip
.
' '
.
$telephone
;
if
(
$is_default
==
1
){
$ii
=
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录