Bring up-to-date with master and resolve merge conflicts

This commit is contained in:
claudiulodro 2018-04-17 13:27:39 -07:00
commit f9e45bea91
383 changed files with 24793 additions and 17939 deletions

View File

@ -1,5 +1,49 @@
== Changelog ==
= 3.3.5 - 2018-04-10 =
* Fix - Shop page notice should not appear when editing the "Hello World!" page.
* Fix - Inconsistent order item refund sign.
* Fix - Change `wc_get_price_excluding_tax` to not round the return value so calculations in admin are not pre-rounded.
* Fix - Use minimum price instead of maximum price when ordering variable products from low to high on term archives.
* Fix - `order` and `orderby` on shop page when using rewrite rules.
* Fix - Ajax loading spinner when using twentyseventeen theme.
* Fix - Out of Stock products change stock to On Backorder when imported to update existing products.
* Fix - Visibility dropdown not responding in quick edit when stock management is disabled.
* Fix - Featured paramenter in products endpoint on REST API.
* Fix - Linebreaks in order item meta.
* Fix - Product rating count when updated by admin.
* Tweak - Define array before attempting to append to it.
* Tweak - Change WC WP-CLI commands default per_page value to 100.
* Tweak - Ensure background process class returns `data` as an array.
* Tweak - Increase orders table checkbox column size on small devices.
* Tweak - Better support for infinite scroll in Jetpack.
= 3.3.4 - 2018-03-20 =
* Fix - Fixed undefined index after running setup wizard two times on fresh install.
* Fix - wc_get_loop_class; force columns to be a minimum of 1.
* Fix - Added loading spinner to WC panels in menu admin.
* Fix - Use relative scheme for AJAX endpoint to avoid errors when using a mix of HTTP and HTTPS.
* Fix - Fix SelectWoo templateSelection property.
* Fix - Layered nav support on unsupported theme archives.
* Fix - Prevent full refresh when editing store notice in the customizer.
* Fix - Only append tax label in email content if taxes are enabled.
* Fix - More reliable Jetpack detection.
* Fix - Check if product has weight before calculate weight total in cart.
* Fix - Correctly handle default ordering on the search page.
* Fix - Fix default product category handling in installer.
* Fix - Properly check slugs when updating attributes.
* Fix - Use gallery thumbnail size for variation image switcher.
* Fix - Clear subcategory cache when updating product categories.
* Fix - Round fractional cents when out of base.
* Fix - Inherit 'is variation' from existing attribute during csv import.
* Fix - Set is_shortcode loop prop when outputting subcategories.
* Fix - Reload gateways after updating the order.
* Tweak - Use wc_get_default_products_per_row as the default for product shortcodes.
* Tweak - Add post_excerpt to product search.
* Tweak - Update the description of the user tracking notice in the onboarding wizard.
* Tweak - Add extra data in order mobile view (status and date).
* Tweak - Add profile link to order screen.
= 3.3.3 - 2018-02-21 =
* Fix - Fixed is_numeric check which was affecting order subtotals/totals when using comma decimal separator.
* Fix - Add missing direct script access checks to loop templates.

View File

@ -1 +1 @@
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}div.woocommerce-message p:last-child{max-width:inherit}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,-1px 0 1px #a36597,0 1px 1px #a36597,1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}div.woocommerce-message p:last-child{max-width:inherit}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,-1px 0 1px #a36597,0 1px 1px #a36597,1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}

View File

@ -1 +1 @@
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}div.woocommerce-message p:last-child{max-width:inherit}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}div.woocommerce-message p:last-child{max-width:inherit}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -807,6 +807,7 @@ table.wc_status_table--tools {
pre {
font-family: monospace;
white-space: pre-wrap;
word-wrap: break-word;
}
}
@ -825,6 +826,11 @@ table.wc_status_table--tools {
margin-left: 10px;
}
label.stock_status_field {
clear: both;
float: left;
}
.dimensions div {
display: block;
margin: 0.2em 0;
@ -2356,7 +2362,11 @@ ul.wc_coupon_list_block {
}
.post-type-shop_order .wp-list-table {
td.check-column {
width: 1em;
}
td.column-order_number {
padding-left: 0;
padding-bottom: .5em;
}
td.column-order_status,
@ -2367,6 +2377,9 @@ ul.wc_coupon_list_block {
display: none !important;
}
}
td.column-order_date {
padding-left: 0 !important;
}
td.column-order_status {
float: right;
}
@ -2603,8 +2616,7 @@ table.wp-list-table {
}
span.wc-image,
span.wc-featured,
span.wc-type {
span.wc-featured {
@include ir();
margin: 0 auto;
@ -2627,42 +2639,6 @@ table.wp-list-table {
cursor: pointer;
}
span.wc-type::before {
font-family: 'WooCommerce';
content: '\e006';
}
span.product-type {
@include ir();
font-size: 1.6em;
margin: 0 auto;
-moz-osx-font-smoothing: grayscale;
&::before {
@include icon( '\e006' );
}
&.grouped::before {
content: '\e002';
}
&.external::before {
content: '\e034';
}
&.variable::before {
content: '\e003';
}
&.downloadable::before {
content: '\e001';
}
&.virtual::before {
content: '\e000';
}
}
mark {
&.instock,
&.outofstock,
@ -2911,23 +2887,19 @@ table.wc_shipping {
th, td {
display: table-cell !important;
padding: 1em !important;
vertical-align: top;
line-height: 1.75em;
}
td {
&.wc_emails td {
vertical-align: middle;
padding: 7px;
line-height: 2em;
}
tr:nth-child( odd ) td {
background: #f9f9f9;
}
th {
padding: 9px 7px !important;
vertical-align: middle;
}
td.name {
font-weight: 700;
}
@ -2949,16 +2921,10 @@ table.wc_shipping {
margin: 0;
}
}
th.sort {
width: 28px;
padding: 0;
}
td.sort {
padding: 0 7px;
cursor: move;
font-size: 15px;
text-align: center;
vertical-align: middle;
&::before {
content: '\f333';
@ -2970,8 +2936,12 @@ table.wc_shipping {
width: 17px;
float: left;
height: 100%;
line-height: 24px;
}
}
.wc-payment-gateway-method-name {
display: block;
}
.wc-email-settings-table-name {
font-weight: 700;
span {
@ -2987,18 +2957,6 @@ table.wc_shipping {
margin: 0 auto;
}
}
.wc-email-settings-table-actions a {
@include ir();
padding: 0 !important;
height: 2em !important;
width: 2em;
&::after {
@include icon('\f111');
font-family: 'Dashicons';
line-height: 1.85;
}
}
}
.wc-shipping-zone-settings {
th {
@ -3088,9 +3046,6 @@ table.wc-shipping-zones, table.wc-shipping-zone-methods, table.wc-shipping-class
text-align: center;
}
}
tbody td {
padding: 1.5em 1em !important;
}
td.wc-shipping-zones-blank-state, td.wc-shipping-zone-method-blank-state {
background: #f7f1f6 !important;
overflow: hidden;
@ -3327,6 +3282,8 @@ table.wc-shipping-zones, table.wc-shipping-zone-methods, table.wc-shipping-class
text-indent: -9999px;
border-radius: 10em;
position: relative;
margin-top: -1px;
vertical-align: text-top;
&:before {
content: "";
@ -3654,6 +3611,7 @@ img.help_tip {
}
}
.wc_payment_gateways_wrapper,
.wc_emails_wrapper {
padding: 0 15px 10px 0;
}

View File

@ -1 +1 @@
body{background:#f1f1f1;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 0 0 1em}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:right;height:70px;margin:0 0 0 1em}.wc-auth-logged-in-as .wc-auth-logout{float:left}.wc-auth .wc-auth-actions{overflow:hidden;padding-right:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;box-sizing:border-box;color:#777;float:left;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:left;opacity:1;text-shadow:0 -1px 1px #8a4f7f,-1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:left}.wc-auth .wc-auth-actions .wc-auth-deny{float:right;margin-right:-24px}
body{background:#f1f1f1;-webkit-box-shadow:none;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 0 0 1em}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:right;height:70px;margin:0 0 0 1em}.wc-auth-logged-in-as .wc-auth-logout{float:left}.wc-auth .wc-auth-actions{overflow:hidden;padding-right:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;-webkit-box-sizing:border-box;box-sizing:border-box;color:#777;float:left;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:left;opacity:1;text-shadow:0 -1px 1px #8a4f7f,-1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:left}.wc-auth .wc-auth-actions .wc-auth-deny{float:right;margin-right:-24px}

View File

@ -1 +1 @@
body{background:#f1f1f1;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 1em 0 0}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:left;height:70px;margin:0 1em 0 0}.wc-auth-logged-in-as .wc-auth-logout{float:right}.wc-auth .wc-auth-actions{overflow:hidden;padding-left:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;box-sizing:border-box;color:#777;float:right;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:right;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:right}.wc-auth .wc-auth-actions .wc-auth-deny{float:left;margin-left:-24px}
body{background:#f1f1f1;-webkit-box-shadow:none;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.13);box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 1em 0 0}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:left;height:70px;margin:0 1em 0 0}.wc-auth-logged-in-as .wc-auth-logout{float:right}.wc-auth .wc-auth-actions{overflow:hidden;padding-left:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border-bottom-width:2px;border:1px solid #d7d7d7;-webkit-box-sizing:border-box;box-sizing:border-box;color:#777;float:right;font-size:1.25em;height:auto;line-height:1em;padding:1em 2em;text-align:center;width:50%}.wc-auth .wc-auth-actions .button:focus,.wc-auth .wc-auth-actions .button:hover{background:#fcfcfc}.wc-auth .wc-auth-actions .button-primary{background:#ad6ea1;border-color:#a16696;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 0 rgba(0,0,0,.15);color:#fff;float:right;opacity:1;text-shadow:0 -1px 1px #8a4f7f,1px 0 1px #8a4f7f,0 1px 1px #8a4f7f,-1px 0 1px #8a4f7f}.wc-auth .wc-auth-actions .button-primary:focus,.wc-auth .wc-auth-actions .button-primary:hover{background:#b472a8;color:#fff}.wc-auth .wc-auth-actions .wc-auth-approve{float:right}.wc-auth .wc-auth-actions .wc-auth-deny{float:left;margin-left:-24px}

View File

@ -1 +1 @@
@charset "UTF-8";@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-weight:400;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-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
@charset "UTF-8";@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-weight:400;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-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;-webkit-box-sizing:border-box;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}

View File

@ -1 +1 @@
@charset "UTF-8";@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-weight:400;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-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
@charset "UTF-8";@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-weight:400;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-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;-webkit-box-sizing:border-box;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,35 @@
/**
* WooCommerce Photoswipe styles.
* 1. These styles are required to overwrite default theme button styles (Twenty Twelve adds gradients via background-image).
* 2. For zooming on mobile.
*/
.woocommerce img.pswp__img,
.woocommerce-page img.pswp__img {
max-width: none; /* 2 */
}
button.pswp__button {
box-shadow: none !important;
background-image: url('default-skin/default-skin.png') !important;
}
button.pswp__button,
button.pswp__button:hover,
button.pswp__button--arrow--left::before,
button.pswp__button--arrow--right::before {
background-color: transparent !important; /* 1 */
}
button.pswp__button--arrow--left,
button.pswp__button--arrow--right,
button.pswp__button--arrow--left:hover,
button.pswp__button--arrow--right:hover {
background-image: none !important; /* 1 */
}
button.pswp__button--close:hover {
background-position: 0 -44px;
}
button.pswp__button--zoom:hover {
background-position: -88px 0;
}
/*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
/*
Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;-webkit-box-shadow:none!important;box-shadow:none!important;border-bottom:1px solid gray!important}

View File

@ -1 +1 @@
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;-webkit-box-shadow:none!important;box-shadow:none!important;border-bottom:1px solid gray!important}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@
* Twenty Seventeen integration styles
*/
@import 'mixins';
@import 'animation';
/**
* Fonts
@ -138,12 +139,18 @@
.required {
color: firebrick;
text-decoration: none;
visibility: hidden; // Only show optional by default.
&[title] {
border-bottom: none;
border: 0 !important;
}
}
.optional {
visibility: visible;
}
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
@ -563,30 +570,6 @@ table.variations {
}
}
/**
* Photoswipe
* 1. These styles are required to overwrite default theme button styles (Twenty Twelve adds gradients via background-image).
*/
button.pswp__button,
button.pswp__button:hover,
button.pswp__button--arrow--left::before,
button.pswp__button--arrow--right::before {
background-color: transparent !important; /* 1 */
}
button.pswp__button--close:hover {
background-position: 0 -44px;
}
button.pswp__button--zoom:hover {
background-position: -88px 0;
}
.pswp img {
max-width: none;
}
/**
* Widgets
*/
@ -917,13 +900,77 @@ button.pswp__button--zoom:hover {
}
}
.woocommerce-no-js {
form.woocommerce-form-login,
form.woocommerce-form-coupon {
display: block !important;
}
.woocommerce-form-login-toggle,
.woocommerce-form-coupon-toggle,
.showcoupon {
display: none !important;
}
}
.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);
}
.woocommerce-terms-and-conditions-link {
display: inline-block;
&:after {
content: "";
display: inline-block;
border-style: solid;
margin-bottom: 2px;
margin-left: .25em;
border-width: 6px 6px 0 6px;
border-color: #111 transparent transparent transparent;
}
&.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;
clear: both;
display: none;
position: relative;
a {
color: #fff;
text-decoration: underline;
border: 0;
box-shadow: none;
}
&:before {
left: 50%;
top: 0%;
margin-top: -4px;
transform: translatex(-50%) rotate(180deg);
content: "";
position: absolute;
border-width: 4px 6px 0 6px;
border-style: solid;
border-color: royalblue transparent transparent transparent;
z-index: 100;
display: block;
}
}
}
.select2-choice,
.select2-choice:hover {
box-shadow: none !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,16 @@ body {
max-width: 30%;
}
}
.wc-setup {
text-align: center;
.select2-container {
text-align: left;
}
.hidden {
display: none;
}
}
.wc-setup-content {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
padding: 2em;
@ -20,6 +30,7 @@ body {
background: #fff;
overflow: hidden;
zoom: 1;
text-align: left;
h1, h2, h3, table {
margin: 0 0 20px;
@ -297,7 +308,6 @@ body {
}
}
.woocommerce-newsletter,
.woocommerce-tracker,
.updated {
padding: 24px 24px 0;
margin: 0 0 24px;
@ -312,9 +322,74 @@ body {
margin: 0 0 24px;
}
}
.woocommerce-tracker + .woocommerce-newsletter {
margin-top: -24px;
border-top: 2px dashed #ddd;
.woocommerce-tracker {
margin: 24px 0;
border: 1px solid #eee;
padding: 20px;
border-radius: 4px;
overflow: hidden;
p {
font-size: 14px;
line-height: 1.5em;
}
.checkbox {
line-height: 24px;
font-weight: 500;
font-size: 1em;
margin-top: 0;
margin-bottom: 20px;
input[type="checkbox"] {
opacity: 0;
position: absolute;
left: -9999px;
}
label {
position: relative;
display: inline-block;
padding-left: 28px;
&:before,
&:after {
position: absolute;
content: "";
display: inline-block;
}
&:before {
height: 16px;
width: 16px;
left: 0px;
top: 3px;
border: 1px solid #aaa;
background-color: #fff;
border-radius: 3px;
}
&:after {
height: 5px;
width: 9px;
border-left: 2px solid;
border-bottom: 2px solid;
transform: rotate(-45deg);
left: 4px;
top: 7px;
color: #fff;
}
}
input[type="checkbox"] + label::after {
content: none;
}
input[type="checkbox"]:checked + label::after {
content: "";
}
input[type="checkbox"]:focus + label::before {
outline: rgb(59, 153, 252) auto 5px;
}
input[type="checkbox"]:checked + label::before {
background: #935687;
border-color: #935687;
outline: none;
}
}
}
}
.wc-setup-steps {
@ -417,8 +492,8 @@ body {
.wc-setup-footer-links {
font-size: 0.85em;
color: #b5b5b5;
margin: 1.18em 0;
display: block;
margin: 1.18em auto;
display: inline-block;
text-align: center;
}
@ -828,11 +903,21 @@ h3.jetpack-reasons {
font-size: 14px;
}
.jetpack-logo {
.jetpack-logo, .wcs-notice {
display: block;
margin: 1.75em auto 2em auto;
max-height: 175px;
}
.activate-splash {
.jetpack-logo {
width: 170px;
margin-bottom: 0;
}
.wcs-notice {
margin-top: 1em;
padding-left: 57px;
}
}
.step {
text-align: center;
@ -888,8 +973,6 @@ h3.jetpack-reasons {
}
.store-address-container {
margin-top: 4px;
.city-and-postcode {
display: flex;
@ -902,9 +985,11 @@ h3.jetpack-reasons {
}
}
}
}
.store-currency-container {
margin-top: 10px;
input[type="text"],
select,
.select2-container {
margin-bottom: 10px;
}
}
.product-type-container {
margin-top: 14px;
@ -1072,15 +1157,6 @@ p.jetpack-terms {
}
}
.allow-tracking {
color: #9f9f9f;
margin-top: 1em;
text-align: center;
font-size: 0.9em;
padding-top: 2em;
border-top: 1px solid #ccc;
}
.wc-wizard-service-setting-stripe_create_account, .wc-wizard-service-setting-ppec_paypal_reroute_requests {
display: flex;
align-items: flex-start;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1276,6 +1276,40 @@ p.demo_store,
display: inline;
}
.woocommerce-input-wrapper {
.description {
background: #1e85be;
color: #fff;
border-radius: 3px;
padding: 1em;
margin: .5em 0 0;
clear: both;
display: none;
position: relative;
a {
color: #fff;
text-decoration: underline;
border: 0;
box-shadow: none;
}
&:before {
left: 50%;
top: 0%;
margin-top: -4px;
transform: translatex(-50%) rotate(180deg);
content: "";
position: absolute;
border-width: 4px 6px 0 6px;
border-style: solid;
border-color: #1e85be transparent transparent transparent;
z-index: 100;
display: block;
}
}
}
select {
cursor: pointer;
margin: 0;
@ -1284,9 +1318,15 @@ p.demo_store,
.required {
color: red;
font-weight: 700;
border: 0;
border: 0 !important;
text-decoration: none;
visibility: hidden; // Only show optional by default.
}
.optional {
visibility: visible;
}
.input-checkbox {
display: inline;
margin: -2px 8px 0 0;
@ -1300,7 +1340,7 @@ p.demo_store,
width: 100%;
margin: 0;
outline: 0;
line-height: 1;
line-height: normal;
}
textarea {
@ -1621,45 +1661,16 @@ p.demo_store,
}
}
/**
* Photoswipe
* 1. These styles are required to overwrite default theme button styles (Twenty Twelve adds gradients via background-image).
* 2. For zooming on mobile.
*/
.pswp {
z-index: 999999;
}
.woocommerce img.pswp__img,
.woocommerce-page img.pswp__img {
max-width: none; /* 2 */
}
button.pswp__button {
box-shadow: none !important;
background-image: url('photoswipe/default-skin/default-skin.png') !important;
}
button.pswp__button,
button.pswp__button:hover,
button.pswp__button--arrow--left::before,
button.pswp__button--arrow--right::before {
background-color: transparent !important; /* 1 */
}
button.pswp__button--arrow--left,
button.pswp__button--arrow--right,
button.pswp__button--arrow--left:hover,
button.pswp__button--arrow--right:hover {
background-image: none !important; /* 1 */
}
button.pswp__button--close:hover {
background-position: 0 -44px;
}
button.pswp__button--zoom:hover {
background-position: -88px 0;
.woocommerce-no-js {
form.woocommerce-form-login,
form.woocommerce-form-coupon {
display: block !important;
}
.woocommerce-form-login-toggle,
.woocommerce-form-coupon-toggle,
.showcoupon {
display: none !important;
}
}
.woocommerce-message,
@ -1807,13 +1818,11 @@ button.pswp__button--zoom:hover {
padding: 6px 6px 5px;
margin: 0 4px 0 0;
outline: 0;
line-height: 1;
}
input {
margin: 0;
vertical-align: middle;
line-height: 1;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -112,9 +112,6 @@ jQuery( function ( $ ) {
if ( ! $country_input.val() ) {
$country_input.val( woocommerce_admin_meta_boxes_order.default_country ).change();
}
if ( ! $state_input.val() ) {
$state_input.val( woocommerce_admin_meta_boxes_order.default_state ).change();
}

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
/*global wc_setup_params */
/*global wc_setup_currencies */
/*global wc_base_state */
jQuery( function( $ ) {
function blockWizardUI() {
$('.wc-setup-content').block({
@ -21,6 +22,35 @@ jQuery( function( $ ) {
return true;
} );
$( '#store_country' ).on( 'change', function() {
// Prevent if we don't have the metabox data
if ( wc_setup_params.states === null ){
return;
}
var $this = $( this ),
country = $this.val(),
$state_select = $( '#store_state' );
if ( ! $.isEmptyObject( wc_setup_params.states[ country ] ) ) {
var states = wc_setup_params.states[ country ];
$state_select.empty();
$.each( states, function( index ) {
$state_select.append( $( '<option value="' + index + '">' + states[ index ] + '</option>' ) );
} );
$( '.store-state-container' ).show();
$state_select.selectWoo().val( wc_base_state ).change().prop( 'required', true );
} else {
$( '.store-state-container' ).hide();
$state_select.empty().val( '' ).change().prop( 'required', false );
}
} );
$( '#store_country' ).change();
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-service-enable input', function() {
if ( $( this ).is( ':checked' ) ) {
$( this ).closest( '.wc-wizard-service-toggle' ).removeClass( 'disabled' );
@ -142,8 +172,8 @@ jQuery( function( $ ) {
}
} ).find( 'input#stripe_create_account, input#ppec_paypal_reroute_requests' ).change();
$( 'select#store_country_state' ).on( 'change', function() {
var countryCode = this.value.split( ':' )[ 0 ];
$( 'select#store_country' ).on( 'change', function() {
var countryCode = $( this ).val();
$( 'select#currency_code' ).val( wc_setup_currencies[ countryCode ] ).change();
} );
} );

View File

@ -1 +1 @@
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){if(e(i.target).is("input"))i.stopPropagation();else{var s=e(this).find('input[type="checkbox"]');s.prop("checked",!s.prop("checked")).change()}}),e(".wc-wizard-services-list-toggle").on("click",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}).find(".wc-wizard-shipping-method-select .method").change(),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account, input#ppec_paypal_reroute_requests",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").hide())}).find("input#stripe_create_account, input#ppec_paypal_reroute_requests").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function t(){e("form.activate-jetpack").submit()}function s(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return t();setTimeout(s,3e3)}).fail(function(){t()})}e(".button-next").on("click",function(){var t=e(this).parents("form").get(0);return("function"!=typeof t.checkValidity||t.checkValidity())&&i(),!0}),e("#store_country").on("change",function(){if(null!==wc_setup_params.states){var i=e(this).val(),t=e("#store_state");if(e.isEmptyObject(wc_setup_params.states[i]))e(".store-state-container").hide(),t.empty().val("").change().prop("required",!1);else{var s=wc_setup_params.states[i];t.empty(),e.each(s,function(i){t.append(e('<option value="'+i+'">'+s[i]+"</option>"))}),e(".store-state-container").show(),t.selectWoo().val(wc_base_state).change().prop("required",!0)}}}),e("#store_country").change(),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){if(e(i.target).is("input"))i.stopPropagation();else{var t=e(this).find('input[type="checkbox"]');t.prop("checked",!t.prop("checked")).change()}}),e(".wc-wizard-services-list-toggle").on("click",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var t=e(this).closest(".wc-wizard-service-description"),s=i.target.value,c=t.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+s).removeClass("hide");var r=t.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+s).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}).find(".wc-wizard-shipping-method-select .method").change(),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),s()}),e(".wc-wizard-services").on("change","input#stripe_create_account, input#ppec_paypal_reroute_requests",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email").hide())}).find("input#stripe_create_account, input#ppec_paypal_reroute_requests").change(),e("select#store_country").on("change",function(){var i=e(this).val();e("select#currency_code").val(wc_setup_currencies[i]).change()})});

View File

@ -11,8 +11,12 @@ jQuery( function ( $ ) {
$blankslate = $product_screen.find( '.woocommerce-BlankState' );
if ( 0 === $blankslate.length ) {
$title_action.after( '<a href="' + woocommerce_admin.urls.export_products + '" class="page-title-action">' + woocommerce_admin.strings.export_products + '</a>' );
$title_action.after( '<a href="' + woocommerce_admin.urls.import_products + '" class="page-title-action">' + woocommerce_admin.strings.import_products + '</a>' );
if ( woocommerce_admin.urls.export_products ) {
$title_action.after('<a href="' + woocommerce_admin.urls.export_products + '" class="page-title-action">' + woocommerce_admin.strings.export_products + '</a>');
}
if ( woocommerce_admin.urls.import_products ) {
$title_action.after( '<a href="' + woocommerce_admin.urls.import_products + '" class="page-title-action">' + woocommerce_admin.strings.import_products + '</a>' );
}
} else {
$title_action.hide();
}
@ -293,4 +297,50 @@ jQuery( function ( $ ) {
// Attribute term table
$( 'table.attributes-table tbody tr:nth-child(odd)' ).addClass( 'alternate' );
// Toggle gateway on/off.
$( '.wc_gateways' ).on( 'click', '.wc-payment-gateway-method-toggle-enabled', function() {
var $link = $( this ),
$row = $link.closest( 'tr' ),
$table = $row.closest( 'div' ),
$toggle = $link.find( '.woocommerce-input-toggle' );
var data = {
action: 'woocommerce_toggle_gateway_enabled',
security: woocommerce_admin.nonces.gateway_toggle,
gateway_id: $row.data( 'gateway_id' )
};
$table.block({
message: null,
overlayCSS: {
background: '#fff',
opacity: 0.6
}
});
$.ajax( {
url: woocommerce_admin.ajax_url,
data: data,
dataType : 'json',
type : 'POST',
success: function( response ) {
if ( true === response.data ) {
$toggle.removeClass( 'woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled' );
$toggle.addClass( 'woocommerce-input-toggle--enabled' );
} else if ( false === response.data ) {
$toggle.removeClass( 'woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled' );
$toggle.addClass( 'woocommerce-input-toggle--disabled' );
} else if ( 'needs_setup' === response.data ) {
window.location.href = $link.attr( 'href' );
}
},
complete: function() {
$table.unblock();
}
} );
return false;
});
});

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,7 @@
this.variationData = $form.data( 'product_variations' );
this.useAjax = false === this.variationData;
this.xhr = false;
this.loading = true;
// Initial state.
this.$singleVariationWrap.show();
@ -41,6 +42,7 @@
setTimeout( function() {
$form.trigger( 'check_variations' );
$form.trigger( 'wc_variation_form' );
$form.loading = false;
}, 100 );
};
@ -145,8 +147,12 @@
form.$form.trigger( 'found_variation', [ variation ] );
} else {
form.$form.trigger( 'reset_data' );
form.$form.find( '.single_variation' ).after( '<p class="wc-no-matching-variations woocommerce-info">' + wc_add_to_cart_variation_params.i18n_no_matching_variations_text + '</p>' );
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
attributes.chosenCount = 0;
if ( ! form.loading ) {
form.$form.find( '.single_variation' ).after( '<p class="wc-no-matching-variations woocommerce-info">' + wc_add_to_cart_variation_params.i18n_no_matching_variations_text + '</p>' );
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
}
}
},
complete: function() {
@ -163,8 +169,12 @@
form.$form.trigger( 'found_variation', [ variation ] );
} else {
form.$form.trigger( 'reset_data' );
form.$form.find( '.single_variation' ).after( '<p class="wc-no-matching-variations woocommerce-info">' + wc_add_to_cart_variation_params.i18n_no_matching_variations_text + '</p>' );
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
attributes.chosenCount = 0;
if ( ! form.loading ) {
form.$form.find( '.single_variation' ).after( '<p class="wc-no-matching-variations woocommerce-info">' + wc_add_to_cart_variation_params.i18n_no_matching_variations_text + '</p>' );
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
}
}
}
} else {
@ -555,8 +565,9 @@
$product_link = $product_img_wrap.find( 'a' ).eq( 0 );
if ( variation && variation.image && variation.image.src && variation.image.src.length > 1 ) {
if ( $gallery_nav.find( 'li img[src="' + variation.image.thumb_src + '"]' ).length > 0 ) {
$gallery_nav.find( 'li img[src="' + variation.image.thumb_src + '"]' ).trigger( 'click' );
if ( $gallery_nav.find( 'li img[src="' + variation.image.gallery_thumbnail_src + '"]' ).length > 0 ) {
$form.wc_variations_image_reset();
$gallery_nav.find( 'li img[src="' + variation.image.gallery_thumbnail_src + '"]' ).trigger( 'click' );
$form.attr( 'current-image', variation.image_id );
return;
} else {
@ -572,24 +583,11 @@
$product_img.wc_set_variation_attr( 'data-large_image_width', variation.image.full_src_w );
$product_img.wc_set_variation_attr( 'data-large_image_height', variation.image.full_src_h );
$product_img_wrap.wc_set_variation_attr( 'data-thumb', variation.image.src );
$gallery_img.wc_set_variation_attr( 'src', variation.image.thumb_src );
$gallery_img.wc_set_variation_attr( 'src', variation.image.gallery_thumbnail_src );
$product_link.wc_set_variation_attr( 'href', variation.image.full_src );
}
} else {
$product_img.wc_reset_variation_attr( 'src' );
$product_img.wc_reset_variation_attr( 'width' );
$product_img.wc_reset_variation_attr( 'height' );
$product_img.wc_reset_variation_attr( 'srcset' );
$product_img.wc_reset_variation_attr( 'sizes' );
$product_img.wc_reset_variation_attr( 'title' );
$product_img.wc_reset_variation_attr( 'alt' );
$product_img.wc_reset_variation_attr( 'data-src' );
$product_img.wc_reset_variation_attr( 'data-large_image' );
$product_img.wc_reset_variation_attr( 'data-large_image_width' );
$product_img.wc_reset_variation_attr( 'data-large_image_height' );
$product_img_wrap.wc_reset_variation_attr( 'data-thumb' );
$gallery_img.wc_reset_variation_attr( 'src' );
$product_link.wc_reset_variation_attr( 'href' );
$form.wc_variations_image_reset();
}
window.setTimeout( function() {
@ -599,6 +597,35 @@
}, 20 );
};
/**
* Reset main image to defaults.
*/
$.fn.wc_variations_image_reset = function() {
var $form = this,
$product = $form.closest( '.product' ),
$product_gallery = $product.find( '.images' ),
$gallery_nav = $product.find( '.flex-control-nav' ),
$gallery_img = $gallery_nav.find( 'li:eq(0) img' ),
$product_img_wrap = $product_gallery.find( '.woocommerce-product-gallery__image, .woocommerce-product-gallery__image--placeholder' ).eq( 0 ),
$product_img = $product_img_wrap.find( '.wp-post-image' ),
$product_link = $product_img_wrap.find( 'a' ).eq( 0 );
$product_img.wc_reset_variation_attr( 'src' );
$product_img.wc_reset_variation_attr( 'width' );
$product_img.wc_reset_variation_attr( 'height' );
$product_img.wc_reset_variation_attr( 'srcset' );
$product_img.wc_reset_variation_attr( 'sizes' );
$product_img.wc_reset_variation_attr( 'title' );
$product_img.wc_reset_variation_attr( 'alt' );
$product_img.wc_reset_variation_attr( 'data-src' );
$product_img.wc_reset_variation_attr( 'data-large_image' );
$product_img.wc_reset_variation_attr( 'data-large_image_width' );
$product_img.wc_reset_variation_attr( 'data-large_image_height' );
$product_img_wrap.wc_reset_variation_attr( 'data-thumb' );
$gallery_img.wc_reset_variation_attr( 'src' );
$product_link.wc_reset_variation_attr( 'href' );
};
$(function() {
if ( typeof wc_add_to_cart_variation_params !== 'undefined' ) {
$( '.variations_form' ).each( function() {

File diff suppressed because one or more lines are too long

View File

@ -9,17 +9,23 @@ jQuery( function( $ ) {
var locale_json = wc_address_i18n_params.locale.replace( /&quot;/g, '"' ),
locale = $.parseJSON( locale_json );
function field_is_required( field, is_required ) {
if ( is_required ) {
if ( field.find( 'label abbr.required' ).length === 0 ) {
field.find( 'label' ).append( ' <abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
function field_is_required( field, is_required ) {
if ( is_required ) {
field.find( 'label .optional' ).remove();
field.addClass( 'validate-required' );
if ( field.find( 'label .required' ).length === 0 ) {
field.find( 'label' ).append( '&nbsp;<abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
}
} else {
field.find( 'label .required' ).remove();
field.removeClass( 'validate-required' );
if ( field.find( 'label .required' ).length === 0 ) {
field.find( 'label' ).append( '&nbsp;<span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>' );
}
}
} else {
field.find( 'label abbr' ).remove();
field.removeClass( 'validate-required' );
}
}
$( document.body )

View File

@ -1 +1 @@
jQuery(function(e){function a(e,a){a?0===e.find("label abbr.required").length&&(e.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.addClass("validate-required")):(e.find("label abbr").remove(),e.removeClass("validate-required"))}if("undefined"==typeof wc_address_i18n_params)return!1;var i=wc_address_i18n_params.locale.replace(/&quot;/g,'"'),d=e.parseJSON(i);e(document.body).bind("country_to_state_changing",function(i,t,r){var l,n=r;l="undefined"!=typeof d[t]?d[t]:d["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),s=n.find("#billing_city_field, #shipping_city_field"),f=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),s.attr("data-o_class",s.attr("class")),f.attr("data-o_class",f.attr("class")));var p=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(p,function(i,t){var r=n.find(t),o=e.extend(!0,{},d["default"][i],l[i]);"undefined"!=typeof o.label&&r.find("label").html(o.label),"undefined"!=typeof o.placeholder&&(r.find("input").attr("placeholder",o.placeholder),r.find(".select2-selection__placeholder").text(o.placeholder)),"undefined"!=typeof o.placeholder||"undefined"==typeof o.label||r.find("label").length||(r.find("input").attr("placeholder",o.label),r.find(".select2-selection__placeholder").text(o.label)),"undefined"!=typeof o.required?a(r,o.required):a(r,!1),"undefined"!=typeof o.priority&&r.data("priority",o.priority),"state"!==i&&("undefined"!=typeof o.hidden&&!0===o.hidden?r.hide().find("input").val(""):r.show())}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,i){var d=e(i).find(".form-row"),t=d.first().parent(),r=0;d.each(function(){e(this).data("priority")||e(this).data("priority",r+1),r=e(this).data("priority")}),d.sort(function(a,i){var d=e(a).data("priority"),t=e(i).data("priority");return d>t?1:d<t?-1:0}),d.detach().appendTo(t)})})});
jQuery(function(e){function a(e,a){a?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('&nbsp;<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>')):(e.find("label .required").remove(),e.removeClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('&nbsp;<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}if("undefined"==typeof wc_address_i18n_params)return!1;var i=wc_address_i18n_params.locale.replace(/&quot;/g,'"'),d=e.parseJSON(i);e(document.body).bind("country_to_state_changing",function(i,t,r){var l,n=r;l="undefined"!=typeof d[t]?d[t]:d["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),s=n.find("#billing_city_field, #shipping_city_field"),p=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),s.attr("data-o_class",s.attr("class")),p.attr("data-o_class",p.attr("class")));var f=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(f,function(i,t){var r=n.find(t),o=e.extend(!0,{},d["default"][i],l[i]);"undefined"!=typeof o.label&&r.find("label").html(o.label),"undefined"!=typeof o.placeholder&&(r.find("input").attr("placeholder",o.placeholder),r.find(".select2-selection__placeholder").text(o.placeholder)),"undefined"!=typeof o.placeholder||"undefined"==typeof o.label||r.find("label").length||(r.find("input").attr("placeholder",o.label),r.find(".select2-selection__placeholder").text(o.label)),"undefined"!=typeof o.required?a(r,o.required):a(r,!1),"undefined"!=typeof o.priority&&r.data("priority",o.priority),"state"!==i&&("undefined"!=typeof o.hidden&&!0===o.hidden?r.hide().find("input").val(""):r.show())}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,i){var d=e(i).find(".form-row"),t=d.first().parent(),r=0;d.each(function(){e(this).data("priority")||e(this).data("priority",r+1),r=e(this).data("priority")}),d.sort(function(a,i){var d=e(a).data("priority"),t=e(i).data("priority");return d>t?1:d<t?-1:0}),d.detach().appendTo(t)})})});

View File

@ -329,6 +329,7 @@ jQuery( function( $ ) {
complete: function() {
unblock( $form );
unblock( $( 'div.cart_totals' ) );
$.scroll_to_notices( $( '[role="alert"]' ) );
}
} );
},
@ -512,6 +513,7 @@ jQuery( function( $ ) {
complete: function() {
unblock( $form );
unblock( $( 'div.cart_totals' ) );
$.scroll_to_notices( $( '[role="alert"]' ) );
}
} );
},
@ -540,6 +542,7 @@ jQuery( function( $ ) {
complete: function() {
unblock( $form );
unblock( $( 'div.cart_totals' ) );
$.scroll_to_notices( $( '[role="alert"]' ) );
}
} );
},

File diff suppressed because one or more lines are too long

View File

@ -512,24 +512,12 @@ jQuery( function( $ ) {
$( document.body ).trigger( 'checkout_error' );
},
scroll_to_notices: function() {
var scrollElement = $( '.woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout' ),
isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style;
var scrollElement = $( '.woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout' );
if ( ! scrollElement.length ) {
scrollElement = $( '.form.checkout' );
}
if ( scrollElement.length ) {
if ( isSmoothScrollSupported ) {
scrollElement[0].scrollIntoView({
behavior: 'smooth'
});
} else {
$( 'html, body' ).animate( {
scrollTop: ( scrollElement.offset().top - 100 )
}, 1000 );
}
}
$.scroll_to_notices( scrollElement );
}
};
@ -649,7 +637,18 @@ jQuery( function( $ ) {
toggle_terms: function() {
if ( $( '.woocommerce-terms-and-conditions' ).length ) {
$( '.woocommerce-terms-and-conditions' ).slideToggle();
$( '.woocommerce-terms-and-conditions' ).slideToggle( function() {
var link_toggle = $( '.woocommerce-terms-and-conditions-link' );
if ( $( '.woocommerce-terms-and-conditions' ).is( ':visible' ) ) {
link_toggle.addClass( 'woocommerce-terms-and-conditions-link--open' );
link_toggle.removeClass( 'woocommerce-terms-and-conditions-link--closed' );
} else {
link_toggle.removeClass( 'woocommerce-terms-and-conditions-link--open' );
link_toggle.addClass( 'woocommerce-terms-and-conditions-link--closed' );
}
} );
return false;
}
}

File diff suppressed because one or more lines are too long

View File

@ -240,17 +240,20 @@ jQuery( function( $ ) {
if ( $slides.length > 0 ) {
$slides.each( function( i, el ) {
var img = $( el ).find( 'img' ),
large_image_src = img.attr( 'data-large_image' ),
large_image_w = img.attr( 'data-large_image_width' ),
large_image_h = img.attr( 'data-large_image_height' ),
item = {
src : large_image_src,
w : large_image_w,
h : large_image_h,
title: img.attr( 'data-caption' ) ? img.attr( 'data-caption' ) : img.attr( 'title' )
};
items.push( item );
var img = $( el ).find( 'img' );
if ( img.length ) {
var large_image_src = img.attr( 'data-large_image' ),
large_image_w = img.attr( 'data-large_image_width' ),
large_image_h = img.attr( 'data-large_image_height' ),
item = {
src : large_image_src,
w : large_image_w,
h : large_image_h,
title: img.attr( 'data-caption' ) ? img.attr( 'data-caption' ) : img.attr( 'title' )
};
items.push( item );
}
} );
}

File diff suppressed because one or more lines are too long

View File

@ -15,15 +15,69 @@ jQuery( function( $ ) {
});
// Set a cookie and hide the store notice when the dismiss button is clicked
jQuery( '.woocommerce-store-notice__dismiss-link' ).click( function() {
$( '.woocommerce-store-notice__dismiss-link' ).click( function() {
Cookies.set( 'store_notice', 'hidden', { path: '/' } );
jQuery( '.woocommerce-store-notice' ).hide();
$( '.woocommerce-store-notice' ).hide();
});
// Check the value of that cookie and show/hide the notice accordingly
if ( 'hidden' === Cookies.get( 'store_notice' ) ) {
jQuery( '.woocommerce-store-notice' ).hide();
$( '.woocommerce-store-notice' ).hide();
} else {
jQuery( '.woocommerce-store-notice' ).show();
$( '.woocommerce-store-notice' ).show();
}
// Make form field descriptions toggle on focus.
$( document.body ).on( 'click', function() {
$( '.woocommerce-input-wrapper span.description:visible' ).prop( 'aria-hidden', true ).slideUp( 250 );
} );
$( '.woocommerce-input-wrapper' ).on( 'click', function( event ) {
event.stopPropagation();
} );
$( '.woocommerce-input-wrapper :input' )
.on( 'keydown', function( event ) {
var input = $( this ),
parent = input.parent(),
description = parent.find( 'span.description' );
if ( 27 === event.which && description.length && description.is( ':visible' ) ) {
description.prop( 'aria-hidden', true ).slideUp( 250 );
event.preventDefault();
return false;
}
} )
.on( 'focus', function() {
var input = $( this ),
parent = input.parent(),
description = parent.find( 'span.description' );
parent.addClass( 'currentTarget' );
$( '.woocommerce-input-wrapper:not(.currentTarget) span.description:visible' ).prop( 'aria-hidden', true ).slideUp( 250 );
if ( description.length && description.is( ':hidden' ) ) {
description.prop( 'aria-hidden', false ).slideDown( 250 );
}
parent.removeClass( 'currentTarget' );
} );
// Common scroll to element code.
$.scroll_to_notices = function( scrollElement ) {
var isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style;
if ( scrollElement.length ) {
if ( isSmoothScrollSupported ) {
scrollElement[0].scrollIntoView({
behavior: 'smooth'
});
} else {
$( 'html, body' ).animate( {
scrollTop: ( scrollElement.offset().top - 100 )
}, 1000 );
}
}
};
});

View File

@ -1 +1 @@
jQuery(function(o){o(".woocommerce-ordering").on("change","select.orderby",function(){o(this).closest("form").submit()}),o("input.qty:not(.product-quantity input.qty)").each(function(){var e=parseFloat(o(this).attr("min"));e>=0&&parseFloat(o(this).val())<e&&o(this).val(e)}),jQuery(".woocommerce-store-notice__dismiss-link").click(function(){Cookies.set("store_notice","hidden",{path:"/"}),jQuery(".woocommerce-store-notice").hide()}),"hidden"===Cookies.get("store_notice")?jQuery(".woocommerce-store-notice").hide():jQuery(".woocommerce-store-notice").show()});
jQuery(function(o){o(".woocommerce-ordering").on("change","select.orderby",function(){o(this).closest("form").submit()}),o("input.qty:not(.product-quantity input.qty)").each(function(){var e=parseFloat(o(this).attr("min"));e>=0&&parseFloat(o(this).val())<e&&o(this).val(e)}),o(".woocommerce-store-notice__dismiss-link").click(function(){Cookies.set("store_notice","hidden",{path:"/"}),o(".woocommerce-store-notice").hide()}),"hidden"===Cookies.get("store_notice")?o(".woocommerce-store-notice").hide():o(".woocommerce-store-notice").show(),o(document.body).on("click",function(){o(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),o(".woocommerce-input-wrapper").on("click",function(o){o.stopPropagation()}),o(".woocommerce-input-wrapper :input").on("keydown",function(e){var i=o(this).parent().find("span.description");if(27===e.which&&i.length&&i.is(":visible"))return i.prop("aria-hidden",!0).slideUp(250),e.preventDefault(),!1}).on("focus",function(){var e=o(this).parent(),i=e.find("span.description");e.addClass("currentTarget"),o(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),i.length&&i.is(":hidden")&&i.prop("aria-hidden",!1).slideDown(250),e.removeClass("currentTarget")}),o.scroll_to_notices=function(e){var i="scrollBehavior"in document.documentElement.style;e.length&&(i?e[0].scrollIntoView({behavior:"smooth"}):o("html, body").animate({scrollTop:e.offset().top-100},1e3))}});

View File

@ -5465,12 +5465,11 @@ S2.define('select2/core',[
$(document).on('keydown', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER) {
} else if (key === KEYS.ENTER || key === KEYS.TAB) {
self.trigger('results:select', {});
evt.preventDefault();

File diff suppressed because one or more lines are too long

View File

@ -5465,12 +5465,11 @@ S2.define('select2/core',[
$(document).on('keydown', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER) {
} else if (key === KEYS.ENTER || key === KEYS.TAB) {
self.trigger('results:select', {});
evt.preventDefault();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@
* Bangladeshi states (districts)
*
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
@ -11,68 +10,68 @@ global $states;
defined( 'ABSPATH' ) || exit;
$states['BD'] = array(
'BAG' => __( 'Bagerhat', 'woocommerce' ),
'BAN' => __( 'Bandarban', 'woocommerce' ),
'BAR' => __( 'Barguna', 'woocommerce' ),
'BARI' => __( 'Barisal', 'woocommerce' ),
'BHO' => __( 'Bhola', 'woocommerce' ),
'BOG' => __( 'Bogra', 'woocommerce' ),
'BRA' => __( 'Brahmanbaria', 'woocommerce' ),
'CHA' => __( 'Chandpur', 'woocommerce' ),
'CHI' => __( 'Chittagong', 'woocommerce' ),
'CHU' => __( 'Chuadanga', 'woocommerce' ),
'COM' => __( 'Comilla', 'woocommerce' ),
'COX' => __( "Cox's Bazar", 'woocommerce' ),
'DHA' => __( 'Dhaka', 'woocommerce' ),
'DIN' => __( 'Dinajpur', 'woocommerce' ),
'FAR' => __( 'Faridpur ', 'woocommerce' ),
'FEN' => __( 'Feni', 'woocommerce' ),
'GAI' => __( 'Gaibandha', 'woocommerce' ),
'GAZI' => __( 'Gazipur', 'woocommerce' ),
'GOP' => __( 'Gopalganj', 'woocommerce' ),
'HAB' => __( 'Habiganj', 'woocommerce' ),
'JAM' => __( 'Jamalpur', 'woocommerce' ),
'JES' => __( 'Jessore', 'woocommerce' ),
'JHA' => __( 'Jhalokati', 'woocommerce' ),
'JHE' => __( 'Jhenaidah', 'woocommerce' ),
'JOY' => __( 'Joypurhat', 'woocommerce' ),
'KHA' => __( 'Khagrachhari', 'woocommerce' ),
'KHU' => __( 'Khulna', 'woocommerce' ),
'KIS' => __( 'Kishoreganj', 'woocommerce' ),
'KUR' => __( 'Kurigram', 'woocommerce' ),
'KUS' => __( 'Kushtia', 'woocommerce' ),
'LAK' => __( 'Lakshmipur', 'woocommerce' ),
'LAL' => __( 'Lalmonirhat', 'woocommerce' ),
'MAD' => __( 'Madaripur', 'woocommerce' ),
'MAG' => __( 'Magura', 'woocommerce' ),
'MAN' => __( 'Manikganj ', 'woocommerce' ),
'MEH' => __( 'Meherpur', 'woocommerce' ),
'MOU' => __( 'Moulvibazar', 'woocommerce' ),
'MUN' => __( 'Munshiganj', 'woocommerce' ),
'MYM' => __( 'Mymensingh', 'woocommerce' ),
'NAO' => __( 'Naogaon', 'woocommerce' ),
'NAR' => __( 'Narail', 'woocommerce' ),
'NARG' => __( 'Narayanganj', 'woocommerce' ),
'NARD' => __( 'Narsingdi', 'woocommerce' ),
'NAT' => __( 'Natore', 'woocommerce' ),
'NAW' => __( 'Nawabganj', 'woocommerce' ),
'NET' => __( 'Netrakona', 'woocommerce' ),
'NIL' => __( 'Nilphamari', 'woocommerce' ),
'NOA' => __( 'Noakhali', 'woocommerce' ),
'PAB' => __( 'Pabna', 'woocommerce' ),
'PAN' => __( 'Panchagarh', 'woocommerce' ),
'PAT' => __( 'Patuakhali', 'woocommerce' ),
'PIR' => __( 'Pirojpur', 'woocommerce' ),
'RAJB' => __( 'Rajbari', 'woocommerce' ),
'RAJ' => __( 'Rajshahi', 'woocommerce' ),
'RAN' => __( 'Rangamati', 'woocommerce' ),
'RANP' => __( 'Rangpur', 'woocommerce' ),
'SAT' => __( 'Satkhira', 'woocommerce' ),
'SHA' => __( 'Shariatpur', 'woocommerce' ),
'SHE' => __( 'Sherpur', 'woocommerce' ),
'SIR' => __( 'Sirajganj', 'woocommerce' ),
'SUN' => __( 'Sunamganj', 'woocommerce' ),
'SYL' => __( 'Sylhet', 'woocommerce' ),
'TAN' => __( 'Tangail', 'woocommerce' ),
'THA' => __( 'Thakurgaon', 'woocommerce' ),
'BD-05' => __( 'Bagerhat', 'woocommerce' ),
'BD-01' => __( 'Bandarban', 'woocommerce' ),
'BD-02' => __( 'Barguna', 'woocommerce' ),
'BD-06' => __( 'Barishal', 'woocommerce' ),
'BD-07' => __( 'Bhola', 'woocommerce' ),
'BD-03' => __( 'Bogura', 'woocommerce' ),
'BD-04' => __( 'Brahmanbaria', 'woocommerce' ),
'BD-09' => __( 'Chandpur', 'woocommerce' ),
'BD-10' => __( 'Chattogram', 'woocommerce' ),
'BD-12' => __( 'Chuadanga', 'woocommerce' ),
'BD-11' => __( "Cox's Bazar", 'woocommerce' ),
'BD-08' => __( 'Cumilla', 'woocommerce' ),
'BD-13' => __( 'Dhaka', 'woocommerce' ),
'BD-14' => __( 'Dinajpur', 'woocommerce' ),
'BD-15' => __( 'Faridpur ', 'woocommerce' ),
'BD-16' => __( 'Feni', 'woocommerce' ),
'BD-19' => __( 'Gaibandha', 'woocommerce' ),
'BD-18' => __( 'Gazipur', 'woocommerce' ),
'BD-17' => __( 'Gopalganj', 'woocommerce' ),
'BD-20' => __( 'Habiganj', 'woocommerce' ),
'BD-21' => __( 'Jamalpur', 'woocommerce' ),
'BD-22' => __( 'Jashore', 'woocommerce' ),
'BD-25' => __( 'Jhalokati', 'woocommerce' ),
'BD-23' => __( 'Jhenaidah', 'woocommerce' ),
'BD-24' => __( 'Joypurhat', 'woocommerce' ),
'BD-29' => __( 'Khagrachhari', 'woocommerce' ),
'BD-27' => __( 'Khulna', 'woocommerce' ),
'BD-26' => __( 'Kishoreganj', 'woocommerce' ),
'BD-28' => __( 'Kurigram', 'woocommerce' ),
'BD-30' => __( 'Kushtia', 'woocommerce' ),
'BD-31' => __( 'Lakshmipur', 'woocommerce' ),
'BD-32' => __( 'Lalmonirhat', 'woocommerce' ),
'BD-36' => __( 'Madaripur', 'woocommerce' ),
'BD-37' => __( 'Magura', 'woocommerce' ),
'BD-33' => __( 'Manikganj ', 'woocommerce' ),
'BD-39' => __( 'Meherpur', 'woocommerce' ),
'BD-38' => __( 'Moulvibazar', 'woocommerce' ),
'BD-35' => __( 'Munshiganj', 'woocommerce' ),
'BD-34' => __( 'Mymensingh', 'woocommerce' ),
'BD-48' => __( 'Naogaon', 'woocommerce' ),
'BD-43' => __( 'Narail', 'woocommerce' ),
'BD-40' => __( 'Narayanganj', 'woocommerce' ),
'BD-42' => __( 'Narsingdi', 'woocommerce' ),
'BD-44' => __( 'Natore', 'woocommerce' ),
'BD-45' => __( 'Nawabganj', 'woocommerce' ),
'BD-41' => __( 'Netrakona', 'woocommerce' ),
'BD-46' => __( 'Nilphamari', 'woocommerce' ),
'BD-47' => __( 'Noakhali', 'woocommerce' ),
'BD-49' => __( 'Pabna', 'woocommerce' ),
'BD-52' => __( 'Panchagarh', 'woocommerce' ),
'BD-51' => __( 'Patuakhali', 'woocommerce' ),
'BD-50' => __( 'Pirojpur', 'woocommerce' ),
'BD-53' => __( 'Rajbari', 'woocommerce' ),
'BD-54' => __( 'Rajshahi', 'woocommerce' ),
'BD-56' => __( 'Rangamati', 'woocommerce' ),
'BD-55' => __( 'Rangpur', 'woocommerce' ),
'BD-58' => __( 'Satkhira', 'woocommerce' ),
'BD-62' => __( 'Shariatpur', 'woocommerce' ),
'BD-57' => __( 'Sherpur', 'woocommerce' ),
'BD-59' => __( 'Sirajganj', 'woocommerce' ),
'BD-61' => __( 'Sunamganj', 'woocommerce' ),
'BD-60' => __( 'Sylhet', 'woocommerce' ),
'BD-63' => __( 'Tangail', 'woocommerce' ),
'BD-64' => __( 'Thakurgaon', 'woocommerce' ),
);

View File

@ -14,10 +14,10 @@ $states['IE'] = array(
'CW' => __( 'Carlow', 'woocommerce' ),
'CN' => __( 'Cavan', 'woocommerce' ),
'CE' => __( 'Clare', 'woocommerce' ),
'CK' => __( 'Cork', 'woocommerce' ),
'CO' => __( 'Cork', 'woocommerce' ),
'DL' => __( 'Donegal', 'woocommerce' ),
'DN' => __( 'Dublin', 'woocommerce' ),
'GY' => __( 'Galway', 'woocommerce' ),
'D' => __( 'Dublin', 'woocommerce' ),
'G' => __( 'Galway', 'woocommerce' ),
'KY' => __( 'Kerry', 'woocommerce' ),
'KE' => __( 'Kildare', 'woocommerce' ),
'KK' => __( 'Kilkenny', 'woocommerce' ),
@ -32,7 +32,7 @@ $states['IE'] = array(
'OY' => __( 'Offaly', 'woocommerce' ),
'RN' => __( 'Roscommon', 'woocommerce' ),
'SO' => __( 'Sligo', 'woocommerce' ),
'TY' => __( 'Tipperary', 'woocommerce' ),
'TA' => __( 'Tipperary', 'woocommerce' ),
'WD' => __( 'Waterford', 'woocommerce' ),
'WH' => __( 'Westmeath', 'woocommerce' ),
'WX' => __( 'Wexford', 'woocommerce' ),

29
i18n/states/LR.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* Liberia provinces
*
* @package WooCommerce/i18n
* @version 3.0.0
*/
global $states;
defined( 'ABSPATH' ) || exit;
$states['LR'] = array(
'BM' => __( 'Bomi', 'woocommerce' ),
'BN' => __( 'Bong', 'woocommerce' ),
'GA' => __( 'Gbarpolu', 'woocommerce' ),
'GB' => __( 'Grand Bassa', 'woocommerce' ),
'GC' => __( 'Grand Cape Mount', 'woocommerce' ),
'GG' => __( 'Grand Gedeh', 'woocommerce' ),
'GK' => __( 'Grand Kru', 'woocommerce' ),
'LO' => __( 'Lofa ', 'woocommerce' ),
'MA' => __( 'Margibi', 'woocommerce' ),
'MY' => __( 'Maryland', 'woocommerce' ),
'MO' => __( 'Montserrado', 'woocommerce' ),
'NM' => __( 'Nimba', 'woocommerce' ),
'RV' => __( 'Rivercess', 'woocommerce' ),
'RG' => __( 'River Gee', 'woocommerce' ),
'SN' => __( 'Sinoe', 'woocommerce' ),
);

View File

@ -706,7 +706,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Return an array of items/products within this order.
*
* @param string|array $types Types of line items to get (array or string).
* @return Array of WC_Order_item
* @return WC_Order_Item[]
*/
public function get_items( $types = 'line_item' ) {
$items = array();
@ -730,7 +730,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Return an array of fees within this order.
*
* @return array
* @return WC_Order_item_Fee[]
*/
public function get_fees() {
return $this->get_items( 'fee' );
@ -739,7 +739,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Return an array of taxes within this order.
*
* @return array
* @return WC_Order_Item_Tax[]
*/
public function get_taxes() {
return $this->get_items( 'tax' );
@ -748,7 +748,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Return an array of shipping costs within this order.
*
* @return array
* @return WC_Order_Item_Shipping[]
*/
public function get_shipping_methods() {
return $this->get_items( 'shipping' );
@ -788,7 +788,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Gets the count of order items of a certain type.
*
* @param string $item_type Item type to lookup.
* @return string
* @return int|string
*/
public function get_item_count( $item_type = '' ) {
$items = $this->get_items( empty( $item_type ) ? 'line_item' : $item_type );
@ -802,7 +802,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
/**
* Get an order item object, based on it's type.
* Get an order item object, based on its type.
*
* @since 3.0.0
* @param int $item_id ID of item to get.
@ -1062,7 +1062,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
/**
* After applying coupons via the WC_Disounts class, update line items.
* After applying coupons via the WC_Discounts class, update line items.
*
* @since 3.2.0
* @param WC_Discounts $discounts Discounts class.
@ -1087,7 +1087,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
/**
* After applying coupons via the WC_Disounts class, update or create coupon items.
* After applying coupons via the WC_Discounts class, update or create coupon items.
*
* @since 3.2.0
* @param WC_Discounts $discounts Discounts class.
@ -1134,7 +1134,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add a product line item to the order. This is the only line item type with
* it's own method because it saves looking up order amounts (costs are added up for you).
* its own method because it saves looking up order amounts (costs are added up for you).
*
* @param WC_Product $product Product object.
* @param int $qty Quantity to add.
@ -1876,7 +1876,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @return bool
*/
public function has_status( $status ) {
return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status, true ) ) || $this->get_status() === $status ? true : false, $this, $status );
return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status, true ) ) || $this->get_status() === $status, $this, $status );
}
/**

View File

@ -178,7 +178,9 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
* Output the gateway settings screen.
*/
public function admin_options() {
echo '<h2>' . esc_html( $this->get_method_title() ) . '</h2>';
echo '<h2>' . esc_html( $this->get_method_title() );
wc_back_link( __( 'Return to payments', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=checkout' ) );
echo '</h2>';
echo wp_kses_post( wpautop( $this->get_method_description() ) );
parent::admin_options();
}
@ -191,6 +193,19 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
$this->enabled = ! empty( $this->settings['enabled'] ) && 'yes' === $this->settings['enabled'] ? 'yes' : 'no';
}
/**
* Return whether or not this gateway still requires setup to function.
*
* When this gateway is toggled on via AJAX, if this returns true a
* redirect will occur to the settings page instead.
*
* @since 3.4.0
* @return bool
*/
public function needs_setup() {
return false;
}
/**
* Get the return url (thank you page).
*
@ -273,7 +288,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
* @return bool
*/
public function has_fields() {
return $this->has_fields ? true : false;
return (bool) $this->has_fields;
}
/**
@ -385,7 +400,19 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
* @since 1.5.7
*/
public function supports( $feature ) {
return apply_filters( 'woocommerce_payment_gateway_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
return apply_filters( 'woocommerce_payment_gateway_supports', in_array( $feature, $this->supports ), $feature, $this );
}
/**
* Can the order be refunded via this gateway?
*
* Should be extended by gateways to do their own checks.
*
* @param WC_Order $order Order object.
* @return bool If false, the automatic refund button is hidden in the UI.
*/
public function can_refund_order( $order ) {
return $order && $this->supports( 'refunds' );
}
/**

View File

@ -1360,7 +1360,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
* @since 2.5.0
*/
public function supports( $feature ) {
return apply_filters( 'woocommerce_product_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
return apply_filters( 'woocommerce_product_supports', in_array( $feature, $this->supports ), $feature, $this );
}
/**
@ -1577,7 +1577,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
return true;
}
return $this->managing_stock() && $this->backorders_allowed() && ( $this->get_stock_quantity() - $qty_in_cart ) < 0 ? true : false;
return $this->managing_stock() && $this->backorders_allowed() && ( $this->get_stock_quantity() - $qty_in_cart ) < 0;
}
/**

View File

@ -177,6 +177,24 @@ abstract class WC_Settings_API {
return $_POST; // WPCS: CSRF ok, input var ok.
}
/**
* Update a single option.
*
* @since 3.4.0
* @param string $key Option key.
* @param mixed $value Value to set.
* @return bool was anything saved?
*/
public function update_option( $key, $value = '' ) {
if ( empty( $this->settings ) ) {
$this->init_settings();
}
$this->settings[ $key ] = $value;
return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) );
}
/**
* Processes and saves options.
* If there is an error thrown, will continue to save and validate fields, but will leave the erroring field out.
@ -748,7 +766,15 @@ abstract class WC_Settings_API {
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<select multiple="multiple" class="multiselect <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>[]" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>>
<?php foreach ( (array) $data['options'] as $option_key => $option_value ) : ?>
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $value, true ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
<?php if ( is_array( $option_value ) ) : ?>
<optgroup label="<?php echo esc_attr( $option_key ); ?>">
<?php foreach ( $option_value as $option_key_inner => $option_value_inner ) : ?>
<option value="<?php echo esc_attr( $option_key_inner ); ?>" <?php selected( in_array( $option_key_inner, $value, true ), true ); ?>><?php echo esc_attr( $option_value_inner ); ?></option>
<?php endforeach; ?>
</optgroup>
<?php else : ?>
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $value, true ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>

View File

@ -43,7 +43,7 @@ abstract class WC_Background_Process extends WP_Background_Process {
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$table} WHERE {$column} LIKE %s", $key ) ); // @codingStandardsIgnoreLine.
return ( $count > 0 ) ? false : true;
return ! ( $count > 0 );
}
/**
@ -72,7 +72,7 @@ abstract class WC_Background_Process extends WP_Background_Process {
$batch = new stdClass();
$batch->key = $query->$column;
$batch->data = maybe_unserialize( $query->$value_column );
$batch->data = array_filter( (array) maybe_unserialize( $query->$value_column ) );
return $batch;
}

View File

@ -70,7 +70,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
* @return string
*/
public function column_title( $key ) {
$url = admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&edit-key=' . $key['key_id'] );
$url = admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys&edit-key=' . $key['key_id'] );
$output = '<strong>';
$output .= '<a href="' . esc_url( $url ) . '" class="row-title">';
@ -92,7 +92,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
add_query_arg(
array(
'revoke-key' => $key['key_id'],
), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' )
), admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys' )
), 'revoke'
)
) . '">' . esc_html__( 'Revoke', 'woocommerce' ) . '</a>',

View File

@ -27,7 +27,7 @@ class WC_Admin_API_Keys {
* @return bool
*/
private function is_api_keys_settings_page() {
return isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'api' === $_GET['tab'] && 'keys' === $_GET['section']; // WPCS: input var okay, CSRF ok.
return isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'advanced' === $_GET['tab'] && 'keys' === $_GET['section']; // WPCS: input var okay, CSRF ok.
}
/**
@ -72,7 +72,7 @@ class WC_Admin_API_Keys {
private static function table_list_output() {
global $wpdb, $keys_table_list;
echo '<h2>' . esc_html__( 'Keys/Apps', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . esc_html__( 'Add key', 'woocommerce' ) . '</a></h2>';
echo '<h2>' . esc_html__( 'REST API', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . esc_html__( 'Add key', 'woocommerce' ) . '</a></h2>';
// Get the API keys count.
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1;" );
@ -91,7 +91,7 @@ class WC_Admin_API_Keys {
echo '<div class="woocommerce-BlankState woocommerce-BlankState--api">';
?>
<h2 class="woocommerce-BlankState-message"><?php esc_html_e( 'The WooCommerce REST API allows external apps to view and manage store data. Access is granted only to those with valid API keys.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ); ?>"><?php esc_html_e( 'Create an API key', 'woocommerce' ); ?></a>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys&create-key=1' ) ); ?>"><?php esc_html_e( 'Create an API key', 'woocommerce' ); ?></a>
<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; }</style>
<?php
}
@ -175,7 +175,7 @@ class WC_Admin_API_Keys {
}
}
wp_redirect( esc_url_raw( add_query_arg( array( 'revoked' => 1 ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ) ) );
wp_redirect( esc_url_raw( add_query_arg( array( 'revoked' => 1 ), admin_url( 'admin.php?page=wc-settings&tab=advanced&section=keys' ) ) ) );
exit();
}

View File

@ -2,8 +2,6 @@
/**
* Load assets
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 2.1.0
*/
@ -36,23 +34,23 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
// Register admin styles
// Register admin styles.
wp_register_style( 'woocommerce_admin_menu_styles', WC()->plugin_url() . '/assets/css/menu.css', array(), WC_VERSION );
wp_register_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
wp_register_style( 'jquery-ui-style', WC()->plugin_url() . '/assets/css/jquery-ui.min.css', array(), WC_VERSION );
wp_register_style( 'woocommerce_admin_dashboard_styles', WC()->plugin_url() . '/assets/css/dashboard.css', array(), WC_VERSION );
wp_register_style( 'woocommerce_admin_print_reports_styles', WC()->plugin_url() . '/assets/css/reports-print.css', array(), WC_VERSION, 'print' );
// Add RTL support for admin styles
// Add RTL support for admin styles.
wp_style_add_data( 'woocommerce_admin_menu_styles', 'rtl', 'replace' );
wp_style_add_data( 'woocommerce_admin_styles', 'rtl', 'replace' );
wp_style_add_data( 'woocommerce_admin_dashboard_styles', 'rtl', 'replace' );
wp_style_add_data( 'woocommerce_admin_print_reports_styles', 'rtl', 'replace' );
// Sitewide menu CSS
// Sitewide menu CSS.
wp_enqueue_style( 'woocommerce_admin_menu_styles' );
// Admin styles for WC pages only
// Admin styles for WC pages only.
if ( in_array( $screen_id, wc_get_screen_ids() ) ) {
wp_enqueue_style( 'woocommerce_admin_styles' );
wp_enqueue_style( 'jquery-ui-style' );
@ -67,9 +65,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_enqueue_style( 'woocommerce_admin_print_reports_styles' );
}
/**
* @deprecated 2.3
*/
// @deprecated 2.3.
if ( has_action( 'woocommerce_admin_css' ) ) {
do_action( 'woocommerce_admin_css' );
wc_deprecated_function( 'The woocommerce_admin_css action', '2.3', 'admin_enqueue_scripts' );
@ -88,7 +84,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
// Register scripts
// Register scripts.
wp_register_script( 'woocommerce_admin', WC()->plugin_url() . '/assets/js/admin/woocommerce_admin' . $suffix . '.js', array( 'jquery', 'jquery-blockui', 'jquery-ui-sortable', 'jquery-ui-widget', 'jquery-ui-core', 'jquery-tiptip' ), WC_VERSION );
wp_register_script( 'jquery-blockui', WC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true );
@ -110,7 +106,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_register_script( 'wc-shipping-classes', WC()->plugin_url() . '/assets/js/admin/wc-shipping-classes' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone' ), WC_VERSION );
wp_register_script( 'wc-clipboard', WC()->plugin_url() . '/assets/js/admin/wc-clipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
wp_register_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.3' );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.4' );
wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
wp_localize_script(
'wc-enhanced-select',
@ -173,25 +169,29 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
'i18_delete_product_notice' => __( 'This product has produced sales and may be linked to existing orders. Are you sure you want to delete it?', 'woocommerce' ),
'decimal_point' => $decimal,
'mon_decimal_point' => wc_get_price_decimal_separator(),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'strings' => array(
'import_products' => __( 'Import', 'woocommerce' ),
'export_products' => __( 'Export', 'woocommerce' ),
),
'nonces' => array(
'gateway_toggle' => wp_create_nonce( 'woocommerce-toggle-payment-gateway-enabled' ),
),
'urls' => array(
'import_products' => esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_importer' ) ),
'export_products' => esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_exporter' ) ),
'import_products' => current_user_can( 'import' ) ? esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_importer' ) ) : null,
'export_products' => current_user_can( 'export' ) ? esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_exporter' ) ) : null,
),
);
wp_localize_script( 'woocommerce_admin', 'woocommerce_admin', $params );
}
// Edit product category pages
// Edit product category pages.
if ( in_array( $screen_id, array( 'edit-product_cat' ) ) ) {
wp_enqueue_media();
}
// Products
// Products.
if ( in_array( $screen_id, array( 'edit-product' ) ) ) {
wp_enqueue_script( 'woocommerce_quick-edit', WC()->plugin_url() . '/assets/js/admin/quick-edit' . $suffix . '.js', array( 'jquery', 'woocommerce_admin' ), WC_VERSION );
@ -204,7 +204,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_localize_script( 'woocommerce_quick-edit', 'woocommerce_quick_edit', $params );
}
// Meta boxes
// Meta boxes.
if ( in_array( $screen_id, array( 'product', 'edit-product' ) ) ) {
wp_enqueue_media();
wp_register_script( 'wc-admin-product-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes-product' . $suffix . '.js', array( 'wc-admin-meta-boxes', 'media-models' ), WC_VERSION );
@ -224,6 +224,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
'load_variations_nonce' => wp_create_nonce( 'load-variations' ),
'save_variations_nonce' => wp_create_nonce( 'save-variations' ),
'bulk_edit_variations_nonce' => wp_create_nonce( 'bulk-edit-variations' ),
/* translators: %d: Number of variations */
'i18n_link_all_variations' => esc_js( sprintf( __( 'Are you sure you want to link all variations? This will create a new variation for each and every possible combination of variation attributes (max %d per run).', 'woocommerce' ), defined( 'WC_MAX_LINKED_VARIATIONS' ) ? WC_MAX_LINKED_VARIATIONS : 50 ) ),
'i18n_enter_a_value' => esc_js( __( 'Enter a value', 'woocommerce' ) ),
'i18n_enter_menu_order' => esc_js( __( 'Variation menu order (determines position in the list of variations)', 'woocommerce' ) ),
@ -270,8 +271,11 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
$post_id = isset( $post->ID ) ? $post->ID : '';
$currency = '';
if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) && ( $order = wc_get_order( $post_id ) ) ) {
$currency = $order->get_currency();
if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) ) {
$order = wc_get_order( $post_id );
if ( $order ) {
$currency = $order->get_currency();
}
}
$params = array(
@ -318,7 +322,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
'currency_format_symbol' => get_woocommerce_currency_symbol( $currency ),
'currency_format_decimal_sep' => esc_attr( wc_get_price_decimal_separator() ),
'currency_format_thousand_sep' => esc_attr( wc_get_price_thousand_separator() ),
'currency_format' => esc_attr( str_replace( array( '%1$s', '%2$s' ), array( '%s', '%v' ), get_woocommerce_price_format() ) ), // For accounting JS
'currency_format' => esc_attr( str_replace( array( '%1$s', '%2$s' ), array( '%s', '%v' ), get_woocommerce_price_format() ) ), // For accounting JS.
'rounding_precision' => wc_get_rounding_precision(),
'tax_rounding_mode' => wc_get_tax_rounding_mode(),
'product_types' => array_unique( array_merge( array( 'simple', 'grouped', 'variable', 'external' ), array_keys( wc_get_product_types() ) ) ),
@ -333,13 +337,13 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_localize_script( 'wc-admin-meta-boxes', 'woocommerce_admin_meta_boxes', $params );
}
// Term ordering - only when sorting by term_order
if ( ( strstr( $screen_id, 'edit-pa_' ) || ( ! empty( $_GET['taxonomy'] ) && in_array( $_GET['taxonomy'], apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ) ) ) ) && ! isset( $_GET['orderby'] ) ) {
// Term ordering - only when sorting by term_order.
if ( ( strstr( $screen_id, 'edit-pa_' ) || ( ! empty( $_GET['taxonomy'] ) && in_array( wp_unslash( $_GET['taxonomy'] ), apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ) ) ) ) && ! isset( $_GET['orderby'] ) ) {
wp_register_script( 'woocommerce_term_ordering', WC()->plugin_url() . '/assets/js/admin/term-ordering' . $suffix . '.js', array( 'jquery-ui-sortable' ), WC_VERSION );
wp_enqueue_script( 'woocommerce_term_ordering' );
$taxonomy = isset( $_GET['taxonomy'] ) ? wc_clean( $_GET['taxonomy'] ) : '';
$taxonomy = isset( $_GET['taxonomy'] ) ? wc_clean( wp_unslash( $_GET['taxonomy'] ) ) : '';
$woocommerce_term_order_params = array(
'taxonomy' => $taxonomy,
@ -348,13 +352,13 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );
}
// Product sorting - only when sorting by menu order on the products page
// Product sorting - only when sorting by menu order on the products page.
if ( current_user_can( 'edit_others_pages' ) && 'edit-product' === $screen_id && isset( $wp_query->query['orderby'] ) && 'menu_order title' === $wp_query->query['orderby'] ) {
wp_register_script( 'woocommerce_product_ordering', WC()->plugin_url() . '/assets/js/admin/product-ordering' . $suffix . '.js', array( 'jquery-ui-sortable' ), WC_VERSION, true );
wp_enqueue_script( 'woocommerce_product_ordering' );
}
// Reports Pages
// Reports Pages.
if ( in_array( $screen_id, apply_filters( 'woocommerce_reports_screen_ids', array( $wc_screen_id . '_page_wc-reports', 'toplevel_page_wc-reports', 'dashboard' ) ) ) ) {
wp_register_script( 'wc-reports', WC()->plugin_url() . '/assets/js/admin/reports' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker' ), WC_VERSION );
@ -366,7 +370,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
wp_enqueue_script( 'flot-stack' );
}
// API settings
// API settings.
if ( $wc_screen_id . '_page_wc-settings' === $screen_id && isset( $_GET['section'] ) && 'keys' == $_GET['section'] ) {
wp_register_script( 'wc-api-keys', WC()->plugin_url() . '/assets/js/admin/api-keys' . $suffix . '.js', array( 'jquery', 'woocommerce_admin', 'underscore', 'backbone', 'wp-util', 'qrcode', 'wc-clipboard' ), WC_VERSION, true );
wp_enqueue_script( 'wc-api-keys' );

View File

@ -26,6 +26,10 @@ class WC_Admin_Exporters {
* Constructor.
*/
public function __construct() {
if ( ! $this->export_allowed() ) {
return;
}
add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
add_action( 'admin_head', array( $this, 'hide_from_menus' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
@ -36,11 +40,20 @@ class WC_Admin_Exporters {
$this->exporters['product_exporter'] = array(
'menu' => 'edit.php?post_type=product',
'name' => __( 'Product Export', 'woocommerce' ),
'capability' => 'edit_products',
'capability' => 'export',
'callback' => array( $this, 'product_exporter' ),
);
}
/**
* Return true if WooCommerce export is allowed for current user, false otherwise.
*
* @return bool Whether current user can perform export.
*/
protected function export_allowed() {
return current_user_can( 'edit_products' ) && current_user_can( 'export' );
}
/**
* Add menu items for our custom exporters.
*/
@ -112,8 +125,8 @@ class WC_Admin_Exporters {
public function do_ajax_product_export() {
check_ajax_referer( 'wc-product-export', 'security' );
if ( ! current_user_can( 'edit_products' ) ) {
wp_die( -1 );
if ( ! $this->export_allowed() ) {
wp_send_json_error( array( 'message' => __( 'Insufficient privileges to export products.', 'woocommerce' ) ) );
}
include_once WC_ABSPATH . 'includes/export/class-wc-product-csv-exporter.php';

View File

@ -2,15 +2,10 @@
/**
* Init WooCommerce data importers.
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin
* @version 3.1.0
* @package WooCommerce/Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
/**
* WC_Admin_Importers Class.
@ -28,6 +23,10 @@ class WC_Admin_Importers {
* Constructor.
*/
public function __construct() {
if ( ! $this->import_allowed() ) {
return;
}
add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
add_action( 'admin_init', array( $this, 'register_importers' ) );
add_action( 'admin_head', array( $this, 'hide_from_menus' ) );
@ -38,11 +37,20 @@ class WC_Admin_Importers {
$this->importers['product_importer'] = array(
'menu' => 'edit.php?post_type=product',
'name' => __( 'Product Import', 'woocommerce' ),
'capability' => 'edit_products',
'capability' => 'import',
'callback' => array( $this, 'product_importer' ),
);
}
/**
* Return true if WooCommerce imports are allowed for current user, false otherwise.
*
* @return bool Whether current user can perform imports.
*/
protected function import_allowed() {
return current_user_can( 'edit_products' ) && current_user_can( 'import' );
}
/**
* Add menu items for our custom importers.
*/
@ -111,7 +119,6 @@ class WC_Admin_Importers {
* The tax rate importer which extends WP_Importer.
*/
public function tax_rates_importer() {
// Load Importer API
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
@ -122,10 +129,8 @@ class WC_Admin_Importers {
}
}
// includes
require dirname( __FILE__ ) . '/importers/class-wc-tax-rate-importer.php';
// Dispatch
$importer = new WC_Tax_Rate_Importer();
$importer->dispatch();
}
@ -139,11 +144,11 @@ class WC_Admin_Importers {
public function post_importer_compatibility() {
global $wpdb;
if ( empty( $_POST['import_id'] ) || ! class_exists( 'WXR_Parser' ) ) {
if ( empty( $_POST['import_id'] ) || ! class_exists( 'WXR_Parser' ) ) { // PHPCS: input var ok, CSRF ok.
return;
}
$id = absint( $_POST['import_id'] );
$id = absint( $_POST['import_id'] ); // PHPCS: input var ok.
$file = get_attached_file( $id );
$parser = new WXR_Parser();
$import_data = $parser->parse( $file );
@ -156,8 +161,8 @@ class WC_Admin_Importers {
if ( ! taxonomy_exists( $term['domain'] ) ) {
$attribute_name = wc_sanitize_taxonomy_name( str_replace( 'pa_', '', $term['domain'] ) );
// Create the taxonomy
if ( ! in_array( $attribute_name, wc_get_attribute_taxonomies() ) ) {
// Create the taxonomy.
if ( ! in_array( $attribute_name, wc_get_attribute_taxonomies(), true ) ) {
wc_create_attribute(
array(
'name' => $attribute_name,
@ -198,19 +203,19 @@ class WC_Admin_Importers {
check_ajax_referer( 'wc-product-import', 'security' );
if ( ! current_user_can( 'edit_products' ) || ! isset( $_POST['file'] ) ) {
wp_die( -1 );
if ( ! $this->import_allowed() || ! isset( $_POST['file'] ) ) { // PHPCS: input var ok.
wp_send_json_error( array( 'message' => __( 'Insufficient privileges to import products.', 'woocommerce' ) ) );
}
include_once WC_ABSPATH . 'includes/admin/importers/class-wc-product-csv-importer-controller.php';
include_once WC_ABSPATH . 'includes/import/class-wc-product-csv-importer.php';
$file = wc_clean( $_POST['file'] );
$file = wc_clean( wp_unslash( $_POST['file'] ) ); // PHPCS: input var ok.
$params = array(
'delimiter' => ! empty( $_POST['delimiter'] ) ? wc_clean( $_POST['delimiter'] ) : ',',
'start_pos' => isset( $_POST['position'] ) ? absint( $_POST['position'] ) : 0,
'mapping' => isset( $_POST['mapping'] ) ? (array) $_POST['mapping'] : array(),
'update_existing' => isset( $_POST['update_existing'] ) ? (bool) $_POST['update_existing'] : false,
'delimiter' => ! empty( $_POST['delimiter'] ) ? wc_clean( wp_unslash( $_POST['delimiter'] ) ) : ',', // PHPCS: input var ok.
'start_pos' => isset( $_POST['position'] ) ? absint( $_POST['position'] ) : 0, // PHPCS: input var ok.
'mapping' => isset( $_POST['mapping'] ) ? (array) wc_clean( wp_unslash( $_POST['mapping'] ) ) : array(), // PHPCS: input var ok.
'update_existing' => isset( $_POST['update_existing'] ) ? (bool) $_POST['update_existing'] : false, // PHPCS: input var ok.
'lines' => apply_filters( 'woocommerce_product_import_batch_size', 30 ),
'parse' => true,
);
@ -231,7 +236,7 @@ class WC_Admin_Importers {
if ( 100 === $percent_complete ) {
// Clear temp meta.
$wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_original_id' ) );
$wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_original_id' ) ); // @codingStandardsIgnoreLine.
$wpdb->query(
"DELETE {$wpdb->posts}, {$wpdb->postmeta}, {$wpdb->term_relationships}
FROM {$wpdb->posts}
@ -243,6 +248,14 @@ class WC_Admin_Importers {
AND {$wpdb->posts}.post_status = 'importing'"
);
// Clear orphan variations.
$wpdb->query(
"DELETE products
FROM {$wpdb->posts} products
LEFT JOIN {$wpdb->posts} wp ON wp.ID = products.post_parent
WHERE wp.ID IS NULL AND products.post_type = 'product_variation';"
);
// Send success.
wp_send_json_success(
array(

View File

@ -65,7 +65,7 @@ class WC_Admin_Meta_Boxes {
add_action( 'woocommerce_process_shop_coupon_meta', 'WC_Meta_Box_Coupon_Data::save', 10, 2 );
// Save Rating Meta Boxes.
add_action( 'comment_edit_redirect', 'WC_Meta_Box_Product_Reviews::save', 1, 2 );
add_filter( 'wp_update_comment_data', 'WC_Meta_Box_Product_Reviews::save', 1 );
// Error handling (for showing errors from meta boxes on next page load).
add_action( 'admin_notices', array( $this, 'output_errors' ) );

View File

@ -828,7 +828,7 @@ class WC_Admin_Post_Types {
public function hide_cpt_archive_templates( $page_templates, $theme, $post ) {
$shop_page_id = wc_get_page_id( 'shop' );
if ( $post && absint( $shop_page_id ) === absint( $post->ID ) ) {
if ( $post && $shop_page_id === absint( $post->ID ) ) {
$page_templates = array();
}
@ -843,7 +843,7 @@ class WC_Admin_Post_Types {
public function show_cpt_archive_notice( $post ) {
$shop_page_id = wc_get_page_id( 'shop' );
if ( $post && absint( $shop_page_id ) === absint( $post->ID ) ) {
if ( $post && $shop_page_id === absint( $post->ID ) ) {
echo '<div class="notice notice-info">';
echo '<p>' . sprintf( wp_kses_post( __( 'This is the WooCommerce shop page. The shop page is a special archive that lists your products. <a href="%s">You can read more about this here</a>.', 'woocommerce' ) ), 'https://docs.woocommerce.com/document/woocommerce-pages/#section-4' ) . '</p>';
echo '</div>';

View File

@ -51,11 +51,11 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
$settings[] = include 'settings/class-wc-settings-products.php';
$settings[] = include 'settings/class-wc-settings-tax.php';
$settings[] = include 'settings/class-wc-settings-shipping.php';
$settings[] = include 'settings/class-wc-settings-checkout.php';
$settings[] = include 'settings/class-wc-settings-payment-gateways.php';
$settings[] = include 'settings/class-wc-settings-accounts.php';
$settings[] = include 'settings/class-wc-settings-emails.php';
$settings[] = include 'settings/class-wc-settings-integrations.php';
$settings[] = include 'settings/class-wc-settings-rest-api.php';
$settings[] = include 'settings/class-wc-settings-advanced.php';
self::$settings = apply_filters( 'woocommerce_get_settings_pages', $settings );
}

View File

@ -171,12 +171,6 @@ class WC_Admin_Setup_Wizard {
unset( $default_steps['shipping'] );
}
// Hide the activate step if Jetpack is already active, but not
// if we're returning from connecting Jetpack on WordPress.com.
if ( class_exists( 'Jetpack' ) && Jetpack::is_active() && ! isset( $_GET['from'] ) && ! isset( $_GET['activate_error'] ) ) { // WPCS: CSRF ok, input var ok.
unset( $default_steps['activate'] );
}
// Whether or not there is a pending background install of Jetpack.
$pending_jetpack = ! class_exists( 'Jetpack' ) && get_option( 'woocommerce_setup_background_installing_jetpack' );
@ -215,6 +209,7 @@ class WC_Admin_Setup_Wizard {
'wc_setup_params',
array(
'pending_jetpack_install' => $pending_jetpack ? 'yes' : 'no',
'states' => WC()->countries->get_states(),
)
);
@ -298,21 +293,38 @@ class WC_Admin_Setup_Wizard {
* Output the steps.
*/
public function setup_wizard_steps() {
$output_steps = $this->steps;
$selected_features = array_filter( $this->wc_setup_activate_get_feature_list() );
// Hide the activate step if Jetpack is already active, unless WooCommerce Services
// features are selected, or unless the Activate step was already taken.
if ( class_exists( 'Jetpack' ) && Jetpack::is_active() && empty( $selected_features ) && 'yes' !== get_transient( 'wc_setup_activated' ) ) {
unset( $output_steps['activate'] );
}
?>
<ol class="wc-setup-steps">
<?php foreach ( $this->steps as $step_key => $step ) :
<?php
foreach ( $output_steps as $step_key => $step ) {
$is_completed = array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true );
if ( $step_key === $this->step ) : ?>
if ( $step_key === $this->step ) {
?>
<li class="active"><?php echo esc_html( $step['name'] ); ?></li>
<?php elseif ( $is_completed ) : ?>
<?php
} elseif ( $is_completed ) {
?>
<li class="done">
<a href="<?php echo esc_url( add_query_arg( 'step', $step_key, remove_query_arg( 'activate_error' ) ) ) ?>"><?php echo esc_html( $step['name'] ); ?></a>
<a href="<?php echo esc_url( add_query_arg( 'step', $step_key, remove_query_arg( 'activate_error' ) ) ); ?>"><?php echo esc_html( $step['name'] ); ?></a>
</li>
<?php else : ?>
<?php
} else {
?>
<li><?php echo esc_html( $step['name'] ); ?></li>
<?php endif; ?>
<?php endforeach; ?>
<?php
}
}
?>
</ol>
<?php
}
@ -347,8 +359,6 @@ class WC_Admin_Setup_Wizard {
$user_location = WC_Geolocation::geolocate_ip();
$country = $user_location['country'];
$state = $user_location['state'];
} elseif ( empty( $state ) ) {
$state = '*';
}
$locale_info = include WC()->plugin_path() . '/i18n/locale-info.php';
@ -357,75 +367,44 @@ class WC_Admin_Setup_Wizard {
<form method="post" class="address-step">
<?php wp_nonce_field( 'wc-setup' ); ?>
<p class="store-setup"><?php esc_html_e( 'The following wizard will help you configure your store and get you started quickly.', 'woocommerce' ); ?></p>
<label for="store_country_state" class="location-prompt">
<?php esc_html_e( 'Where is your store based?', 'woocommerce' ); ?>
</label>
<select
id="store_country_state"
name="store_country_state"
required
data-placeholder="<?php esc_attr_e( 'Choose a country&hellip;', 'woocommerce' ); ?>"
aria-label="<?php esc_attr_e( 'Country', 'woocommerce' ); ?>"
class="location-input wc-enhanced-select dropdown"
>
<?php WC()->countries->country_dropdown_options( $country, $state ); ?>
</select>
<div class="store-address-container">
<label class="location-prompt" for="store_address">
<?php esc_html_e( 'Address', 'woocommerce' ); ?>
</label>
<input
type="text"
id="store_address"
class="location-input"
name="store_address"
required
value="<?php echo esc_attr( $address ); ?>"
/>
<label class="location-prompt" for="store_address_2">
<?php esc_html_e( 'Address line 2', 'woocommerce' ); ?>
</label>
<input
type="text"
id="store_address_2"
class="location-input"
name="store_address_2"
value="<?php echo esc_attr( $address_2 ); ?>"
/>
<div class="city-and-postcode">
<div>
<label class="location-prompt" for="store_city">
<?php esc_html_e( 'City', 'woocommerce' ); ?>
<label for="store_country" class="location-prompt"><?php esc_html_e( 'Where is your store based?', 'woocommerce' ); ?></label>
<select id="store_country" name="store_country" required data-placeholder="<?php esc_attr_e( 'Choose a country&hellip;', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'Country', 'woocommerce' ); ?>" class="location-input wc-enhanced-select dropdown">
<?php foreach ( WC()->countries->get_countries() as $code => $label ) : ?>
<option <?php selected( $code, $country ); ?> value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $label ); ?></option>
<?php endforeach; ?>
</select>
<label class="location-prompt" for="store_address"><?php esc_html_e( 'Address', 'woocommerce' ); ?></label>
<input type="text" id="store_address" class="location-input" name="store_address" required value="<?php echo esc_attr( $address ); ?>" />
<label class="location-prompt" for="store_address_2"><?php esc_html_e( 'Address line 2', 'woocommerce' ); ?></label>
<input type="text" id="store_address_2" class="location-input" name="store_address_2" value="<?php echo esc_attr( $address_2 ); ?>" />
<div class="store-state-container hidden">
<label for="store_state" class="location-prompt">
<?php esc_html_e( 'State', 'woocommerce' ); ?>
</label>
<input
type="text"
id="store_city"
class="location-input"
name="store_city"
required
value="<?php echo esc_attr( $city ); ?>"
/>
<select id="store_state" name="store_state" data-placeholder="<?php esc_attr_e( 'Choose a state&hellip;', 'woocommerce' ); ?>" aria-label="<?php esc_attr_e( 'State', 'woocommerce' ); ?>" class="location-input wc-enhanced-select dropdown"></select>
</div>
<div>
<label class="location-prompt" for="store_postcode">
<?php esc_html_e( 'Postcode / ZIP', 'woocommerce' ); ?>
</label>
<input
type="text"
id="store_postcode"
class="location-input"
name="store_postcode"
required
value="<?php echo esc_attr( $postcode ); ?>"
/>
<div class="city-and-postcode">
<div>
<label class="location-prompt" for="store_city"><?php esc_html_e( 'City', 'woocommerce' ); ?></label>
<input type="text" id="store_city" class="location-input" name="store_city" required value="<?php echo esc_attr( $city ); ?>" />
</div>
<div>
<label class="location-prompt" for="store_postcode"><?php esc_html_e( 'Postcode / ZIP', 'woocommerce' ); ?></label>
<input type="text" id="store_postcode" class="location-input" name="store_postcode" required value="<?php echo esc_attr( $postcode ); ?>" />
</div>
</div>
</div>
</div>
<div class="store-currency-container">
<label class="location-prompt" for="currency_code">
<?php esc_html_e( 'What currency do you use?', 'woocommerce' ); ?>
<?php esc_html_e( 'What currency do you accept payments in?', 'woocommerce' ); ?>
</label>
<select
id="currency_code"
@ -438,27 +417,30 @@ class WC_Admin_Setup_Wizard {
<?php foreach ( get_woocommerce_currencies() as $code => $name ) : ?>
<option value="<?php echo esc_attr( $code ); ?>" <?php selected( $currency, $code ); ?>>
<?php
$symbol = get_woocommerce_currency_symbol( $code );
if ( $symbol === $code ) {
/* translators: 1: currency name 2: currency code */
echo esc_html( sprintf( __( '%1$s (%2$s)', 'woocommerce' ), $name, get_woocommerce_currency_symbol( $code ) ) );
echo esc_html( sprintf( __( '%1$s (%2$s)', 'woocommerce' ), $name, $code ) );
} else {
/* translators: 1: currency name 2: currency symbol, 3: currency code */
echo esc_html( sprintf( __( '%1$s (%2$s / %3$s)', 'woocommerce' ), $name, get_woocommerce_currency_symbol( $code ), $code ) );
}
?>
</option>
<?php endforeach; ?>
</select>
<script type="text/javascript">
var wc_setup_currencies = <?php echo wp_json_encode( $currency_by_country ); ?>;
var wc_base_state = "<?php echo esc_js( $state ); ?>";
</script>
</div>
<div class="product-type-container">
<label class="location-prompt" for="product_type">
<?php esc_html_e( 'What type of product do you plan to sell?', 'woocommerce' ); ?>
<?php esc_html_e( 'What type of products do you plan to sell?', 'woocommerce' ); ?>
</label>
<select
id="product_type"
name="product_type"
required
class="location-input wc-enhanced-select dropdown"
>
<select id="product_type" name="product_type" required class="location-input wc-enhanced-select dropdown">
<option value="both" <?php selected( $product_type, 'both' ); ?>><?php esc_html_e( 'I plan to sell both physical and digital products', 'woocommerce' ); ?></option>
<option value="physical" <?php selected( $product_type, 'physical' ); ?>><?php esc_html_e( 'I plan to sell physical products', 'woocommerce' ); ?></option>
<option value="virtual" <?php selected( $product_type, 'virtual' ); ?>><?php esc_html_e( 'I plan to sell digital products', 'woocommerce' ); ?></option>
@ -476,12 +458,24 @@ class WC_Admin_Setup_Wizard {
<?php esc_html_e( 'I will also be selling products or services in person.', 'woocommerce' ); ?>
</label>
<?php if ( 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) : ?>
<div class="allow-tracking">
<input type="checkbox" id="wc_tracker_optin" name="wc_tracker_optin" value="yes" checked />
<label for="wc_tracker_optin"><?php esc_html_e( 'Allow WooCommerce to collect non-sensitive diagnostic data and usage information.', 'woocommerce' ); ?></label>
<?php
if ( 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) {
?>
<div class="woocommerce-tracker">
<p class="checkbox">
<input type="checkbox" id="wc_tracker_checkbox" name="wc_tracker_checkbox" value="yes" checked />
<label for="wc_tracker_checkbox"><?php esc_html_e( 'Help WooCommerce improve with usage tracking.', 'woocommerce' ); ?></label>
</p>
<p>
<?php
esc_html_e( 'Gathering usage data allows us to make WooCommerce better &mdash; your store will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. If you would rather opt-out, and do not check this box, we will not know this store exists and we will not collect any usage data.', 'woocommerce' );
echo ' <a target="_blank" href="https://woocommerce.com/usage-tracking/">' . esc_html__( 'Read more about what we collect.', 'woocommerce' ) . '</a>';
?>
</p>
</div>
<?php endif; ?>
<?php
}
?>
<p class="wc-setup-actions step">
<button type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( "Let's go!", 'woocommerce' ); ?>" name="save_step"><?php esc_html_e( "Let's go!", 'woocommerce' ); ?></button>
</p>
@ -498,24 +492,29 @@ class WC_Admin_Setup_Wizard {
$address = sanitize_text_field( $_POST['store_address'] );
$address_2 = sanitize_text_field( $_POST['store_address_2'] );
$city = sanitize_text_field( $_POST['store_city'] );
$country_state = sanitize_text_field( $_POST['store_country_state'] );
$country = sanitize_text_field( $_POST['store_country'] );
$state = sanitize_text_field( $_POST['store_state'] );
$postcode = sanitize_text_field( $_POST['store_postcode'] );
$currency_code = sanitize_text_field( $_POST['currency_code'] );
$product_type = sanitize_text_field( $_POST['product_type'] );
$sell_in_person = isset( $_POST['sell_in_person'] ) && ( 'yes' === sanitize_text_field( $_POST['sell_in_person'] ) );
$tracking = isset( $_POST['wc_tracker_optin'] ) && ( 'yes' === sanitize_text_field( $_POST['wc_tracker_optin'] ) );
$tracking = isset( $_POST['wc_tracker_checkbox'] ) && ( 'yes' === sanitize_text_field( $_POST['wc_tracker_checkbox'] ) );
// @codingStandardsIgnoreEnd
if ( ! $state ) {
$state = '*';
}
update_option( 'woocommerce_store_address', $address );
update_option( 'woocommerce_store_address_2', $address_2 );
update_option( 'woocommerce_store_city', $city );
update_option( 'woocommerce_default_country', $country_state );
update_option( 'woocommerce_default_country', $country . ':' . $state );
update_option( 'woocommerce_store_postcode', $postcode );
update_option( 'woocommerce_currency', $currency_code );
update_option( 'woocommerce_product_type', $product_type );
update_option( 'woocommerce_sell_in_person', $sell_in_person );
$locale_info = include WC()->plugin_path() . '/i18n/locale-info.php';
$country = WC()->countries->get_base_country();
// Set currency formatting options based on chosen location and currency.
if (
@ -594,7 +593,7 @@ class WC_Admin_Setup_Wizard {
* Helper method to queue the background install of a plugin.
*
* @param string $plugin_id Plugin id used for background install.
* @param array $plugin_info Plugin info array containing at least main file and repo slug.
* @param array $plugin_info Plugin info array containing name and repo-slug, and optionally file if different from [repo-slug].php.
*/
protected function install_plugin( $plugin_id, $plugin_info ) {
// Make sure we don't trigger multiple simultaneous installs.
@ -602,7 +601,8 @@ class WC_Admin_Setup_Wizard {
return;
}
if ( ! empty( $plugin_info['file'] ) && is_plugin_active( $plugin_info['file'] ) ) {
$plugin_file = isset( $plugin_info['file'] ) ? $plugin_info['file'] : $plugin_info['repo-slug'] . '.php';
if ( is_plugin_active( $plugin_info['repo-slug'] . '/' . $plugin_file ) ) {
return;
}
@ -648,7 +648,6 @@ class WC_Admin_Setup_Wizard {
$this->install_plugin(
'jetpack',
array(
'file' => 'jetpack/jetpack.php',
'name' => __( 'Jetpack', 'woocommerce' ),
'repo-slug' => 'jetpack',
)
@ -663,7 +662,6 @@ class WC_Admin_Setup_Wizard {
$this->install_plugin(
'woocommerce-services',
array(
'file' => 'woocommerce-services/woocommerce-services.php',
'name' => __( 'WooCommerce Services', 'woocommerce' ),
'repo-slug' => 'woocommerce-services',
)
@ -1675,8 +1673,9 @@ class WC_Admin_Setup_Wizard {
}
}
protected function wc_setup_activate_get_description() {
$description = false;
protected function wc_setup_activate_get_feature_list() {
$features = array();
$stripe_settings = get_option( 'woocommerce_stripe_settings', false );
$stripe_enabled = is_array( $stripe_settings )
&& isset( $stripe_settings['create_account'] ) && 'yes' === $stripe_settings['create_account']
@ -1685,32 +1684,35 @@ class WC_Admin_Setup_Wizard {
$ppec_enabled = is_array( $ppec_settings )
&& isset( $ppec_settings['reroute_requests'] ) && 'yes' === $ppec_settings['reroute_requests']
&& isset( $ppec_settings['enabled'] ) && 'yes' === $ppec_settings['enabled'];
$payment_enabled = $stripe_enabled || $ppec_enabled;
$taxes_enabled = (bool) get_option( 'woocommerce_setup_automated_taxes', false );
$features['payment'] = $stripe_enabled || $ppec_enabled;
$features['taxes'] = (bool) get_option( 'woocommerce_setup_automated_taxes', false );
$domestic_rates = (bool) get_option( 'woocommerce_setup_domestic_live_rates_zone', false );
$intl_rates = (bool) get_option( 'woocommerce_setup_intl_live_rates_zone', false );
$rates_enabled = $domestic_rates || $intl_rates;
$features['rates'] = $domestic_rates || $intl_rates;
/* translators: %s: list of features, potentially comma separated */
$description_base = __( 'Your store is almost ready! To activate services like %s, just connect with Jetpack.', 'woocommerce' );
return $features;
}
if ( $payment_enabled && $taxes_enabled && $rates_enabled ) {
$description = sprintf( $description_base, __( 'payment setup, automated taxes, live rates and discounted shipping labels', 'woocommerce' ) );
} else if ( $payment_enabled && $taxes_enabled ) {
$description = sprintf( $description_base, __( 'payment setup and automated taxes', 'woocommerce' ) );
} else if ( $payment_enabled && $rates_enabled ) {
$description = sprintf( $description_base, __( 'payment setup, live rates and discounted shipping labels', 'woocommerce' ) );
} else if ( $payment_enabled ) {
$description = sprintf( $description_base, __( 'payment setup', 'woocommerce' ) );
} else if ( $taxes_enabled && $rates_enabled ) {
$description = sprintf( $description_base, __( 'automated taxes, live rates and discounted shipping labels', 'woocommerce' ) );
} else if ( $taxes_enabled ) {
$description = sprintf( $description_base, __( 'automated taxes', 'woocommerce' ) );
} else if ( $rates_enabled ) {
$description = sprintf( $description_base, __( 'live rates and discounted shipping labels', 'woocommerce' ) );
protected function wc_setup_activate_get_feature_list_str() {
$features = $this->wc_setup_activate_get_feature_list();
if ( $features['payment'] && $features['taxes'] && $features['rates'] ) {
return __( 'payment setup, automated taxes, live rates and discounted shipping labels', 'woocommerce' );
} else if ( $features['payment'] && $features['taxes'] ) {
return __( 'payment setup and automated taxes', 'woocommerce' );
} else if ( $features['payment'] && $features['rates'] ) {
return __( 'payment setup, live rates and discounted shipping labels', 'woocommerce' );
} else if ( $features['payment'] ) {
return __( 'payment setup', 'woocommerce' );
} else if ( $features['taxes'] && $features['rates'] ) {
return __( 'automated taxes, live rates and discounted shipping labels', 'woocommerce' );
} else if ( $features['taxes'] ) {
return __( 'automated taxes', 'woocommerce' );
} else if ( $features['rates'] ) {
return __( 'live rates and discounted shipping labels', 'woocommerce' );
}
return $description;
return false;
}
/**
@ -1719,6 +1721,8 @@ class WC_Admin_Setup_Wizard {
public function wc_setup_activate() {
$this->wc_setup_activate_actions();
$jetpack_connected = class_exists( 'Jetpack' ) && Jetpack::is_active();
$has_jetpack_error = false;
if ( isset( $_GET['activate_error'] ) ) {
$has_jetpack_error = true;
@ -1728,19 +1732,57 @@ class WC_Admin_Setup_Wizard {
$error_message = $this->get_activate_error_message( sanitize_text_field( wp_unslash( $_GET['activate_error'] ) ) );
$description = $error_message;
} else {
$description = $this->wc_setup_activate_get_description();
$title = $description ?
__( 'Connect your store to Jetpack', 'woocommerce' ) :
__( 'Connect your store to Jetpack to enable extra features', 'woocommerce' );
$feature_list = $this->wc_setup_activate_get_feature_list_str();
$description = false;
if ( $feature_list ) {
if ( ! $jetpack_connected ) {
/* translators: %s: list of features, potentially comma separated */
$description_base = __( 'Your store is almost ready! To activate services like %s, just connect with Jetpack.', 'woocommerce' );
} else {
$description_base = __( 'Thanks for using Jetpack! Your store is almost ready: to activate services like %s, just connect your store.', 'woocommerce' );
}
$description = sprintf( $description_base, $feature_list );
}
if ( ! $jetpack_connected ) {
$title = $feature_list ?
__( 'Connect your store to Jetpack', 'woocommerce' ) :
__( 'Connect your store to Jetpack to enable extra features', 'woocommerce' );
$button_text = __( 'Continue with Jetpack', 'woocommerce' );
} elseif ( $feature_list ) {
$title = __( 'Connect your store to activate WooCommerce Services', 'woocommerce' );
$button_text = __( 'Continue with WooCommerce Services', 'woocommerce' );
} else {
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
exit;
}
}
?>
<h1><?php echo esc_html( $title ); ?></h1>
<p><?php echo esc_html( $description ); ?></p>
<img
class="jetpack-logo"
src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/jetpack_vertical_logo.png' ); ?>"
alt="Jetpack logo"
/>
<?php if ( $jetpack_connected ) : ?>
<div class="activate-splash">
<img
class="jetpack-logo"
src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/jetpack_horizontal_logo.png' ); ?>"
alt="Jetpack logo"
/>
<img
class="wcs-notice"
src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/wcs-notice.png' ); ?>"
/>
</div>
<?php else : ?>
<img
class="jetpack-logo"
src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/jetpack_vertical_logo.png' ); ?>"
alt="Jetpack logo"
/>
<?php endif; ?>
<?php if ( $has_jetpack_error ) : ?>
<p class="wc-setup-actions step">
<a
@ -1762,53 +1804,55 @@ class WC_Admin_Setup_Wizard {
</p>
<form method="post" class="activate-jetpack">
<p class="wc-setup-actions step">
<button type="submit" class="button-primary button button-large" value="<?php esc_attr_e( 'Connect with Jetpack', 'woocommerce' ); ?>"><?php esc_html_e( 'Continue with Jetpack', 'woocommerce' ); ?></button>
<button type="submit" class="button-primary button button-large" value="<?php echo esc_attr( $button_text ); ?>"><?php echo esc_html( $button_text ); ?></button>
</p>
<input type="hidden" name="save_step" value="activate" />
<?php wp_nonce_field( 'wc-setup' ); ?>
</form>
<h3 class="jetpack-reasons">
<?php
echo esc_html( $description ?
__( "Bonus reasons you'll love Jetpack", 'woocommerce' ) :
__( "Reasons you'll love Jetpack", 'woocommerce' )
);
?>
</h3>
<ul class="wc-wizard-features">
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Better security', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Protect your store from unauthorized access.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Store stats', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Get insights on how your store is doing, including total sales, top products, and more.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Store monitoring', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Get an alert if your store is down for even a few minutes.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Product promotion', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( "Share new items on social media the moment they're live in your store.", 'woocommerce' ); ?>
</p>
</li>
</ul>
<?php if ( ! $jetpack_connected ) : ?>
<h3 class="jetpack-reasons">
<?php
echo esc_html( $description ?
__( "Bonus reasons you'll love Jetpack", 'woocommerce' ) :
__( "Reasons you'll love Jetpack", 'woocommerce' )
);
?>
</h3>
<ul class="wc-wizard-features">
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Better security', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Protect your store from unauthorized access.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Store stats', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Get insights on how your store is doing, including total sales, top products, and more.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Store monitoring', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( 'Get an alert if your store is down for even a few minutes.', 'woocommerce' ); ?>
</p>
</li>
<li class="wc-wizard-feature-item">
<p class="wc-wizard-feature-name">
<strong><?php esc_html_e( 'Product promotion', 'woocommerce' ); ?></strong>
</p>
<p class="wc-wizard-feature-description">
<?php esc_html_e( "Share new items on social media the moment they're live in your store.", 'woocommerce' ); ?>
</p>
</li>
</ul>
<?php endif; ?>
<?php endif; ?>
<?php
}
@ -1835,11 +1879,17 @@ class WC_Admin_Setup_Wizard {
public function wc_setup_activate_save() {
check_admin_referer( 'wc-setup' );
set_transient( 'wc_setup_activated', 'yes', MINUTE_IN_SECONDS * 10 );
// Leave a note for WooCommerce Services that Jetpack has been opted into.
update_option( 'woocommerce_setup_jetpack_opted_in', true );
if ( class_exists( 'Jetpack' ) && Jetpack::is_active() ) {
wp_safe_redirect( esc_url_raw( $this->get_next_step_link() ) );
exit;
}
WC_Install::background_installer( 'jetpack', array(
'file' => 'jetpack/jetpack.php',
'name' => __( 'Jetpack', 'woocommerce' ),
'repo-slug' => 'jetpack',
) );

View File

@ -86,7 +86,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
add_query_arg(
array(
'delete' => $webhook->get_id(),
), admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks' )
), admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks' )
), 'delete-webhook'
)
) . '">' . esc_html__( 'Delete permanently', 'woocommerce' ) . '</a>',

View File

@ -43,7 +43,7 @@ class WC_Admin_Webhooks {
* @return bool
*/
private function is_webhook_settings_page() {
return isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'api' === $_GET['tab'] && 'webhooks' === $_GET['section']; // WPCS: input var okay, CSRF ok.
return isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'advanced' === $_GET['tab'] && 'webhooks' === $_GET['section']; // WPCS: input var okay, CSRF ok.
}
/**
@ -127,7 +127,7 @@ class WC_Admin_Webhooks {
do_action( 'woocommerce_webhook_options_save', $webhook->get_id() );
if ( $errors ) {
// Redirect to webhook edit page to avoid settings save actions.
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->get_id() . '&error=' . rawurlencode( implode( '|', $errors ) ) ) );
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=' . $webhook->get_id() . '&error=' . rawurlencode( implode( '|', $errors ) ) ) );
exit();
} elseif ( isset( $_POST['webhook_status'] ) && 'active' === $_POST['webhook_status'] && $webhook->get_pending_delivery() ) { // WPCS: input var okay, CSRF ok.
// Ping the webhook at the first time that is activated.
@ -135,13 +135,13 @@ class WC_Admin_Webhooks {
if ( is_wp_error( $result ) ) {
// Redirect to webhook edit page to avoid settings save actions.
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->get_id() . '&error=' . rawurlencode( $result->get_error_message() ) ) );
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=' . $webhook->get_id() . '&error=' . rawurlencode( $result->get_error_message() ) ) );
exit();
}
}
// Redirect to webhook edit page to avoid settings save actions.
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->get_id() . '&updated=1' ) );
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=' . $webhook->get_id() . '&updated=1' ) );
exit();
}
@ -160,7 +160,7 @@ class WC_Admin_Webhooks {
$status = isset( $_GET['status'] ) ? '&status=' . sanitize_text_field( wp_unslash( $_GET['status'] ) ) : ''; // WPCS: input var okay, CSRF ok.
// Redirect to webhooks page.
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks' . $status . '&deleted=' . $qty ) );
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks' . $status . '&deleted=' . $qty ) );
exit();
}
@ -292,7 +292,7 @@ class WC_Admin_Webhooks {
private static function table_list_output() {
global $webhooks_table_list;
echo '<h2>' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=0' ) ) . '" class="add-new-h2">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';
echo '<h2>' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ) . '" class="add-new-h2">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';
// Get the webhooks count.
$data_store = WC_Data_Store::load( 'webhook' );
@ -312,7 +312,7 @@ class WC_Admin_Webhooks {
echo '<div class="woocommerce-BlankState woocommerce-BlankState--webhooks">';
?>
<h2 class="woocommerce-BlankState-message"><?php esc_html_e( 'Webhooks are event notifications sent to URLs of your choice. They can be used to integrate with third-party services which support them.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=0' ) ); ?>"><?php esc_html_e( 'Create a new webhook', 'woocommerce' ); ?></a>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=advanced&section=webhooks&edit-webhook=0' ) ); ?>"><?php esc_html_e( 'Create a new webhook', 'woocommerce' ); ?></a>
<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; }</style>
<?php
}

View File

@ -1318,6 +1318,10 @@ class WC_Helper {
* @param string $screen_id Current screen ID.
*/
private static function _prompt_helper_connect( $screen_id ) {
if ( apply_filters( 'woocommerce_helper_suppress_connect_notice', false ) ) {
return;
}
$screens = wc_get_screen_ids();
$screens[] = 'plugins';

View File

@ -1,4 +1,10 @@
<?php
/**
* Class WC_Product_CSV_Importer_Controller file.
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -10,8 +16,6 @@ if ( ! class_exists( 'WP_Importer' ) ) {
/**
* Product importer controller - handles file upload and forms in admin.
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin/Importers
* @version 3.1.0
*/
@ -108,11 +112,13 @@ class WC_Product_CSV_Importer_Controller {
$this->steps = apply_filters( 'woocommerce_product_csv_importer_steps', $default_steps );
// phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
$this->step = isset( $_REQUEST['step'] ) ? sanitize_key( $_REQUEST['step'] ) : current( array_keys( $this->steps ) );
$this->file = isset( $_REQUEST['file'] ) ? wc_clean( $_REQUEST['file'] ) : '';
$this->file = isset( $_REQUEST['file'] ) ? wc_clean( wp_unslash( $_REQUEST['file'] ) ) : '';
$this->update_existing = isset( $_REQUEST['update_existing'] ) ? (bool) $_REQUEST['update_existing'] : false;
$this->delimiter = ! empty( $_REQUEST['delimiter'] ) ? wc_clean( $_REQUEST['delimiter'] ) : ',';
$this->delimiter = ! empty( $_REQUEST['delimiter'] ) ? wc_clean( wp_unslash( $_REQUEST['delimiter'] ) ) : ',';
$this->map_preferences = isset( $_REQUEST['map_preferences'] ) ? (bool) $_REQUEST['map_preferences'] : false;
// phpcs:enable
if ( $this->map_preferences ) {
add_filter( 'woocommerce_csv_product_import_mapped_columns', array( $this, 'auto_map_user_preferences' ), 9999 );
@ -122,7 +128,7 @@ class WC_Product_CSV_Importer_Controller {
/**
* Get the URL for the next step's screen.
*
* @param string step slug (default: current step)
* @param string $step slug (default: current step).
* @return string URL for next step if a next step exists.
* Admin URL if it's the last step.
* Empty string on failure.
@ -138,7 +144,7 @@ class WC_Product_CSV_Importer_Controller {
return admin_url();
}
$step_index = array_search( $step, $keys );
$step_index = array_search( $step, $keys, true );
if ( false === $step_index ) {
return '';
@ -217,6 +223,7 @@ class WC_Product_CSV_Importer_Controller {
* Dispatch current step and show correct view.
*/
public function dispatch() {
// phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification
if ( ! empty( $_POST['save_step'] ) && ! empty( $this->steps[ $this->step ]['handler'] ) ) {
call_user_func( $this->steps[ $this->step ]['handler'], $this );
}
@ -271,13 +278,16 @@ class WC_Product_CSV_Importer_Controller {
)
);
if ( empty( $_POST['file_url'] ) ) {
// phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification -- Nonce already verified in WC_Product_CSV_Importer_Controller::upload_form_handler()
$file_url = isset( $_POST['file_url'] ) ? esc_url_raw( wp_unslash( $_POST['file_url'] ) ) : '';
if ( empty( $file_url ) ) {
if ( ! isset( $_FILES['import'] ) ) {
return new WP_Error( 'woocommerce_product_csv_importer_upload_file_empty', __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.', 'woocommerce' ) );
}
$filetype = wp_check_filetype( $_FILES['import']['name'], $valid_filetypes );
if ( ! in_array( $filetype['type'], $valid_filetypes ) ) {
$filetype = wp_check_filetype( wc_clean( wp_unslash( $_FILES['import']['name'] ) ), $valid_filetypes );
if ( ! in_array( $filetype['type'], $valid_filetypes, true ) ) {
return new WP_Error( 'woocommerce_product_csv_importer_upload_file_invalid', __( 'Invalid file type. The importer supports CSV and TXT file formats.', 'woocommerce' ) );
}
@ -285,7 +295,8 @@ class WC_Product_CSV_Importer_Controller {
'test_form' => false,
'mimes' => $valid_filetypes,
);
$upload = wp_handle_upload( $_FILES['import'], $overrides );
$import = wp_unslash( $_FILES['import'] ); // WPCS: sanitization ok.
$upload = wp_handle_upload( $import, $overrides );
if ( isset( $upload['error'] ) ) {
return new WP_Error( 'woocommerce_product_csv_importer_upload_error', $upload['error'] );
@ -311,14 +322,15 @@ class WC_Product_CSV_Importer_Controller {
wp_schedule_single_event( time() + DAY_IN_SECONDS, 'importer_scheduled_cleanup', array( $id ) );
return $upload['file'];
} elseif ( file_exists( ABSPATH . $_POST['file_url'] ) ) {
$filetype = wp_check_filetype( ABSPATH . $_POST['file_url'], $valid_filetypes );
if ( ! in_array( $filetype['type'], $valid_filetypes ) ) {
} elseif ( file_exists( ABSPATH . $file_url ) ) {
$filetype = wp_check_filetype( ABSPATH . $file_url, $valid_filetypes );
if ( ! in_array( $filetype['type'], $valid_filetypes, true ) ) {
return new WP_Error( 'woocommerce_product_csv_importer_upload_file_invalid', __( 'Invalid file type. The importer supports CSV and TXT file formats.', 'woocommerce' ) );
}
return ABSPATH . $_POST['file_url'];
return ABSPATH . $file_url;
}
// phpcs:enable
return new WP_Error( 'woocommerce_product_csv_importer_upload_invalid_file', __( 'Please upload or provide the link to a valid CSV file.', 'woocommerce' ) );
}
@ -365,7 +377,8 @@ class WC_Product_CSV_Importer_Controller {
return;
}
if ( ! empty( $_POST['map_to'] ) ) {
// phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification -- Nonce already verified in WC_Admin_Importers::do_ajax_product_import()
if ( ! empty( $_POST['map_from'] ) && ! empty( $_POST['map_to'] ) ) {
$mapping_from = wc_clean( wp_unslash( $_POST['map_from'] ) );
$mapping_to = wc_clean( wp_unslash( $_POST['map_to'] ) );
@ -375,6 +388,7 @@ class WC_Product_CSV_Importer_Controller {
wp_redirect( esc_url_raw( $this->get_next_step_link( 'upload' ) ) );
exit;
}
// phpcs:enable
wp_localize_script(
'wc-product-import', 'wc_product_import_params', array(
@ -397,11 +411,13 @@ class WC_Product_CSV_Importer_Controller {
* Done step.
*/
protected function done() {
// phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification
$imported = isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0;
$updated = isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0;
$failed = isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0;
$skipped = isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0;
$errors = array_filter( (array) get_user_option( 'product_import_error_log' ) );
// phpcs:enable
include_once dirname( __FILE__ ) . '/views/html-csv-import-done.php';
}
@ -435,7 +451,7 @@ class WC_Product_CSV_Importer_Controller {
include dirname( __FILE__ ) . '/mappings/mappings.php';
/**
/*
* @hooked wc_importer_generic_mappings - 10
* @hooked wc_importer_wordpress_mappings - 10
* @hooked wc_importer_default_english_mappings - 100
@ -460,9 +476,13 @@ class WC_Product_CSV_Importer_Controller {
__( 'Stock', 'woocommerce' ) => 'stock_quantity',
__( 'Backorders allowed?', 'woocommerce' ) => 'backorders',
__( 'Sold individually?', 'woocommerce' ) => 'sold_individually',
/* translators: %s: Weight unit */
sprintf( __( 'Weight (%s)', 'woocommerce' ), $weight_unit ) => 'weight',
/* translators: %s: Length unit */
sprintf( __( 'Length (%s)', 'woocommerce' ), $dimension_unit ) => 'length',
/* translators: %s: Width unit */
sprintf( __( 'Width (%s)', 'woocommerce' ), $dimension_unit ) => 'width',
/* translators: %s: Height unit */
sprintf( __( 'Height (%s)', 'woocommerce' ), $dimension_unit ) => 'height',
__( 'Allow customer reviews?', 'woocommerce' ) => 'reviews_allowed',
__( 'Purchase note', 'woocommerce' ) => 'purchase_note',
@ -490,13 +510,21 @@ class WC_Product_CSV_Importer_Controller {
apply_filters(
'woocommerce_csv_product_import_mapping_special_columns',
array(
/* translators: %d: Attribute number */
__( 'Attribute %d name', 'woocommerce' ) => 'attributes:name',
/* translators: %d: Attribute number */
__( 'Attribute %d value(s)', 'woocommerce' ) => 'attributes:value',
/* translators: %d: Attribute number */
__( 'Attribute %d visible', 'woocommerce' ) => 'attributes:visible',
/* translators: %d: Attribute number */
__( 'Attribute %d global', 'woocommerce' ) => 'attributes:taxonomy',
/* translators: %d: Attribute number */
__( 'Attribute %d default', 'woocommerce' ) => 'attributes:default',
/* translators: %d: Download number */
__( 'Download %d name', 'woocommerce' ) => 'downloads:name',
/* translators: %d: Download number */
__( 'Download %d URL', 'woocommerce' ) => 'downloads:url',
/* translators: %d: Meta number */
__( 'Meta: %s', 'woocommerce' ) => 'meta:',
)
)
@ -571,7 +599,7 @@ class WC_Product_CSV_Importer_Controller {
/**
* Get mapping options.
*
* @param string $item Item name
* @param string $item Item name.
* @return array
*/
protected function get_mapping_options( $item = '' ) {

View File

@ -3,9 +3,7 @@
* Tax importer class file
*
* @version 2.3.0
* @category Admin
* @package WooCommerce/Admin
* @author WooCommerce
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -19,8 +17,6 @@ if ( ! class_exists( 'WP_Importer' ) ) {
/**
* Tax Rates importer - import tax rates and local tax rates into WooCommerce.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Importers
* @version 2.3.0
*/
@ -59,8 +55,7 @@ class WC_Tax_Rate_Importer extends WP_Importer {
*/
public function __construct() {
$this->import_page = 'woocommerce_tax_rate_csv';
// @codingStandardsIgnoreLine
$this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) wc_clean( $_POST['delimiter'] );
$this->delimiter = empty( $_POST['delimiter'] ) ? ',' : (string) wc_clean( wp_unslash( $_POST['delimiter'] ) ); // WPCS: CSRF ok.
}
/**
@ -106,7 +101,7 @@ class WC_Tax_Rate_Importer extends WP_Importer {
*/
private function import_start() {
if ( function_exists( 'gc_enable' ) ) {
gc_enable();
gc_enable(); // phpcs:ignore PHPCompatibility.PHP.NewFunctions.gc_enableFound
}
wc_set_time_limit( 0 );
@ob_flush();
@ -137,15 +132,18 @@ class WC_Tax_Rate_Importer extends WP_Importer {
$this->import_start();
$loop = 0;
$loop = 0;
$handle = fopen( $file, 'r' );
if ( ( $handle = fopen( $file, 'r' ) ) !== false ) {
if ( false !== $handle ) {
$header = fgetcsv( $handle, 0, $this->delimiter );
if ( 10 === count( $header ) ) {
while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== false ) {
$row = fgetcsv( $handle, 0, $this->delimiter );
while ( false !== $row ) {
list( $country, $state, $postcode, $city, $rate, $name, $priority, $compound, $shipping, $class ) = $row;
@ -174,8 +172,8 @@ class WC_Tax_Rate_Importer extends WP_Importer {
// Show Result.
echo '<div class="updated settings-error"><p>';
/* translators: %s: tax rates count */
printf(
/* translators: %s: tax rates count */
esc_html__( 'Import complete - imported %s tax rates.', 'woocommerce' ),
'<strong>' . absint( $loop ) . '</strong>'
);
@ -200,9 +198,10 @@ class WC_Tax_Rate_Importer extends WP_Importer {
* @return bool False if error uploading or invalid file, true otherwise
*/
public function handle_upload() {
// @codingStandardsIgnoreLine
if ( empty( $_POST['file_url'] ) ) {
// phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification -- Nonce already verified in WC_Tax_Rate_Importer::dispatch()
$file_url = isset( $_POST['file_url'] ) ? esc_url_raw( wp_unslash( $_POST['file_url'] ) ) : '';
if ( empty( $file_url ) ) {
$file = wp_import_handle_upload();
if ( isset( $file['error'] ) ) {
@ -210,13 +209,12 @@ class WC_Tax_Rate_Importer extends WP_Importer {
}
$this->id = absint( $file['id'] );
// @codingStandardsIgnoreLine
} elseif ( file_exists( ABSPATH . $_POST['file_url'] ) ) {
// @codingStandardsIgnoreLine
$this->file_url = esc_attr( $_POST['file_url'] );
} elseif ( file_exists( ABSPATH . $file_url ) ) {
$this->file_url = esc_attr( $file_url );
} else {
$this->import_error();
}
// phpcs:enable
return true;
}
@ -244,6 +242,7 @@ class WC_Tax_Rate_Importer extends WP_Importer {
echo '<div class="narrow">';
echo '<p>' . esc_html__( 'Hi there! Upload a CSV file containing tax rates to import the contents into your shop. Choose a .csv file to upload, then click "Upload file and import".', 'woocommerce' ) . '</p>';
/* translators: 1: Link to tax rates sample file */
echo '<p>' . sprintf( esc_html__( 'Tax rates need to be defined with columns in a specific order (10 columns). <a href="%s">Click here to download a sample</a>.', 'woocommerce' ), esc_url( WC()->plugin_url() ) . '/sample-data/sample_tax_rates.csv' ) . '</p>';
$action = 'admin.php?import=woocommerce_tax_rate_csv&step=1';
@ -271,8 +270,8 @@ class WC_Tax_Rate_Importer extends WP_Importer {
<input type="hidden" name="max_file_size" value="<?php echo absint( $bytes ); ?>" />
<small>
<?php
/* translators: %s: maximum upload size */
printf(
/* translators: %s: maximum upload size */
esc_html__( 'Maximum size: %s', 'woocommerce' ),
esc_attr( $size )
);
@ -307,7 +306,7 @@ class WC_Tax_Rate_Importer extends WP_Importer {
/**
* Show import error and quit.
*
* @param string $message Error messag.
* @param string $message Error message.
*/
private function import_error( $message = '' ) {
echo '<p><strong>' . esc_html__( 'Sorry, there has been an error.', 'woocommerce' ) . '</strong><br />';

View File

@ -1,4 +1,9 @@
<?php
/**
* Default mappings
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@ -23,7 +28,7 @@ function wc_importer_current_locale() {
* Add English mapping placeholders when not using English as current language.
*
* @since 3.1.0
* @param array $mappings
* @param array $mappings Importer columns mappings.
* @return array
*/
function wc_importer_default_english_mappings( $mappings ) {
@ -82,7 +87,7 @@ add_filter( 'woocommerce_csv_product_import_mapping_default_columns', 'wc_import
* Add English special mapping placeholders when not using English as current language.
*
* @since 3.1.0
* @param array $mappings
* @param array $mappings Importer columns mappings.
* @return array
*/
function wc_importer_default_special_english_mappings( $mappings ) {

View File

@ -1,4 +1,9 @@
<?php
/**
* Generic mappings
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@ -8,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Add generic mappings.
*
* @since 3.1.0
* @param array $mappings
* @param array $mappings Importer columns mappings.
* @return array
*/
function wc_importer_generic_mappings( $mappings ) {

View File

@ -1,6 +1,8 @@
<?php
/**
* Load up extra automatic mappings for the CSV importer.
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,4 +1,9 @@
<?php
/**
* WordPress mappings
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@ -8,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Add mappings for WordPress tables.
*
* @since 3.1.0
* @param array $mappings
* @param array $mappings Importer columns mappings.
* @return array
*/
function wc_importer_wordpress_mappings( $mappings ) {

View File

@ -1,7 +1,10 @@
<?php
/**
* Admin View: Importer - Done!
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -1,7 +1,10 @@
<?php
/**
* Admin View: Header
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -1,7 +1,10 @@
<?php
/**
* Admin View: Header
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -2,7 +2,7 @@
/**
* Admin View: Importer - CSV mapping
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -1,7 +1,10 @@
<?php
/**
* Admin View: Importer - CSV import progress
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

View File

@ -1,7 +1,10 @@
<?php
/**
* Admin View: Steps
*
* @package WooCommerce\Admin\Importers
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -11,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( $step_key === $this->step ) {
$step_class = 'active';
} elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) {
} elseif ( array_search( $this->step, array_keys( $this->steps ), true ) > array_search( $step_key, array_keys( $this->steps ), true ) ) {
$step_class = 'done';
}
?>

View File

@ -40,10 +40,10 @@ if ( ! defined( 'ABSPATH' ) ) {
<br>
<small>
<?php
/* translators: %s: maximum upload size */
printf(
/* translators: %s: maximum upload size */
esc_html__( 'Maximum size: %s', 'woocommerce' ),
$size
esc_html( $size )
);
?>
</small>

View File

@ -118,7 +118,6 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
$show_columns['product_cat'] = __( 'Categories', 'woocommerce' );
$show_columns['product_tag'] = __( 'Tags', 'woocommerce' );
$show_columns['featured'] = '<span class="wc-featured parent-tips" data-tip="' . esc_attr__( 'Featured', 'woocommerce' ) . '">' . __( 'Featured', 'woocommerce' ) . '</span>';
$show_columns['product_type'] = '<span class="wc-type parent-tips" data-tip="' . esc_attr__( 'Type', 'woocommerce' ) . '">' . __( 'Type', 'woocommerce' ) . '</span>';
$show_columns['date'] = __( 'Date', 'woocommerce' );
return array_merge( $show_columns, $columns );
@ -199,31 +198,6 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
echo $this->object->get_sku() ? esc_html( $this->object->get_sku() ) : '<span class="na">&ndash;</span>';
}
/**
* Render columm: product_type.
*/
protected function render_product_type_column() {
if ( $this->object->is_type( 'grouped' ) ) {
echo '<span class="product-type tips grouped" data-tip="' . esc_attr__( 'Grouped', 'woocommerce' ) . '"></span>';
} elseif ( $this->object->is_type( 'external' ) ) {
echo '<span class="product-type tips external" data-tip="' . esc_attr__( 'External/Affiliate', 'woocommerce' ) . '"></span>';
} elseif ( $this->object->is_type( 'simple' ) ) {
if ( $this->object->is_virtual() ) {
echo '<span class="product-type tips virtual" data-tip="' . esc_attr__( 'Virtual', 'woocommerce' ) . '"></span>';
} elseif ( $this->object->is_downloadable() ) {
echo '<span class="product-type tips downloadable" data-tip="' . esc_attr__( 'Downloadable', 'woocommerce' ) . '"></span>';
} else {
echo '<span class="product-type tips simple" data-tip="' . esc_attr__( 'Simple', 'woocommerce' ) . '"></span>';
}
} elseif ( $this->object->is_type( 'variable' ) ) {
echo '<span class="product-type tips variable" data-tip="' . esc_attr__( 'Variable', 'woocommerce' ) . '"></span>';
} else {
// Assuming that we have other types in future.
echo '<span class="product-type tips ' . esc_attr( sanitize_html_class( $this->object->get_type() ) ) . '" data-tip="' . esc_attr( ucfirst( $this->object->get_type() ) ) . '"></span>';
}
}
/**
* Render columm: price.
*/
@ -454,10 +428,9 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
// Search using CRUD.
if ( ! empty( $query_vars['s'] ) ) {
$data_store = WC_Data_Store::load( 'product' );
$ids = $data_store->search_products( wc_clean( $query_vars['s'] ), '', true, true );
$query_vars['post__in'] = array_merge( $ids, array( 0 ) );
// So we know we are searching products.
$data_store = WC_Data_Store::load( 'product' );
$ids = $data_store->search_products( wc_clean( wp_unslash( $query_vars['s'] ) ), '', true, true );
$query_vars['post__in'] = array_merge( $ids, array( 0 ) );
$query_vars['product_search'] = true;
unset( $query_vars['s'] );
}

View File

@ -27,7 +27,8 @@ class WC_Meta_Box_Coupon_Data {
public static function output( $post ) {
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
$coupon = new WC_Coupon( $post->ID );
$coupon_id = absint( $post->ID );
$coupon = new WC_Coupon( $coupon_id );
?>
@ -78,6 +79,7 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'discount_type',
'label' => __( 'Discount type', 'woocommerce' ),
'options' => wc_get_coupon_types(),
'value' => $coupon->get_discount_type( 'edit' ),
)
);
@ -90,6 +92,7 @@ class WC_Meta_Box_Coupon_Data {
'description' => __( 'Value of the coupon.', 'woocommerce' ),
'data_type' => 'price',
'desc_tip' => true,
'value' => $coupon->get_amount( 'edit' ),
)
);
@ -100,12 +103,13 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'free_shipping',
'label' => __( 'Allow free shipping', 'woocommerce' ),
'description' => sprintf( __( 'Check this box if the coupon grants free shipping. A <a href="%s" target="_blank">free shipping method</a> must be enabled in your shipping zone and be set to require "a valid free shipping coupon" (see the "Free Shipping Requires" setting).', 'woocommerce' ), 'https://docs.woocommerce.com/document/free-shipping/' ),
'value' => wc_bool_to_string( $coupon->get_free_shipping( 'edit' ) ),
)
);
}
// Expiry date.
$expiry_date = $coupon->get_date_expires() ? $coupon->get_date_expires()->date( 'Y-m-d' ) : '';
$expiry_date = $coupon->get_date_expires( 'edit' ) ? $coupon->get_date_expires( 'edit' )->date( 'Y-m-d' ) : '';
woocommerce_wp_text_input(
array(
'id' => 'expiry_date',
@ -138,6 +142,7 @@ class WC_Meta_Box_Coupon_Data {
'description' => __( 'This field allows you to set the minimum spend (subtotal) allowed to use the coupon.', 'woocommerce' ),
'data_type' => 'price',
'desc_tip' => true,
'value' => $coupon->get_minimum_amount( 'edit' ),
)
);
@ -150,6 +155,7 @@ class WC_Meta_Box_Coupon_Data {
'description' => __( 'This field allows you to set the maximum spend (subtotal) allowed when using the coupon.', 'woocommerce' ),
'data_type' => 'price',
'desc_tip' => true,
'value' => $coupon->get_maximum_amount( 'edit' ),
)
);
@ -159,6 +165,7 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'individual_use',
'label' => __( 'Individual use only', 'woocommerce' ),
'description' => __( 'Check this box if the coupon cannot be used in conjunction with other coupons.', 'woocommerce' ),
'value' => wc_bool_to_string( $coupon->get_individual_use( 'edit' ) ),
)
);
@ -168,6 +175,7 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'exclude_sale_items',
'label' => __( 'Exclude sale items', 'woocommerce' ),
'description' => __( 'Check this box if the coupon should not apply to items on sale. Per-item coupons will only work if the item is not on sale. Per-cart coupons will only work if there are items in the cart that are not on sale.', 'woocommerce' ),
'value' => wc_bool_to_string( $coupon->get_exclude_sale_items( 'edit' ) ),
)
);
@ -179,7 +187,7 @@ class WC_Meta_Box_Coupon_Data {
<label><?php _e( 'Products', 'woocommerce' ); ?></label>
<select class="wc-product-search" multiple="multiple" style="width: 50%;" name="product_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product&hellip;', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations">
<?php
$product_ids = $coupon->get_product_ids();
$product_ids = $coupon->get_product_ids( 'edit' );
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
@ -197,7 +205,7 @@ class WC_Meta_Box_Coupon_Data {
<label><?php _e( 'Exclude products', 'woocommerce' ); ?></label>
<select class="wc-product-search" multiple="multiple" style="width: 50%;" name="exclude_product_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product&hellip;', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations">
<?php
$product_ids = $coupon->get_excluded_product_ids();
$product_ids = $coupon->get_excluded_product_ids( 'edit' );
foreach ( $product_ids as $product_id ) {
$product = wc_get_product( $product_id );
@ -219,7 +227,7 @@ class WC_Meta_Box_Coupon_Data {
<label for="product_categories"><?php _e( 'Product categories', 'woocommerce' ); ?></label>
<select id="product_categories" name="product_categories[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php esc_attr_e( 'Any category', 'woocommerce' ); ?>">
<?php
$category_ids = $coupon->get_product_categories();
$category_ids = $coupon->get_product_categories( 'edit' );
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
if ( $categories ) {
@ -236,7 +244,7 @@ class WC_Meta_Box_Coupon_Data {
<label for="exclude_product_categories"><?php _e( 'Exclude categories', 'woocommerce' ); ?></label>
<select id="exclude_product_categories" name="exclude_product_categories[]" style="width: 50%;" class="wc-enhanced-select" multiple="multiple" data-placeholder="<?php esc_attr_e( 'No categories', 'woocommerce' ); ?>">
<?php
$category_ids = $coupon->get_excluded_product_categories();
$category_ids = $coupon->get_excluded_product_categories( 'edit' );
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
if ( $categories ) {
@ -249,7 +257,7 @@ class WC_Meta_Box_Coupon_Data {
<?php echo wc_help_tip( __( 'Product categories that the coupon will not be applied to, or that cannot be in the cart in order for the "Fixed cart discount" to be applied.', 'woocommerce' ) ); ?>
</p>
</div>
<div class="options_group">';
<div class="options_group">
<?php
// Customers.
woocommerce_wp_text_input(
@ -257,8 +265,8 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'customer_email',
'label' => __( 'Email restrictions', 'woocommerce' ),
'placeholder' => __( 'No restrictions', 'woocommerce' ),
'description' => __( 'List of allowed emails to check against the customer billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ),
'value' => implode( ', ', (array) $coupon->get_email_restrictions() ),
'description' => __( 'List of allowed emails to check against the customer billing email when an order is placed. Separate email addresses with commas. You can also use an asterisk (*) to match parts of an email. For example "*@gmail.com" would match all gmail addresses.', 'woocommerce' ),
'value' => implode( ', ', (array) $coupon->get_email_restrictions( 'edit' ) ),
'desc_tip' => true,
'type' => 'email',
'class' => '',
@ -288,7 +296,7 @@ class WC_Meta_Box_Coupon_Data {
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit() ? $coupon->get_usage_limit() : '',
'value' => $coupon->get_usage_limit( 'edit' ) ? $coupon->get_usage_limit( 'edit' ) : '',
)
);
@ -306,7 +314,7 @@ class WC_Meta_Box_Coupon_Data {
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_limit_usage_to_x_items() ? $coupon->get_limit_usage_to_x_items() : '',
'value' => $coupon->get_limit_usage_to_x_items( 'edit' ) ? $coupon->get_limit_usage_to_x_items( 'edit' ) : '',
)
);
@ -324,7 +332,7 @@ class WC_Meta_Box_Coupon_Data {
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit_per_user() ? $coupon->get_usage_limit_per_user() : '',
'value' => $coupon->get_usage_limit_per_user( 'edit' ) ? $coupon->get_usage_limit_per_user( 'edit' ) : '',
)
);
?>

View File

@ -362,6 +362,15 @@ class WC_Meta_Box_Order_Data {
if ( ! isset( $field['id'] ) ) {
$field['id'] = '_billing_' . $key;
}
$field_name = 'billing_' . $key;
if ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
$field['value'] = $order->{"get_$field_name"}( 'edit' );
} else {
$field['value'] = $order->get_meta( '_' . $field_name );
}
switch ( $field['type'] ) {
case 'select':
woocommerce_wp_select( $field );
@ -402,6 +411,7 @@ class WC_Meta_Box_Order_Data {
array(
'id' => '_transaction_id',
'label' => __( 'Transaction ID', 'woocommerce' ),
'value' => $order->get_transaction_id( 'edit' ),
)
);
?>
@ -466,6 +476,14 @@ class WC_Meta_Box_Order_Data {
$field['id'] = '_shipping_' . $key;
}
$field_name = 'shipping_' . $key;
if ( is_callable( array( $order, 'get_' . $field_name ) ) ) {
$field['value'] = $order->{"get_$field_name"}( 'edit' );
} else {
$field['value'] = $order->get_meta( '_' . $field_name );
}
switch ( $field['type'] ) {
case 'select':
woocommerce_wp_select( $field );
@ -587,6 +605,11 @@ class WC_Meta_Box_Order_Data {
$props['date_created'] = $date;
// Set created via prop if new post.
if ( isset( $_POST['original_post_status'] ) && $_POST['original_post_status'] === 'auto-draft' ) {
$props['created_via'] = 'admin';
}
// Save order data.
$order->set_props( $props );
$order->set_status( wc_clean( $_POST['order_status'] ), '', true );

View File

@ -40,17 +40,22 @@ class WC_Meta_Box_Product_Reviews {
/**
* Save meta box data
*
* @param mixed $location
* @param int $comment_id
* @param mixed $data
*
* @return mixed
*/
public static function save( $location, $comment_id ) {
public static function save( $data ) {
// Not allowed, return regular value without updating meta
if ( ! wp_verify_nonce( $_POST['woocommerce_meta_nonce'], 'woocommerce_save_data' ) && ! isset( $_POST['rating'] ) ) {
return $location;
return $data;
}
if ( $_POST['rating'] > 5 || $_POST['rating'] < 0 ) {
return $data;
}
$comment_id = $data['comment_ID'];
// Update meta
update_comment_meta(
$comment_id,
@ -59,6 +64,6 @@ class WC_Meta_Box_Product_Reviews {
);
// Return regular value after updating
return $location;
return $data;
}
}

View File

@ -4,15 +4,11 @@
*
* Replaces the standard excerpt box.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
defined( 'ABSPATH' ) || exit;
/**
* WC_Meta_Box_Product_Short_Description Class.
@ -22,7 +18,7 @@ class WC_Meta_Box_Product_Short_Description {
/**
* Output the metabox.
*
* @param WP_Post $post
* @param WP_Post $post Post object.
*/
public static function output( $post ) {
@ -36,6 +32,6 @@ class WC_Meta_Box_Product_Short_Description {
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
);
wp_editor( htmlspecialchars_decode( $post->post_excerpt ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );
wp_editor( htmlspecialchars_decode( $post->post_excerpt, ENT_QUOTES ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );
}
}

View File

@ -63,7 +63,7 @@ $row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empt
echo '<small class="times">&times;</small> ' . esc_html( $item->get_quantity() );
if ( $refunded_qty = $order->get_qty_refunded_for_item( $item_id ) ) {
echo '<small class="refunded">' . ( $refunded_qty * -1 ) . '</small>';
echo '<small class="refunded">-' . ( $refunded_qty * -1 ) . '</small>';
}
?>
</div>
@ -84,7 +84,7 @@ $row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empt
}
if ( $refunded = $order->get_total_refunded_for_item( $item_id ) ) {
echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
}
?>
</div>
@ -130,7 +130,7 @@ $row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empt
}
if ( $refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id ) ) {
echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
}
?>
</div>

Some files were not shown because too many files have changed in this diff Show More