Merge pull request #22357 from woocommerce/pr/22125

State and country field handling improvements
This commit is contained in:
Mike Jolley 2019-02-19 09:52:34 +00:00 committed by GitHub
commit 1e74b2567f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 7139 additions and 6443 deletions

View File

@ -14,6 +14,7 @@ div.woocommerce-message {
p.woocommerce-actions,
.woocommerce-message {
.button-primary {
background: #bb77ae;
border-color: #a36597;
@ -21,7 +22,9 @@ p.woocommerce-actions,
color: #fff;
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
&:hover, &:focus, &:active {
&:hover,
&:focus,
&:active {
background: #a36597;
border-color: #a36597;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
@ -33,11 +36,12 @@ p.woocommerce-actions,
float: right;
top: 0;
right: 0;
padding: 0px 15px 10px 28px;
padding: 0 15px 10px 28px;
margin-top: -10px;
font-size: 13px;
line-height: 1.23076923;
text-decoration: none;
&::before {
position: relative;
top: 18px;
@ -67,6 +71,7 @@ div.woocommerce-legacy-shipping-notice,
div.woocommerce-no-shipping-methods-notice {
overflow: hidden;
padding: 1px 12px;
p {
position: relative;
z-index: 1;
@ -77,9 +82,10 @@ div.woocommerce-no-shipping-methods-notice {
font-size: 1.1em;
}
}
&::before {
content: '\e01b';
font-family: 'WooCommerce';
content: "\e01b";
font-family: "WooCommerce";
text-align: center;
line-height: 1;
color: #f7f1f6;

File diff suppressed because it is too large Load Diff

View File

@ -2,23 +2,23 @@
General table styling
------------------------------------------------------------------------------*/
$white: #ffffff;
$white: #fff;
// Grays
$gray: #87a6bc;
$gray-light: lighten( $gray, 33% ); //#f3f6f8
$gray-dark: darken( $gray, 38% ); //#2e4453
$gray-light: lighten($gray, 33%); //#f3f6f8
$gray-dark: darken($gray, 38%); //#2e4453
// $gray-text: ideal for standard, non placeholder text
// $gray-text-min: minimum contrast needed for WCAG 2.0 AA on white background
$gray-text: $gray-dark;
$gray-text-min: darken( $gray, 18% ); //#537994
$gray-text-min: darken($gray, 18%); //#537994
$woo_pink1: #955a89;
$woo_pink2: #bb77ae;
$color_text_blue: #0073AA;
$color_text_blue: #0073aa;
$color_button_primary: $woo_pink1;
$color_button_secondary: $woo_pink2;
@ -26,11 +26,13 @@ $color_button_secondary: $woo_pink2;
Tab navigation
------------------------------------------------------------------------------*/
.wc-helper {
.nav-tab-wrapper {
margin-bottom: 22px;
}
@media only screen and (max-width : 784px) {
@media only screen and (max-width: 784px) {
.nav-tab {
max-width: 40%;
overflow: hidden;
@ -45,7 +47,11 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
.button, .button:hover, .button:focus, .button:active{
.button,
.button:hover,
.button:focus,
.button:active {
background-color: $color_button_primary;
border-width: 0;
box-shadow: none;
@ -56,7 +62,7 @@ $color_button_secondary: $woo_pink2;
text-align: center;
white-space: normal !important;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
line-height: 2;
}
@ -73,7 +79,7 @@ $color_button_secondary: $woo_pink2;
}
.wc-helper .subscription-filter {
color: #2E4453;
color: #2e4453;
font-size: 13px;
line-height: 13px;
margin: 22px 0;
@ -83,17 +89,18 @@ $color_button_secondary: $woo_pink2;
position: relative;
.chevron {
color: #E1E1E1;
color: #e1e1e1;
border-bottom-width: 0;
line-height: 1;
padding: 0;
position: absolute;
top: 10px;
right: 14px;
top: 10px;
right: 14px;
}
}
li {
color: #0073AA;
color: #0073aa;
display: inline-block;
padding: 0 4px 0 8px;
position: relative;
@ -102,37 +109,38 @@ $color_button_secondary: $woo_pink2;
background-color: #979797;
content: " ";
position: absolute;
top: 0;
left: 0;
bottom: 0;
top: 0;
left: 0;
bottom: 0;
width: 1px;
}
&:first-of-type {
&::before {
display: none;
}
}
}
a{
color: #0073AA;
a {
color: #0073aa;
text-decoration: none;
&.current{
&.current {
color: #000;
font-weight: 600;
}
}
.count{
.count {
color: #555d66;
font-weight: 400;
}
@media only screen and (max-width : 600px) {
@media only screen and (max-width: 600px) {
background-color: #fff;
border: 1px solid #E1E1E1;
border: 1px solid #e1e1e1;
border-radius: 4px;
font-size: 14px;
@ -148,7 +156,7 @@ $color_button_secondary: $woo_pink2;
}
li {
border-bottom: 1px solid #E1E1E1;
border-bottom: 1px solid #e1e1e1;
}
label,
@ -165,6 +173,7 @@ $color_button_secondary: $woo_pink2;
}
li {
&::before {
display: none;
}
@ -175,7 +184,7 @@ $color_button_secondary: $woo_pink2;
}
span.chevron {
color: #555555;
color: #555;
opacity: 0.5;
transform: rotateX(180deg);
}
@ -185,7 +194,7 @@ $color_button_secondary: $woo_pink2;
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
label {
border-bottom: 1px solid #E1E1E1;
border-bottom: 1px solid #e1e1e1;
}
li {
@ -205,6 +214,7 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
.subscriptions-header {
margin: 3em 0 0;
position: relative;
@ -217,8 +227,10 @@ $color_button_secondary: $woo_pink2;
}
}
.button-update, .button-update:hover {
background-color: #E6E6E6;
.button-update,
.button-update:hover {
background-color: #e6e6e6;
border-radius: 4px;
color: #333;
font-weight: 800;
@ -243,16 +255,16 @@ $color_button_secondary: $woo_pink2;
.user-info {
background-color: #fff;
border: 1px solid #E1E1E1;
border: 1px solid #e1e1e1;
border-radius: 4px;
font-size: 12px;
line-height: 26px;
position: absolute;
top: -10px;
right: 0;
transition: all .1s ease-in;
top: -10px;
right: 0;
transition: all 0.1s ease-in;
@media only screen and (max-width : 600px) {
@media only screen and (max-width: 600px) {
position: relative;
width: 100%;
}
@ -263,11 +275,11 @@ $color_button_secondary: $woo_pink2;
}
&:hover {
box-shadow: 0 3px 5px rgba(0,0,0,.2);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}
header {
color: #555555;
color: #555;
font-weight: 600;
padding: 6px 14px;
position: relative;
@ -279,8 +291,8 @@ $color_button_secondary: $woo_pink2;
.dashicons {
opacity: 0.5;
position: absolute;
top: 9px;
right: 14px;
top: 9px;
right: 14px;
}
&:hover {
@ -292,18 +304,18 @@ $color_button_secondary: $woo_pink2;
display: none;
p {
border-top: 1px solid #E1E1E1;
border-top: 1px solid #e1e1e1;
padding: 6px 14px;
text-align: center;
}
.actions {
border-top: 1px solid #E1E1E1;
border-top: 1px solid #e1e1e1;
display: flex;
}
a {
color: #A26897;
color: #a26897;
cursor: pointer;
font-weight: 600;
line-height: 38px;
@ -319,17 +331,17 @@ $color_button_secondary: $woo_pink2;
}
&:first-child {
border-right: 1px solid #E1E1E1;
border-right: 1px solid #e1e1e1;
}
&:hover {
background-color: #A26897;
background-color: #a26897;
color: #fff;
}
}
.avatar {
border: 1px solid #ECE1EA;
border: 1px solid #ece1ea;
border-radius: 50%;
height: auto;
margin-right: 6px;
@ -342,11 +354,13 @@ $color_button_secondary: $woo_pink2;
.user-info:hover,
.user-info:focus,
.user-info:active {
header .dashicons {
transform: rotateX(180deg);
}
section {
display: block
display: block;
}
}
}
@ -356,10 +370,11 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
.striped > tbody > :nth-child(odd),
ul.striped > :nth-child(odd),
.alternate {
background-color: #ffffff;
background-color: #fff;
}
table.widefat,
@ -396,23 +411,24 @@ $color_button_secondary: $woo_pink2;
}
.button {
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
font-size: 11px;
}
}
.wp-list-table__row {
background-color: rgba(0,0,0,0);
background-color: rgba(0, 0, 0, 0);
td {
align-items: center;
background-color: #fff;
border: 0px;
border: 0;
//border-top: 1px solid #e5e5e5;
padding: 16px 22px;
vertical-align: middle;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
padding: 16px;
}
}
@ -424,10 +440,10 @@ $color_button_secondary: $woo_pink2;
&.is-ext-header {
td {
border-top: 1px solid #E1E1E1;
border-top: 1px solid #e1e1e1;
}
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
display: inline-flex;
flex-flow: row wrap;
width: 100%;
@ -436,6 +452,7 @@ $color_button_secondary: $woo_pink2;
display: block;
flex: 2;
}
.wp-list-table__ext-actions {
display: block;
flex: 1;
@ -445,8 +462,8 @@ $color_button_secondary: $woo_pink2;
}
&:last-child td {
border-bottom: 24px solid #F1F1F1;
box-shadow: inset 0 -1px 0 #E1E1E1;
border-bottom: 24px solid #f1f1f1;
box-shadow: inset 0 -1px 0 #e1e1e1;
}
}
@ -458,82 +475,84 @@ $color_button_secondary: $woo_pink2;
width: 100%;
&::before {
background-color: #E1E1E1;
background-color: #e1e1e1;
content: " ";
position: absolute;
top: 0;
bottom: 0;
left: 0 !important;
top: 0;
bottom: 0;
left: 0 !important;
width: 1px !important;
}
}
.wp-list-table__ext-details {
display: flex;
display: flex;
@media only screen and (max-width : 782px) {
display: table;
}
@media only screen and (max-width: 782px) {
display: table;
}
}
.wp-list-table__ext-title {
color: $color_text_blue;
font-size: 18px;
font-weight: 600;
width: 60%;
width: 60%;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
margin-bottom: 12px;
width: 100%;
}
@media only screen and (max-width : 320px) {
@media only screen and (max-width: 320px) {
max-width: 120px;
}
}
.wp-list-table__ext-description {
color: #333;
padding-left: 12px;
width: 40%;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
padding-left: 0;
width: 100%;
}
}
.wp-list-table__ext-status {
position: relative;
&.update-available::after {
background-color: #FFC322;
background-color: #ffc322;
content: " ";
position: absolute;
top: 0;
left: 0;
bottom: 0;
top: 0;
left: 0;
bottom: 0;
width: 5px;
}
&.expired::after {
background-color: #B81C23;
background-color: #b81c23;
content: " ";
position: absolute;
top: 0;
left: 0;
bottom: 0;
top: 0;
left: 0;
bottom: 0;
width: 5px;
}
.dashicons-update {
color: #FFC322;
color: #ffc322;
}
.dashicons-info {
color: #B81C23;
color: #b81c23;
}
p {
color: #333333;
color: #333;
margin: 0;
}
@ -549,34 +568,36 @@ $color_button_secondary: $woo_pink2;
text-align: right;
&::after {
background-color: #E1E1E1;
background-color: #e1e1e1;
content: " ";
position: absolute;
top: 0;
bottom: 0;
right: 0;
top: 0;
bottom: 0;
right: 0;
width: 1px;
}
}
.wp-list-table__ext-updates,
.wp-list-table__ext-licence {
td {
position: relative;
&::before {
background-color: #E1E1E1;
background-color: #e1e1e1;
content: " ";
height: 1px;
position: absolute;
top: 0;
left: 0;
right: 0;
top: 0;
left: 0;
right: 0;
}
}
td.wp-list-table__ext-status,
td.wp-list-table__licence-container {
&::before {
left: 22px !important;
width: auto !important;
@ -587,7 +608,7 @@ $color_button_secondary: $woo_pink2;
right: 22px;
}
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
display: flex;
.wp-list-table__ext-status {
@ -604,9 +625,9 @@ $color_button_secondary: $woo_pink2;
min-width: 0;
&::before {
left: 0 !important;
right: 0 !important;
width: 100% !important;
left: 0 !important;
right: 0 !important;
width: 100% !important;
}
}
}
@ -616,13 +637,13 @@ $color_button_secondary: $woo_pink2;
padding: 0 !important;
&::after {
background-color: #E1E1E1;
content: " ";
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 1px;
background-color: #e1e1e1;
content: " ";
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 1px;
}
}
@ -630,20 +651,20 @@ $color_button_secondary: $woo_pink2;
display: flex;
padding: 16px 22px;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
display: block;
}
&::before {
background-color: #E1E1E1;
content: " ";
background-color: #e1e1e1;
content: " ";
height: 1px;
position: absolute;
top: 0;
right: 22px;
left: 22px;
position: absolute;
top: 0;
right: 22px;
left: 22px;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
right: 0;
left: 0;
}
@ -653,7 +674,7 @@ $color_button_secondary: $woo_pink2;
padding-right: 16px;
vertical-align: middle;
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
padding: 0;
}
}
@ -664,6 +685,7 @@ $color_button_secondary: $woo_pink2;
}
.wp-list-table__licence-label {
label {
color: #23282d;
font-weight: 600;
@ -672,15 +694,16 @@ $color_button_secondary: $woo_pink2;
}
.wp-list-table__licence-field {
input {
height: 32px;
@media only screen and (max-width : 480px) {
@media only screen and (max-width: 480px) {
width: 100%;
}
}
@media only screen and (max-width : 782px) {
@media only screen and (max-width: 782px) {
padding: 8px 0 16px !important;
}
}
@ -692,12 +715,13 @@ $color_button_secondary: $woo_pink2;
.button {
margin-right: 8px;
}
.button-secondary {
float: right;
margin: 0 0 0 8px;
}
@media only screen and (max-width : 480px) {
@media only screen and (max-width: 480px) {
text-align: right;
}
}
@ -708,12 +732,13 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
td.color-bar {
border-left: solid 4px transparent;
}
td.color-bar.expired {
border-left-color: #B81C23;
border-left-color: #b81c23;
}
td.color-bar.expiring {
@ -721,11 +746,11 @@ $color_button_secondary: $woo_pink2;
}
td.color-bar.update-available {
border-left-color: #8FAE1B;
border-left-color: #8fae1b;
}
td.color-bar.expiring.update-available {
border-left-color: #8FAE1B;
border-left-color: #8fae1b;
}
}
@ -734,6 +759,7 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
.connect-wrapper {
background-color: #fff;
border: 1px solid #e5e5e5;
@ -776,7 +802,7 @@ $color_button_secondary: $woo_pink2;
}
}
@media only screen and (max-width : 784px) {
@media only screen and (max-width: 784px) {
display: block;
strong {
@ -802,7 +828,7 @@ $color_button_secondary: $woo_pink2;
}
.chevron {
color: #E1E1E1;
color: #e1e1e1;
display: block;
margin: 10px;
transform: rotateX(0deg);
@ -810,7 +836,7 @@ $color_button_secondary: $woo_pink2;
.buttons {
display: none;
border-top: 1px solid #E1E1E1;
border-top: 1px solid #e1e1e1;
padding: 10px 20px;
&.active {
@ -827,8 +853,9 @@ $color_button_secondary: $woo_pink2;
------------------------------------------------------------------------------*/
.wc-helper {
.start-container {
background-color: #ffffff;
background-color: #fff;
border-left: 4px solid #cc99c2;
padding: 45px 20px 20px 30px;
position: relative;
@ -848,8 +875,8 @@ $color_button_secondary: $woo_pink2;
font-size: 192px;
line-height: 1;
position: absolute;
top: 65%;
right: -3%;
top: 65%;
right: -3%;
text-align: center;
width: 1em;
}
@ -898,10 +925,10 @@ $color_button_secondary: $woo_pink2;
cursor: pointer;
display: block;
position: absolute;
top: 0;
bottom: -1px;
left: 0;
right: 0;
top: 0;
bottom: -1px;
left: 0;
right: 0;
text-align: left;
text-indent: -100000px;
z-index: 2;
@ -917,7 +944,7 @@ $color_button_secondary: $woo_pink2;
.form-toggle__switch {
align-self: flex-start;
background: lighten( $gray, 20% );
background: lighten($gray, 20%);
border-radius: 12px;
box-sizing: border-box;
display: inline-block;
@ -926,7 +953,7 @@ $color_button_secondary: $woo_pink2;
position: relative;
width: 40px;
height: 24px;
transition: all .4s ease, box-shadow 0s;
transition: all 0.4s ease, box-shadow 0s;
vertical-align: middle;
&::before,
@ -942,7 +969,7 @@ $color_button_secondary: $woo_pink2;
border-radius: 50%;
background: $white;
left: 0;
transition: all .2s ease;
transition: all 0.2s ease;
}
&::before {
@ -961,42 +988,47 @@ $color_button_secondary: $woo_pink2;
z-index: 1;
.form-toggle__label-content {
color: #87a6bc;
color: #87a6bc;
flex: 0 1 100%;
font-size: 13px;
line-height: 16px;
font-size: 13px;
line-height: 16px;
margin-left: 12px;
margin-right: 8px;
vertical-align: top;
text-transform: uppercase;
margin-right: 8px;
vertical-align: top;
text-transform: uppercase;
@media only screen and (max-width : 480px) {
@media only screen and (max-width: 480px) {
display: none;
}
}
}
.form-toggle {
.accessible-focus &:focus {
+ .form-toggle__label .form-toggle__switch {
box-shadow: 0 0 0 2px $woo_pink1;
}
&:checked + .form-toggle__label .form-toggle__switch {
box-shadow: 0 0 0 2px $woo_pink2;
}
}
& + .form-toggle__label .form-toggle__switch {
background: lighten( $gray, 10% );
background: lighten($gray, 10%);
}
&:not( :disabled ) {
&:not(:disabled) {
+ .form-toggle__label:hover .form-toggle__switch {
background: lighten( $gray, 20% );
background: lighten($gray, 20%);
}
}
&.active {
+ .form-toggle__label .form-toggle__switch {
background: $woo_pink1;
@ -1011,6 +1043,7 @@ $color_button_secondary: $woo_pink2;
}
&.disabled {
+ label.form-toggle__label span.form-toggle__switch {
opacity: 0.25;
}
@ -1019,17 +1052,21 @@ $color_button_secondary: $woo_pink2;
// Classes for toggle state before action is complete (updating plugin or something)
.form-toggle.is-toggling {
+ .form-toggle__label .form-toggle__switch {
background: $woo_pink1;
}
&:checked {
+ .form-toggle__label .form-toggle__switch {
background: lighten( $gray, 20% );
background: lighten($gray, 20%);
}
}
}
.form-toggle.is-compact {
+ .form-toggle__label .form-toggle__switch {
border-radius: 8px;
width: 24px;
@ -1041,8 +1078,11 @@ $color_button_secondary: $woo_pink2;
width: 12px;
}
}
&:checked {
+ .form-toggle__label .form-toggle__switch {
&::after {
left: 8px;
}

View File

@ -1,30 +1,32 @@
/**
* Twenty Seventeen integration styles
*/
@import 'mixins';
@import 'animation';
@import "mixins";
@import "animation";
/**
* Fonts
*/
@font-face {
font-family: 'star';
src: url('../fonts/star.eot');
src: url('../fonts/star.eot?#iefix') format('embedded-opentype'),
url('../fonts/star.woff') format('woff'),
url('../fonts/star.ttf') format('truetype'),
url('../fonts/star.svg#star') format('svg');
font-family: "star";
src: url("../fonts/star.eot");
src:
url("../fonts/star.eot?#iefix") format("embedded-opentype"),
url("../fonts/star.woff") format("woff"),
url("../fonts/star.ttf") format("truetype"),
url("../fonts/star.svg#star") format("svg");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'WooCommerce';
src: url('../fonts/WooCommerce.eot');
src: url('../fonts/WooCommerce.eot?#iefix') format('embedded-opentype'),
url('../fonts/WooCommerce.woff') format('woff'),
url('../fonts/WooCommerce.ttf') format('truetype'),
url('../fonts/WooCommerce.svg#WooCommerce') format('svg');
font-family: "WooCommerce";
src: url("../fonts/WooCommerce.eot");
src:
url("../fonts/WooCommerce.eot?#iefix") format("embedded-opentype"),
url("../fonts/WooCommerce.woff") format("woff"),
url("../fonts/WooCommerce.ttf") format("truetype"),
url("../fonts/WooCommerce.svg#WooCommerce") format("svg");
font-weight: normal;
font-style: normal;
}
@ -55,17 +57,21 @@
/**
* Global elements
*/
.woocommerce {
.woocommerce {
.blockUI.blockOverlay {
position: relative;
@include loader();
}
.loader {
@include loader();
}
form .form-row {
.required {
color: firebrick;
text-decoration: none;
@ -78,14 +84,16 @@
.optional {
visibility: visible;
}
}
}
.woocommerce-form-login {
.woocommerce-form-login__submit {
float: left;
margin-right: 1em;
}
.woocommerce-form-login__rememberme {
display: inline-block;
line-height: 3em;
@ -101,6 +109,7 @@
font-size: 0.8125rem;
a {
@include link();
}
}
@ -128,7 +137,7 @@
float: none;
line-height: 1.5;
border-radius: 2px;
transition: background-color ease-in-out .3s;
transition: background-color ease-in-out 0.3s;
}
span.page-numbers {
@ -147,7 +156,7 @@
top: 0;
left: 0;
display: inline-block;
padding: .5em 1em;
padding: 0.5em 1em;
font-size: 13px;
font-size: 0.8125rem;
text-transform: uppercase;
@ -155,10 +164,12 @@
}
.price {
del {
opacity: .5;
opacity: 0.5;
display: inline-block;
}
ins {
display: inline-block;
}
@ -190,7 +201,9 @@
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
a {
@include link_white();
}
}
@ -224,37 +237,40 @@
* Shop page
*/
.woocommerce-result-count {
padding: .75em 0;
padding: 0.75em 0;
}
/**
* Products
*/
ul.products {
li.product {
list-style: none;
.price,
.star-rating {
display: block;
margin-bottom: .75em;
margin-bottom: 0.75em;
}
.woocommerce-placeholder {
border: 1px solid #F2F2F2;
border: 1px solid #f2f2f2;
}
.button {
@include link();
&.loading {
opacity: .5;
opacity: 0.5;
}
}
.added_to_cart {
@include link();
margin-left: .5em;
margin-left: 0.5em;
}
}
}
@ -266,10 +282,10 @@ ul.products {
line-height: 1;
font-size: 1em;
width: 5.4em;
font-family: 'star';
font-family: "star";
&::before {
content: '\73\73\73\73\73';
content: "\73\73\73\73\73";
float: left;
top: 0;
left: 0;
@ -286,7 +302,7 @@ ul.products {
}
span::before {
content: '\53\53\53\53\53';
content: "\53\53\53\53\53";
top: 0;
position: absolute;
left: 0;
@ -318,13 +334,15 @@ a.remove {
}
}
dl.variation, .wc-item-meta {
dl.variation,
.wc-item-meta {
list-style: none outside;
dt, .wc-item-meta-label {
dt,
.wc-item-meta-label {
float: left;
clear: both;
margin-right: .25em;
margin-right: 0.25em;
display: inline-block;
list-style: none outside;
}
@ -343,6 +361,7 @@ dl.variation, .wc-item-meta {
* Single product
*/
.single-product {
div.product {
position: relative;
}
@ -365,14 +384,15 @@ dl.variation, .wc-item-meta {
.star-rating {
float: left;
margin-right: .25em;
margin-right: 0.25em;
}
}
form.cart {
.quantity {
float: left;
margin-right: .5em;
margin-right: 0.5em;
}
input {
@ -381,10 +401,12 @@ dl.variation, .wc-item-meta {
}
.woocommerce-variation-add-to-cart {
.button {
padding-top: .72em;
padding-bottom: .72em;
padding-top: 0.72em;
padding-bottom: 0.72em;
}
.button.disabled {
opacity: 0.2;
}
@ -392,12 +414,13 @@ dl.variation, .wc-item-meta {
}
table.variations {
label {
margin: 0;
}
select {
margin-right: .5em;
margin-right: 0.5em;
}
}
@ -421,7 +444,7 @@ table.variations {
}
.woocommerce-product-gallery__image--placeholder {
border: 1px solid #F2F2F2;
border: 1px solid #f2f2f2;
}
.woocommerce-product-gallery__image:nth-child(n+2) {
@ -430,6 +453,7 @@ table.variations {
}
.flex-control-thumbs {
li {
list-style: none;
cursor: pointer;
@ -437,7 +461,7 @@ table.variations {
}
img {
opacity: .5;
opacity: 0.5;
&:hover,
&.flex-active {
@ -453,27 +477,33 @@ table.variations {
}
.woocommerce-product-gallery--columns-3 {
.flex-control-thumbs li {
width: 33.3333%;
}
.flex-control-thumbs li:nth-child(3n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-4 {
.flex-control-thumbs li {
width: 25%;
}
.flex-control-thumbs li:nth-child(4n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-5 {
.flex-control-thumbs li {
width: 20%;
}
.flex-control-thumbs li:nth-child(5n+1) {
clear: left;
}
@ -493,6 +523,7 @@ table.variations {
margin-right: 1em;
&.active {
a {
box-shadow: 0 3px 0 rgba(15, 15, 15, 1);
}
@ -500,6 +531,7 @@ table.variations {
}
a {
@include link();
}
@ -517,6 +549,7 @@ table.variations {
}
#reviews {
li.review,
li.comment {
list-style: none;
@ -530,11 +563,12 @@ table.variations {
}
p.meta {
margin-bottom: .5em;
margin-bottom: 0.5em;
}
}
p.stars {
a {
position: relative;
height: 1em;
@ -552,40 +586,46 @@ table.variations {
width: 1em;
height: 1em;
line-height: 1;
font-family: 'WooCommerce';
content: '\e021';
font-family: "WooCommerce";
content: "\e021";
text-indent: 0;
}
&:hover {
~ a::before {
content: '\e021';
content: "\e021";
}
}
}
&:hover {
a {
&::before {
content: '\e020';
content: "\e020";
}
}
}
&.selected {
a.active {
&::before {
content: '\e020';
content: "\e020";
}
~ a::before {
content: '\e021';
content: "\e021";
}
}
a:not( .active ) {
a:not(.active) {
&::before {
content: '\e020';
content: "\e020";
}
}
}
@ -624,17 +664,21 @@ table.variations {
}
.widget_shopping_cart {
.buttons {
a {
display: inline-block;
margin: 0 .5em 0 0;
margin: 0 0.5em 0 0;
}
}
}
.widget_layered_nav {
.chosen {
&:before {
&::before {
content: "×";
display: inline-block;
width: 16px;
@ -644,12 +688,13 @@ table.variations {
text-align: center;
border-radius: 100%;
border: 1px solid black;
margin-right: .25em;
margin-right: 0.25em;
}
}
}
.widget_price_filter {
.price_slider {
margin-bottom: 1em;
}
@ -661,7 +706,7 @@ table.variations {
.button {
float: left;
padding: .4em 1em;
padding: 0.4em 1em;
}
}
@ -720,17 +765,19 @@ table.variations {
}
.widget_rating_filter {
li {
text-align: right;
.star-rating {
float: left;
margin-top: .3em;
margin-top: 0.3em;
}
}
}
.widget_product_search {
form {
position: relative;
}
@ -741,8 +788,8 @@ table.variations {
input[type=submit] {
position: absolute;
top: .5em;
right: .5em;
top: 0.5em;
right: 0.5em;
padding-left: 1em;
padding-right: 1em;
}
@ -752,6 +799,7 @@ table.variations {
* Account section
*/
.woocommerce-account {
.woocommerce-MyAccount-navigation {
float: right;
width: 25%;
@ -759,7 +807,7 @@ table.variations {
li {
list-style: none;
padding: .5em 0;
padding: 0.5em 0;
border-bottom: 1px solid #ddd;
a {
@ -770,14 +818,15 @@ table.variations {
}
}
&:before {
&::before {
content: "";
display: inline-block;
margin-right: .25em;
margin-right: 0.25em;
color: #ddd;
}
&.is-active {
a {
box-shadow: 0 3px 0 rgba(15, 15, 15, 1);
}
@ -794,8 +843,9 @@ table.variations {
* Cart
*/
.woocommerce-cart-form {
td {
padding: 1em .5em;
padding: 1em 0.5em;
}
img {
@ -818,14 +868,16 @@ table.variations {
}
.actions {
.input-text {
width: 130px !important;
float: left;
margin-right: .25em;
margin-right: 0.25em;
}
}
.quantity {
input {
width: 4em;
}
@ -833,21 +885,25 @@ table.variations {
}
.cart_totals {
th, td {
th,
td {
vertical-align: top;
padding: 1em 0;
line-height: 1.5em;
}
th {
padding-right: 1em;
}
.woocommerce-shipping-destination {
margin-bottom: 0;
}
}
.shipping-calculator-button {
margin-top: .5em;
margin-top: 0.5em;
display: inline-block;
}
@ -860,7 +916,7 @@ table.variations {
margin: 0;
li {
margin-bottom: .5em;
margin-bottom: 0.5em;
input {
float: left;
@ -886,7 +942,7 @@ table.variations {
border-color: #999;
}
&:after {
&::after {
content: "";
}
}
@ -895,6 +951,7 @@ table.variations {
* Checkout
*/
#ship-to-different-address {
label {
font-weight: 300;
cursor: pointer;
@ -903,7 +960,7 @@ table.variations {
position: relative;
display: block;
&:before {
&::before {
content: "";
display: block;
height: 16px;
@ -912,13 +969,13 @@ table.variations {
background: #bbb;
border-radius: 13em;
box-sizing: content-box;
transition: all ease-in-out .3s;
transition: all ease-in-out 0.3s;
position: absolute;
top: 4px;
right: 0;
}
&:after {
&::after {
content: "";
display: block;
width: 14px;
@ -928,7 +985,7 @@ table.variations {
top: 7px;
right: 17px;
border-radius: 13em;
transition: all ease-in-out .3s;
transition: all ease-in-out 0.3s;
}
}
@ -936,11 +993,11 @@ table.variations {
display: none;
}
input[type=checkbox]:checked + span:after {
input[type=checkbox]:checked + span::after {
right: 3px;
}
input[type=checkbox]:checked + span:before {
input[type=checkbox]:checked + span::before {
border-color: #000;
background: #000;
}
@ -948,10 +1005,12 @@ table.variations {
}
.woocommerce-no-js {
form.woocommerce-form-login,
form.woocommerce-form-coupon {
display: block !important;
}
.woocommerce-form-login-toggle,
.woocommerce-form-coupon-toggle,
.showcoupon {
@ -960,37 +1019,40 @@ table.variations {
}
.woocommerce-terms-and-conditions {
border: 1px solid rgba(0,0,0,.2);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
background: rgba(0,0,0,.05);
border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
background: rgba(0, 0, 0, 0.05);
}
.woocommerce-terms-and-conditions-link {
display: inline-block;
&:after {
&::after {
content: "";
display: inline-block;
border-style: solid;
margin-bottom: 2px;
margin-left: .25em;
margin-left: 0.25em;
border-width: 6px 6px 0 6px;
border-color: #111 transparent transparent transparent;
}
&.woocommerce-terms-and-conditions-link--open:after {
&.woocommerce-terms-and-conditions-link--open::after {
border-width: 0 6px 6px 6px;
border-color: transparent transparent #111 transparent;
}
}
.woocommerce-checkout {
.woocommerce-input-wrapper {
.description {
background: royalblue;
color: #fff;
border-radius: 3px;
padding: 1em;
margin: .5em 0 0;
margin: 0.5em 0 0;
clear: both;
display: none;
position: relative;
@ -1002,11 +1064,11 @@ table.variations {
box-shadow: none;
}
&:before {
&::before {
left: 50%;
top: 0%;
margin-top: -4px;
transform: translatex(-50%) rotate(180deg);
transform: translateX(-50%) rotate(180deg);
content: "";
position: absolute;
border-width: 4px 6px 0 6px;
@ -1022,26 +1084,32 @@ table.variations {
.select2-choice:hover {
box-shadow: none !important;
}
.select2-choice {
padding: .7em 0 .7em .7em;
padding: 0.7em 0 0.7em 0.7em;
}
.select2-container .select2-selection--single {
height: 48px;
}
.select2-container .select2-selection--single .select2-selection__rendered {
line-height: 48px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 46px;
}
.select2-container--focus .select2-selection {
border-color: black;
}
}
.woocommerce-checkout-review-order-table {
td {
padding: 1em .5em;
padding: 1em 0.5em;
}
dl.variation {
@ -1063,6 +1131,7 @@ table.variations {
ul,
ol {
&:last-of-type {
margin-bottom: 0;
}
@ -1102,7 +1171,8 @@ table.variations {
display: none;
& + label {
&:before {
&::before {
content: "";
display: inline-block;
width: 16px;
@ -1111,14 +1181,15 @@ table.variations {
box-shadow: 0 0 0 2px black;
background: white;
margin-left: 4px;
margin-right: .5em;
margin-right: 0.5em;
border-radius: 100%;
transform: translateY(2px);
}
}
&:checked + label {
&:before {
&::before {
background: black;
}
}
@ -1126,10 +1197,12 @@ table.variations {
}
.colors-dark {
.page-numbers {
color: #444;
&.next, &.prev {
&.next,
&.prev {
color: #ddd;
}
}
@ -1143,17 +1216,21 @@ table.variations {
}
.wc_payment_method {
.payment_box {
background: #333;
}
}
.select2-container--default {
.select2-results {
.select2-results__options {
background:#333;
background: #333;
}
.select2-results__option[data-selected="true"]{
.select2-results__option[data-selected="true"] {
color: #333;
}
}
@ -1177,7 +1254,9 @@ table.variations {
* Layout stuff
*/
@media screen and (min-width: 48em) {
.has-sidebar.woocommerce-page:not(.error404) {
#primary {
width: 74%;
}

File diff suppressed because it is too large Load Diff

View File

@ -122,6 +122,10 @@ jQuery( function( $ ) {
}
}
if ( ! placeholder ) {
placeholder = wc_country_select_params.i18n_select_state_text;
}
$statebox.closest( 'p.form-row' ).show();
if ( $statebox.is( 'input' ) ) {

View File

@ -205,13 +205,30 @@ class WC_Checkout {
return $fieldset ? $this->fields[ $fieldset ] : $this->fields;
}
// Fields are based on billing/shipping country. Grab those values but ensure they are valid for the store before using.
$billing_country = $this->get_value( 'billing_country' );
$billing_country = empty( $billing_country ) ? WC()->countries->get_base_country() : $billing_country;
$allowed_countries = WC()->countries->get_allowed_countries();
if ( ! array_key_exists( $billing_country, $allowed_countries ) ) {
$billing_country = current( array_keys( $allowed_countries ) );
}
$shipping_country = $this->get_value( 'shipping_country' );
$shipping_country = empty( $shipping_country ) ? WC()->countries->get_base_country() : $shipping_country;
$allowed_countries = WC()->countries->get_shipping_countries();
if ( ! array_key_exists( $shipping_country, $allowed_countries ) ) {
$shipping_country = current( array_keys( $allowed_countries ) );
}
$this->fields = array(
'billing' => WC()->countries->get_address_fields(
$this->get_value( 'billing_country' ),
$billing_country,
'billing_'
),
'shipping' => WC()->countries->get_address_fields(
$this->get_value( 'shipping_country' ),
$shipping_country,
'shipping_'
),
'account' => array(),

View File

@ -1253,6 +1253,7 @@ class WC_Countries {
foreach ( $fields as $key => $value ) {
if ( 'state' === $key ) {
$value['country_field'] = $type . 'country';
$value['country'] = $country;
}
$address_fields[ $type . $key ] = $value;
}

View File

@ -111,11 +111,14 @@ class WC_Shortcode_My_Account {
$args = shortcode_atts(
array(
'order_count' => 15, // @deprecated 2.6.0. Keep for backward compatibility.
), $atts, 'woocommerce_my_account'
),
$atts,
'woocommerce_my_account'
);
wc_get_template(
'myaccount/my-account.php', array(
'myaccount/my-account.php',
array(
'current_user' => get_user_by( 'id', get_current_user_id() ),
'order_count' => 'all' === $args['order_count'] ? -1 : $args['order_count'],
)
@ -141,7 +144,8 @@ class WC_Shortcode_My_Account {
$status->name = wc_get_order_status_name( $order->get_status() );
wc_get_template(
'myaccount/view-order.php', array(
'myaccount/view-order.php',
array(
'status' => $status, // @deprecated 2.2.
'order' => wc_get_order( $order_id ),
'order_id' => $order_id,
@ -164,8 +168,29 @@ class WC_Shortcode_My_Account {
public static function edit_address( $load_address = 'billing' ) {
$current_user = wp_get_current_user();
$load_address = sanitize_key( $load_address );
$country = get_user_meta( get_current_user_id(), $load_address . '_country', true );
$address = WC()->countries->get_address_fields( get_user_meta( get_current_user_id(), $load_address . '_country', true ), $load_address . '_' );
if ( ! $country ) {
$country = WC()->countries->get_base_country();
}
if ( 'billing' === $load_address ) {
$allowed_countries = WC()->countries->get_allowed_countries();
if ( ! array_key_exists( $country, $allowed_countries ) ) {
$country = current( array_keys( $allowed_countries ) );
}
}
if ( 'shipping' === $load_address ) {
$allowed_countries = WC()->countries->get_shipping_countries();
if ( ! array_key_exists( $country, $allowed_countries ) ) {
$country = current( array_keys( $allowed_countries ) );
}
}
$address = WC()->countries->get_address_fields( $country, $load_address . '_' );
// Enqueue scripts.
wp_enqueue_script( 'wc-country-select' );
@ -182,14 +207,6 @@ class WC_Shortcode_My_Account {
case 'shipping_email':
$value = $current_user->user_email;
break;
case 'billing_country':
case 'shipping_country':
$value = WC()->countries->get_base_country();
break;
case 'billing_state':
case 'shipping_state':
$value = WC()->countries->get_base_state();
break;
}
}
@ -197,7 +214,8 @@ class WC_Shortcode_My_Account {
}
wc_get_template(
'myaccount/form-edit-address.php', array(
'myaccount/form-edit-address.php',
array(
'load_address' => $load_address,
'address' => apply_filters( 'woocommerce_address_to_edit', $address, $load_address ),
)
@ -227,7 +245,8 @@ class WC_Shortcode_My_Account {
// Reset key / login is correct, display reset password form with hidden key / login values.
if ( is_object( $user ) ) {
return wc_get_template(
'myaccount/form-reset-password.php', array(
'myaccount/form-reset-password.php',
array(
'key' => $rp_key,
'login' => $rp_login,
)
@ -238,7 +257,8 @@ class WC_Shortcode_My_Account {
// Show lost password form by default.
wc_get_template(
'myaccount/form-lost-password.php', array(
'myaccount/form-lost-password.php',
array(
'form' => 'lost_password',
)
);

View File

@ -1093,30 +1093,30 @@ function wc_get_base_location() {
* @return array
*/
function wc_get_customer_default_location() {
$location = array();
$set_default_location_to = get_option( 'woocommerce_default_customer_address', 'geolocation' );
$default_location = '' === $set_default_location_to ? '' : get_option( 'woocommerce_default_country', '' );
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', $default_location ) );
switch ( get_option( 'woocommerce_default_customer_address' ) ) {
case 'geolocation_ajax':
case 'geolocation':
// Exclude common bots from geolocation by user agent.
$ua = strtolower( wc_get_user_agent() );
// Geolocation takes priority if used and if geolocation is possible.
if ( 'geolocation' === $set_default_location_to || 'geolocation_ajax' === $set_default_location_to ) {
$ua = wc_get_user_agent();
if ( ! strstr( $ua, 'bot' ) && ! strstr( $ua, 'spider' ) && ! strstr( $ua, 'crawl' ) ) {
$location = WC_Geolocation::geolocate_ip( '', false, false );
// Exclude common bots from geolocation by user agent.
if ( ! stristr( $ua, 'bot' ) && ! stristr( $ua, 'spider' ) && ! stristr( $ua, 'crawl' ) ) {
$geolocation = WC_Geolocation::geolocate_ip( '', true, false );
if ( ! empty( $geolocation['country'] ) ) {
$location = $geolocation;
}
}
}
// Base fallback.
if ( empty( $location['country'] ) ) {
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
}
break;
case 'base':
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
break;
default:
$countries = WC()->countries->get_allowed_countries();
$location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', 1 === count( $countries ) ? key( $countries ) : '' ) );
break;
// Once we have a location, ensure it's valid, otherwise fallback to a valid location.
$allowed_country_codes = WC()->countries->get_allowed_countries();
if ( ! empty( $location['country'] ) && ! array_key_exists( $location['country'], $allowed_country_codes ) ) {
$location['country'] = current( $allowed_country_codes );
$location['state'] = '';
}
return apply_filters( 'woocommerce_customer_default_location_array', $location );

View File

@ -2672,7 +2672,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
} elseif ( ! is_null( $for_country ) && is_array( $states ) ) {
$field .= '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="state_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ) . '">
$field .= '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="state_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ? $args['placeholder'] : esc_html__( 'Select an option&hellip;', 'woocommerce' ) ) . '">
<option value="">' . esc_html__( 'Select an option&hellip;', 'woocommerce' ) . '</option>';
foreach ( $states as $ckey => $cvalue ) {

View File

@ -12,24 +12,20 @@
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.0.9
* @version 3.6.0
* @global WC_Checkout $checkout
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/** @global WC_Checkout $checkout */
defined( 'ABSPATH' ) || exit;
?>
<div class="woocommerce-billing-fields">
<?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
<h3><?php _e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h3>
<h3><?php esc_html_e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h3>
<?php else : ?>
<h3><?php _e( 'Billing details', 'woocommerce' ); ?></h3>
<h3><?php esc_html_e( 'Billing details', 'woocommerce' ); ?></h3>
<?php endif; ?>
@ -37,14 +33,11 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="woocommerce-billing-fields__field-wrapper">
<?php
$fields = $checkout->get_checkout_fields( 'billing' );
$fields = $checkout->get_checkout_fields( 'billing' );
foreach ( $fields as $key => $field ) {
if ( isset( $field['country_field'], $fields[ $field['country_field'] ] ) ) {
$field['country'] = $checkout->get_value( $field['country_field'] );
}
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
foreach ( $fields as $key => $field ) {
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
?>
</div>
@ -57,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p class="form-row form-row-wide create-account">
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ) ?> type="checkbox" name="createaccount" value="1" /> <span><?php _e( 'Create an account?', 'woocommerce' ); ?></span>
<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ); ?> type="checkbox" name="createaccount" value="1" /> <span><?php esc_html_e( 'Create an account?', 'woocommerce' ); ?></span>
</label>
</p>

View File

@ -12,20 +12,18 @@
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.0.9
* @version 3.6.0
* @global WC_Checkout $checkout
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
defined( 'ABSPATH' ) || exit;
?>
<div class="woocommerce-shipping-fields">
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
<h3 id="ship-to-different-address">
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php _e( 'Ship to a different address?', 'woocommerce' ); ?></span>
<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php esc_html_e( 'Ship to a different address?', 'woocommerce' ); ?></span>
</label>
</h3>
@ -35,14 +33,11 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="woocommerce-shipping-fields__field-wrapper">
<?php
$fields = $checkout->get_checkout_fields( 'shipping' );
$fields = $checkout->get_checkout_fields( 'shipping' );
foreach ( $fields as $key => $field ) {
if ( isset( $field['country_field'], $fields[ $field['country_field'] ] ) ) {
$field['country'] = $checkout->get_value( $field['country_field'] );
}
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
foreach ( $fields as $key => $field ) {
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
?>
</div>
@ -59,7 +54,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?>
<h3><?php _e( 'Additional information', 'woocommerce' ); ?></h3>
<h3><?php esc_html_e( 'Additional information', 'woocommerce' ); ?></h3>
<?php endif; ?>

View File

@ -12,7 +12,7 @@
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.4.0
* @version 3.6.0
*/
defined( 'ABSPATH' ) || exit;
@ -35,9 +35,6 @@ do_action( 'woocommerce_before_edit_account_address_form' ); ?>
<div class="woocommerce-address-fields__field-wrapper">
<?php
foreach ( $address as $key => $field ) {
if ( isset( $field['country_field'], $address[ $field['country_field'] ] ) ) {
$field['country'] = wc_get_post_data_by_key( $field['country_field'], $address[ $field['country_field'] ]['value'] );
}
woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
}
?>