Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
3db273ad
Commit
3db273ad
authored
Mar 30, 2023
by
dhn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发票地址位置及功能修改
parent
0d843a60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
190 additions
and
25 deletions
+190
-25
app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php
+20
-1
app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
+7
-0
app/code/Magento/Checkout/view/frontend/web/js/action/set-billing-address-new.js
+77
-0
app/code/Magento/Checkout/view/frontend/web/js/model/quote.js
+2
-1
app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js
+0
-0
app/code/Magento/Checkout/view/frontend/web/js/view/part.js
+48
-2
app/code/Magento/Checkout/view/frontend/web/js/view/shipping-get.js
+3
-1
app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html
+2
-2
app/code/Magento/Checkout/view/frontend/web/template/new-billing-address.html
+7
-5
app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html
+0
-5
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/onepage.phtml
+3
-1
app/design/frontend/Joshine/breeze/Magento_Checkout/web/template/shipping.html
+21
-7
No files found.
app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php
View file @
3db273ad
...
...
@@ -197,8 +197,27 @@ class LayoutProcessor implements LayoutProcessorInterface
$fields
);
}
$jsLayout
[
'components'
][
'checkout'
][
'children'
][
'steps'
][
'children'
][
'shipping-step'
][
'children'
]
if
(
isset
(
$jsLayout
[
'components'
][
'checkout'
][
'children'
][
'steps'
][
'children'
][
'shipping-step'
]
[
'children'
][
'shippingAddress'
][
'children'
][
'after-shipping-method-form'
])){
$component
[
'billing-address-form'
]
=
$this
->
getBillingAddressComponent
(
'shared'
,
$elements
);
$jsLayout
[
'components'
][
'checkout'
][
'children'
][
'steps'
][
'children'
][
'shipping-step'
]
[
'children'
][
'shippingAddress'
][
'children'
][
'after-shipping-method-form'
][
'children'
]
=
array_merge_recursive
(
$component
,
$jsLayout
[
'components'
][
'checkout'
][
'children'
][
'steps'
][
'children'
][
'shipping-step'
]
[
'children'
][
'shippingAddress'
][
'children'
][
'after-shipping-method-form'
]
);
}
$jsLayout
[
'components'
][
'checkout'
][
'children'
][
'steps'
][
'children'
][
'shipping-step'
][
'children'
]
[
'shippingAddress'
][
'children'
][
'shipping-address-fieldset'
][
'children'
][
'company'
][
'sortOrder'
]
=
140
;
file_put_contents
(
'./yyyy.txt'
,
json_encode
(
$jsLayout
));
return
$jsLayout
;
}
...
...
app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml
View file @
3db273ad
...
...
@@ -229,6 +229,13 @@
</item>
</item>
</item>
<item
name=
"after-shipping-method-form"
xsi:type=
"array"
>
<item
name=
"component"
xsi:type=
"string"
>
uiComponent
</item>
<item
name=
"displayArea"
xsi:type=
"string"
>
after-shipping-method-form
</item>
<item
name=
"children"
xsi:type=
"array"
>
<!-- address-list-additional-addresses -->
</item>
</item>
</item>
</item>
</item>
...
...
app/code/Magento/Checkout/view/frontend/web/js/action/set-billing-address-new.js
0 → 100644
View file @
3db273ad
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @api
*/
define
(
[
'jquery'
,
'Magento_Checkout/js/model/quote'
,
'Magento_Checkout/js/model/url-builder'
,
'mage/storage-new'
,
'Magento_Checkout/js/model/error-processor'
,
'Magento_Customer/js/model/customer'
,
'Magento_Checkout/js/model/full-screen-loader'
,
'Magento_Checkout/js/action/get-payment-information'
],
function
(
$
,
quote
,
urlBuilder
,
storage
,
errorProcessor
,
customer
,
fullScreenLoader
,
getPaymentInformationAction
)
{
'use strict'
;
return
function
(
messageContainer
)
{
var
serviceUrl
,
payload
;
/**
* Checkout for guest and registered customer.
*/
if
(
!
customer
.
isLoggedIn
())
{
serviceUrl
=
urlBuilder
.
createUrl
(
'/guest-carts/:cartId/billing-address'
,
{
cartId
:
quote
.
getQuoteId
()
});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
address
:
quote
.
billingAddress
()
};
}
else
{
serviceUrl
=
urlBuilder
.
createUrl
(
'/carts/mine/billing-address'
,
{});
payload
=
{
cartId
:
quote
.
getQuoteId
(),
address
:
quote
.
billingAddress
()
};
}
fullScreenLoader
.
startLoader
();
quote
.
responseBillStatus
(
null
);
return
storage
.
post
(
serviceUrl
,
JSON
.
stringify
(
payload
)
).
done
(
function
()
{
var
deferred
=
$
.
Deferred
();
getPaymentInformationAction
(
deferred
);
$
.
when
(
deferred
).
done
(
function
()
{
fullScreenLoader
.
stopLoader
();
});
quote
.
responseBillStatus
(
200
);
}
).
fail
(
function
(
response
)
{
errorProcessor
.
process
(
response
,
messageContainer
);
fullScreenLoader
.
stopLoader
();
quote
.
responseBillStatus
(
400
);
}
);
};
}
);
app/code/Magento/Checkout/view/frontend/web/js/model/quote.js
View file @
3db273ad
...
...
@@ -32,6 +32,7 @@ define([
shippingSaveMethod
=
ko
.
observable
(
null
),
paymentMethod
=
ko
.
observable
(
null
),
paymentMethodlist
=
ko
.
observable
(
null
),
responseBillStatus
=
ko
.
observable
(
null
),
quoteData
=
window
.
checkoutConfig
.
quoteData
,
basePriceFormat
=
window
.
checkoutConfig
.
basePriceFormat
,
priceFormat
=
window
.
checkoutConfig
.
priceFormat
,
...
...
@@ -45,6 +46,7 @@ define([
shippingAddress
:
shippingAddress
,
shippingMethod
:
shippingMethod
,
shippingSaveMethod
:
shippingSaveMethod
,
responseBillStatus
:
responseBillStatus
,
billingAddress
:
billingAddress
,
paymentMethod
:
paymentMethod
,
paymentMethodlist
:
paymentMethodlist
,
...
...
@@ -121,7 +123,6 @@ define([
getShippingSaveMethod
:
function
()
{
return
shippingSaveMethod
;
},
setPaymentMethodList
:
function
(
MethodList
)
{
paymentMethodlist
(
MethodList
);
},
...
...
app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js
View file @
3db273ad
This diff is collapsed.
Click to expand it.
app/code/Magento/Checkout/view/frontend/web/js/view/part.js
View file @
3db273ad
define
([
'jquery'
,
'uiComponent'
,
'Magento_Checkout/js/model/checkout-data-resolver'
],
function
(
$
,
Component
,
checkoutDataResolver
)
{
'uiRegistry'
,
'Magento_Checkout/js/model/checkout-data-resolver'
,
'Magento_Checkout/js/model/quote'
],
function
(
$
,
Component
,
registry
,
checkoutDataResolver
,
quote
)
{
'use strict'
;
var
input_city
=
$
(
'#co-shipping-form input[name="city"]'
);
if
(
input_city
.
is
(
':visible'
)
&&
!
input_city
.
closest
(
'.field'
).
hasClass
(
'_required'
))
{
...
...
@@ -39,6 +41,9 @@ define([
if
(
!
addressForm
.
validate
().
form
())
{
return
false
;
}
var
paymentMethodObj
=
$
(
'.checkout-index-index .payment-method'
);
if
(
paymentMethodObj
.
length
<
1
)
{
...
...
@@ -58,12 +63,22 @@ define([
}
else
{
regin
=
region_select
.
find
(
":selected"
).
text
();
}
if
(
!
registry
.
get
(
'checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form'
).
isAddressSameAsShipping
())
{
$
(
'#submitBill'
).
trigger
(
'click'
);
if
(
quote
.
responseBillStatus
()
==
400
)
{
return
false
;
}
}
$
(
'#checkout-step-shipping'
).
hide
();
$
(
'#shipping-text'
).
show
();
$
(
'#shipping-text .main-address.shipping-address'
).
html
(
firstname
+
' '
+
lastname
+
'<br>'
+
street
+
'<br>'
+
city
+
', '
+
regin
+
', '
+
country
+
'<br>'
+
postcode
+
', '
+
telephone
+
'<br>'
+
email
);
}
$
(
paymentMethodObj
[
0
]).
find
(
'input[type="radio"]'
).
trigger
(
'click'
);
$
(
'#next-shipping'
).
hide
();
$
(
'#edit-shipping'
).
show
();
$
(
'#checkout-step-shipping_method'
).
show
();
$
(
'#checkout-payment-method-load'
).
show
();
$
(
'#checkout-step-payment,#opc-shipping_method'
).
find
(
'.step-title'
).
removeClass
(
'no-border'
);
...
...
@@ -80,10 +95,41 @@ define([
$
(
'#shipping-text'
).
hide
();
$
(
'#checkout-step-shipping'
).
show
();
$
(
'#next-shipping'
).
show
();
$
(
'#edit-shipping'
).
hide
();
$
(
'#checkout-step-shipping_method'
).
hide
();
$
(
'#checkout-payment-method-load'
).
hide
();
$
(
'#checkout-step-payment,#opc-shipping_method'
).
find
(
'.step-title'
).
addClass
(
'no-border'
);
});
$
(
document
).
on
(
'click'
,
'#billing-address-same-as-shipping-shared'
,
function
()
{
if
(
!
registry
.
get
(
'checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form'
).
isAddressSameAsShipping
())
{
$
(
'#shipping-text .main-address.shipping-address'
).
html
(
''
);
$
(
'#checkout_place_order'
).
removeClass
(
'button-fix'
);
$
(
'#shipping-text'
).
hide
();
$
(
'#checkout-step-shipping'
).
show
();
$
(
'#next-shipping'
).
show
();
$
(
'#edit-shipping'
).
hide
();
$
(
'#checkout-step-shipping_method'
).
hide
();
$
(
'#checkout-payment-method-load'
).
hide
();
$
(
'#checkout-step-payment,#opc-shipping_method'
).
find
(
'.step-title'
).
addClass
(
'no-border'
);
}
});
$
(
document
).
on
(
'click'
,
'#editLink'
,
function
()
{
$
(
'#shipping-text .main-address.shipping-address'
).
html
(
''
);
$
(
'#checkout_place_order'
).
removeClass
(
'button-fix'
);
$
(
'#shipping-text'
).
hide
();
$
(
'#checkout-step-shipping'
).
show
();
$
(
'#next-shipping'
).
show
();
$
(
'#edit-shipping'
).
hide
();
$
(
'#checkout-step-shipping_method'
).
hide
();
$
(
'#checkout-payment-method-load'
).
hide
();
$
(
'#checkout-step-payment,#opc-shipping_method'
).
find
(
'.step-title'
).
addClass
(
'no-border'
);
if
(
!
registry
.
get
(
'checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form'
).
isAddressSameAsShipping
())
{
$
(
'#action-edit-address'
).
trigger
(
'click'
);
}
});
}
});
}
...
...
app/code/Magento/Checkout/view/frontend/web/js/view/shipping-get.js
View file @
3db273ad
...
...
@@ -70,8 +70,10 @@ define([
* @returns {*}
*/
_isAddressSameAsShipping
:
function
()
{
if
(
registry
.
get
(
'checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form'
)){
return
registry
.
get
(
'checkout.steps.shipping-step.shippingAddress.after-shipping-method-form.billing-address-form'
).
isAddressSameAsShipping
();
}
return
true
;
//return registry.get('checkout.steps.billing-step.payment.payments-list.billing-address-form-shared').isAddressSameAsShipping();
}
});
});
app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html
View file @
3db273ad
...
...
@@ -21,11 +21,11 @@
<br/>
</each>
</div>
<div
class=
"billing-handle"
>
<div
class=
"billing-handle"
style=
"display: none;"
>
<button
visible=
"!isAddressSameAsShipping()"
type=
"button"
class=
"action action-edit-address"
click=
"editAddress"
>
click=
"editAddress"
id=
"action-edit-address"
>
<span
translate=
"'Edit'"
></span>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
>
<path
d=
"M19.769 9.923l-12.642 12.639-7.127 1.438 1.438-7.128 12.641-12.64 5.69 5.691zm1.414-1.414l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z"
></path>
...
...
app/code/Magento/Checkout/view/frontend/web/template/new-billing-address.html
View file @
3db273ad
...
...
@@ -5,15 +5,17 @@
padding
:
20px
22px
;
border
:
1px
solid
#d6d6d6
;
font-size
:
14px
;
min-height
:
200px
;
/*min-height: 200px;*/
position
:
relative
;
box-sizing
:
border-box
;
}
/*
.billing-address-box{
padding-bottom: 1rem;
border-bottom: 1px dashed #ddd;
}
*/
.billing-handle
.action-edit-address
{
border
:
none
;
background
:
0
0
;
...
...
@@ -30,7 +32,7 @@
fill
:
#666
;
}
.billing-address-details
{
padding
:
0.5rem
0px
0.5rem
1.5
rem
;
padding
:
0.5rem
0px
0.5rem
0
rem
;
}
@media
(
max-width
:
1023px
){
.action-update-cancel
{
...
...
@@ -77,7 +79,7 @@
</style>
<div
class=
"checkout-billing-address cclt"
>
<div
class=
"billing-address-same-as-shipping-block field choice"
data-bind=
"visible: canUseShippingAddress()"
>
<div
class=
"billing-address-same-as-shipping-block field choice"
data-bind=
"visible: canUseShippingAddress()"
style=
"padding:0;"
>
<input
type=
"checkbox"
name=
"billing-address-same-as-shipping"
data-bind=
"checked: isAddressSameAsShipping, click: useShippingAddress, attr: {id: 'billing-address-same-as-shipping-' + getCode($parent)}"
/>
<label
data-bind=
"attr: {for: 'billing-address-same-as-shipping-' + getCode($parent)}"
><span
...
...
@@ -91,7 +93,7 @@
<!-- ko template: 'Magento_Checkout/billing-address/form' --><!-- /ko -->
<div
class=
"actions-toolbar action-update-cancel"
style=
"margin-left: 0%;"
>
<div
class=
"primary"
>
<button
class=
"action action-update"
type=
"button"
data-bind=
"click: updateAddress"
>
<button
class=
"action action-update"
id=
"submitBill"
type=
"button"
data-bind=
"click: updateAddress"
>
<span
data-bind=
"i18n: 'Update'"
></span>
</button>
<button
class=
"action action-cancel"
type=
"button"
data-bind=
"click: cancelAddressEdit"
>
...
...
app/code/Magento/Checkout/view/frontend/web/template/payment-methods/list.html
View file @
3db273ad
...
...
@@ -8,11 +8,6 @@
class=
"items payment-methods"
>
<div
repeat=
"foreach: paymentGroupsList, item: '$group'"
class=
"payment-group"
>
<!-- ko if: showFormShared($group) -->
<!-- ko foreach: getRegion(getBillingAddressRegionName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<!--/ko-->
<each
args=
"data: getRegion($group().displayArea), as: 'method'"
render=
""
></each>
</div>
</div>
...
...
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/onepage.phtml
View file @
3db273ad
...
...
@@ -283,7 +283,7 @@ $full_free_ship = $_helper->currency($full_free, true, false);
padding
:
20px
22px
;
border
:
1px
solid
#d6d6d6
;
font-size
:
14px
;
min-height
:
200px
;
/*min-height: 200px;*/
position
:
relative
;
box-sizing
:
border-box
;
}
...
...
@@ -297,11 +297,13 @@ $full_free_ship = $_helper->currency($full_free, true, false);
background-size
:
contain
;
background
:
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAACECAYAAABVnZHfAAAA+0lEQVQ4je3UsUrDUBTG8X9s6yZOeYMOLejgS7iIUDCrS0uH0oI+QUGdHZSsjnZw6dB3ENK1U8eCQqBjoWvkaE/4SpHgYjv0bj9yc5J7v3tukN5GGT9jcICMreFDEQFLRwK0gCyIXtLvKfGkd5aDwr+uKkbAsaMGvAElf+cc6GuB6m7szo4hU9w5ysA9UNdpTWDsS7BMn3U9mZ3EtdIlxZOiC3T8O6yeTr1axU7JPp8iJIor7zvDJ9CwjLTNwj+02aEiVrSBGyS5R03OEr/e51OEd4UFNXPMgUtgkTdT7zQONzrrd1woXoETh92UQyD0AnaXPmi1o3/ZA+ALpYA1JaK/rAEAAAAASUVORK5CYII=)
repeat-y
;
}
/*
.main-address.shipping-address
{
border-bottom: 1px dashed #d6d6d6;
padding-bottom: 20px;
}
*/
.address-edit
{
border
:
none
;
background
:
0
0
;
...
...
app/design/frontend/Joshine/breeze/Magento_Checkout/web/template/shipping.html
View file @
3db273ad
...
...
@@ -4,6 +4,15 @@
* See COPYING.txt for license details.
*/
-->
<style>
#edit-shipping
{
border-bottom
:
1px
#dddddd
dashed
;
text-align
:
right
;
}
#edit-shipping
svg
{
vertical-align
:
revert
;
}
</style>
<li
id=
"shipping"
class=
"checkout-shipping-address"
data-bind=
"fadeVisible: visible()"
>
<!--<div class="step-title" translate="'Shipping Address'" data-role="title" />-->
<p
class=
"step-title"
>
...
...
@@ -14,7 +23,7 @@
</p>
<div
id=
"checkout-step-shipping"
class=
"step-content"
data-role=
"content"
>
data-role=
"content"
style=
"margin-bottom: 1rem;"
>
<each
if=
"!quoteIsVirtual"
args=
"getRegion('customer-email')"
render=
""
/>
<each
args=
"getRegion('address-list')"
render=
""
/>
...
...
@@ -46,17 +55,22 @@
<div
class=
"confirmed-address"
>
<div
class=
"main-address shipping-address"
>
</div>
<button
class=
"address-edit"
>
<span>
edit
</span>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
>
<path
d=
"M19.769 9.923l-12.642 12.639-7.127 1.438 1.438-7.128 12.641-12.64 5.69 5.691zm1.414-1.414l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z"
></path>
</svg>
</button>
</div>
</div>
<div
class=
"billing-address-form"
>
<each
args=
"getRegion('after-shipping-method-form')"
render=
""
/>
</div>
<div
id=
"next-shipping"
>
<span>
<!-- ko i18n: 'Save & Continue'--><!-- /ko -->
</span>
</div>
<div
id=
"edit-shipping"
style=
"display:none;"
>
<a
href=
"javascript:;"
id=
"editLink"
style=
"color:#000;"
>
<span>
<!-- ko i18n: 'Edit'--><!-- /ko -->
</span>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"12"
height=
"12"
viewBox=
"0 0 24 24"
>
<path
d=
"M19.769 9.923l-12.642 12.639-7.127 1.438 1.438-7.128 12.641-12.64 5.69 5.691zm1.414-1.414l2.817-2.82-5.691-5.689-2.816 2.817 5.69 5.692z"
></path>
</svg>
</a>
</div>
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment