Merge branch 'master' into feature/rest-api-v3

This commit is contained in:
Claudio Sanches 2018-09-10 19:16:22 -03:00
commit 61873627a7
246 changed files with 15145 additions and 1773 deletions

View File

@ -21,6 +21,6 @@ parsers:
macro: no
comment:
layout: "reach, diff, flags, files, footer"
layout: "files"
behavior: default
require_changes: no
require_changes: yes

View File

@ -28,12 +28,13 @@ matrix:
dist: precise
- php: 7.2
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1 RUN_E2E=1
- php: 7.2
- php: 7.1
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
allow_failures:
- env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
before_script:
- phpenv config-rm xdebug.ini
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION
- bash tests/bin/travis.sh before
@ -41,7 +42,7 @@ before_script:
script:
- bash tests/bin/phpunit.sh
- bash tests/bin/phpcs.sh
- bash tests/bin/run-e2e-CI.sh
- travis_retry bash tests/bin/run-e2e-CI.sh
after_script:
- bash tests/bin/travis.sh after

View File

@ -1,5 +1,46 @@
== Changelog ==
= 3.4.5 - 2018-08-29 =
* Fix - Tweak sanitization when resetting password cookie. #20901
* Fix - Use `+` instead of `array_merge` when appending parent to tax class to fix issues with numeric tax class names. #20916
* Fix - Correct translation for North Khorasan. #20972
* Fix - Unify scroll-to notices for all browsers. #20992
* Fix - Prevent multiple slashing of variation's SKU. #21019
* Fix - Variation image in fullscreen now shows correct caption for the respective image. #21022
* Fix - Vertically center admin order action buttons. #21053
* Fix - Correct context for shipping packages translation. #21065
* Fix - Add permission checks for installing Jetpack on the setup wizard. #21072
* Fix - Use refund currency instead of store default currency when displaying refund amount in the edit order screen. #21106
* Fix - Fix a typo in REST API customer schema. #21171
* Fix - Use entire sentence for checkout address_2 placeholder string. #21186
* Fix - Only suppress comments number on unsupported theme shop page. #21191
* Fix - Don't allow users without manage_product_terms permissions to create categories using the product importer. #21192
* Fix - Correct sale coupon restriction logic. #21219
= 3.4.4 - 2018-07-25 =
* Fix - Only wordwrap plain email content. #20723
* Fix - Better escaping on product quick edit. #20740
* Fix - Log file deletion. #20730
* Fix - Search feature in Webhooks and REST API keys settings. #20706
* Fix - Notices in REST API keys settings screen. #20706
* Fix - add a check to prevent WC_Geolite_Integration::get_country_iso() from generating a PHP undefined index notice when unable to determine the country code for a given IP address. #20608
* Fix - Variable product stock display if parent is stock managed and not the variation. #20661
* Fix - Correctly hide cost for zero cost shipping methods after placing orders. #20663
* Fix - Disabled autocomplete to prevent datepicker overlapping. #20687
* Fix - Prevent a PHP notice in the setup wizard when store state is not selectable. #20695
* Fix - Fix logic error in WC_Product_CSV_Exporter::get_column_value_stock. #20753
* Fix - Fixed missing notice about no product variation matching. #20762
* Fix - Correct PHPDocs in exporter class. #20861
* Fix - Prevent Mailchimp redirection during the Setup Wizard. #20879
* Fix - Don't hide coupon form after coupon has been applied. #20889
* Tweak - Remove (optional) text from Address line 2 field. #20622 #20639
* Tweak - Removed 100% width for images on single product page using 2017 theme. #20818
* Tweak - Add margin to best selling product title in the dashboard widget to avoid overlapping the sparkline. #20849
* Tweak - Re-add woocommerce_order_details_after_customer_details_filter removed during WC 3.2. #20886
* Dev - Added woocommerce_calculate_item_totals_taxes filter. #20586
* Dev - Links to next and previous page sent out in HTTP header via REST API fixed for some endpoints. #20686
* Dev - Better wc_format_phone_number cleaning. #20637
= 3.4.3 - 2018-06-20 =
* Fix - Fix label for the price filter widget on RTL sites. #20417
* Fix - Checkout: stopPropagation when payment method selected so description tips show on radio buttons. #20432

View File

@ -164,7 +164,7 @@ module.exports = function( grunt ) {
watch: {
css: {
files: ['<%= dirs.css %>/*.scss'],
tasks: ['sass', 'rtlcss', 'cssmin', 'concat']
tasks: ['sass', 'rtlcss', 'postcss', 'cssmin', 'concat']
},
js: {
files: [

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;-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:static;float:left;top:0;left:0;padding:0 28px 10px 15px;margin-top:-10px;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:relative;top:18px;right:-20px;-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;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:static;float:left;top:0;left:0;padding:0 28px 10px 15px;margin-top:-10px;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:relative;top:18px;right:-20px;-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;-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:static;float:right;top:0;right:0;padding:0 15px 10px 28px;margin-top:-10px;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:relative;top:18px;left:-20px;-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;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:static;float:right;top:0;right:0;padding:0 15px 10px 28px;margin-top:-10px;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:relative;top:18px;left:-20px;-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

@ -1948,6 +1948,7 @@
height: 2em !important;
width: 2em;
overflow: hidden;
vertical-align: middle;
&::after {
font-family: 'Dashicons';
@ -3512,6 +3513,14 @@
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="week"],
input[type="url"],
input[type="tel"],
input.regular-input {
width: 400px;
margin: 0;
@ -3520,6 +3529,14 @@
vertical-align: top;
}
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="week"],
input[type="tel"] {
width: 200px;
}
select {
width: 400px;
margin: 0;

View File

@ -1 +1 @@
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}
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}

View File

@ -1 +1 @@
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}
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}

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;-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'}
@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 .best-seller-this-month a strong{margin-left:48px}#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'}

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;-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'}
@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 .best-seller-this-month a strong{margin-right:48px}#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'}

View File

@ -52,6 +52,14 @@ ul.woocommerce_stats {
margin: 0;
}
.best-seller-this-month {
a {
strong {
margin-right: 48px;
}
}
}
.wc_status_list {
overflow: hidden;
margin: 0;

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 +1 @@
#woocommerce_network_orders .inside{margin:0;padding:0}#woocommerce_network_orders .woocommerce-network-order-table,#woocommerce_network_orders .woocommerce-network-order-table-loading,#woocommerce_network_orders .woocommerce-network-orders-no-orders{width:100%;display:none}#woocommerce_network_orders .woocommerce-network-order-table-loading.is-active,#woocommerce_network_orders .woocommerce-network-order-table.is-active,#woocommerce_network_orders .woocommerce-network-orders-no-orders.is-active{display:block}#woocommerce_network_orders .woocommerce-network-order-table-loading p,#woocommerce_network_orders .woocommerce-network-orders-no-orders p{text-align:center}#woocommerce_network_orders .woocommerce-network-order-table{margin-top:0}#woocommerce_network_orders .woocommerce-network-order-table.is-active{display:table}#woocommerce_network_orders .woocommerce-network-order-table thead td{padding:.5em 1em}#woocommerce_network_orders .spinner{margin-top:0;float:none}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td,#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody th{border-top:1px solid #f5f5f5}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td{vertical-align:middle;padding:1em}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;padding:0 1em;line-height:2.5em;color:#777;background:#e5e5e5;border-radius:4px;border-bottom:1px solid rgba(0,0,0,.05);margin:-.5em 0;cursor:inherit!important}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-completed{background:#c8d7e1;color:#2e4453}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-on-hold{background:#f8dda7;color:#94660c}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-failed{background:#eba3a3;color:#761919}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-processing{background:#c6e1c6;color:#5b841b}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-trash{background:#eba3a3;color:#761919}
#woocommerce_network_orders .inside{margin:0;padding:0}#woocommerce_network_orders .woocommerce-network-order-table,#woocommerce_network_orders .woocommerce-network-order-table-loading,#woocommerce_network_orders .woocommerce-network-orders-no-orders{width:100%;display:none}#woocommerce_network_orders .woocommerce-network-order-table-loading.is-active,#woocommerce_network_orders .woocommerce-network-order-table.is-active,#woocommerce_network_orders .woocommerce-network-orders-no-orders.is-active{display:block}#woocommerce_network_orders .woocommerce-network-order-table-loading p,#woocommerce_network_orders .woocommerce-network-orders-no-orders p{text-align:center}#woocommerce_network_orders .woocommerce-network-order-table{margin-top:0}#woocommerce_network_orders .woocommerce-network-order-table.is-active{display:table}#woocommerce_network_orders .woocommerce-network-order-table thead td{padding:.5em 1em}#woocommerce_network_orders .spinner{margin-top:0;float:none}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td,#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody th{border-top:1px solid #f5f5f5}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td{vertical-align:middle;padding:1em}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status{display:-webkit-inline-box;display:inline-flex;padding:0 1em;line-height:2.5em;color:#777;background:#e5e5e5;border-radius:4px;border-bottom:1px solid rgba(0,0,0,.05);margin:-.5em 0;cursor:inherit!important}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-completed{background:#c8d7e1;color:#2e4453}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-on-hold{background:#f8dda7;color:#94660c}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-failed{background:#eba3a3;color:#761919}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-processing{background:#c6e1c6;color:#5b841b}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-trash{background:#eba3a3;color:#761919}

View File

@ -1 +1 @@
#woocommerce_network_orders .inside{margin:0;padding:0}#woocommerce_network_orders .woocommerce-network-order-table,#woocommerce_network_orders .woocommerce-network-order-table-loading,#woocommerce_network_orders .woocommerce-network-orders-no-orders{width:100%;display:none}#woocommerce_network_orders .woocommerce-network-order-table-loading.is-active,#woocommerce_network_orders .woocommerce-network-order-table.is-active,#woocommerce_network_orders .woocommerce-network-orders-no-orders.is-active{display:block}#woocommerce_network_orders .woocommerce-network-order-table-loading p,#woocommerce_network_orders .woocommerce-network-orders-no-orders p{text-align:center}#woocommerce_network_orders .woocommerce-network-order-table{margin-top:0}#woocommerce_network_orders .woocommerce-network-order-table.is-active{display:table}#woocommerce_network_orders .woocommerce-network-order-table thead td{padding:.5em 1em}#woocommerce_network_orders .spinner{margin-top:0;float:none}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td,#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody th{border-top:1px solid #f5f5f5}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td{vertical-align:middle;padding:1em}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;padding:0 1em;line-height:2.5em;color:#777;background:#e5e5e5;border-radius:4px;border-bottom:1px solid rgba(0,0,0,.05);margin:-.5em 0;cursor:inherit!important}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-completed{background:#c8d7e1;color:#2e4453}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-on-hold{background:#f8dda7;color:#94660c}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-failed{background:#eba3a3;color:#761919}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-processing{background:#c6e1c6;color:#5b841b}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-trash{background:#eba3a3;color:#761919}
#woocommerce_network_orders .inside{margin:0;padding:0}#woocommerce_network_orders .woocommerce-network-order-table,#woocommerce_network_orders .woocommerce-network-order-table-loading,#woocommerce_network_orders .woocommerce-network-orders-no-orders{width:100%;display:none}#woocommerce_network_orders .woocommerce-network-order-table-loading.is-active,#woocommerce_network_orders .woocommerce-network-order-table.is-active,#woocommerce_network_orders .woocommerce-network-orders-no-orders.is-active{display:block}#woocommerce_network_orders .woocommerce-network-order-table-loading p,#woocommerce_network_orders .woocommerce-network-orders-no-orders p{text-align:center}#woocommerce_network_orders .woocommerce-network-order-table{margin-top:0}#woocommerce_network_orders .woocommerce-network-order-table.is-active{display:table}#woocommerce_network_orders .woocommerce-network-order-table thead td{padding:.5em 1em}#woocommerce_network_orders .spinner{margin-top:0;float:none}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td,#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody th{border-top:1px solid #f5f5f5}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td{vertical-align:middle;padding:1em}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status{display:-webkit-inline-box;display:inline-flex;padding:0 1em;line-height:2.5em;color:#777;background:#e5e5e5;border-radius:4px;border-bottom:1px solid rgba(0,0,0,.05);margin:-.5em 0;cursor:inherit!important}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-completed{background:#c8d7e1;color:#2e4453}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-on-hold{background:#f8dda7;color:#94660c}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-failed{background:#eba3a3;color:#761919}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-processing{background:#c6e1c6;color:#5b841b}#woocommerce_network_orders .post-type-shop_order .woocommerce-network-order-table tbody td .order-status.status-trash{background:#eba3a3;color:#761919}

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;-webkit-box-shadow:none!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;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;-webkit-box-shadow:none!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;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

@ -437,7 +437,6 @@ table.variations {
img {
display: block;
width: 100%;
height: auto;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -767,6 +767,7 @@ body {
// Shipping list of services
.wc-wizard-services.shipping {
margin: 0;
.wc-wizard-service-name {
font-weight: normal;
@ -852,13 +853,15 @@ body {
line-height: 1.5em;
font-size: 13px;
margin-bottom: 0.25em;
text-align: center;
}
.wc-setup-shipping-unit {
margin-bottom: 1.75em;
.select2 {
min-width: 100%; // widen dropdowns
min-width: 125px; // widen dropdowns
top: -5px; // vertically align dropdown value with surrounding text
}
}
}
@ -960,10 +963,14 @@ h3.jetpack-reasons {
display: block;
}
.plugin-install-info-list-item:not(:last-child)::after {
.plugin-install-info-list-item::after {
content: ', ';
}
.plugin-install-info-list-item:last-of-type::after {
content: '. ';
}
a {
white-space: nowrap;
@ -1245,13 +1252,13 @@ p.jetpack-terms {
border: 1px solid #ebebeb;
border-radius: 4px;
padding: 2.5em;
}
li {
list-style: none;
.wc-setup-content .recommended-item {
list-style: none;
&:last-child label {
margin-bottom: 0; // Avoid extra space at the end of the list.
}
&:last-child label {
margin-bottom: 0; // Avoid extra space at the end of the list.
}
label {
@ -1292,6 +1299,17 @@ p.jetpack-terms {
height: 2em;
padding: ( 3.5em - 2em ) / 2;
}
&.recommended-item-icon-woocommerce_services {
background-color: #f0f0f0;
max-height: 1.5em;
padding: 1.3em .7em;
}
&.recommended-item-icon-shipstation {
background-color: #f0f0f0;
padding: .3em;
}
}
.recommended-item-description-container {
@ -1308,3 +1326,28 @@ p.jetpack-terms {
}
}
}
.wc-wizard-service-info {
padding: 1em 2em;
background-color: #fafafa;
}
.help_tip {
text-decoration: underline dotted;
}
.wc-setup {
#tiptip_content {
background: #5f6973;
}
#tiptip_holder.tip_top #tiptip_arrow_inner {
border-top-color: #5f6973;
}
}
.wc-setup-shipping-recommended {
border-bottom: 1px solid #eee;
margin-top: 0;
padding: 30px 0;
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -641,6 +641,8 @@ jQuery( function ( $ ) {
items: $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize(),
security: woocommerce_admin_meta_boxes.calc_totals_nonce
} );
$( document.body ).trigger( 'order-totals-recalculate-before', data );
$.ajax({
url: woocommerce_admin_meta_boxes.ajax_url,
@ -651,6 +653,11 @@ jQuery( function ( $ ) {
$( '#woocommerce-order-items' ).find( '.inside' ).append( response );
wc_meta_boxes_order_items.reloaded_items();
wc_meta_boxes_order_items.unblock();
$( document.body ).trigger( 'order-totals-recalculate-success', response );
},
complete: function( response ) {
$( document.body ).trigger( 'order-totals-recalculate-complete', response );
}
});
}

View File

@ -44,6 +44,7 @@
selected_columns = $( '.woocommerce-exporter-columns' ).val(),
export_meta = $( '#woocommerce-exporter-meta:checked' ).length ? 1: 0,
export_types = $( '.woocommerce-exporter-types' ).val();
export_category = $( '.woocommerce-exporter-category' ).val();
$.ajax( {
type: 'POST',
@ -56,6 +57,7 @@
selected_columns : selected_columns,
export_meta : export_meta,
export_types : export_types,
export_category : export_category,
filename : filename,
security : wc_product_export_params.export_nonce
},

View File

@ -162,6 +162,7 @@ jQuery( function( $ ) {
if ( $( this ).is( ':checked' ) ) {
$( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' )
.attr( 'type', 'email' )
.prop( 'required', true );
$( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email' )
@ -169,6 +170,7 @@ jQuery( function( $ ) {
} else {
$( this ).closest( '.wc-wizard-service-settings' )
.find( 'input.payment-email-input' )
.attr( 'type', null )
.prop( 'required', false );
$( this ).closest( '.wc-wizard-service-settings' )
.find( '.wc-wizard-service-setting-stripe_email, .wc-wizard-service-setting-ppec_paypal_email' )
@ -193,12 +195,14 @@ jQuery( function( $ ) {
function updatePluginInfo() {
var pluginLinkBySlug = {};
var extraPlugins = [];
$( '.wc-wizard-service-enable input:checked' ).each( function() {
addPlugins( pluginLinkBySlug, $( this ), '.wc-wizard-service-item' );
var $container = $( this ).closest( '.wc-wizard-service-item' );
$container.find( 'input.payment-checkbox-input:checked' ).each( function() {
extraPlugins.push( $( this ).attr( 'id' ) );
addPlugins( pluginLinkBySlug, $( this ), '.wc-wizard-service-settings' );
} );
$container.find( '.wc-wizard-shipping-method-select .method' ).each( function() {
@ -214,12 +218,35 @@ jQuery( function( $ ) {
} );
var $list = $( 'span.plugin-install-info-list' ).empty();
for ( var slug in pluginLinkBySlug ) {
$list.append( pluginLinkBySlug[ slug ] );
}
if (
extraPlugins &&
wc_setup_params.current_step &&
wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ] &&
wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ][ extraPlugins.join( ',' ) ]
) {
$list.append(
wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ][ extraPlugins.join( ',' ) ]
);
}
$( 'span.plugin-install-info' ).toggle( $list.children().length > 0 );
}
updatePluginInfo();
$( '.wc-setup-content' ).on( 'change', '[data-plugins]', updatePluginInfo );
$( document.body ).on( 'init_tooltips', function() {
$( '.help_tip' ).tipTip( {
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200,
'defaultPosition': 'top'
} );
} ).trigger( 'init_tooltips' );
} );

View File

@ -4,45 +4,47 @@
* VariationForm class which handles variation forms and attributes.
*/
var VariationForm = function( $form ) {
this.$form = $form;
this.$attributeFields = $form.find( '.variations select' );
this.$singleVariation = $form.find( '.single_variation' );
this.$singleVariationWrap = $form.find( '.single_variation_wrap' );
this.$resetVariations = $form.find( '.reset_variations' );
this.$product = $form.closest( '.product' );
this.variationData = $form.data( 'product_variations' );
this.useAjax = false === this.variationData;
this.xhr = false;
this.loading = true;
var self = this;
self.$form = $form;
self.$attributeFields = $form.find( '.variations select' );
self.$singleVariation = $form.find( '.single_variation' );
self.$singleVariationWrap = $form.find( '.single_variation_wrap' );
self.$resetVariations = $form.find( '.reset_variations' );
self.$product = $form.closest( '.product' );
self.variationData = $form.data( 'product_variations' );
self.useAjax = false === self.variationData;
self.xhr = false;
self.loading = true;
// Initial state.
this.$singleVariationWrap.show();
this.$form.off( '.wc-variation-form' );
self.$singleVariationWrap.show();
self.$form.off( '.wc-variation-form' );
// Methods.
this.getChosenAttributes = this.getChosenAttributes.bind( this );
this.findMatchingVariations = this.findMatchingVariations.bind( this );
this.isMatch = this.isMatch.bind( this );
this.toggleResetLink = this.toggleResetLink.bind( this );
self.getChosenAttributes = self.getChosenAttributes.bind( self );
self.findMatchingVariations = self.findMatchingVariations.bind( self );
self.isMatch = self.isMatch.bind( self );
self.toggleResetLink = self.toggleResetLink.bind( self );
// Events.
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: this }, this.onReset );
$form.on( 'reload_product_variations', { variationForm: this }, this.onReload );
$form.on( 'hide_variation', { variationForm: this }, this.onHide );
$form.on( 'show_variation', { variationForm: this }, this.onShow );
$form.on( 'click', '.single_add_to_cart_button', { variationForm: this }, this.onAddToCart );
$form.on( 'reset_data', { variationForm: this }, this.onResetDisplayedVariation );
$form.on( 'reset_image', { variationForm: this }, this.onResetImage );
$form.on( 'change.wc-variation-form', '.variations select', { variationForm: this }, this.onChange );
$form.on( 'found_variation.wc-variation-form', { variationForm: this }, this.onFoundVariation );
$form.on( 'check_variations.wc-variation-form', { variationForm: this }, this.onFindVariation );
$form.on( 'update_variation_values.wc-variation-form', { variationForm: this }, this.onUpdateAttributes );
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: self }, self.onReset );
$form.on( 'reload_product_variations', { variationForm: self }, self.onReload );
$form.on( 'hide_variation', { variationForm: self }, self.onHide );
$form.on( 'show_variation', { variationForm: self }, self.onShow );
$form.on( 'click', '.single_add_to_cart_button', { variationForm: self }, self.onAddToCart );
$form.on( 'reset_data', { variationForm: self }, self.onResetDisplayedVariation );
$form.on( 'reset_image', { variationForm: self }, self.onResetImage );
$form.on( 'change.wc-variation-form', '.variations select', { variationForm: self }, self.onChange );
$form.on( 'found_variation.wc-variation-form', { variationForm: self }, self.onFoundVariation );
$form.on( 'check_variations.wc-variation-form', { variationForm: self }, self.onFindVariation );
$form.on( 'update_variation_values.wc-variation-form', { variationForm: self }, self.onUpdateAttributes );
// Init after gallery.
setTimeout( function() {
$form.trigger( 'check_variations' );
$form.trigger( 'wc_variation_form' );
$form.loading = false;
self.loading = false;
}, 100 );
};
@ -219,7 +221,7 @@
}
form.$form.wc_variations_image_update( variation );
if ( ! variation.variation_is_visible ) {
template = wp_template( 'unavailable-variation-template' );
} else {
@ -592,6 +594,7 @@
$product_img.wc_set_variation_attr( 'srcset', variation.image.srcset );
$product_img.wc_set_variation_attr( 'sizes', variation.image.sizes );
$product_img.wc_set_variation_attr( 'title', variation.image.title );
$product_img.wc_set_variation_attr( 'data-caption', variation.image.caption );
$product_img.wc_set_variation_attr( 'alt', variation.image.alt );
$product_img.wc_set_variation_attr( 'data-src', variation.image.full_src );
$product_img.wc_set_variation_attr( 'data-large_image', variation.image.full_src );
@ -630,6 +633,7 @@
$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( 'data-caption' );
$product_img.wc_reset_variation_attr( 'alt' );
$product_img.wc_reset_variation_attr( 'data-src' );
$product_img.wc_reset_variation_attr( 'data-large_image' );

File diff suppressed because one or more lines are too long

View File

@ -86,7 +86,7 @@ jQuery( function( $ ) {
window.location = $thisbutton.attr( 'href' );
return;
}
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash ] );
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash, $thisbutton ] );
}).fail( function() {
window.location = $thisbutton.attr( 'href' );
return;

View File

@ -66,19 +66,10 @@ jQuery( function( $ ) {
// 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',
block: 'center'
});
} else {
$( 'html, body' ).animate( {
scrollTop: ( scrollElement.offset().top - 100 )
}, 1000 );
}
$( 'html, body' ).animate( {
scrollTop: ( scrollElement.offset().top - 100 )
}, 1000 );
}
};
});

View File

@ -3,7 +3,7 @@
* Locales information
*
* @package WooCommerce/i18n
* @version 3.4.0
* @version 3.5.0
*/
defined( 'ABSPATH' ) || exit;
@ -483,6 +483,26 @@ return array(
),
),
),
'PY' => array(
'currency_code' => 'PYG',
'currency_pos' => 'left',
'thousand_sep' => '.',
'decimal_sep' => ',',
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
'tax_rates' => array(
'' => array(
array(
'country' => 'PY',
'state' => '',
'rate' => '10.0000',
'name' => 'VAT',
'shipping' => true,
),
),
),
),
'RO' => array(
'currency_code' => 'RON',
'currency_pos' => 'right_space',

View File

@ -30,7 +30,7 @@ $states['IR'] = array(
'CHB' => __( 'Chaharmahal and Bakhtiari (چهارمحال و بختیاری)', 'woocommerce' ),
'SKH' => __( 'South Khorasan (خراسان جنوبی)', 'woocommerce' ),
'RKH' => __( 'Razavi Khorasan (خراسان رضوی)', 'woocommerce' ),
'NKH' => __( 'North Khorasan (خراسان جنوبی)', 'woocommerce' ),
'NKH' => __( 'North Khorasan (خراسان شمالی)', 'woocommerce' ),
'SMN' => __( 'Semnan (سمنان)', 'woocommerce' ),
'FRS' => __( 'Fars (فارس)', 'woocommerce' ),
'QHM' => __( 'Qom (قم)', 'woocommerce' ),

32
i18n/states/PY.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* Paraguay states
*
* @package WooCommerce/i18n
* @version 3.5.0
*/
global $states;
defined( 'ABSPATH' ) || exit;
$states['PYG'] = array(
'PY-ASU' => __( 'Asunci&oacute;n', 'woocommerce' ),
'PY-1' => __( 'Concepci&oacute;n', 'woocommerce' ),
'PY-2' => __( 'San Pedro', 'woocommerce' ),
'PY-3' => __( 'Cordillera', 'woocommerce' ),
'PY-4' => __( 'Guair&aacute;', 'woocommerce' ),
'PY-5' => __( 'Caaguaz&uacute;', 'woocommerce' ),
'PY-6' => __( 'Caazap&aacute;', 'woocommerce' ),
'PY-7' => __( 'Itap&uacute;a', 'woocommerce' ),
'PY-8' => __( 'Misiones', 'woocommerce' ),
'PY-9' => __( 'Paraguar&iacute;', 'woocommerce' ),
'PY-10' => __( 'Alto Paran&aacute;', 'woocommerce' ),
'PY-11' => __( 'Central', 'woocommerce' ),
'PY-12' => __( '&Ntilde;eembuc&uacute;', 'woocommerce' ),
'PY-13' => __( 'Amambay', 'woocommerce' ),
'PY-14' => __( 'Canindey&uacute;', 'woocommerce' ),
'PY-15' => __( 'Presidente Hayes', 'woocommerce' ),
'PY-16' => __( 'Alto Paraguay', 'woocommerce' ),
'PY-17' => __( 'Boquer&oacute;n', 'woocommerce' ),
);

View File

@ -429,9 +429,7 @@ abstract class WC_Data {
$array_key = $array_keys ? current( $array_keys ) : false;
} else {
// Find matches by key.
$matches = array();
$ids_to_keys = wp_list_pluck( $this->meta_data, 'key', 'id' );
$matches = array();
foreach ( $this->meta_data as $meta_data_array_key => $meta ) {
if ( $meta->key === $key ) {
$matches[] = $meta_data_array_key;

View File

@ -74,6 +74,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
'stock_quantity' => null,
'stock_status' => 'instock',
'backorders' => 'no',
'low_stock_amount' => '',
'sold_individually' => false,
'weight' => '',
'length' => '',
@ -389,6 +390,17 @@ class WC_Product extends WC_Abstract_Legacy_Product {
return $this->get_prop( 'backorders', $context );
}
/**
* Get low stock amount.
*
* @param string $context What the value is for. Valid values are view and edit.
* @since 3.5.0
* @return int|string Returns empty string if value not set
*/
public function get_low_stock_amount( $context = 'view' ) {
return $this->get_prop( 'low_stock_amount', $context );
}
/**
* Return if should be sold individually.
*
@ -963,6 +975,16 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$this->set_prop( 'backorders', $backorders );
}
/**
* Set low stock amount.
*
* @param int|string $amount Empty string if value not set.
* @since 3.5.0
*/
public function set_low_stock_amount( $amount ) {
$this->set_prop( 'low_stock_amount', '' === $amount ? '' : absint( $amount ) );
}
/**
* Set if should be sold individually.
*
@ -1082,7 +1104,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$attributes = array_fill_keys( array_keys( $this->get_attributes( 'edit' ) ), null );
foreach ( $raw_attributes as $attribute ) {
if ( is_a( $attribute, 'WC_Product_Attribute' ) ) {
$attributes[ sanitize_title( $attribute->get_name() ) ] = $attribute;
$attributes[ sanitize_text_field( $attribute->get_name() ) ] = $attribute;
}
}
@ -1299,10 +1321,11 @@ class WC_Product extends WC_Abstract_Legacy_Product {
* @since 3.0.0
*/
public function validate_props() {
// Before updating, ensure stock props are all aligned. Qty and backorders are not needed if not stock managed.
// Before updating, ensure stock props are all aligned. Qty, backorders and low stock amount are not needed if not stock managed.
if ( ! $this->get_manage_stock() ) {
$this->set_stock_quantity( '' );
$this->set_backorders( 'no' );
$this->set_low_stock_amount( '' );
// If we are stock managing and we don't have stock, force out of stock status.
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount', 0 ) && 'no' === $this->get_backorders() ) {

View File

@ -150,6 +150,10 @@ class WC_Admin_Exporters {
$exporter->set_product_types_to_export( wp_unslash( $_POST['export_types'] ) ); // WPCS: input var ok, sanitization ok.
}
if ( ! empty( $_POST['export_category'] ) && is_array( $_POST['export_category'] ) ) {// WPCS: input var ok.
$exporter->set_product_category_to_export( wp_unslash( array_values( $_POST['export_category'] ) ) ); // WPCS: input var ok, sanitization ok.
}
if ( ! empty( $_POST['filename'] ) ) { // WPCS: input var ok.
$exporter->set_filename( wp_unslash( $_POST['filename'] ) ); // WPCS: input var ok, sanitization ok.
}

View File

@ -215,10 +215,11 @@ class WC_Admin_Menus {
/**
* Custom menu order.
*
* @param bool $enabled Whether custom menu ordering is already enabled.
* @return bool
*/
public function custom_menu_order() {
return current_user_can( 'manage_woocommerce' );
public function custom_menu_order( $enabled ) {
return $enabled || current_user_can( 'manage_woocommerce' );
}
/**

View File

@ -55,6 +55,7 @@ class WC_Admin_Setup_Wizard {
if ( apply_filters( 'woocommerce_enable_setup_wizard', true ) && current_user_can( 'manage_woocommerce' ) ) {
add_action( 'admin_menu', array( $this, 'admin_menus' ) );
add_action( 'admin_init', array( $this, 'setup_wizard' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
}
@ -143,6 +144,62 @@ class WC_Admin_Setup_Wizard {
|| $this->should_show_mailchimp();
}
/**
* Register/enqueue scripts and styles for the Setup Wizard.
*
* Hooked onto 'admin_enqueue_scripts'.
*/
public function enqueue_scripts() {
// Whether or not there is a pending background install of Jetpack.
$pending_jetpack = ! class_exists( 'Jetpack' ) && get_option( 'woocommerce_setup_background_installing_jetpack' );
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_register_script( 'jquery-blockui', WC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.0' );
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',
'wc_enhanced_select_params',
array(
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'woocommerce' ),
'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'woocommerce' ),
'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'woocommerce' ),
'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'woocommerce' ),
'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'woocommerce' ),
'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'woocommerce' ),
'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'woocommerce' ),
'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'woocommerce' ),
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
)
);
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
wp_enqueue_style( 'wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array( 'dashicons', 'install' ), WC_VERSION );
wp_register_script( 'wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup' . $suffix . '.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui', 'wp-util', 'jquery-tiptip' ), WC_VERSION );
wp_localize_script(
'wc-setup',
'wc_setup_params',
array(
'pending_jetpack_install' => $pending_jetpack ? 'yes' : 'no',
'states' => WC()->countries->get_states(),
'current_step' => isset( $this->steps[ $this->step ] ) ? $this->step : false,
'i18n' => array(
'extra_plugins' => array(
'payment' => array(
'stripe_create_account' => __( 'Stripe setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ),
'ppec_paypal_reroute_requests' => __( 'PayPal setup is powered by Jetpack and WooCommerce Services.', 'woocommerce' ),
'stripe_create_account,ppec_paypal_reroute_requests' => __( 'Stripe and PayPal setup are powered by Jetpack and WooCommerce Services.', 'woocommerce' ),
),
),
),
)
);
}
/**
* Show the setup wizard.
*/
@ -193,47 +250,13 @@ class WC_Admin_Setup_Wizard {
unset( $default_steps['shipping'] );
}
// Whether or not there is a pending background install of Jetpack.
$pending_jetpack = ! class_exists( 'Jetpack' ) && get_option( 'woocommerce_setup_background_installing_jetpack' );
// Hide activate section when the user does not have capabilities to install plugins, think multiside admins not being a super admin.
if ( ! current_user_can( 'install_plugins' ) ) {
unset( $default_steps['activate'] );
}
$this->steps = apply_filters( 'woocommerce_setup_wizard_steps', $default_steps );
$this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); // WPCS: CSRF ok, input var ok.
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_register_script( 'jquery-blockui', WC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.0' );
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',
'wc_enhanced_select_params',
array(
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'woocommerce' ),
'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'woocommerce' ),
'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'woocommerce' ),
'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'woocommerce' ),
'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'woocommerce' ),
'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'woocommerce' ),
'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'woocommerce' ),
'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'woocommerce' ),
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
)
);
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
wp_enqueue_style( 'wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array( 'dashicons', 'install' ), WC_VERSION );
wp_register_script( 'wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup' . $suffix . '.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui', 'wp-util' ), WC_VERSION );
wp_localize_script(
'wc-setup',
'wc_setup_params',
array(
'pending_jetpack_install' => $pending_jetpack ? 'yes' : 'no',
'states' => WC()->countries->get_states(),
)
);
// @codingStandardsIgnoreStart
if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
@ -280,6 +303,7 @@ class WC_Admin_Setup_Wizard {
* Setup Wizard Header.
*/
public function setup_wizard_header() {
set_current_screen();
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
@ -287,6 +311,7 @@ class WC_Admin_Setup_Wizard {
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php esc_html_e( 'WooCommerce &rsaquo; Setup Wizard', 'woocommerce' ); ?></title>
<?php do_action( 'admin_enqueue_scripts' ); ?>
<?php wp_print_scripts( 'wc-setup' ); ?>
<?php do_action( 'admin_print_styles' ); ?>
<?php do_action( 'admin_head' ); ?>
@ -726,26 +751,6 @@ class WC_Admin_Setup_Wizard {
<?php
}
/**
* Get the WCS shipping carrier for a given country code.
*
* Can also be used to determine if WCS supports a given country.
*
* @param string $country_code Country Code.
* @param string $currency_code Currecy Code.
* @return bool|string Carrier name if supported, boolean False otherwise.
*/
protected function get_wcs_shipping_carrier( $country_code, $currency_code ) {
switch ( array( $country_code, $currency_code ) ) {
case array( 'US', 'USD' ):
return 'USPS';
case array( 'CA', 'CAD' ):
return 'Canada Post';
default:
return false;
}
}
/**
* Get shipping methods based on country code.
*
@ -755,10 +760,6 @@ class WC_Admin_Setup_Wizard {
*/
protected function get_wizard_shipping_methods( $country_code, $currency_code ) {
$shipping_methods = array(
'live_rates' => array(
'name' => __( 'Live Rates', 'woocommerce' ),
'description' => __( 'Powered by WooCommerce Services and Jetpack.', 'woocommerce' ),
),
'flat_rate' => array(
'name' => __( 'Flat Rate', 'woocommerce' ),
'description' => __( 'Set a fixed price to cover shipping costs.', 'woocommerce' ),
@ -777,12 +778,6 @@ class WC_Admin_Setup_Wizard {
),
);
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
if ( false === $live_rate_carrier || ! current_user_can( 'install_plugins' ) ) {
unset( $shipping_methods['live_rates'] );
}
return $shipping_methods;
}
@ -794,8 +789,7 @@ class WC_Admin_Setup_Wizard {
* @param string $input_prefix Input prefix.
*/
protected function shipping_method_selection_form( $country_code, $currency_code, $input_prefix ) {
$live_rate_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
$selected = $live_rate_carrier ? 'live_rates' : 'flat_rate';
$selected = 'flat_rate';
$shipping_methods = $this->get_wizard_shipping_methods( $country_code, $currency_code );
?>
<div class="wc-wizard-shipping-method-select">
@ -848,6 +842,51 @@ class WC_Admin_Setup_Wizard {
<?php
}
/**
* Render a product weight unit dropdown.
*
* @return string
*/
protected function get_product_weight_selection() {
$weight_unit = get_option( 'woocommerce_weight_unit' );
ob_start();
?>
<span class="wc-setup-shipping-unit">
<select id="weight_unit" name="weight_unit" class="wc-enhanced-select">
<option value="kg" <?php selected( $weight_unit, 'kg' ); ?>><?php esc_html_e( 'Kilograms', 'woocommerce' ); ?></option>
<option value="g" <?php selected( $weight_unit, 'g' ); ?>><?php esc_html_e( 'Grams', 'woocommerce' ); ?></option>
<option value="lbs" <?php selected( $weight_unit, 'lbs' ); ?>><?php esc_html_e( 'Pounds', 'woocommerce' ); ?></option>
<option value="oz" <?php selected( $weight_unit, 'oz' ); ?>><?php esc_html_e( 'Ounces', 'woocommerce' ); ?></option>
</select>
</span>
<?php
return ob_get_clean();
}
/**
* Render a product dimension unit dropdown.
*
* @return string
*/
protected function get_product_dimension_selection() {
$dimension_unit = get_option( 'woocommerce_dimension_unit' );
ob_start();
?>
<span class="wc-setup-shipping-unit">
<select id="dimension_unit" name="dimension_unit" class="wc-enhanced-select">
<option value="m" <?php selected( $dimension_unit, 'm' ); ?>><?php esc_html_e( 'Meters', 'woocommerce' ); ?></option>
<option value="cm" <?php selected( $dimension_unit, 'cm' ); ?>><?php esc_html_e( 'Centimeters', 'woocommerce' ); ?></option>
<option value="mm" <?php selected( $dimension_unit, 'mm' ); ?>><?php esc_html_e( 'Millimeters', 'woocommerce' ); ?></option>
<option value="in" <?php selected( $dimension_unit, 'in' ); ?>><?php esc_html_e( 'Inches', 'woocommerce' ); ?></option>
<option value="yd" <?php selected( $dimension_unit, 'yd' ); ?>><?php esc_html_e( 'Yards', 'woocommerce' ); ?></option>
</select>
</span>
<?php
return ob_get_clean();
}
/**
* Shipping.
*/
@ -856,31 +895,25 @@ class WC_Admin_Setup_Wizard {
$country_name = WC()->countries->countries[ $country_code ];
$prefixed_country_name = WC()->countries->estimated_for_prefix( $country_code ) . $country_name;
$currency_code = get_woocommerce_currency();
$wcs_carrier = $this->get_wcs_shipping_carrier( $country_code, $currency_code );
$existing_zones = WC_Shipping_Zones::get_zones();
$dimension_unit = get_option( 'woocommerce_dimension_unit' );
$weight_unit = get_option( 'woocommerce_weight_unit' );
$intro_text = '';
if ( ! empty( $existing_zones ) ) {
$intro_text = __( 'How would you like units on your store displayed?', 'woocommerce' );
} elseif ( $wcs_carrier ) {
$intro_text = sprintf(
/* translators: %1$s: country name including the 'the' prefix, %2$s: shipping carrier name */
__( "You're all set up to ship anywhere in %1\$s, and outside of it. We recommend using <strong>live rates</strong> (which are powered by our WooCommerce Services plugin and Jetpack) to get accurate %2\$s shipping prices to cover the cost of order fulfillment.", 'woocommerce' ),
$prefixed_country_name,
$wcs_carrier
);
} else {
if ( empty( $existing_zones ) ) {
$intro_text = sprintf(
/* translators: %s: country name including the 'the' prefix if needed */
__( "You can choose which countries you'll be shipping to and with which methods. To get started, we've set you up with shipping inside and outside of %s.", 'woocommerce' ),
__( "We've created two Shipping Zones - for %s and for the rest of the world. Below you can set Flat Rate shipping costs for these Zones or offer Free Shipping.", 'woocommerce' ),
$prefixed_country_name
);
}
$is_wcs_labels_supported = $this->is_wcs_shipping_labels_supported_country( $country_code );
$is_shipstation_supported = $this->is_shipstation_supported_country( $country_code );
?>
<h1><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></h1>
<p><?php echo wp_kses_post( $intro_text ); ?></p>
<?php if ( $intro_text ) : ?>
<p><?php echo wp_kses_post( $intro_text ); ?></p>
<?php endif; ?>
<form method="post">
<?php if ( empty( $existing_zones ) ) : ?>
<ul class="wc-wizard-services shipping">
@ -920,51 +953,91 @@ class WC_Admin_Setup_Wizard {
</span>
</div>
</li>
<li class="wc-wizard-service-info">
<p>
<?php
printf(
wp_kses(
/* translators: %1$s: live rates tooltip text, %2$s: shipping extensions URL */
__( 'If you\'d like to offer <span class="help_tip" data-tip="%1$s">live rates</span> from a specific carrier (e.g. UPS) you can find a variety of extensions available for WooCommerce <a href="%2$s" target="_blank">here</a>.', 'woocommerce' ),
array(
'span' => array(
'class' => array(),
'data-tip' => array(),
),
'a' => array(
'href' => array(),
'target' => array(),
),
)
),
esc_attr__( 'A live rate is the exact cost to ship an order, quoted directly from the shipping carrier.', 'woocommerce' ),
'https://woocommerce.com/product-category/woocommerce-extensions/shipping-methods/shipping-carriers/'
);
?>
</p>
</li>
</ul>
<?php endif; ?>
<?php if ( $is_wcs_labels_supported || $is_shipstation_supported ) : ?>
<ul class="wc-setup-shipping-recommended">
<?php
if ( $is_wcs_labels_supported ) :
$this->display_recommended_item( array(
'type' => 'woocommerce_services',
'title' => __( 'Print shipping labels at home', 'woocommerce' ),
'description' => __( 'We recommend WooCommerce Services & Jetpack. These plugins will save you time at the Post Office by enabling you to print your shipping labels at home.', 'woocommerce' ),
'img_url' => WC()->plugin_url() . '/assets/images/obw-woocommerce-services-icon.png',
'img_alt' => __( 'WooCommerce Services icon', 'woocommerce' ),
'plugins' => $this->get_wcs_requisite_plugins(),
) );
elseif ( $is_shipstation_supported ) :
$this->display_recommended_item( array(
'type' => 'shipstation',
'title' => __( 'Print shipping labels at home', 'woocommerce' ),
'description' => __( 'We recommend using ShipStation to save time at the Post Office by printing your shipping labels at home. Try ShipStation free for 30 days.', 'woocommerce' ),
'img_url' => WC()->plugin_url() . '/assets/images/obw-shipstation-icon.png',
'img_alt' => __( 'ShipStation icon', 'woocommerce' ),
'plugins' => array(
array(
'name' => __( 'ShipStation', 'woocommerce' ),
'slug' => 'woocommerce-shipstation',
),
),
) );
endif;
endif;
?>
</ul>
<div class="wc-setup-shipping-units">
<div class="wc-setup-shipping-unit">
<p>
<label for="weight_unit">
<?php
printf(
wp_kses(
__( '<strong>Weight unit</strong>—used to calculate shipping rates, and more.', 'woocommerce' ),
array( 'strong' => array() )
)
);
?>
</label>
</p>
<select id="weight_unit" name="weight_unit" class="wc-enhanced-select">
<option value="kg" <?php selected( $weight_unit, 'kg' ); ?>><?php esc_html_e( 'kg', 'woocommerce' ); ?></option>
<option value="g" <?php selected( $weight_unit, 'g' ); ?>><?php esc_html_e( 'g', 'woocommerce' ); ?></option>
<option value="lbs" <?php selected( $weight_unit, 'lbs' ); ?>><?php esc_html_e( 'lbs', 'woocommerce' ); ?></option>
<option value="oz" <?php selected( $weight_unit, 'oz' ); ?>><?php esc_html_e( 'oz', 'woocommerce' ); ?></option>
</select>
</div>
<div class="wc-setup-shipping-unit">
<p>
<label for="dimension_unit">
<?php
printf(
wp_kses(
__( '<strong>Dimension unit</strong>—helps for accurate package selection.', 'woocommerce' ),
array( 'strong' => array() )
)
);
?>
</label>
</p>
<select id="dimension_unit" name="dimension_unit" class="wc-enhanced-select">
<option value="m" <?php selected( $dimension_unit, 'm' ); ?>><?php esc_html_e( 'm', 'woocommerce' ); ?></option>
<option value="cm" <?php selected( $dimension_unit, 'cm' ); ?>><?php esc_html_e( 'cm', 'woocommerce' ); ?></option>
<option value="mm" <?php selected( $dimension_unit, 'mm' ); ?>><?php esc_html_e( 'mm', 'woocommerce' ); ?></option>
<option value="in" <?php selected( $dimension_unit, 'in' ); ?>><?php esc_html_e( 'in', 'woocommerce' ); ?></option>
<option value="yd" <?php selected( $dimension_unit, 'yd' ); ?>><?php esc_html_e( 'yd', 'woocommerce' ); ?></option>
</select>
</div>
<p>
<?php
echo wp_kses(
sprintf(
/* translators: %1$s: weight unit dropdown, %2$s: dimension unit dropdown */
esc_html__( 'We\'ll use %1$s for product weight and %2$s for product dimensions.', 'woocommerce' ),
$this->get_product_weight_selection(),
$this->get_product_dimension_selection()
),
array(
'span' => array(
'class' => array(),
),
'select' => array(
'id' => array(),
'name' => array(),
'class' => array(),
),
'option' => array(
'value' => array(),
'selected' => array(),
),
)
);
?>
</p>
</div>
<p class="wc-setup-actions step">
@ -982,11 +1055,6 @@ class WC_Admin_Setup_Wizard {
public function wc_setup_shipping_save() {
check_admin_referer( 'wc-setup' );
// If going through this step again, remove the live rates options.
// in case the user saved different settings this time.
delete_option( 'woocommerce_setup_domestic_live_rates_zone' );
delete_option( 'woocommerce_setup_intl_live_rates_zone' );
// @codingStandardsIgnoreStart
$setup_domestic = isset( $_POST['shipping_zones']['domestic']['enabled'] ) && ( 'yes' === $_POST['shipping_zones']['domestic']['enabled'] );
$domestic_method = isset( $_POST['shipping_zones']['domestic']['method'] ) ? sanitize_text_field( wp_unslash( $_POST['shipping_zones']['domestic']['method'] ) ) : '';
@ -1001,20 +1069,29 @@ class WC_Admin_Setup_Wizard {
update_option( 'woocommerce_weight_unit', $weight_unit );
update_option( 'woocommerce_dimension_unit', $dimension_unit );
$setup_wcs_labels = isset( $_POST['setup_woocommerce_services'] ) && 'yes' === $_POST['setup_woocommerce_services'];
$setup_shipstation = isset( $_POST['setup_shipstation'] ) && 'yes' === $_POST['setup_shipstation'];
if ( $setup_wcs_labels ) {
$this->install_woocommerce_services();
}
if ( $setup_shipstation ) {
$this->install_plugin(
'woocommerce-shipstation',
array(
'name' => __( 'ShipStation', 'woocommerce' ),
'repo-slug' => 'woocommerce-shipstation',
)
);
}
// For now, limit this setup to the first run.
if ( ! empty( $existing_zones ) ) {
wp_safe_redirect( esc_url_raw( $this->get_next_step_link() ) );
exit;
}
// Install WooCommerce Services if live rates were selected.
if (
( $setup_domestic && 'live_rates' === $domestic_method ) ||
( $setup_intl && 'live_rates' === $intl_method )
) {
$this->install_woocommerce_services();
}
/*
* If enabled, create a shipping zone containing the country the
* store is located in, with the selected method preconfigured.
@ -1025,14 +1102,7 @@ class WC_Admin_Setup_Wizard {
$zone = new WC_Shipping_Zone( null );
$zone->set_zone_order( 0 );
$zone->add_location( $country, 'country' );
if ( 'live_rates' === $domestic_method ) {
// Signal WooCommerce Services to setup the domestic zone.
update_option( 'woocommerce_setup_domestic_live_rates_zone', true, 'no' );
} else {
$instance_id = $zone->add_shipping_method( $domestic_method );
}
$instance_id = $zone->add_shipping_method( $domestic_method );
$zone->save();
// Save chosen shipping method settings (using REST controller for convenience).
@ -1050,15 +1120,10 @@ class WC_Admin_Setup_Wizard {
// If enabled, set the selected method for the "rest of world" zone.
if ( $setup_intl ) {
if ( 'live_rates' === $intl_method ) {
// Signal WooCommerce Services to setup the international zone.
update_option( 'woocommerce_setup_intl_live_rates_zone', true, 'no' );
} else {
$zone = new WC_Shipping_Zone( 0 );
$instance_id = $zone->add_shipping_method( $intl_method );
$zone = new WC_Shipping_Zone( 0 );
$instance_id = $zone->add_shipping_method( $intl_method );
$zone->save();
}
$zone->save();
// Save chosen shipping method settings (using REST controller for convenience).
if ( isset( $instance_id ) && ! empty( $_POST['shipping_zones']['intl'][ $intl_method ] ) ) { // WPCS: input var ok.
@ -1213,6 +1278,32 @@ class WC_Admin_Setup_Wizard {
return in_array( $country_code, $supported_countries, true );
}
/**
* Is ShipStation country supported
*
* @param string $country_code Country code.
*/
protected function is_shipstation_supported_country( $country_code ) {
$supported_countries = array(
'AU', // Australia.
'CA', // Canada.
'GB', // United Kingdom.
);
return in_array( $country_code, $supported_countries, true );
}
/**
* Is WooCommerce Services shipping label country supported
*
* @param string $country_code Country code.
*/
protected function is_wcs_shipping_labels_supported_country( $country_code ) {
$supported_countries = array(
'US', // United States.
);
return in_array( $country_code, $supported_countries, true );
}
/**
* Helper method to retrieve the current user's email address.
*
@ -1268,9 +1359,10 @@ class WC_Admin_Setup_Wizard {
'repo-slug' => 'woocommerce-gateway-stripe',
'settings' => array(
'create_account' => array(
'label' => __( 'Create a new Stripe account for me', 'woocommerce' ),
'label' => __( 'Set up Stripe for me using this email:', 'woocommerce' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'placeholder' => '',
'required' => false,
'plugins' => $this->get_wcs_requisite_plugins(),
@ -1280,7 +1372,6 @@ class WC_Admin_Setup_Wizard {
'type' => 'email',
'value' => $user_email,
'placeholder' => __( 'Stripe email address', 'woocommerce' ),
'description' => __( "Enter your email address and we'll handle account creation. Powered by WooCommerce Services and Jetpack.", 'woocommerce' ),
'required' => true,
),
),
@ -1294,9 +1385,10 @@ class WC_Admin_Setup_Wizard {
'repo-slug' => 'woocommerce-gateway-paypal-express-checkout',
'settings' => array(
'reroute_requests' => array(
'label' => __( 'Accept payments without linking a PayPal account', 'woocommerce' ),
'label' => __( 'Set up PayPal for me using this email:', 'woocommerce' ),
'type' => 'checkbox',
'value' => 'yes',
'default' => 'yes',
'placeholder' => '',
'required' => false,
'plugins' => $this->get_wcs_requisite_plugins(),
@ -1306,7 +1398,6 @@ class WC_Admin_Setup_Wizard {
'type' => 'email',
'value' => $user_email,
'placeholder' => __( 'Email address to receive payments', 'woocommerce' ),
'description' => __( "Enter your email address and we'll authenticate payments for you. Powered by WooCommerce Services and Jetpack.", 'woocommerce' ),
'required' => true,
),
),
@ -1527,6 +1618,8 @@ class WC_Admin_Setup_Wizard {
$checked = false;
if ( isset( $previously_saved_settings[ $setting_id ] ) ) {
$checked = 'yes' === $previously_saved_settings[ $setting_id ];
} elseif ( false === $previously_saved_settings && isset( $setting['default'] ) ) {
$checked = 'yes' === $setting['default'];
}
}
if ( 'email' === $setting['type'] ) {

View File

@ -39,6 +39,22 @@ class WC_Admin_Status {
if ( array_key_exists( $action, $tools ) ) {
$response = $tools_controller->execute_tool( $action );
$tool = $tools[ $action ];
$tool = array(
'id' => $action,
'name' => $tool['name'],
'action' => $tool['button'],
'description' => $tool['desc'],
);
$tool = array_merge( $tool, $response );
/**
* Fires after a WooCommerce system status tool has been executed.
*
* @param array $tool Details about the tool that has been executed.
*/
do_action( 'woocommerce_system_status_tool_executed', $tool );
} else {
$response = array(
'success' => false,

View File

@ -200,7 +200,7 @@ class WC_Admin_Taxonomies {
$image = wc_placeholder_img_src();
}
?>
<tr class="form-field">
<tr class="form-field term-display-type-wrap">
<th scope="row" valign="top"><label><?php _e( 'Display type', 'woocommerce' ); ?></label></th>
<td>
<select id="display_type" name="display_type" class="postform">
@ -211,7 +211,7 @@ class WC_Admin_Taxonomies {
</select>
</td>
</tr>
<tr class="form-field">
<tr class="form-field term-thumbnail-wrap">
<th scope="row" valign="top"><label><?php _e( 'Thumbnail', 'woocommerce' ); ?></label></th>
<td>
<div id="product_cat_thumbnail" style="float: left; margin-right: 10px;"><img src="<?php echo esc_url( $image ); ?>" width="60px" height="60px" /></div>

View File

@ -475,6 +475,7 @@ class WC_Product_CSV_Importer_Controller {
__( 'In stock?', 'woocommerce' ) => 'stock_status',
__( 'Stock', 'woocommerce' ) => 'stock_quantity',
__( 'Backorders allowed?', 'woocommerce' ) => 'backorders',
__( 'Low stock amount', 'woocommerce' ) => 'low_stock_amount',
__( 'Sold individually?', 'woocommerce' ) => 'sold_individually',
/* translators: %s: Weight unit */
sprintf( __( 'Weight (%s)', 'woocommerce' ), $weight_unit ) => 'weight',
@ -640,6 +641,7 @@ class WC_Product_CSV_Importer_Controller {
'stock_status' => __( 'In stock?', 'woocommerce' ),
'stock_quantity' => _x( 'Stock', 'Quantity in stock', 'woocommerce' ),
'backorders' => __( 'Backorders allowed?', 'woocommerce' ),
'low_stock_amount' => __( 'Low stock amount', 'woocommerce' ),
'sold_individually' => __( 'Sold individually?', 'woocommerce' ),
/* translators: %s: weight unit */
'weight' => sprintf( __( 'Weight (%s)', 'woocommerce' ), $weight_unit ),

View File

@ -55,6 +55,7 @@ function wc_importer_default_english_mappings( $mappings ) {
'In stock?' => 'stock_status',
'Stock' => 'stock_quantity',
'Backorders allowed?' => 'backorders',
'Low stock amount' => 'low_stock_amount',
'Sold individually?' => 'sold_individually',
sprintf( 'Weight (%s)', $weight_unit ) => 'weight',
sprintf( 'Length (%s)', $dimension_unit ) => 'length',

View File

@ -39,6 +39,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
add_filter( 'query_vars', array( $this, 'add_custom_query_var' ) );
add_filter( 'views_edit-product', array( $this, 'product_views' ) );
add_filter( 'get_search_query', array( $this, 'search_label' ) );
add_filter( 'posts_clauses', array( $this, 'add_variation_parents_for_shipping_class' ), 10, 2 );
}
/**
@ -145,7 +146,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
}
/**
* Render columm: name.
* Render column: name.
*/
protected function render_name_column() {
global $post;
@ -187,6 +188,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
<div class="tax_status">' . esc_html( $this->object->get_tax_status() ) . '</div>
<div class="tax_class">' . esc_html( $this->object->get_tax_class() ) . '</div>
<div class="backorders">' . esc_html( $this->object->get_backorders() ) . '</div>
<div class="low_stock_amount">' . esc_html( $this->object->get_low_stock_amount() ) . '</div>
</div>
';
}
@ -496,4 +498,26 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
return wc_clean( wp_unslash( $_GET['s'] ) ); // WPCS: input var ok, sanitization ok.
}
/**
* Modifies post query so that it includes parent products whose variations have particular shipping class assigned.
*
* @param array $pieces Array of SELECT statement pieces (from, where, etc).
* @param WP_Query $wp_query WP_Query instance.
* @return array Array of products, including parents of variations.
*/
public function add_variation_parents_for_shipping_class( $pieces, $wp_query ) {
global $wpdb;
if ( isset( $_GET['product_shipping_class'] ) && '0' !== $_GET['product_shipping_class'] ) { // WPCS: input var ok.
$replaced_where = str_replace( ".post_type = 'product'", ".post_type = 'product_variation'", $pieces['where'] );
$pieces['where'] .= " OR {$wpdb->posts}.ID in (
SELECT {$wpdb->posts}.post_parent FROM
wp_posts LEFT JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)
WHERE 1=1 $replaced_where
)";
return $pieces;
}
return $pieces;
}
}

View File

@ -173,7 +173,7 @@ class WC_Meta_Box_Product_Data {
$variation_attributes = array_filter( $product_object->get_attributes(), array( __CLASS__, 'filter_variation_attributes' ) );
$default_attributes = $product_object->get_default_attributes();
$variations_count = absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation' AND post_status IN ('publish', 'private')", $post->ID ) ) );
$variations_count = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_count', $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation' AND post_status IN ('publish', 'private')", $post->ID ) ), $post->ID ) );
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) );
$variations_total_pages = ceil( $variations_count / $variations_per_page );
@ -365,6 +365,7 @@ class WC_Meta_Box_Product_Data {
'backorders' => isset( $_POST['_backorders'] ) ? wc_clean( wp_unslash( $_POST['_backorders'] ) ) : null,
'stock_status' => wc_clean( wp_unslash( $_POST['_stock_status'] ) ),
'stock_quantity' => $stock,
'low_stock_amount' => wc_stock_amount( wp_unslash( $_POST['_low_stock_amount'] ) ),
'download_limit' => '' === $_POST['_download_limit'] ? '' : absint( wp_unslash( $_POST['_download_limit'] ) ),
'download_expiry' => '' === $_POST['_download_expiry'] ? '' : absint( wp_unslash( $_POST['_download_expiry'] ) ),
'downloads' => self::prepare_downloads(
@ -372,12 +373,12 @@ class WC_Meta_Box_Product_Data {
isset( $_POST['_wc_file_urls'] ) ? wp_unslash( $_POST['_wc_file_urls'] ) : array(),
isset( $_POST['_wc_file_hashes'] ) ? wp_unslash( $_POST['_wc_file_hashes'] ) : array()
),
'product_url' => esc_url_raw( wp_unslash( $_POST['_product_url'] ) ),
'button_text' => wc_clean( wp_unslash( $_POST['_button_text'] ) ),
'children' => 'grouped' === $product_type ? self::prepare_children() : null,
'reviews_allowed' => ! empty( $_POST['comment_status'] ) && 'open' === $_POST['comment_status'],
'attributes' => $attributes,
'default_attributes' => self::prepare_set_attributes( $attributes, 'default_attribute_' ),
'product_url' => esc_url_raw( wp_unslash( $_POST['_product_url'] ) ),
'button_text' => wc_clean( wp_unslash( $_POST['_button_text'] ) ),
'children' => 'grouped' === $product_type ? self::prepare_children() : null,
'reviews_allowed' => ! empty( $_POST['comment_status'] ) && 'open' === $_POST['comment_status'],
'attributes' => $attributes,
'default_attributes' => self::prepare_set_attributes( $attributes, 'default_attribute_' ),
)
);
@ -458,7 +459,7 @@ class WC_Meta_Box_Product_Data {
'stock_status' => wc_clean( $_POST['variable_stock_status'][ $i ] ),
'image_id' => wc_clean( $_POST['upload_image_id'][ $i ] ),
'attributes' => self::prepare_set_attributes( $parent->get_attributes(), 'attribute_', $i ),
'sku' => isset( $_POST['variable_sku'][ $i ] ) ? wc_clean( $_POST['variable_sku'][ $i ] ) : '',
'sku' => isset( $_POST['variable_sku'][ $i ] ) ? wc_clean( wp_unslash( $_POST['variable_sku'][ $i ] ) ) : '',
'weight' => isset( $_POST['variable_weight'][ $i ] ) ? wc_clean( $_POST['variable_weight'][ $i ] ) : '',
'length' => isset( $_POST['variable_length'][ $i ] ) ? wc_clean( $_POST['variable_length'][ $i ] ) : '',
'width' => isset( $_POST['variable_width'][ $i ] ) ? wc_clean( $_POST['variable_width'][ $i ] ) : '',

View File

@ -1,11 +1,15 @@
<?php
/**
* Show order refund
*
* @var object $refund The refund object.
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
exit; // Exit if accessed directly.
}
/**
* @var object $refund The refund object.
*/
$who_refunded = new WP_User( $refund->get_refunded_by() );
?>
<tr class="refund <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_refund_id="<?php echo esc_attr( $refund->get_id() ); ?>">
@ -17,8 +21,8 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
printf(
/* translators: 1: refund id 2: refund date 3: username */
esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ),
$refund->get_id(),
wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ),
esc_html( $refund->get_id() ),
esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ),
sprintf(
'<abbr class="refund_by" title="%1$s">%2$s</abbr>',
/* translators: 1: ID who refunded */
@ -30,8 +34,8 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
printf(
/* translators: 1: refund id 2: refund date */
esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ),
$refund->get_id(),
wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) )
esc_html( $refund->get_id() ),
esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) )
);
}
?>
@ -48,7 +52,11 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
<td class="line_cost" width="1%">
<div class="view">
<?php echo wc_price( '-' . $refund->get_amount() ); ?>
<?php
echo wp_kses_post(
wc_price( '-' . $refund->get_amount(), array( 'currency' => $refund->get_currency() ) )
);
?>
</div>
</td>

View File

@ -1,4 +1,10 @@
<?php
/**
* Displays the inventory tab in the product data meta box.
*
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -65,6 +71,20 @@ if ( ! defined( 'ABSPATH' ) ) {
)
);
woocommerce_wp_text_input( array(
'id' => '_low_stock_amount',
'value' => $product_object->get_low_stock_amount( 'edit' ),
'placeholder' => get_option( 'woocommerce_notify_low_stock_amount' ),
'label' => __( 'Low stock threshold', 'woocommerce' ),
'desc_tip' => true,
'description' => __( 'When product stock reaches this amount you will be notified by email', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any',
),
'data_type' => 'stock',
) );
do_action( 'woocommerce_product_options_stock_fields' );
echo '</div>';
@ -74,7 +94,7 @@ if ( ! defined( 'ABSPATH' ) ) {
array(
'id' => '_stock_status',
'value' => $product_object->get_stock_status( 'edit' ),
'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external',
'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external hide_if_grouped',
'label' => __( 'Stock status', 'woocommerce' ),
'options' => wc_get_product_stock_status_options(),
'desc_tip' => true,

View File

@ -52,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'class' => 'select short',
);
?>
<p class="form-field dimensions_field">
<p class="form-field shipping_class_field">
<label for="product_shipping_class"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></label>
<?php wp_dropdown_categories( $args ); ?>
<?php echo wc_help_tip( __( 'Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce' ) ); ?>

View File

@ -170,7 +170,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'value' => wc_stock_amount( $variation_object->get_stock_quantity( 'edit' ) ),
'label' => __( 'Stock quantity', 'woocommerce' ),
'desc_tip' => true,
'description' => __( "Enter a quantity to enable stock management at variation level, or leave blank to use the parent product's options.", 'woocommerce' ),
'description' => __( "Enter a number to set stock quantity at the variation level. Use a variation's 'Manage stock?' check box above to enable/disable stock management at the variation level.", 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any',
@ -311,7 +311,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'name' => "variable_tax_class[{$loop}]",
'value' => $variation_object->get_tax_class( 'edit' ),
'label' => __( 'Tax class', 'woocommerce' ),
'options' => array_merge( array( 'parent' => __( 'Same as parent', 'woocommerce' ) ), wc_get_product_tax_class_options() ),
'options' => array( 'parent' => __( 'Same as parent', 'woocommerce' ) ) + wc_get_product_tax_class_options(),
'desc_tip' => 'true',
'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' ),
'wrapper_class' => 'form-row form-row-full',

View File

@ -265,7 +265,7 @@ class WC_Report_Customer_List extends WP_List_Table {
*/
$admin_users = new WP_User_Query(
array(
'role' => 'administrator1',
'role' => 'administrator',
'fields' => 'ID',
)
);

View File

@ -50,7 +50,7 @@ $settings = array(
'default' => 'inherit',
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array_merge( array( 'inherit' => __( 'Shipping tax class based on cart items', 'woocommerce' ) ), wc_get_product_tax_class_options() ),
'options' => array( 'inherit' => __( 'Shipping tax class based on cart items', 'woocommerce' ) ) + wc_get_product_tax_class_options(),
'desc_tip' => true,
),

View File

@ -57,6 +57,19 @@ $exporter = new WC_Product_CSV_Exporter();
</select>
</td>
</tr>
<tr>
<th scope="row">
<label for="woocommerce-exporter-category"><?php esc_html_e( 'Which product category should be exported?', 'woocommerce' ); ?></label>
</th>
<td>
<select id="woocommerce-exporter-category" class="woocommerce-exporter-category wc-enhanced-select" style="width:100%;" multiple data-placeholder="<?php esc_attr_e( 'Export all categories', 'woocommerce' ); ?>">
<?php
foreach ( get_categories( array( 'taxonomy' => 'product_cat' ) ) as $category ) {
echo '<option value="' . esc_attr( $category->slug ) . '">' . esc_html( $category->name ) . '</option>';
}
?>
</td>
</tr>
<tr>
<th scope="row">
<label for="woocommerce-exporter-meta"><?php esc_html_e( 'Export custom meta?', 'woocommerce' ); ?></label>

View File

@ -208,7 +208,7 @@ function wc_save_order_items( $order_id, $items ) {
$item_data = array();
foreach ( $data_keys as $key => $default ) {
$item_data[ $key ] = isset( $items[ $key ][ $item_id ] ) ? wc_clean( wp_unslash( $items[ $key ][ $item_id ] ) ) : $default;
$item_data[ $key ] = isset( $items[ $key ][ $item_id ] ) ? wp_check_invalid_utf8( wp_unslash( $items[ $key ][ $item_id ] ) ) : $default;
}
if ( '0' === $item_data['order_item_qty'] ) {

View File

@ -86,7 +86,7 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V2_Controller {
'readonly' => true,
),
'date_created_gmt' => array(
'description' => __( 'The date the order was created, as GMT.', 'woocommerce' ),
'description' => __( 'The date the customer was created, as GMT.', 'woocommerce' ),
'type' => 'date-time',
'context' => array( 'view', 'edit' ),
'readonly' => true,

View File

@ -125,8 +125,13 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
}
}
// Build tax_query if taxonomies are set.
if ( ! empty( $tax_query ) ) {
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
if ( ! empty( $args['tax_query'] ) ) {
$args['tax_query'] = array_merge( $tax_query, $args['tax_query'] ); // WPCS: slow query ok.
} else {
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
}
}
// Filter featured.

View File

@ -419,7 +419,7 @@ class WC_REST_Customers_V1_Controller extends WC_REST_Controller {
// Customer password.
if ( isset( $request['password'] ) ) {
$customer->set_password( wc_clean( $request['password'] ) );
$customer->set_password( $request['password'] );
}
$this->update_customer_meta_fields( $customer, $request );

View File

@ -228,7 +228,7 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'mysql_version_string' => array(
'mysql_version_string' => array(
'description' => __( 'MySQL version string.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
@ -796,18 +796,42 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
$version_data = get_transient( md5( $plugin ) . '_version_data' );
if ( false === $version_data ) {
$changelog = wp_safe_remote_get( 'http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $dirname . '/changelog.txt' );
$cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) );
if ( ! empty( $cl_lines ) ) {
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match( '/^[0-9]/', $cl_line ) ) {
$date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );
$version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );
$update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );
if ( 200 === wp_remote_retrieve_response_code( $changelog ) ) {
$cl_lines = explode( "\n", wp_remote_retrieve_body( $changelog ) );
if ( ! empty( $cl_lines ) ) {
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match( '/^[0-9]/', $cl_line ) ) {
$date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );
$version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );
$update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );
$version_data = array(
'date' => $date,
'version' => $version,
'update' => $update,
'changelog' => $changelog,
);
set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS );
break;
}
}
}
} else {
$args = (object) array(
'slug' => $dirname,
);
$request = array(
'action' => 'plugin_information',
'request' => serialize( $args ),
);
$plugin_info = wp_safe_remote_post( 'http://api.wordpress.org/plugins/info/1.0/', array( 'body' => $request ) );
if ( 200 === wp_remote_retrieve_response_code( $plugin_info ) ) {
$body = maybe_unserialize( wp_remote_retrieve_body( $plugin_info ) );
if ( is_object( $body ) && isset( $body->sections['changelog'] ) ) {
$version_data = array(
'date' => $date,
'version' => $version,
'update' => $update,
'changelog' => $changelog,
'date' => $body->last_updated,
'version' => $body->version,
'update' => $body->sections['changelog'],
'changelog' => $body->sections['changelog'],
);
set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS );
break;

View File

@ -630,7 +630,8 @@ class WC_AJAX {
$attributes = $product->get_attributes( 'edit' );
$i = -1;
foreach ( $attributes as $attribute ) {
foreach ( $data['attribute_names'] as $attribute_name ) {
$attribute = isset( $attributes[ $attribute_name ] ) ? $attributes[ $attribute_name ] : false;
if ( ! $attribute ) {
continue;
}
@ -2393,7 +2394,7 @@ class WC_AJAX {
WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, $postcode );
}
if ( isset( $data['city'] ) ) {
WC_Tax::_update_tax_rate_cities( $tax_rate_id, array_map( 'wc_clean', $data['city'] ) );
WC_Tax::_update_tax_rate_cities( $tax_rate_id, array_map( 'wc_clean', array_map( 'wp_unslash', $data['city'] ) ) );
}
}

View File

@ -106,7 +106,7 @@ class WC_Background_Updater extends WC_Background_Process {
if ( is_callable( $callback ) ) {
$logger->info( sprintf( 'Running %s callback', $callback ), array( 'source' => 'wc_db_updates' ) );
$result = (bool) call_user_func( $callback );
$result = (bool) call_user_func( $callback, $this );
if ( $result ) {
$logger->info( sprintf( '%s callback needs to run again', $callback ), array( 'source' => 'wc_db_updates' ) );

View File

@ -181,7 +181,7 @@ class WC_Cache_Helper {
return;
}
$affected = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s ORDER BY option_id LIMIT %d;", '\_transient\_%' . $version, $limit ) ); // WPCS: cache ok, db call ok.
$affected = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s LIMIT %d;", '\_transient\_%' . $version, $limit ) ); // WPCS: cache ok, db call ok.
// If affected rows is equal to limit, there are more rows to delete. Delete in 30 secs.
if ( $affected === $limit ) {

View File

@ -130,6 +130,11 @@ final class WC_Cart_Session {
}
}
// If it's not empty, it's been already populated by the loop above.
if ( ! empty( $cart_contents ) ) {
$this->cart->set_cart_contents( apply_filters( 'woocommerce_cart_contents_changed', $cart_contents ) );
}
do_action( 'woocommerce_cart_loaded_from_session', $this->cart );
if ( $update_cart_session || is_null( WC()->session->get( 'cart_totals', null ) ) ) {

View File

@ -104,7 +104,7 @@ class WC_Cart extends WC_Legacy_Cart {
public function __construct() {
$this->session = new WC_Cart_Session( $this );
$this->fees_api = new WC_Cart_Fees( $this );
$this->tax_display_cart = get_option( 'woocommerce_tax_display_cart' );
$this->tax_display_cart = $this->is_tax_displayed();
// Register hooks for the objects.
$this->session->init();
@ -1062,7 +1062,7 @@ class WC_Cart extends WC_Legacy_Cart {
sprintf(
'<a href="%s" class="button wc-forward">%s</a> %s',
wc_get_cart_url(),
__( 'View Cart', 'woocommerce' ),
__( 'View cart', 'woocommerce' ),
/* translators: 1: quantity in stock 2: current quantity */
sprintf( __( 'You cannot add that amount to the cart &mdash; we have %1$s in stock and you already have %2$s in your cart.', 'woocommerce' ), wc_format_stock_quantity_for_display( $product_data->get_stock_quantity(), $product_data ), wc_format_stock_quantity_for_display( $products_qty_in_cart[ $product_data->get_stock_managed_by_id() ], $product_data ) )
)
@ -1093,6 +1093,8 @@ class WC_Cart extends WC_Legacy_Cart {
);
}
$this->cart_contents = apply_filters( 'woocommerce_cart_contents_changed', $this->cart_contents );
do_action( 'woocommerce_add_to_cart', $cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data );
return $cart_item_key;
@ -1938,4 +1940,17 @@ class WC_Cart extends WC_Legacy_Cart {
$this->fees_api->remove_all_fees();
do_action( 'woocommerce_cart_reset', $this, false );
}
/**
* Returns 'incl' if tax should be included in cart, otherwise returns 'excl'.
*
* @return string
*/
private function is_tax_displayed() {
if ( $this->get_customer() && $this->get_customer()->get_is_vat_exempt() ) {
return 'excl';
}
return get_option( 'woocommerce_tax_display_cart' );
}
}

View File

@ -309,15 +309,23 @@ class WC_Checkout {
$order = new WC_Order();
}
$fields_prefix = array(
'shipping' => true,
'billing' => true,
);
$shipping_fields = array(
'shipping_method' => true,
'shipping_total' => true,
'shipping_tax' => true,
);
foreach ( $data as $key => $value ) {
if ( is_callable( array( $order, "set_{$key}" ) ) ) {
$order->{"set_{$key}"}( $value );
// Store custom fields prefixed with wither shipping_ or billing_. This is for backwards compatibility with 2.6.x.
// TODO: Fix conditional to only include shipping/billing address fields in a smarter way without str(i)pos.
} elseif ( ( 0 === stripos( $key, 'billing_' ) || 0 === stripos( $key, 'shipping_' ) )
&& ! in_array( $key, array( 'shipping_method', 'shipping_total', 'shipping_tax' ), true ) ) {
$order->update_meta_data( '_' . $key, $value );
} elseif ( isset( $fields_prefix[ current( explode( '_', $key ) ) ] ) ) {
if ( ! isset( $shipping_fields[ $key ] ) ) {
$order->update_meta_data( '_' . $key, $value );
}
}
}
@ -615,6 +623,9 @@ class WC_Checkout {
case 'textarea':
$value = isset( $_POST[ $key ] ) ? wc_sanitize_textarea( wp_unslash( $_POST[ $key ] ) ) : ''; // WPCS: input var ok, CSRF ok.
break;
case 'password':
$value = isset( $_POST[ $key ] ) ? wp_unslash( $_POST[ $key ] ) : ''; // WPCS: input var ok, CSRF ok, sanitization ok.
break;
default:
$value = isset( $_POST[ $key ] ) ? wc_clean( wp_unslash( $_POST[ $key ] ) ) : ''; // WPCS: input var ok, CSRF ok.
break;
@ -688,8 +699,6 @@ class WC_Checkout {
}
if ( in_array( 'phone', $format, true ) ) {
$data[ $key ] = wc_format_phone_number( $data[ $key ] );
if ( $validate_fieldset && '' !== $data[ $key ] && ! WC_Validation::is_phone( $data[ $key ] ) ) {
/* translators: %s: phone number */
$errors->add( 'validation', sprintf( __( '%s is not a valid phone number.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ) );
@ -697,9 +706,10 @@ class WC_Checkout {
}
if ( in_array( 'email', $format, true ) && '' !== $data[ $key ] ) {
$email_is_valid = is_email( $data[ $key ] );
$data[ $key ] = sanitize_email( $data[ $key ] );
if ( $validate_fieldset && ! is_email( $data[ $key ] ) ) {
if ( $validate_fieldset && ! $email_is_valid ) {
/* translators: %s: email address */
$errors->add( 'validation', sprintf( __( '%s is not a valid email address.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ) );
continue;

View File

@ -616,10 +616,10 @@ class WC_Countries {
* @return array
*/
public function get_default_address_fields() {
$address_2_placeholder = __( 'Apartment, suite, unit etc.', 'woocommerce' );
if ( 'optional' === get_option( 'woocommerce_checkout_address_2_field', 'optional' ) ) {
$address_2_placeholder .= ' (' . __( 'optional', 'woocommerce' ) . ')';
$address_2_placeholder = __( 'Apartment, suite, unit etc. (optional)', 'woocommerce' );
} else {
$address_2_placeholder = __( 'Apartment, suite, unit etc.', 'woocommerce' );
}
$fields = array(
@ -662,6 +662,8 @@ class WC_Countries {
'priority' => 50,
),
'address_2' => array(
'label' => __( 'Apartment, suite, or unit.', 'woocommerce' ),
'label_class' => 'screen-reader-text',
'placeholder' => esc_attr( $address_2_placeholder ),
'class' => array( 'form-row-wide', 'address-field' ),
'autocomplete' => 'address-line2',
@ -791,7 +793,10 @@ class WC_Countries {
),
),
'BH' => array(
'state' => array(
'postcode' => array(
'required' => false,
),
'state' => array(
'required' => false,
),
),
@ -1005,6 +1010,16 @@ class WC_Countries {
'label' => __( 'Province', 'woocommerce' ),
),
),
'NG' => array(
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'required' => false,
'hidden' => true,
),
'state' => array(
'label' => __( 'State', 'woocommerce' ),
),
),
'NZ' => array(
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
@ -1051,13 +1066,17 @@ class WC_Countries {
'RO' => array(
'state' => array(
'label' => __( 'County', 'woocommerce' ),
'required' => false,
'required' => true,
),
),
'SG' => array(
'state' => array(
'required' => false,
),
'city' => array(
'required' => false,
'hidden' => true,
),
),
'SK' => array(
'postcode' => array(

View File

@ -294,7 +294,7 @@ class WC_Customer extends WC_Legacy_Customer {
* @param string $password Password.
*/
public function set_password( $password ) {
$this->password = wc_clean( $password );
$this->password = $password;
}
/**

View File

@ -764,12 +764,12 @@ class WC_Discounts {
* @return bool
*/
protected function validate_coupon_sale_items( $coupon ) {
if ( $coupon->get_exclude_sale_items() ) {
$valid = false;
if ( $coupon->get_exclude_sale_items() && 'fixed_product' !== $coupon->get_discount_type() ) {
$valid = true;
foreach ( $this->get_items_to_validate() as $item ) {
if ( $item->product && ! $item->product->is_on_sale() ) {
$valid = true;
if ( $item->product && $item->product->is_on_sale() ) {
$valid = false;
break;
}
}

View File

@ -130,8 +130,6 @@ class WC_Form_Handler {
}
break;
case 'phone' :
$_POST[ $key ] = wc_format_phone_number( $_POST[ $key ] );
if ( ! WC_Validation::is_phone( $_POST[ $key ] ) ) {
wc_add_notice( sprintf( __( '%s is not a valid phone number.', 'woocommerce' ), '<strong>' . $field['label'] . '</strong>' ), 'error' );
}

View File

@ -256,12 +256,12 @@ class WC_Frontend_Scripts {
),
'wc-add-to-cart' => array(
'src' => self::get_asset_url( 'assets/js/frontend/add-to-cart' . $suffix . '.js' ),
'deps' => array( 'jquery' ),
'deps' => array( 'jquery', 'jquery-blockui' ),
'version' => WC_VERSION,
),
'wc-add-to-cart-variation' => array(
'src' => self::get_asset_url( 'assets/js/frontend/add-to-cart-variation' . $suffix . '.js' ),
'deps' => array( 'jquery', 'wp-util' ),
'deps' => array( 'jquery', 'wp-util', 'jquery-blockui' ),
'version' => WC_VERSION,
),
'wc-geolocation' => array(

View File

@ -44,7 +44,6 @@ class WC_Geolocation {
* @var array
*/
private static $ip_lookup_apis = array(
'icanhazip' => 'http://icanhazip.com',
'ipify' => 'http://api.ipify.org/',
'ipecho' => 'http://ipecho.net/plain',
'ident' => 'http://ident.me',

View File

@ -115,6 +115,7 @@ class WC_Install {
),
'3.5.0' => array(
'wc_update_350_order_customer_id',
'wc_update_350_change_woocommerce_sessions_schema',
'wc_update_350_db_version',
),
);
@ -627,8 +628,8 @@ CREATE TABLE {$wpdb->prefix}woocommerce_sessions (
session_key char(32) NOT NULL,
session_value longtext NOT NULL,
session_expiry BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (session_key),
UNIQUE KEY session_id (session_id)
PRIMARY KEY (session_id),
UNIQUE KEY session_key (session_key)
) $collate;
CREATE TABLE {$wpdb->prefix}woocommerce_api_keys (
key_id BIGINT UNSIGNED NOT NULL auto_increment,
@ -1316,6 +1317,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
// Activate this thing.
if ( $activate ) {
try {
add_action( 'add_option_mailchimp_woocommerce_plugin_do_activation_redirect', array( __CLASS__, 'remove_mailchimps_redirect' ), 10, 2 );
$result = activate_plugin( $installed ? $installed_plugins[ $plugin_file ] : $plugin_slug . '/' . $plugin_file );
if ( is_wp_error( $result ) ) {
@ -1336,6 +1338,20 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
}
}
/**
* Removes redirect added during MailChimp plugin's activation.
*
* @param string $option Option name.
* @param string $value Option value.
*/
public static function remove_mailchimps_redirect( $option, $value ) {
// Remove this action to prevent infinite looping.
remove_action( 'add_option_mailchimp_woocommerce_plugin_do_activation_redirect', array( __CLASS__, 'remove_mailchimps_redirect' ) );
// Update redirect back to false.
update_option( 'mailchimp_woocommerce_plugin_do_activation_redirect', false );
}
/**
* Install a theme from .org in the background via a cron job (used by installer - opt in).
*

View File

@ -186,7 +186,7 @@ class WC_Order_Item extends WC_Data implements ArrayAccess {
* @param string $value Item name.
*/
public function set_name( $value ) {
$this->set_prop( 'name', wc_clean( $value ) );
$this->set_prop( 'name', wp_check_invalid_utf8( $value ) );
}
/*

View File

@ -46,6 +46,7 @@ class WC_Product_Query extends WC_Object_Query {
'stock_quantity' => '',
'stock_status' => '',
'backorders' => '',
'low_stock_amount' => '',
'sold_individually' => '',
'weight' => '',
'length' => '',

View File

@ -302,7 +302,7 @@ class WC_Product_Variable extends WC_Product {
$available_variations[] = $this->get_available_variation( $variation );
}
$available_variations = array_filter( $available_variations );
$available_variations = array_values( array_filter( $available_variations ) );
return $available_variations;
}
@ -406,6 +406,7 @@ class WC_Product_Variable extends WC_Product {
if ( ! $this->get_manage_stock() ) {
$this->set_stock_quantity( '' );
$this->set_backorders( 'no' );
$this->set_low_stock_amount( '' );
$this->data_store->sync_stock_status( $this );
// If we are stock managing, backorders are allowed, and we don't have stock, force on backorder status.
@ -503,7 +504,7 @@ class WC_Product_Variable extends WC_Product {
if ( false === $has_weight ) {
$has_weight = $this->data_store->child_has_weight( $this );
set_transient( $transient_name, $has_weight, DAY_IN_SECONDS * 30 );
set_transient( $transient_name, (int) $has_weight, DAY_IN_SECONDS * 30 );
}
return (bool) $has_weight;
@ -520,7 +521,7 @@ class WC_Product_Variable extends WC_Product {
if ( false === $has_dimension ) {
$has_dimension = $this->data_store->child_has_dimensions( $this );
set_transient( $transient_name, $has_dimension, DAY_IN_SECONDS * 30 );
set_transient( $transient_name, (int) $has_dimension, DAY_IN_SECONDS * 30 );
}
return (bool) $has_dimension;

View File

@ -5,7 +5,7 @@
* All functionality pertaining to regenerating product images in realtime.
*
* @package WooCommerce/Classes
* @version 3.3.0
* @version 3.5.0
* @since 3.3.0
*/
@ -87,10 +87,7 @@ class WC_Regenerate_Images {
$size_data = wc_get_image_size( $size );
return image_get_intermediate_size( $attachment_id, array( absint( $size_data['width'] ), absint( $size_data['height'] ) ) );
}
return false;
}
return $data;
}

View File

@ -212,7 +212,7 @@ class WC_Session_Handler extends WC_Session {
if ( $this->_dirty && $this->has_session() ) {
global $wpdb;
$wpdb->replace( // @codingStandardsIgnoreLine.
$wpdb->replace(
$this->_table,
array(
'session_key' => $this->_customer_id,
@ -309,7 +309,7 @@ class WC_Session_Handler extends WC_Session {
wp_cache_delete( $this->get_cache_prefix() . $customer_id, WC_SESSION_CACHE_GROUP );
$wpdb->delete( // @codingStandardsIgnoreLine.
$wpdb->delete(
$this->_table,
array(
'session_key' => $customer_id,
@ -326,7 +326,6 @@ class WC_Session_Handler extends WC_Session {
public function update_session_timestamp( $customer_id, $timestamp ) {
global $wpdb;
// @codingStandardsIgnoreStart.
$wpdb->update(
$this->_table,
array(
@ -336,9 +335,8 @@ class WC_Session_Handler extends WC_Session {
'session_key' => $customer_id,
),
array(
'%d'
'%d',
)
);
// @codingStandardsIgnoreEnd.
}
}

View File

@ -209,7 +209,6 @@ class WC_Shipping {
/**
* Returns all registered shipping methods for usage.
*
* @access public
* @return array
*/
public function get_shipping_methods() {
@ -222,7 +221,6 @@ class WC_Shipping {
/**
* Get an array of shipping classes.
*
* @access public
* @return array
*/
public function get_shipping_classes() {

View File

@ -150,7 +150,7 @@ class WC_Structured_Data {
*/
public function output_structured_data() {
$types = $this->get_data_type_for_page();
$data = wc_clean( $this->get_structured_data( $types ) );
$data = $this->get_structured_data( $types );
if ( $data ) {
echo '<script type="application/ld+json">' . wp_json_encode( $data ) . '</script>';

View File

@ -409,7 +409,7 @@ class WC_Tax {
}
$matched_tax_rates[ $found_rate->tax_rate_id ] = array(
'rate' => $found_rate->tax_rate,
'rate' => (float) $found_rate->tax_rate,
'label' => $found_rate->tax_rate_name,
'shipping' => $found_rate->tax_rate_shipping ? 'yes' : 'no',
'compound' => $found_rate->tax_rate_compound ? 'yes' : 'no',

View File

@ -212,7 +212,7 @@ class WC_Template_Loader {
private static function unsupported_theme_shop_page_init() {
add_filter( 'the_content', array( __CLASS__, 'unsupported_theme_shop_content_filter' ), 10 );
add_filter( 'the_title', array( __CLASS__, 'unsupported_theme_title_filter' ), 10, 2 );
add_filter( 'comments_number', '__return_empty_string' );
add_filter( 'comments_number', array( __CLASS__, 'unsupported_theme_comments_number_filter' ) );
}
/**
@ -501,6 +501,21 @@ class WC_Template_Loader {
return $content;
}
/**
* Suppress the comments number on the Shop page for unsupported themes since there is no commenting on the Shop page.
*
* @since 3.4.5
* @param string $comments_number The comments number text.
* @return string
*/
public static function unsupported_theme_comments_number_filter( $comments_number ) {
if ( is_page( self::$shop_page_id ) ) {
return '';
}
return $comments_number;
}
/**
* Are we filtering content for unsupported themes?
*

View File

@ -30,7 +30,7 @@ class WC_Validation {
* @return bool
*/
public static function is_phone( $phone ) {
if ( 0 < strlen( trim( preg_replace( '/[\s\#0-9_\-\+\/\(\)]/', '', $phone ) ) ) ) {
if ( 0 < strlen( trim( preg_replace( '/[\s\#0-9_\-\+\/\(\)\.]/', '', $phone ) ) ) ) {
return false;
}

View File

@ -183,14 +183,16 @@ final class WooCommerce {
*/
public function log_errors() {
$error = error_get_last();
if ( E_ERROR === $error['type'] ) {
if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ) ) ) {
$logger = wc_get_logger();
$logger->critical(
$error['message'] . PHP_EOL,
/* translators: 1: error message 2: file name and path 3: line number */
sprintf( __( '%1$s in %2$s on line %3$s', 'woocommerce' ), $error['message'], $error['file'], $error['line'] ) . PHP_EOL,
array(
'source' => 'fatal-errors',
)
);
do_action( 'woocommerce_shutdown_error', $error );
}
}
@ -274,6 +276,7 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/interfaces/class-wc-logger-interface.php';
include_once WC_ABSPATH . 'includes/interfaces/class-wc-log-handler-interface.php';
include_once WC_ABSPATH . 'includes/interfaces/class-wc-webhooks-data-store-interface.php';
include_once WC_ABSPATH . 'includes/interfaces/class-wc-queue-interface.php';
/**
* Abstract classes.
@ -331,6 +334,8 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/class-wc-structured-data.php';
include_once WC_ABSPATH . 'includes/class-wc-shortcodes.php';
include_once WC_ABSPATH . 'includes/class-wc-logger.php';
include_once WC_ABSPATH . 'includes/queue/class-wc-action-queue.php';
include_once WC_ABSPATH . 'includes/queue/class-wc-queue.php';
/**
* Data stores - used to store and retrieve CRUD object data from the database.
@ -368,6 +373,11 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/class-wc-auth.php';
include_once WC_ABSPATH . 'includes/class-wc-register-wp-admin-settings.php';
/**
* Libraries
*/
include_once WC_ABSPATH . 'includes/libraries/action-scheduler/action-scheduler.php';
if ( defined( 'WP_CLI' ) && WP_CLI ) {
include_once WC_ABSPATH . 'includes/class-wc-cli.php';
}
@ -476,8 +486,9 @@ final class WooCommerce {
$this->session = new $session_class();
$this->session->init();
$this->cart = new WC_Cart();
$this->customer = new WC_Customer( get_current_user_id(), true );
// Cart needs the customer info.
$this->cart = new WC_Cart();
// Customer should be saved during shutdown.
add_action( 'shutdown', array( $this->customer, 'save' ), 10 );
@ -649,6 +660,15 @@ final class WooCommerce {
}
}
/**
* Get queue instance.
*
* @return WC_Queue_Interface
*/
public function queue() {
return WC_Queue::instance();
}
/**
* Get Checkout Class.
*

View File

@ -61,12 +61,12 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
apply_filters( 'woocommerce_downloadable_file_permission_format', $format, $data )
);
do_action( 'woocommerce_grant_product_download_access', $data );
if ( $result ) {
$download->set_id( $wpdb->insert_id );
$download->apply_changes();
}
do_action( 'woocommerce_grant_product_download_access', $data );
}
/**

View File

@ -162,7 +162,7 @@ class WC_Customer_Download_Log_Data_Store implements WC_Customer_Download_Log_Da
'user_id' => '',
'user_ip_address' => '',
'orderby' => 'download_log_id',
'order' => 'DESC',
'order' => 'ASC',
'limit' => -1,
'page' => 1,
'return' => 'objects',
@ -185,9 +185,9 @@ class WC_Customer_Download_Log_Data_Store implements WC_Customer_Download_Log_Da
}
$allowed_orders = array( 'download_log_id', 'timestamp', 'permission_id', 'user_id' );
$order = in_array( $args['order'], $allowed_orders, true ) ? $args['order'] : 'download_log_id';
$orderby = 'DESC' === strtoupper( $args['orderby'] ) ? 'DESC' : 'ASC';
$orderby_sql = sanitize_sql_orderby( "{$order} {$orderby}" );
$orderby = in_array( $args['orderby'], $allowed_orders, true ) ? $args['orderby'] : 'download_log_id';
$order = 'DESC' === strtoupper( $args['order'] ) ? 'DESC' : 'ASC';
$orderby_sql = sanitize_sql_orderby( "{$orderby} {$order}" );
$query[] = "ORDER BY {$orderby_sql}";
if ( 0 < $args['limit'] ) {

View File

@ -229,11 +229,26 @@ class WC_Data_Store_WP {
// Build meta queries out of vars that are stored in internal meta keys.
if ( in_array( '_' . $key, $this->internal_meta_keys, true ) ) {
$wp_query_args['meta_query'][] = array(
'key' => '_' . $key,
'value' => $value,
'compare' => is_array( $value ) ? 'IN' : '=',
);
// Check for existing values if wildcard is used.
if ( '*' === $value ) {
$wp_query_args['meta_query'][] = array(
array(
'key' => '_' . $key,
'compare' => 'EXISTS',
),
array(
'key' => '_' . $key,
'value' => '',
'compare' => '!=',
),
);
} else {
$wp_query_args['meta_query'][] = array(
'key' => '_' . $key,
'value' => $value,
'compare' => is_array( $value ) ? 'IN' : '=',
);
}
} else { // Other vars get mapped to wp_query args or just left alone.
$key_mapping = array(
'parent' => 'post_parent',
@ -479,13 +494,17 @@ class WC_Data_Store_WP {
*/
protected function get_search_stopwords() {
// Translators: This is a comma-separated list of very common words that should be excluded from a search, like a, an, and the. These are usually called "stopwords". You should not simply translate these individual words into your language. Instead, look for and provide commonly accepted stopwords in your language.
$stopwords = array_map( 'wc_strtolower', array_map( 'trim', explode(
',', _x(
'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www',
'Comma-separated list of search stopwords in your language',
'woocommerce'
$stopwords = array_map(
'wc_strtolower', array_map(
'trim', explode(
',', _x(
'about,an,are,as,at,be,by,com,for,from,how,in,is,it,of,on,or,that,the,this,to,was,what,when,where,who,will,with,www',
'Comma-separated list of search stopwords in your language',
'woocommerce'
)
)
)
) ) );
);
return apply_filters( 'wp_search_stopwords', $stopwords );
}

View File

@ -37,6 +37,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'_stock',
'_stock_status',
'_backorders',
'_low_stock_amount',
'_sold_individually',
'_weight',
'_length',
@ -333,6 +334,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'stock_quantity' => get_post_meta( $id, '_stock', true ),
'stock_status' => get_post_meta( $id, '_stock_status', true ),
'backorders' => get_post_meta( $id, '_backorders', true ),
'low_stock_amount' => get_post_meta( $id, '_low_stock_amount', true ),
'sold_individually' => get_post_meta( $id, '_sold_individually', true ),
'weight' => get_post_meta( $id, '_weight', true ),
'length' => get_post_meta( $id, '_length', true ),
@ -499,6 +501,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
'_tax_class' => 'tax_class',
'_manage_stock' => 'manage_stock',
'_backorders' => 'backorders',
'_low_stock_amount' => 'low_stock_amount',
'_sold_individually' => 'sold_individually',
'_weight' => 'weight',
'_length' => 'length',
@ -1625,11 +1628,26 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
// Handle SKU.
if ( $manual_queries['sku'] ) {
$wp_query_args['meta_query'][] = array(
'key' => '_sku',
'value' => $manual_queries['sku'],
'compare' => 'LIKE',
);
// Check for existing values if wildcard is used.
if ( '*' === $manual_queries['sku'] ) {
$wp_query_args['meta_query'][] = array(
array(
'key' => '_sku',
'compare' => 'EXISTS',
),
array(
'key' => '_sku',
'value' => '',
'compare' => '!=',
),
);
} else {
$wp_query_args['meta_query'][] = array(
'key' => '_sku',
'value' => $manual_queries['sku'],
'compare' => 'LIKE',
);
}
}
// Handle featured.

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