Merge branch 'master' into fix/14578

# Conflicts:
#	assets/js/frontend/single-product.min.js
This commit is contained in:
Mike Jolley 2017-05-23 15:09:20 +01:00
commit b140f61510
235 changed files with 3874 additions and 2400 deletions

View File

@ -1,5 +1,30 @@
== Changelog ==
= 3.0.5 - 2017-04-28 =
* Fix - Tooltip display within shipping zone modals.
* Fix - Fix missing title for actions column on mobile.
* Fix - Allow forward slash in telephone field.
* Fix - Sort grouped products by menu order when displaying.
* Fix - Fix term exclusion in term count queries.
* Fix - Filter invalid products before returning them for wc_get_products.
* Fix - Prevent orders being their own parent (causes errors).
* Fix - Correctly migrate legacy shipping taxes data.
* Fix - Make sure the meta data cache is not shared among instances.
* Fix - Correct the stock display notice when a variable product manages stock for it's children.
* Fix - On multisite, add user to blog during checkout if not a user to prevent errors.
* Fix - Correct sale price date handling with some timezone setups.
* Fix - wc_attribute_taxonomy_id_by_name needs to use lowercase attribute slug to work.
* Fix - Make changes to the buyer's company name in the shipping section of checkout persist.
* Tweak - Add required placeholder for meta fields in backend.
* Tweak - Don't strtolower address strings on checkout validation messages.
* REST API - Prevent password change notification when creating a customer.
* REST API - Removed duplicated items returned in shipping and checkout endpoints.
* CLI - Fixed missing shipping zones route.
* Dev - Make get_price_html handling match 2.6 and pass all values through woocommerce_get_price_html filter.
* Dev - Legacy customer class missing get_address / get_address_2 functions.
* Dev - Restored filter `woocommerce_checkout_customer_id` during checkout validation.
* Dev - Adds missing `$this` argument for all `woocommerce_payment_complete_order_status` filters.
= 3.0.4 - 2017-04-20 =
* Fix - Variations were not inheriting the product image and shipping class ID.
* Fix - Prevent rating/review counts being duplicated when duplicating products.

View File

@ -284,6 +284,26 @@ module.exports = function( grunt ) {
'!vendor/**' // Exclude vendor/
]
}
},
// Autoprefixer.
postcss: {
options: {
processors: [
require( 'autoprefixer' )({
browsers: [
'> 0.1%',
'ie 8',
'ie 9'
]
})
]
},
dist: {
src: [
'<%= dirs.css %>/*.css'
]
}
}
});
@ -301,6 +321,7 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-phpcs' );
grunt.loadNpmTasks( 'grunt-postcss' );
// Register tasks
grunt.registerTask( 'default', [
@ -318,6 +339,7 @@ module.exports = function( grunt ) {
grunt.registerTask( 'css', [
'sass',
'rtlcss',
'postcss',
'cssmin',
'concat'
]);

View File

@ -9,11 +9,11 @@ If you are not a developer, please use the [WooCommerce plugin page](https://wor
* [WooCommerce Code Reference](https://docs.woocommerce.com/wc-apidocs/)
* [WooCommerce REST API Docs](https://woocommerce.github.io/woocommerce-rest-api-docs/)
## Reporting Security issues
## Reporting Security Issues
To disclose a security issue to our team, [please submit a report via HackerOne here](https://hackerone.com/automattic/).
## Support
This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core WooCommerce issues only. Support can take place in the appropriate channels:
This repository is not suitable for support. Please don't use our issue tracker for support requests, but for core, WooCommerce issues only. Support can take place through the appropriate channels:
* The [WooCommerce premium support portal](https://woocommerce.com/my-account/create-a-ticket/) for customers who have purchased themes or extensions.
* [Our community forum on wp.org](https://wordpress.org/support/plugin/woocommerce) which is available for all WooCommerce users.
@ -21,4 +21,4 @@ This repository is not suitable for support. Please don't use our issue tracker
Support requests in issues on this repository will be closed on sight.
## Contributing to WooCommerce
If you have a patch, or stumbled upon an issue with WooCommerce core, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md) for more information how you can do this.
If you have a patch or have stumbled upon an issue with WooCommerce core, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md) for more information how you can do this.

View File

@ -18,31 +18,32 @@ class WC_HookFinder {
$dir = '';
}
return self::get_files( basename( $pattern ), $flags, $dir . '/' );
return self::get_files( basename( $pattern ), $flags, $dir . '/' );
} // End IF Statement
} // End IF Statement
$paths = glob( $path . '*', GLOB_ONLYDIR | GLOB_NOSORT );
$files = glob( $path . $pattern, $flags );
$paths = glob( $path . '*', GLOB_ONLYDIR | GLOB_NOSORT );
$files = glob( $path . $pattern, $flags );
if ( is_array( $paths ) ) {
foreach ( $paths as $p ) {
$found_files = array();
$retrieved_files = (array) self::get_files( $pattern, $flags, $p . '/' );
foreach ( $retrieved_files as $file ) {
if ( ! in_array( $file, self::$found_files ) )
$found_files[] = $file;
}
if ( is_array( $paths ) ) {
foreach ( $paths as $p ) {
$found_files = array();
$retrieved_files = (array) self::get_files( $pattern, $flags, $p . '/' );
foreach ( $retrieved_files as $file ) {
if ( ! in_array( $file, self::$found_files ) ) {
$found_files[] = $file;
}
}
self::$found_files = array_merge( self::$found_files, $found_files );
self::$found_files = array_merge( self::$found_files, $found_files );
if ( is_array( $files ) && is_array( $found_files ) ) {
$files = array_merge( $files, $found_files );
}
} // End FOREACH Loop
}
return $files;
}
if ( is_array( $files ) && is_array( $found_files ) ) {
$files = array_merge( $files, $found_files );
}
} // End FOREACH Loop
}
return $files;
}
private static function get_hook_link( $hook, $details = array() ) {
if ( ! empty( $details['class'] ) ) {
@ -166,7 +167,7 @@ class WC_HookFinder {
if ( isset( self::$custom_hooks_found[ $hook ] ) ) {
self::$custom_hooks_found[ $hook ]['file'][] = self::$current_file;
} else {
self::$custom_hooks_found[ $hook ] = array(
self::$custom_hooks_found[ $hook ] = array(
'line' => $token[2],
'class' => $current_class,
'function' => $current_function,

View File

@ -1 +1 @@
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message a.button-primary,p.woocommerce-actions a.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 a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.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}.woocommerce-message a.button-primary,p.woocommerce-actions a.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 a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.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}.woocommerce-message a.button-primary,p.woocommerce-actions a.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 a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.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}.woocommerce-message a.button-primary,p.woocommerce-actions a.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 a.button-primary:active,.woocommerce-message a.button-primary:focus,.woocommerce-message a.button-primary:hover,p.woocommerce-actions a.button-primary:active,p.woocommerce-actions a.button-primary:focus,p.woocommerce-actions a.button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message a.button-primary,.woocommerce-message a.button-secondary,p.woocommerce-actions a.button-primary,p.woocommerce-actions a.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

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
body{background:#f1f1f1;box-shadow:none;margin:100px auto 24px;padding:0}#wc-logo{border:0;margin:0 0 24px;padding:0;text-align:center}#wc-logo img{max-width:50%}.wc-auth-content{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);overflow:hidden;padding:24px 24px 0;zoom:1}.wc-auth-content h1,.wc-auth-content h2,.wc-auth-content h3,.wc-auth-content table{border:0;clear:none;color:#666;margin:0 0 24px;padding:0}.wc-auth-content p,.wc-auth-content ul{color:#666;font-size:1em;line-height:1.75em;margin:0 0 24px}.wc-auth-content p{padding:0}.wc-auth-content a{color:#a16696}.wc-auth-content a:focus,.wc-auth-content a:hover{color:#111}.wc-auth-content .wc-auth-login label{color:#999;display:block;margin-bottom:.5em}.wc-auth-content .wc-auth-login input{box-sizing:border-box;font-size:1.3em;padding:.5em;width:100%}.wc-auth-content .wc-auth-login .wc-auth-actions{padding:0}.wc-auth-content .wc-auth-login .wc-auth-actions .wc-auth-login-button{float:none;width:100%}.wc-auth-permissions{list-style:disc inside;padding:0}.wc-auth-permissions li{font-size:1em}.wc-auth-logged-in-as{background:#f5f5f5;border-bottom:2px solid #eee;line-height:70px;margin:0 0 24px;padding:0 0 0 1em}.wc-auth-logged-in-as p{margin:0;line-height:70px}.wc-auth-logged-in-as img{float:right;height:70px;margin:0 0 0 1em}.wc-auth-logged-in-as .wc-auth-logout{float:left}.wc-auth .wc-auth-actions{overflow:hidden;padding-right:24px}.wc-auth .wc-auth-actions .button{background:#f7f7f7;border: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;-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: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;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: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;-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: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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e03d'}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image::before,#adminmenu #menu-posts-product .menu-icon-product div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e006'}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e023';font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}#woocommerce-update p.wc_plugin_upgrade_notice{font-weight:400;color:#fff!important;background:#d54d21!important;padding:1em!important;margin:9px 0!important}#woocommerce-update p.wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}#woocommerce-update p.wc_plugin_upgrade_notice::before{color:#fff!important;content:'\f348';display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 -2px 0 8px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}
@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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e03d'}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image::before,#adminmenu #menu-posts-product .menu-icon-product div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e006'}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e023';font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}#woocommerce-update .updating-message .wc_plugin_upgrade_notice{display:none}#woocommerce-update .wc_plugin_upgrade_notice{font-weight:400;color:#fff!important;background:#d54d21!important;padding:1em!important;margin:9px 0!important}#woocommerce-update .wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}#woocommerce-update .wc_plugin_upgrade_notice::before{color:#fff!important;content:'\f348';display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 -2px 0 8px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}

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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e03d'}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image::before,#adminmenu #menu-posts-product .menu-icon-product div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e006'}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e023';font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}#woocommerce-update p.wc_plugin_upgrade_notice{font-weight:400;color:#fff!important;background:#d54d21!important;padding:1em!important;margin:9px 0!important}#woocommerce-update p.wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}#woocommerce-update p.wc_plugin_upgrade_notice::before{color:#fff!important;content:'\f348';display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 8px 0 -2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}
@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}#adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e03d'}#adminmenu #menu-posts-product .menu-icon-post div.wp-menu-image::before,#adminmenu #menu-posts-product .menu-icon-product div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e006'}#adminmenu #toplevel_page_wc-reports .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce!important;content:'\e023';font-size:1.3em!important}span.mce_woocommerce_shortcodes_button{background-image:none!important;display:block;text-indent:-9999px;position:relative;height:1em;width:1em}span.mce_woocommerce_shortcodes_button::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:.9em;line-height:1.2}#woocommerce-update .updating-message .wc_plugin_upgrade_notice{display:none}#woocommerce-update .wc_plugin_upgrade_notice{font-weight:400;color:#fff!important;background:#d54d21!important;padding:1em!important;margin:9px 0!important}#woocommerce-update .wc_plugin_upgrade_notice a{color:#fff;text-decoration:underline}#woocommerce-update .wc_plugin_upgrade_notice::before{color:#fff!important;content:'\f348';display:inline-block;font:400 18px/1 dashicons;speak:none;margin:0 8px 0 -2px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top}

View File

@ -44,7 +44,12 @@ span.mce_woocommerce_shortcodes_button {
}
#woocommerce-update {
p.wc_plugin_upgrade_notice {
.updating-message {
.wc_plugin_upgrade_notice {
display: none;
}
}
.wc_plugin_upgrade_notice {
font-weight: normal;
color: #fff !important;
background: #d54d21 !important;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

@ -407,18 +407,27 @@ table.variations {
.flex-control-thumbs li {
width: 33.3333%;
}
.flex-control-thumbs li:nth-child(3n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-4 {
.flex-control-thumbs li {
width: 25%;
}
.flex-control-thumbs li:nth-child(4n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-5 {
.flex-control-thumbs li {
width: 20%;
}
.flex-control-thumbs li:nth-child(5n+1) {
clear: left;
}
}
.woocommerce-product-gallery__trigger {
@ -887,6 +896,12 @@ button.pswp__button--zoom:hover {
}
}
.woocommerce-terms-and-conditions {
border: 1px solid rgba(0,0,0,.2);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
background: rgba(0,0,0,.05);
}
.woocommerce-checkout {
.select2-choice,
.select2-choice:hover {
@ -985,12 +1000,21 @@ button.pswp__button--zoom:hover {
}
}
.colors-dark.woocommerce-checkout {
.colors-dark {
.checkout-button {
border: 2px solid #555;
&:hover {
border-color: #fff;
}
}
.wc_payment_method {
.payment_box {
background: #333;
}
}
.select2-container--default {
.select2-results {
.select2-results__options {
@ -1000,6 +1024,7 @@ button.pswp__button--zoom:hover {
color: #333;
}
}
.select2-selection--single {
background-color: #333;
border: 1px solid #555;

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

@ -347,6 +347,18 @@
.woocommerce-shipping-fields {
@include clearfix();
}
.woocommerce-terms-and-conditions {
margin-bottom: 1.618em;
padding: 1.618em;
}
/**
* oEmbeds
*/
.woocommerce-oembed {
position: relative;
}
}
.woocommerce-account {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,10 +39,8 @@ p.demo_store,
}
}
.admin-bar {
p.demo_store {
top: 32px;
}
.admin-bar p.demo_store {
top: 32px;
}
/**
@ -103,11 +101,9 @@ p.demo_store,
}
}
.quantity {
.qty {
width: 3.631em;
text-align: center;
}
.quantity .qty {
width: 3.631em;
text-align: center;
}
/**
@ -252,6 +248,24 @@ p.demo_store,
}
}
.woocommerce-product-gallery--columns-3 {
.flex-control-thumbs li:nth-child(3n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-4 {
.flex-control-thumbs li:nth-child(4n+1) {
clear: left;
}
}
.woocommerce-product-gallery--columns-5 {
.flex-control-thumbs li:nth-child(5n+1) {
clear: left;
}
}
div.summary {
margin-bottom: 2em;
}
@ -435,10 +449,8 @@ p.demo_store,
}
}
.woocommerce-variation-description {
p {
margin-bottom: 1em;
}
.woocommerce-variation-description p {
margin-bottom: 1em;
}
.reset_variations {
@ -518,71 +530,69 @@ p.demo_store,
}
}
ul.products {
li.product {
.onsale {
top: 0;
right: 0;
left: auto;
margin: -0.5em -0.5em 0 0;
}
ul.products li.product {
.onsale {
top: 0;
right: 0;
left: auto;
margin: -0.5em -0.5em 0 0;
}
h3,
.woocommerce-loop-product__title,
.woocommerce-loop-category__title {
padding: 0.5em 0;
margin: 0;
font-size: 1em;
}
h3,
.woocommerce-loop-product__title,
.woocommerce-loop-category__title {
padding: 0.5em 0;
margin: 0;
font-size: 1em;
}
a {
text-decoration: none;
}
a {
text-decoration: none;
}
a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 1em;
box-shadow: none;
}
a img {
width: 100%;
height: auto;
display: block;
margin: 0 0 1em;
box-shadow: none;
}
strong {
strong {
display: block;
}
.star-rating {
font-size: 0.857em;
}
.button {
margin-top: 1em;
}
.price {
color: $highlight;
display: block;
font-weight: normal;
margin-bottom: 0.5em;
font-size: 0.857em;
del {
color: inherit;
opacity: 0.5;
display: block;
}
.star-rating {
font-size: 0.857em;
ins {
background: none;
font-weight: 700;
}
.button {
margin-top: 1em;
}
.price {
color: $highlight;
display: block;
font-weight: normal;
margin-bottom: 0.5em;
font-size: 0.857em;
del {
color: inherit;
opacity: 0.5;
display: block;
}
ins {
background: none;
font-weight: 700;
}
.from {
font-size: 0.67em;
margin: -2px 0 0 0;
text-transform: uppercase;
color: rgba(desaturate($highlight, 75%), 0.5);
}
.from {
font-size: 0.67em;
margin: -2px 0 0 0;
text-transform: uppercase;
color: rgba(desaturate($highlight, 75%), 0.5);
}
}
}
@ -689,13 +699,11 @@ p.demo_store,
}
}
&.added {
&::after {
font-family: 'WooCommerce';
content: '\e017';
margin-left: 0.53em;
vertical-align: bottom;
}
&.added::after {
font-family: 'WooCommerce';
content: '\e017';
margin-left: 0.53em;
vertical-align: bottom;
}
&:hover {
@ -915,44 +923,36 @@ p.demo_store,
}
}
.products {
.star-rating {
display: block;
margin: 0 0 0.5em;
float: none;
}
.products .star-rating {
display: block;
margin: 0 0 0.5em;
float: none;
}
.hreview-aggregate {
.star-rating {
margin: 10px 0 0;
}
.hreview-aggregate .star-rating {
margin: 10px 0 0;
}
#review_form {
#respond {
@include clearfix();
position: static;
margin: 0;
width: auto;
padding: 0;
background: transparent none;
border: 0;
#review_form #respond {
@include clearfix();
position: static;
margin: 0;
width: auto;
padding: 0;
background: transparent none;
border: 0;
p {
margin: 0 0 10px;
}
p {
margin: 0 0 10px;
}
.form-submit {
input {
left: auto;
}
}
.form-submit input {
left: auto;
}
textarea {
box-sizing: border-box;
width: 100%;
}
textarea {
box-sizing: border-box;
width: 100%;
}
}
@ -978,19 +978,13 @@ p.demo_store,
text-indent: 0;
}
&:hover {
~ a::before {
content: '\e021';
}
&:hover ~ a::before {
content: '\e021';
}
}
&:hover {
a {
&::before {
content: '\e020';
}
}
&:hover a::before {
content: '\e020';
}
&.selected {
@ -1004,10 +998,8 @@ p.demo_store,
}
}
a:not( .active ) {
&::before {
content: '\e020';
}
a:not( .active )::before {
content: '\e020';
}
}
}
@ -1074,12 +1066,10 @@ p.demo_store,
}
}
tbody:first-child {
tr:first-child {
th,
td {
border-top: 0;
}
tbody:first-child tr:first-child {
th,
td {
border-top: 0;
}
}
@ -1125,11 +1115,9 @@ p.demo_store,
&:last-child {
text-align: left;
}
.woocommerce-MyAccount-downloads-file {
&::before {
content: '\2193';
display: inline-block;
}
.woocommerce-MyAccount-downloads-file::before {
content: '\2193';
display: inline-block;
}
}
}
@ -1165,7 +1153,6 @@ p.demo_store,
min-width: 80px;
}
/**
* Cart sidebar
*/
@ -1241,17 +1228,15 @@ p.demo_store,
}
}
.cart_list {
li {
padding-left: 2em;
position: relative;
padding-top: 0;
.cart_list li {
padding-left: 2em;
position: relative;
padding-top: 0;
a.remove {
position: absolute;
top: 0;
left: 0;
}
a.remove {
position: absolute;
top: 0;
left: 0;
}
}
@ -1267,101 +1252,99 @@ p.demo_store,
/**
* Forms
*/
form {
.form-row {
padding: 3px;
margin: 0 0 6px;
form .form-row {
padding: 3px;
margin: 0 0 6px;
[placeholder]:focus::-webkit-input-placeholder {
-webkit-transition: opacity 0.5s 0.5s ease;
-moz-transition: opacity 0.5s 0.5s ease;
transition: opacity 0.5s 0.5s ease;
opacity: 0;
}
[placeholder]:focus::-webkit-input-placeholder {
-webkit-transition: opacity 0.5s 0.5s ease;
-moz-transition: opacity 0.5s 0.5s ease;
transition: opacity 0.5s 0.5s ease;
opacity: 0;
}
label {
line-height: 2;
}
label.hidden {
visibility: hidden;
}
label.inline {
display: inline;
}
select {
cursor: pointer;
margin: 0;
}
.required {
color: red;
font-weight: 700;
border: 0;
}
.input-checkbox {
display: inline;
margin: -2px 8px 0 0;
text-align: center;
vertical-align: middle;
}
input.input-text,
textarea {
box-sizing: border-box;
width: 100%;
margin: 0;
outline: 0;
line-height: 1;
}
textarea {
height: 4em;
line-height: 1.5;
display: block;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.select2-container {
width: 100%;
line-height: 2em;
}
&.woocommerce-invalid {
label {
line-height: 2;
color: $red;
}
label.hidden {
visibility: hidden;
}
label.inline {
display: inline;
}
select {
cursor: pointer;
margin: 0;
}
.required {
color: red;
font-weight: 700;
border: 0;
}
.input-checkbox {
display: inline;
margin: -2px 8px 0 0;
text-align: center;
vertical-align: middle;
}
.select2-container,
input.input-text,
textarea {
box-sizing: border-box;
width: 100%;
margin: 0;
outline: 0;
line-height: 1;
select {
border-color: $red;
}
}
textarea {
height: 4em;
line-height: 1.5;
display: block;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
&.woocommerce-validated {
.select2-container,
input.input-text,
select {
border-color: $green - #111;
}
}
.select2-container {
width: 100%;
line-height: 2em;
}
::-webkit-input-placeholder {
line-height: normal;
}
&.woocommerce-invalid {
label {
color: $red;
}
.select2-container,
input.input-text,
select {
border-color: $red;
}
}
:-moz-placeholder {
line-height: normal;
}
&.woocommerce-validated {
.select2-container,
input.input-text,
select {
border-color: $green - #111;
}
}
::-webkit-input-placeholder {
line-height: normal;
}
:-moz-placeholder {
line-height: normal;
}
:-ms-input-placeholder {
line-height: normal;
}
:-ms-input-placeholder {
line-height: normal;
}
}
@ -1442,56 +1425,48 @@ p.demo_store,
/**
* Layered nav widget
*/
.widget_layered_nav {
ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
.widget_layered_nav ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
li {
@include clearfix();
padding: 0 0 1px;
list-style: none;
li {
@include clearfix();
padding: 0 0 1px;
list-style: none;
a,
span {
padding: 1px 0;
}
a,
span {
padding: 1px 0;
}
}
li.chosen {
a {
&::before {
@include iconbefore( '\e013' );
color: $red;
}
}
}
li.chosen a::before {
@include iconbefore( '\e013' );
color: $red;
}
}
.widget_layered_nav_filters {
ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
overflow: hidden;
zoom: 1;
.widget_layered_nav_filters ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
overflow: hidden;
zoom: 1;
li {
float: left;
padding: 0 1px 1px 0;
list-style: none;
li {
float: left;
padding: 0 1px 1px 0;
list-style: none;
a {
text-decoration: none;
a {
text-decoration: none;
&::before {
@include iconbefore( '\e013' );
color: $red;
}
&::before {
@include iconbefore( '\e013' );
color: $red;
}
}
}
@ -1512,9 +1487,6 @@ p.demo_store,
.button {
font-size: 1.15em;
}
.button {
float: left;
}
}
@ -1536,10 +1508,8 @@ p.demo_store,
cursor: ew-resize;
outline: none;
top: -0.3em;
//&:last-child {
/* rtl:ignore */
margin-left: -0.5em;
//}
}
.ui-slider .ui-slider-range {
@ -1579,38 +1549,32 @@ p.demo_store,
/**
* Rating Filter Widget
*/
.widget_rating_filter {
ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
.widget_rating_filter ul {
margin: 0;
padding: 0;
border: 0;
list-style: none outside;
li {
@include clearfix();
padding: 0 0 1px;
list-style: none;
li {
@include clearfix();
padding: 0 0 1px;
list-style: none;
a {
padding: 1px 0;
text-decoration: none;
}
.star-rating {
float: none;
display: inline-block;
}
a {
padding: 1px 0;
text-decoration: none;
}
li.chosen {
a {
&::before {
@include iconbefore( '\e013' );
color: $red;
}
}
.star-rating {
float: none;
display: inline-block;
}
}
li.chosen a::before {
@include iconbefore( '\e013' );
color: $red;
}
}
}
@ -1692,18 +1656,8 @@ button.pswp__button--zoom:hover {
/**
* Right to left styles
*/
.rtl {
&.woocommerce {
div.product {
div.images {
.flex-control-thumbs {
li {
float: right;
}
}
}
}
}
.rtl.woocommerce div.product div.images .flex-control-thumbs li {
float: right;
}
.woocommerce-message {
@ -1740,33 +1694,26 @@ button.pswp__button--zoom:hover {
@include clearfix();
}
.addresses {
.title {
@include clearfix();
.addresses .title {
@include clearfix();
h3 {
float: left;
}
h3 {
float: left;
}
.edit {
float: right;
}
.edit {
float: right;
}
}
ol.commentlist.notes {
li.note {
ol.commentlist.notes li.note {
p.meta {
font-weight: 700;
margin-bottom: 0;
}
p.meta {
font-weight: 700;
margin-bottom: 0;
}
.description {
p:last-child {
margin-bottom: 0;
}
}
.description p:last-child {
margin-bottom: 0;
}
}
ul.digital-downloads {
@ -1810,20 +1757,16 @@ button.pswp__button--zoom:hover {
vertical-align: middle;
}
td.actions {
.coupon {
.input-text {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid darken( $secondary, 10% );
padding: 6px 6px 5px;
margin: 0 4px 0 0;
outline: 0;
line-height: 1;
}
}
td.actions .coupon .input-text {
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid darken( $secondary, 10% );
padding: 6px 6px 5px;
margin: 0 4px 0 0;
outline: 0;
line-height: 1;
}
input {
@ -1854,19 +1797,15 @@ button.pswp__button--zoom:hover {
display: block;
}
.shipping-calculator-button {
&::after {
@include iconafter( '\e019' );
}
.shipping-calculator-button::after {
@include iconafter( '\e019' );
}
}
.cart_totals {
p {
small {
color: $subtext;
font-size: 0.83em;
}
p small {
color: $subtext;
font-size: 0.83em;
}
table {
@ -1912,12 +1851,8 @@ button.pswp__button--zoom:hover {
}
}
.cross-sells {
ul.products {
li.product {
margin-top: 0;
}
}
.cross-sells ul.products li.product {
margin-top: 0;
}
}
.checkout {
@ -2132,6 +2067,12 @@ button.pswp__button--zoom:hover {
}
}
.woocommerce-terms-and-conditions {
border: 1px solid rgba(0,0,0,.2);
box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
background: rgba(0,0,0,.05);
}
/**
* Password strength meter
*/
@ -2170,65 +2111,47 @@ button.pswp__button--zoom:hover {
/**
* Twenty Eleven specific styles
*/
#content.twentyeleven {
.woocommerce-pagination {
a {
font-size: 1em;
line-height: 1;
}
}
#content.twentyeleven .woocommerce-pagination a {
font-size: 1em;
line-height: 1;
}
/**
* Twenty Thirteen specific styles
*/
.single-product {
.twentythirteen {
.entry-summary,
#reply-title,
#respond #commentform {
padding: 0;
}
.single-product .twentythirteen {
.entry-summary,
#reply-title,
#respond #commentform {
padding: 0;
}
p.stars {
clear: both;
}
p.stars {
clear: both;
}
}
.twentythirteen {
.woocommerce-breadcrumb {
padding-top: 40px;
}
.twentythirteen .woocommerce-breadcrumb {
padding-top: 40px;
}
/**
* Twenty Fourteen specific styles
*/
.twentyfourteen {
ul.products {
li.product {
margin-top: 0 !important;
}
}
.twentyfourteen ul.products li.product {
margin-top: 0 !important;
}
/**
* Twenty Sixteen specific styles
*/
body:not( .search-results ) {
.twentysixteen {
.entry-summary {
color: inherit;
font-size: inherit;
line-height: inherit;
}
}
body:not( .search-results ) .twentysixteen .entry-summary {
color: inherit;
font-size: inherit;
line-height: inherit;
}
.twentysixteen {
.price ins {
background: inherit;
color: inherit;
}
.twentysixteen .price ins {
background: inherit;
color: inherit;
}

View File

@ -793,8 +793,8 @@ jQuery( function ( $ ) {
var index = $items.find('tr').length + 1;
var $row = '<tr data-meta_id="0">' +
'<td>' +
'<input type="text" name="meta_key[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']" />' +
'<textarea name="meta_value[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']"></textarea>' +
'<input type="text" placeholder="' + woocommerce_admin_meta_boxes_order.placeholder_name + '" name="meta_key[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']" />' +
'<textarea placeholder="' + woocommerce_admin_meta_boxes_order.placeholder_value + '" name="meta_value[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']"></textarea>' +
'</td>' +
'<td width="1%"><button class="remove_order_item_meta button">&times;</button></td>' +
'</tr>';

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,4 @@
/* global jQuery, woocommerce_admin_system_status */
jQuery( function ( $ ) {
/**
@ -112,4 +113,9 @@ jQuery( function ( $ ) {
};
wcSystemStatus.init();
$( '#log-viewer-select' ).on( 'click', 'h2 a.page-title-action', function( evt ) {
evt.stopImmediatePropagation();
return window.confirm( woocommerce_admin_system_status.delete_log_confirmation );
});
});

View File

@ -1 +1 @@
jQuery(function(a){var b={init:function(){a(document.body).on("click","a.help_tip, a.woocommerce-help-tip",this.preventTipTipClick).on("click","a.debug-report",this.generateReport).on("copy","#copy-for-support",this.copyReport).on("aftercopy","#copy-for-support",this.afterCopyReport)},preventTipTipClick:function(){return!1},generateReport:function(){var b="";a(".wc_status_table thead, .wc_status_table tbody").each(function(){if(a(this).is("thead")){var c=a(this).find("th:eq(0)").data("export-label")||a(this).text();b=b+"\n### "+a.trim(c)+" ###\n\n"}else a("tr",a(this)).each(function(){var c=a(this).find("td:eq(0)").data("export-label")||a(this).find("td:eq(0)").text(),d=a.trim(c).replace(/(<([^>]+)>)/gi,""),e=a(this).find("td:eq(2)").clone();e.find(".private").remove(),e.find(".dashicons-yes").replaceWith("&#10004;"),e.find(".dashicons-no-alt, .dashicons-warning").replaceWith("&#10060;");var f=a.trim(e.text()),g=f.split(", ");if(g.length>1){var h="";a.each(g,function(a,b){h=h+b+"\n"}),f=h}b=b+""+d+": "+f+"\n"})});try{return a("#debug-report").slideDown(),a("#debug-report").find("textarea").val("`"+b+"`").focus().select(),a(this).fadeOut(),!1}catch(a){console.log(a)}return!1},copyReport:function(b){b.clipboardData.clearData(),b.clipboardData.setData("text/plain",a("#debug-report").find("textarea").val()),b.preventDefault()},afterCopyReport:function(b){!0===b.success["text/plain"]?a("#copy-for-support").tipTip({attribute:"data-tip",activation:"focus",fadeIn:50,fadeOut:50,delay:0}).focus():(a(".copy-error").removeClass("hidden"),a("#debug-report").find("textarea").focus().select())}};b.init()});
jQuery(function(a){var b={init:function(){a(document.body).on("click","a.help_tip, a.woocommerce-help-tip",this.preventTipTipClick).on("click","a.debug-report",this.generateReport).on("copy","#copy-for-support",this.copyReport).on("aftercopy","#copy-for-support",this.afterCopyReport)},preventTipTipClick:function(){return!1},generateReport:function(){var b="";a(".wc_status_table thead, .wc_status_table tbody").each(function(){if(a(this).is("thead")){var c=a(this).find("th:eq(0)").data("export-label")||a(this).text();b=b+"\n### "+a.trim(c)+" ###\n\n"}else a("tr",a(this)).each(function(){var c=a(this).find("td:eq(0)").data("export-label")||a(this).find("td:eq(0)").text(),d=a.trim(c).replace(/(<([^>]+)>)/gi,""),e=a(this).find("td:eq(2)").clone();e.find(".private").remove(),e.find(".dashicons-yes").replaceWith("&#10004;"),e.find(".dashicons-no-alt, .dashicons-warning").replaceWith("&#10060;");var f=a.trim(e.text()),g=f.split(", ");if(g.length>1){var h="";a.each(g,function(a,b){h=h+b+"\n"}),f=h}b=b+""+d+": "+f+"\n"})});try{return a("#debug-report").slideDown(),a("#debug-report").find("textarea").val("`"+b+"`").focus().select(),a(this).fadeOut(),!1}catch(a){console.log(a)}return!1},copyReport:function(b){b.clipboardData.clearData(),b.clipboardData.setData("text/plain",a("#debug-report").find("textarea").val()),b.preventDefault()},afterCopyReport:function(b){!0===b.success["text/plain"]?a("#copy-for-support").tipTip({attribute:"data-tip",activation:"focus",fadeIn:50,fadeOut:50,delay:0}).focus():(a(".copy-error").removeClass("hidden"),a("#debug-report").find("textarea").focus().select())}};b.init(),a("#log-viewer-select").on("click","h2 a.page-title-action",function(a){return a.stopImmediatePropagation(),window.confirm(woocommerce_admin_system_status.delete_log_confirmation)})});

View File

@ -3,11 +3,14 @@
/* Modifided script from the simple-page-ordering plugin */
jQuery( function( $ ) {
$( 'table.widefat.wp-list-table tbody th, table.widefat tbody td' ).css( 'cursor', 'move' );
$( 'table.widefat.wp-list-table tr' ).append(
'<td class="column-handle"></td>'
);
$( 'table.widefat.wp-list-table' ).sortable({
items: 'tbody tr:not(.inline-edit-row)',
cursor: 'move',
handle: '.column-handle',
axis: 'y',
forcePlaceholderSize: true,
helper: 'clone',

View File

@ -1 +1 @@
jQuery(function(a){a("table.widefat.wp-list-table tbody th, table.widefat tbody td").css("cursor","move"),a("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(a,b){b.item.hasClass("alternate")||b.item.css("background-color","#ffffff"),b.item.children("td, th").css("border-bottom-width","0"),b.item.css("outline","1px solid #aaa")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td, th").css("border-bottom-width","1px")},update:function(b,c){var d,e,f=c.item.find(".check-column input").val(),g=c.item.find(".parent").html(),h=c.item.prev().find(".check-column input").val(),i=c.item.next().find(".check-column input").val();return void 0!==h&&(d=c.item.prev().find(".parent").html(),d!==g&&(h=void 0)),void 0!==i&&(e=c.item.next().find(".parent").html(),e!==g&&(i=void 0)),void 0===h&&void 0===i||void 0===i&&e===h||void 0!==i&&d===f?void a("table.widefat.wp-list-table").sortable("cancel"):(c.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),a.post(ajaxurl,{action:"woocommerce_term_ordering",id:f,nextid:i,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(a){"children"===a?window.location.reload():c.item.find(".check-column input").show().siblings("img").remove()}),void a("table.widefat tbody tr").each(function(){var a=jQuery("table.widefat tbody tr").index(this);a%2===0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});
jQuery(function(a){a("table.widefat.wp-list-table tr").append('<td class="column-handle"></td>'),a("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",handle:".column-handle",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(a,b){b.item.hasClass("alternate")||b.item.css("background-color","#ffffff"),b.item.children("td, th").css("border-bottom-width","0"),b.item.css("outline","1px solid #aaa")},stop:function(a,b){b.item.removeAttr("style"),b.item.children("td, th").css("border-bottom-width","1px")},update:function(b,c){var d,e,f=c.item.find(".check-column input").val(),g=c.item.find(".parent").html(),h=c.item.prev().find(".check-column input").val(),i=c.item.next().find(".check-column input").val();return void 0!==h&&(d=c.item.prev().find(".parent").html(),d!==g&&(h=void 0)),void 0!==i&&(e=c.item.next().find(".parent").html(),e!==g&&(i=void 0)),void 0===h&&void 0===i||void 0===i&&e===h||void 0!==i&&d===f?void a("table.widefat.wp-list-table").sortable("cancel"):(c.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),a.post(ajaxurl,{action:"woocommerce_term_ordering",id:f,nextid:i,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(a){"children"===a?window.location.reload():c.item.find(".check-column input").show().siblings("img").remove()}),void a("table.widefat tbody tr").each(function(){var a=jQuery("table.widefat tbody tr").index(this);a%2===0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});

View File

@ -15,6 +15,8 @@ jQuery( function ( $ ) {
$( '.js_field-country' ).select2().change( this.change_country );
$( '.js_field-country' ).trigger( 'change', [ true ] );
$( document.body ).on( 'change', 'select.js_field-state', this.change_state );
$( document.body ).on( 'click', 'button.js_copy-billing', this.copy_billing );
},
change_country: function( e, stickValue ) {
@ -75,6 +77,23 @@ jQuery( function ( $ ) {
country = $country.val();
$country.data( 'woocommerce.stickState-' + country, state );
},
copy_billing: function( event ) {
event.preventDefault();
$( '#fieldset-billing' ).find( 'input, select' ).each( function( i, el ) {
// The address keys match up, except for the prefix
var shipName = el.name.replace( /^billing_/, 'shipping_' );
// Swap prefix, then check if there are any elements
var shipEl = $( '[name="' + shipName + '"]' );
// No corresponding shipping field, skip this item
if ( ! shipEl.length ) {
return;
}
// Found a matching shipping element, update the value
shipEl.val( el.value ).trigger( 'change' );
} );
}
};

View File

@ -1 +1 @@
jQuery(function(a){var b={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=a.parseJSON(wc_users_params.countries.replace(/&quot;/g,'"'))),a(".js_field-country").select2().change(this.change_country),a(".js_field-country").trigger("change",[!0]),a(document.body).on("change","select.js_field-state",this.change_state)},change_country:function(c,d){if("undefined"==typeof d&&(d=!1),null!==b.states){var e=a(this),f=e.val(),g=e.parents(".form-table").find(":input.js_field-state"),h=g.parent(),i=g.attr("name"),j=g.attr("id"),k=e.data("woocommerce.stickState-"+f)?e.data("woocommerce.stickState-"+f):g.val();if(d&&e.data("woocommerce.stickState-"+f,k),h.show().find(".select2-container").remove(),a.isEmptyObject(b.states[f]))g.replaceWith('<input type="text" class="js_field-state" name="'+i+'" id="'+j+'" value="'+k+'" />');else{var l=a('<select name="'+i+'" id="'+j+'" class="js_field-state" style="width: 25em;"></select>'),m=b.states[f];l.append(a('<option value="">'+wc_users_params.i18n_select_state_text+"</option>")),a.each(m,function(b){l.append(a('<option value="'+b+'">'+m[b]+"</option>"))}),l.val(k),g.replaceWith(l),l.show().select2().hide().change()}a(document.body).trigger("contry-change.woocommerce",[f,a(this).closest("div")]),a(document.body).trigger("country-change.woocommerce",[f,a(this).closest("div")])}},change_state:function(){var b=a(this),c=b.val(),d=b.parents(".form-table").find(":input.js_field-country"),e=d.val();d.data("woocommerce.stickState-"+e,c)}};b.init()});
jQuery(function(a){var b={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=a.parseJSON(wc_users_params.countries.replace(/&quot;/g,'"'))),a(".js_field-country").select2().change(this.change_country),a(".js_field-country").trigger("change",[!0]),a(document.body).on("change","select.js_field-state",this.change_state),a(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(c,d){if("undefined"==typeof d&&(d=!1),null!==b.states){var e=a(this),f=e.val(),g=e.parents(".form-table").find(":input.js_field-state"),h=g.parent(),i=g.attr("name"),j=g.attr("id"),k=e.data("woocommerce.stickState-"+f)?e.data("woocommerce.stickState-"+f):g.val();if(d&&e.data("woocommerce.stickState-"+f,k),h.show().find(".select2-container").remove(),a.isEmptyObject(b.states[f]))g.replaceWith('<input type="text" class="js_field-state" name="'+i+'" id="'+j+'" value="'+k+'" />');else{var l=a('<select name="'+i+'" id="'+j+'" class="js_field-state" style="width: 25em;"></select>'),m=b.states[f];l.append(a('<option value="">'+wc_users_params.i18n_select_state_text+"</option>")),a.each(m,function(b){l.append(a('<option value="'+b+'">'+m[b]+"</option>"))}),l.val(k),g.replaceWith(l),l.show().select2().hide().change()}a(document.body).trigger("contry-change.woocommerce",[f,a(this).closest("div")]),a(document.body).trigger("country-change.woocommerce",[f,a(this).closest("div")])}},change_state:function(){var b=a(this),c=b.val(),d=b.parents(".form-table").find(":input.js_field-country"),e=d.val();d.data("woocommerce.stickState-"+e,c)},copy_billing:function(b){b.preventDefault(),a("#fieldset-billing").find("input, select").each(function(b,c){var d=c.name.replace(/^billing_/,"shipping_"),e=a('[name="'+d+'"]');e.length&&e.val(c.value).trigger("change")})}};b.init()});

View File

@ -331,7 +331,7 @@ jQuery( function( $ ) {
$( '#terms' ).prop( 'checked', true );
}
// Fill in the payment details if possible
// Fill in the payment details if possible without overwriting data if set.
if ( ! $.isEmptyObject( paymentDetails ) ) {
$( '.payment_box input' ).each( function() {
var ID = $( this ).attr( 'id' );
@ -339,7 +339,7 @@ jQuery( function( $ ) {
if ( ID ) {
if ( $.inArray( $( this ).attr( 'type' ), [ 'checkbox', 'radio' ] ) !== -1 ) {
$( this ).prop( 'checked', paymentDetails[ ID ] ).change();
} else {
} else if ( 0 === $( this ).val().length ) {
$( this ).val( paymentDetails[ ID ] ).change();
}
}
@ -608,7 +608,19 @@ jQuery( function( $ ) {
}
};
var wc_terms_toggle = {
init: function() {
$( document.body ).on( 'click', 'a.woocommerce-terms-and-conditions-link', this.toggle_terms );
},
toggle_terms: function() {
$( '.woocommerce-terms-and-conditions' ).slideToggle();
return false;
}
};
wc_checkout_form.init();
wc_checkout_coupons.init();
wc_checkout_login_form.init();
wc_terms_toggle.init();
});

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,8 @@ jQuery( function( $ ) {
$tabs.find( 'li.reviews_tab a' ).click();
} else if ( url.indexOf( 'comment-page-' ) > 0 || url.indexOf( 'cpage=' ) > 0 ) {
$tabs.find( 'li.reviews_tab a' ).click();
} else if ( hash === '#tab-additional_information' ) {
$tabs.find( 'li.additional_information_tab a' ).click();
} else {
$tabs.find( 'li:first a' ).click();
}
@ -127,8 +129,7 @@ jQuery( function( $ ) {
* Initialize flexSlider.
*/
ProductGallery.prototype.initFlexslider = function() {
var images = this.$images,
$target = this.$target;
var $target = this.$target;
$target.flexslider( {
selector: '.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image',
@ -141,20 +142,6 @@ jQuery( function( $ ) {
animationLoop: wc_single_product_params.flexslider.animationLoop, // Breaks photoswipe pagination if true.
start: function() {
$target.css( 'opacity', 1 );
var largest_height = 0;
images.each( function() {
var height = $( this ).height();
if ( height > largest_height ) {
largest_height = height;
}
} );
images.each( function() {
$( this ).css( 'min-height', largest_height );
} );
}
} );
};
@ -256,14 +243,9 @@ jQuery( function( $ ) {
clicked = this.$target.find( '.flex-active-slide' );
}
var options = {
index: $( clicked ).index(),
shareEl: false,
closeOnScroll: false,
history: false,
hideAnimationDuration: 0,
showAnimationDuration: 0
};
var options = $.extend( {
index: $( clicked ).index()
}, wc_single_product_params.photoswipe_options );
// Initializes and opens PhotoSwipe.
var photoswipe = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options );

File diff suppressed because one or more lines are too long

14
assets/js/jquery-payment/jquery.payment.js Normal file → Executable file
View File

@ -22,13 +22,6 @@ jQuery( function( $ ) {
$.payment.cards = cards = [
{
type: 'visaelectron',
patterns: [4026, 417500, 4405, 4508, 4844, 4913, 4917],
format: defaultFormat,
length: [16],
cvcLength: [3],
luhn: true
}, {
type: 'maestro',
patterns: [5018, 502, 503, 506, 56, 58, 639, 6220, 67],
format: defaultFormat,
@ -49,13 +42,6 @@ jQuery( function( $ ) {
length: [16],
cvcLength: [3],
luhn: true
}, {
type: 'elo',
patterns: [4011, 4312, 4389, 4514, 4573, 4576, 5041, 5066, 5067, 509, 6277, 6362, 6363, 650, 6516, 6550],
format: defaultFormat,
length: [16],
cvcLength: [3],
luhn: true
}, {
type: 'visa',
patterns: [4],

2
assets/js/jquery-payment/jquery.payment.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,8 @@
/*! js-cookie v2.1.4 | MIT */
!function(a){var b=!1;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(c){function d(b,e,f){var g;if("undefined"!=typeof document){if(arguments.length>1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}f.expires=f.expires?f.expires.toUTCString():"";try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(p){}e=c.write?c.write(e,b):encodeURIComponent(e+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(b+""),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape);var i="";for(var j in f)f[j]&&(i+="; "+j,!0!==f[j]&&(i+="="+f[j]));return document.cookie=b+"="+e+i}b||(g={});for(var k=document.cookie?document.cookie.split("; "):[],l=0;l<k.length;l++){var m=k[l].split("="),n=m.slice(1).join("=");'"'===n.charAt(0)&&(n=n.slice(1,-1));try{var o=m[0].replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);if(n=c.read?c.read(n,o):c(n,o)||n.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent),this.json)try{n=JSON.parse(n)}catch(p){}if(b===o){g=n;break}b||(g[o]=n)}catch(p){}}return g}}return d.set=d,d.get=function(a){return d.call(d,a)},d.getJSON=function(){return d.apply({json:!0},[].slice.call(arguments))},d.defaults={},d.remove=function(b,c){d(b,"",a(c,{expires:-1}))},d.withConverter=b,d}return b(function(){})});
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
!function(a){var b=!1;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(c){function d(b,e,f){var g;if("undefined"!=typeof document){if(arguments.length>1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}f.expires=f.expires?f.expires.toUTCString():"";try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(a){}e=c.write?c.write(e,b):encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape);var i="";for(var j in f)f[j]&&(i+="; "+j,f[j]!==!0&&(i+="="+f[j]));return document.cookie=b+"="+e+i}b||(g={});for(var k=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,m=0;m<k.length;m++){var n=k[m].split("="),o=n.slice(1).join("=");'"'===o.charAt(0)&&(o=o.slice(1,-1));try{var p=n[0].replace(l,decodeURIComponent);if(o=c.read?c.read(o,p):c(o,p)||o.replace(l,decodeURIComponent),this.json)try{o=JSON.parse(o)}catch(a){}if(b===p){g=o;break}b||(g[p]=o)}catch(a){}}return g}}return d.set=d,d.get=function(a){return d.call(d,a)},d.getJSON=function(){return d.apply({json:!0},[].slice.call(arguments))},d.defaults={},d.remove=function(b,c){d(b,"",a(c,{expires:-1}))},d.withConverter=b,d}return b(function(){})});

View File

@ -21,7 +21,7 @@ $states['BD'] = array(
'CHI' => __( 'Chittagong', 'woocommerce' ),
'CHU' => __( 'Chuadanga', 'woocommerce' ),
'COM' => __( 'Comilla', 'woocommerce' ),
'COX' => __( 'Cox\'s Bazar', 'woocommerce' ),
'COX' => __( "Cox's Bazar", 'woocommerce' ),
'DHA' => __( 'Dhaka', 'woocommerce' ),
'DIN' => __( 'Dinajpur', 'woocommerce' ),
'FAR' => __( 'Faridpur ', 'woocommerce' ),

22
i18n/states/BO.php Normal file
View File

@ -0,0 +1,22 @@
<?php
/**
* Bolivian states
*
* @author Roman Random
* @category i18n
* @package WooCommerce/i18n
* @version 3.1.0
*/
global $states;
$states['BO'] = array(
'B' => __( 'Chuquisaca', 'woocommerce' ),
'H' => __( 'Beni', 'woocommerce' ),
'C' => __( 'Cochabamba', 'woocommerce' ),
'L' => __( 'La Paz', 'woocommerce' ),
'O' => __( 'Oruro', 'woocommerce' ),
'N' => __( 'Pando', 'woocommerce' ),
'P' => __( 'Potosí', 'woocommerce' ),
'S' => __( 'Santa Cruz', 'woocommerce' ),
'T' => __( 'Tarija', 'woocommerce' ),
);

View File

@ -54,7 +54,7 @@ $states['IT'] = array(
'IM' => __( 'Imperia', 'woocommerce' ),
'IS' => __( 'Isernia', 'woocommerce' ),
'SP' => __( 'La Spezia', 'woocommerce' ),
'AQ' => __( 'L\'Aquila', 'woocommerce' ),
'AQ' => __( "L'Aquila", 'woocommerce' ),
'LT' => __( 'Latina', 'woocommerce' ),
'LE' => __( 'Lecce', 'woocommerce' ),
'LC' => __( 'Lecco', 'woocommerce' ),

View File

@ -12,7 +12,7 @@ global $states;
$states['NP'] = array(
'BAG' => __( 'Bagmati', 'woocommerce' ),
'BHE' => __( 'Bheri', 'woocommerce' ),
'DHA' => __( 'Dhawalagiri', 'woocommerce' ),
'DHA' => __( 'Dhaulagiri', 'woocommerce' ),
'GAN' => __( 'Gandaki', 'woocommerce' ),
'JAN' => __( 'Janakpur', 'woocommerce' ),
'KAR' => __( 'Karnali', 'woocommerce' ),

View File

@ -140,6 +140,7 @@ abstract class WC_Data {
$this->maybe_read_meta_data();
if ( ! empty( $this->meta_data ) ) {
foreach ( $this->meta_data as $array_key => $meta ) {
$this->meta_data[ $array_key ] = clone $meta;
if ( ! empty( $meta->id ) ) {
unset( $this->meta_data[ $array_key ]->id );
}
@ -436,28 +437,23 @@ abstract class WC_Data {
if ( ! $force_read ) {
if ( ! empty( $this->cache_group ) ) {
$cached_meta = wp_cache_get( $cache_key, $this->cache_group );
if ( false !== $cached_meta ) {
$this->meta_data = $cached_meta;
$cache_loaded = true;
}
$cached_meta = wp_cache_get( $cache_key, $this->cache_group );
$cache_loaded = ! empty( $cached_meta );
}
}
if ( ! $cache_loaded ) {
$raw_meta_data = $this->data_store->read_meta( $this );
if ( $raw_meta_data ) {
foreach ( $raw_meta_data as $meta ) {
$this->meta_data[] = (object) array(
'id' => (int) $meta->meta_id,
'key' => $meta->meta_key,
'value' => maybe_unserialize( $meta->meta_value ),
);
}
$raw_meta_data = $cache_loaded ? $cached_meta : $this->data_store->read_meta( $this );
if ( $raw_meta_data ) {
foreach ( $raw_meta_data as $meta ) {
$this->meta_data[] = (object) array(
'id' => (int) $meta->meta_id,
'key' => $meta->meta_key,
'value' => maybe_unserialize( $meta->meta_value ),
);
}
if ( ! empty( $this->cache_group ) ) {
wp_cache_set( $cache_key, $this->meta_data, $this->cache_group );
}
if ( ! $cache_loaded && ! empty( $this->cache_group ) ) {
wp_cache_set( $cache_key, $raw_meta_data, $this->cache_group );
}
}
}

View File

@ -0,0 +1,85 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Abstract WC Object Query Class
*
* Extended by classes to provide a query abstraction layer for safe object searching.
*
* @version 3.1.0
* @package WooCommerce/Abstracts
* @category Abstract Class
* @author Automattic
*/
abstract class WC_Object_Query {
/**
* Stores query data.
* @var array
*/
protected $query_vars = array();
/**
* Create a new query.
* @param array $args Criteria to query on in a format similar to WP_Query.
*/
public function __construct( $args = array() ) {
$this->query_vars = wp_parse_args( $args, $this->get_default_query_vars() );
}
/**
* Get the current query vars.
* @return array
*/
public function get_query_vars() {
return $this->query_vars;
}
/**
* Get the value of a query variable.
* @param string $query_var Query variable to get value for.
* @param mixed $default Default value if query variable is not set.
* @return mixed Query variable value if set, otherwise default.
*/
public function get( $query_var, $default = '' ) {
if ( isset( $this->query_vars[ $query_var ] ) ) {
return $this->query_vars[ $query_var ];
}
return $default;
}
/**
* Set a query variable.
* @param string $query_var Query variable to set.
* @param mixed $value Value to set for query variable.
*/
public function set( $query_var, $value ) {
$this->query_vars[ $query_var ] = $value;
}
/**
* Get the default allowed query vars.
* @return array
*/
protected function get_default_query_vars() {
return array(
'name' => '',
'parent' => '',
'parent_exclude' => '',
'exclude' => '',
'limit' => get_option( 'posts_per_page' ),
'page' => 1,
'offset' => '',
'paginate' => false,
'order' => 'DESC',
'orderby' => 'date',
'return' => 'objects',
);
}
}

View File

@ -472,7 +472,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @throws WC_Data_Exception
*/
public function set_parent_id( $value ) {
if ( $value && ! wc_get_order( $value ) ) {
if ( $value && ( $value === $this->get_id() || ! wc_get_order( $value ) ) ) {
$this->error( 'order_invalid_parent_id', __( 'Invalid parent ID', 'woocommerce' ) );
}
$this->set_prop( 'parent_id', absint( $value ) );
@ -853,7 +853,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $item_id = $item->get_id() ) {
$this->items[ $items_key ][ $item_id ] = $item;
} else {
$this->items[ $items_key ][ 'new:' . sizeof( $this->items[ $items_key ] ) ] = $item;
$this->items[ $items_key ][ 'new:' . $items_key . sizeof( $this->items[ $items_key ] ) ] = $item;
}
}
@ -1024,7 +1024,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$tax_class = $item->get_tax_class();
$tax_status = $item->get_tax_status();
if ( '0' !== $tax_class && 'taxable' === $tax_status ) {
if ( '0' !== $tax_class && 'taxable' === $tax_status && wc_tax_enabled() ) {
$tax_rates = WC_Tax::find_rates( array(
'country' => $args['country'],
'state' => $args['state'],
@ -1043,43 +1043,49 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
} else {
$item->set_taxes( array( 'total' => $taxes ) );
}
$item->save();
} else {
$item->set_taxes( false );
}
$item->save();
}
// Calc taxes for shipping
foreach ( $this->get_shipping_methods() as $item_id => $item ) {
$shipping_tax_class = get_option( 'woocommerce_shipping_tax_class' );
if ( wc_tax_enabled() ) {
$shipping_tax_class = get_option( 'woocommerce_shipping_tax_class' );
// Inherit tax class from items
if ( 'inherit' === $shipping_tax_class ) {
$tax_rates = array();
$tax_classes = array_merge( array( '' ), WC_Tax::get_tax_class_slugs() );
$found_tax_classes = $this->get_items_tax_classes();
// Inherit tax class from items
if ( 'inherit' === $shipping_tax_class ) {
$tax_rates = array();
$tax_classes = array_merge( array( '' ), WC_Tax::get_tax_class_slugs() );
$found_tax_classes = $this->get_items_tax_classes();
foreach ( $tax_classes as $tax_class ) {
if ( in_array( $tax_class, $found_tax_classes ) ) {
$tax_rates = WC_Tax::find_shipping_rates( array(
'country' => $args['country'],
'state' => $args['state'],
'postcode' => $args['postcode'],
'city' => $args['city'],
'tax_class' => $tax_class,
) );
break;
foreach ( $tax_classes as $tax_class ) {
if ( in_array( $tax_class, $found_tax_classes ) ) {
$tax_rates = WC_Tax::find_shipping_rates( array(
'country' => $args['country'],
'state' => $args['state'],
'postcode' => $args['postcode'],
'city' => $args['city'],
'tax_class' => $tax_class,
) );
break;
}
}
} else {
$tax_rates = WC_Tax::find_shipping_rates( array(
'country' => $args['country'],
'state' => $args['state'],
'postcode' => $args['postcode'],
'city' => $args['city'],
'tax_class' => $shipping_tax_class,
) );
}
} else {
$tax_rates = WC_Tax::find_shipping_rates( array(
'country' => $args['country'],
'state' => $args['state'],
'postcode' => $args['postcode'],
'city' => $args['city'],
'tax_class' => $shipping_tax_class,
) );
}
$item->set_taxes( array( 'total' => WC_Tax::calc_tax( $item->get_total(), $tax_rates, false ) ) );
$item->set_taxes( array( 'total' => WC_Tax::calc_tax( $item->get_total(), $tax_rates, false ) ) );
} else {
$item->set_taxes( false );
}
$item->save();
}
$this->update_taxes();
@ -1151,7 +1157,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$cart_subtotal_tax = 0;
$cart_total_tax = 0;
if ( $and_taxes && wc_tax_enabled() ) {
if ( $and_taxes ) {
$this->calculate_taxes();
}
@ -1194,7 +1200,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $inc_tax ) {
$subtotal = ( $item->get_subtotal() + $item->get_subtotal_tax() ) / max( 1, $item->get_quantity() );
} else {
$subtotal = ( $item->get_subtotal() / max( 1, $item->get_quantity() ) );
$subtotal = ( floatval( $item->get_subtotal() ) / max( 1, $item->get_quantity() ) );
}
$subtotal = $round ? number_format( (float) $subtotal, wc_get_price_decimals(), '.', '' ) : $subtotal;
@ -1242,7 +1248,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $inc_tax ) {
$total = ( $item->get_total() + $item->get_total_tax() ) / max( 1, $item->get_quantity() );
} else {
$total = $item->get_total() / max( 1, $item->get_quantity() );
$total = floatval( $item->get_total() ) / max( 1, $item->get_quantity() );
}
$total = $round ? round( $total, wc_get_price_decimals() ) : $total;

View File

@ -1332,7 +1332,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
*
* Backwards compat with downloadable/virtual.
*
* @param string $type Array or string of types
* @param string|array $type Array or string of types
* @return bool
*/
public function is_type( $type ) {
@ -1413,11 +1413,11 @@ class WC_Product extends WC_Abstract_Legacy_Product {
if ( '' !== (string) $this->get_sale_price( $context ) && $this->get_regular_price( $context ) > $this->get_sale_price( $context ) ) {
$on_sale = true;
if ( $this->get_date_on_sale_from( $context ) && $this->get_date_on_sale_from( $context )->getTimestamp() > time() ) {
if ( $this->get_date_on_sale_from( $context ) && $this->get_date_on_sale_from( $context )->getTimestamp() > current_time( 'timestamp', true ) ) {
$on_sale = false;
}
if ( $this->get_date_on_sale_to( $context ) && $this->get_date_on_sale_to( $context )->getTimestamp() < time() ) {
if ( $this->get_date_on_sale_to( $context ) && $this->get_date_on_sale_to( $context )->getTimestamp() < current_time( 'timestamp', true ) ) {
$on_sale = false;
}
} else {
@ -1643,10 +1643,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
*/
public function get_price_html( $deprecated = '' ) {
if ( '' === $this->get_price() ) {
return apply_filters( 'woocommerce_empty_price_html', '', $this );
}
if ( $this->is_on_sale() ) {
$price = apply_filters( 'woocommerce_empty_price_html', '', $this );
} elseif ( $this->is_on_sale() ) {
$price = wc_format_sale_price( wc_get_price_to_display( $this, array( 'price' => $this->get_regular_price() ) ), wc_get_price_to_display( $this ) ) . $this->get_price_suffix();
} else {
$price = wc_price( wc_get_price_to_display( $this ) ) . $this->get_price_suffix();

View File

@ -58,18 +58,33 @@ class WC_Admin_API_Keys {
* Table list output.
*/
private static function table_list_output() {
global $wpdb;
echo '<h2>' . __( 'Keys/Apps', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . __( 'Add key', 'woocommerce' ) . '</a></h2>';
$keys_table_list = new WC_Admin_API_Keys_Table_List();
$keys_table_list->prepare_items();
// Get the API keys count
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1;" );
echo '<input type="hidden" name="page" value="wc-settings" />';
echo '<input type="hidden" name="tab" value="api" />';
echo '<input type="hidden" name="section" value="keys" />';
if ( absint( $count ) && $count > 0 ) {
$keys_table_list = new WC_Admin_API_Keys_Table_List();
$keys_table_list->prepare_items();
$keys_table_list->views();
$keys_table_list->search_box( __( 'Search key', 'woocommerce' ), 'key' );
$keys_table_list->display();
echo '<input type="hidden" name="page" value="wc-settings" />';
echo '<input type="hidden" name="tab" value="api" />';
echo '<input type="hidden" name="section" value="keys" />';
$keys_table_list->views();
$keys_table_list->search_box( __( 'Search key', 'woocommerce' ), 'key' );
$keys_table_list->display();
} else {
echo '<div class="woocommerce-BlankState woocommerce-BlankState--api">';
?>
<h2 class="woocommerce-BlankState-message"><?php _e( 'The WooCommerce REST API allows external apps to view and manage store data. Access is granted only to those with valid API keys.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ); ?>"><?php _e( 'Create an API key', 'woocommerce' ); ?></a>
<?php echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; } </style></div>';
}
}
/**

View File

@ -222,6 +222,8 @@ class WC_Admin_Assets {
'i18n_select_state_text' => esc_attr__( 'Select an option&hellip;', 'woocommerce' ),
'default_country' => isset( $default_location['country'] ) ? $default_location['country'] : '',
'default_state' => isset( $default_location['state'] ) ? $default_location['state'] : '',
'placeholder_name' => esc_attr__( 'Name (required)', 'woocommerce' ),
'placeholder_value' => esc_attr__( 'Value (required)', 'woocommerce' ),
) );
}
if ( in_array( $screen_id, array( 'shop_coupon', 'edit-shop_coupon' ) ) ) {
@ -231,13 +233,12 @@ class WC_Admin_Assets {
$post_id = isset( $post->ID ) ? $post->ID : '';
$currency = '';
if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) ) {
$order = wc_get_order( $post_id );
if ( $post_id && in_array( get_post_type( $post_id ), wc_get_order_types( 'order-meta-boxes' ) ) && ( $order = wc_get_order( $post_id ) ) ) {
$currency = $order->get_currency();
}
$params = array(
'remove_item_notice' => __( 'Are you sure you want to remove the selected items? If you have previously reduced this item\'s stock, or this order was submitted by a customer, you will need to manually restore the item\'s stock.', 'woocommerce' ),
'remove_item_notice' => __( "Are you sure you want to remove the selected items? If you have previously reduced this item's stock, or this order was submitted by a customer, you will need to manually restore the item's stock.", 'woocommerce' ),
'i18n_select_items' => __( 'Please select some items.', 'woocommerce' ),
'i18n_do_refund' => __( 'Are you sure you wish to process this refund? This action cannot be undone.', 'woocommerce' ),
'i18n_delete_refund' => __( 'Are you sure you wish to delete this refund? This action cannot be undone.', 'woocommerce' ),
@ -254,8 +255,8 @@ class WC_Admin_Assets {
'new_attribute_prompt' => __( 'Enter a name for the new attribute term:', 'woocommerce' ),
'calc_totals' => __( 'Recalculate totals? This will calculate taxes based on the customers country (or the store base country) and update totals.', 'woocommerce' ),
'copy_billing' => __( 'Copy billing information to shipping information? This will remove any currently entered shipping information.', 'woocommerce' ),
'load_billing' => __( 'Load the customer\'s billing information? This will remove any currently entered billing information.', 'woocommerce' ),
'load_shipping' => __( 'Load the customer\'s shipping information? This will remove any currently entered shipping information.', 'woocommerce' ),
'load_billing' => __( "Load the customer's billing information? This will remove any currently entered billing information.", 'woocommerce' ),
'load_shipping' => __( "Load the customer's shipping information? This will remove any currently entered shipping information.", 'woocommerce' ),
'featured_label' => __( 'Featured', 'woocommerce' ),
'prices_include_tax' => esc_attr( get_option( 'woocommerce_prices_include_tax' ) ),
'tax_based_on' => esc_attr( get_option( 'woocommerce_tax_based_on' ) ),
@ -345,6 +346,13 @@ class WC_Admin_Assets {
if ( $wc_screen_id . '_page_wc-status' === $screen_id ) {
wp_register_script( 'wc-admin-system-status', WC()->plugin_url() . '/assets/js/admin/system-status' . $suffix . '.js', array( 'zeroclipboard' ), WC_VERSION );
wp_enqueue_script( 'wc-admin-system-status' );
wp_localize_script(
'wc-admin-system-status',
'woocommerce_admin_system_status',
array(
'delete_log_confirmation' => esc_js( __( 'Are you sure you want to delete this log?', 'woocommerce' ) ),
)
);
}
if ( in_array( $screen_id, array( 'user-edit', 'profile' ) ) ) {
@ -368,7 +376,9 @@ class WC_Admin_Assets {
*/
public function product_taxonomy_styles() {
if ( ! current_user_can( 'manage_woocommerce' ) ) return;
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return;
}
?>
<style type="text/css">
<?php if ( isset( $_GET['taxonomy'] ) && 'product_cat' === $_GET['taxonomy'] ) : ?>

View File

@ -246,10 +246,8 @@ class WC_Admin_Dashboard {
*/
public function recent_reviews() {
global $wpdb;
$comments = $wpdb->get_results( "
SELECT posts.ID, posts.post_title, comments.comment_author, comments.comment_ID, SUBSTRING(comments.comment_content,1,100) AS comment_excerpt
FROM $wpdb->comments comments
LEFT JOIN $wpdb->posts posts ON (comments.comment_post_ID = posts.ID)
$query_from = apply_filters( 'woocommerce_report_recent_reviews_query_from', "FROM {$wpdb->comments} comments
LEFT JOIN {$wpdb->posts} posts ON (comments.comment_post_ID = posts.ID)
WHERE comments.comment_approved = '1'
AND comments.comment_type = ''
AND posts.post_password = ''
@ -257,6 +255,10 @@ class WC_Admin_Dashboard {
ORDER BY comments.comment_date_gmt DESC
LIMIT 5
" );
$comments = $wpdb->get_results( "
SELECT posts.ID, posts.post_title, comments.comment_author, comments.comment_ID, SUBSTRING(comments.comment_content,1,100) AS comment_excerpt
{$query_from};
" );
if ( $comments ) {
echo '<ul>';

View File

@ -117,10 +117,6 @@ class WC_Admin_Help {
'title' => __( 'API Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?',
),
'wc-settings-api' => array(
'title' => __( 'API Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?',
),
'product' => array(
'title' => __( 'Creating Products', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/fw0477t6wr.jsonp?',

View File

@ -311,7 +311,7 @@ class WC_Admin_Log_Table_List extends WP_List_Table {
$order = 'DESC';
}
return "ORDER BY {$by} {$order}";
return "ORDER BY {$by} {$order}, log_id {$order}";
}
/**

View File

@ -94,7 +94,7 @@ class WC_Admin_Menus {
* Add menu item.
*/
public function status_menu() {
add_submenu_page( 'woocommerce', __( 'WooCommerce status', 'woocommerce' ), __( 'System status', 'woocommerce' ) , 'manage_woocommerce', 'wc-status', array( $this, 'status_page' ) );
add_submenu_page( 'woocommerce', __( 'WooCommerce status', 'woocommerce' ), __( 'Status', 'woocommerce' ) , 'manage_woocommerce', 'wc-status', array( $this, 'status_page' ) );
}
/**

View File

@ -283,8 +283,6 @@ class WC_Admin_Notices {
*/
public static function no_shipping_methods_notice() {
if ( wc_shipping_enabled() && ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) ) {
global $wpdb;
$product_count = wp_count_posts( 'product' );
$method_count = wc_get_shipping_method_count();

View File

@ -138,7 +138,7 @@ class WC_Admin_Pointers {
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Prices', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Next you\'ll need to give your product a price.', 'woocommerce' ) . '</p>',
'<p>' . esc_html__( 'Next you need to give your product a price.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle',
@ -166,7 +166,7 @@ class WC_Admin_Pointers {
'next' => 'product_tag',
'options' => array(
'content' => '<h3>' . esc_html__( 'Product images', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Upload or assign an image to your product here. This image will be shown in your store\'s catalog.', 'woocommerce' ) . '</p>',
'<p>' . esc_html__( "Upload or assign an image to your product here. This image will be shown in your store's catalog.", 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle',

View File

@ -93,6 +93,13 @@ class WC_Admin_Profile {
'shipping' => array(
'title' => __( 'Customer shipping address', 'woocommerce' ),
'fields' => array(
'copy_billing' => array(
'label' => __( 'Copy from billing address', 'woocommerce' ),
'description' => '',
'class' => 'js_copy-billing',
'type' => 'button',
'text' => __( 'Copy', 'woocommerce' ),
),
'shipping_first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'description' => '',
@ -151,10 +158,10 @@ class WC_Admin_Profile {
$show_fields = $this->get_customer_meta_fields();
foreach ( $show_fields as $fieldset ) :
foreach ( $show_fields as $fieldset_key => $fieldset ) :
?>
<h2><?php echo $fieldset['title']; ?></h2>
<table class="form-table">
<table class="form-table" id="<?php echo esc_attr( 'fieldset-' . $fieldset_key ); ?>">
<?php
foreach ( $fieldset['fields'] as $key => $field ) :
?>
@ -162,7 +169,7 @@ class WC_Admin_Profile {
<th><label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ); ?></label></th>
<td>
<?php if ( ! empty( $field['type'] ) && 'select' === $field['type'] ) : ?>
<select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? $field['class'] : '' ); ?>" style="width: 25em;">
<select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" class="<?php echo esc_attr( $field['class'] ); ?>" style="width: 25em;">
<?php
$selected = esc_attr( get_user_meta( $user->ID, $key, true ) );
foreach ( $field['options'] as $option_key => $option_value ) : ?>
@ -170,9 +177,11 @@ class WC_Admin_Profile {
<?php endforeach; ?>
</select>
<?php elseif ( ! empty( $field['type'] ) && 'checkbox' === $field['type'] ) : ?>
<input type="checkbox" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="1" class="<?php echo ( ! empty( $field['class'] ) ? $field['class'] : '' ); ?>" <?php checked( (int) get_user_meta( $user->ID, $key, true ), 1, true ); ?> />
<input type="checkbox" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="1" class="<?php echo esc_attr( $field['class'] ); ?>" <?php checked( (int) get_user_meta( $user->ID, $key, true ), 1, true ); ?> />
<?php elseif ( ! empty( $field['type'] ) && 'button' === $field['type'] ) : ?>
<button id="<?php echo esc_attr( $key ); ?>" class="button <?php echo esc_attr( $field['class'] ); ?>"><?php echo esc_html( $field['text'] ); ?></button>
<?php else : ?>
<input type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( get_user_meta( $user->ID, $key, true ) ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? $field['class'] : 'regular-text' ); ?>" />
<input type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>" />
<?php endif; ?>
<br/>
<span class="description"><?php echo wp_kses_post( $field['description'] ); ?></span>
@ -206,6 +215,27 @@ class WC_Admin_Profile {
}
}
}
/**
* Get user meta for a given key, with fallbacks to core user info for pre-existing fields.
*
* @since 3.1.0
* @param int $user_id User ID of the user being edited
* @param string $key Key for user meta field
* @return string
*/
protected function get_user_meta( $user_id, $key ) {
$value = get_user_meta( $user_id, $key, true );
$existing_fields = array( 'billing_first_name', 'billing_last_name' );
if ( ! $value && in_array( $key, $existing_fields ) ) {
$value = get_user_meta( $user_id, str_replace( 'billing_', '', $key ), true );
} elseif ( ! $value && ( 'billing_email' === $key ) ) {
$user = get_userdata( $user_id );
$value = $user->user_email;
}
return $value;
}
}
endif;

View File

@ -159,8 +159,9 @@ class WC_Admin_Reports {
include_once( apply_filters( 'wc_admin_reports_path', 'reports/class-wc-report-' . $name . '.php', $name, $class ) );
if ( ! class_exists( $class ) )
if ( ! class_exists( $class ) ) {
return;
}
$report = new $class();
$report->output_report();

View File

@ -227,7 +227,7 @@ class WC_Admin_Setup_Wizard {
<p><?php _e( 'Thank you for choosing WooCommerce to power your online store! This quick setup wizard will help you configure the basic settings. <strong>Its completely optional and shouldnt take longer than five minutes.</strong>', 'woocommerce' ); ?></p>
<p><?php esc_html_e( 'No time right now? If you dont want to go through the wizard, you can skip and return to the WordPress dashboard. Come back anytime if you change your mind!', 'woocommerce' ); ?></p>
<p class="wc-setup-actions step">
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button-primary button button-large button-next"><?php esc_html_e( 'Let\'s go!', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( $this->get_next_step_link() ); ?>" class="button-primary button button-large button-next"><?php esc_html_e( "Let's go!", 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( admin_url() ); ?>" class="button button-large"><?php esc_html_e( 'Not right now', 'woocommerce' ); ?></a>
</p>
<?php
@ -526,12 +526,30 @@ class WC_Admin_Setup_Wizard {
public function wc_setup_shipping_taxes_save() {
check_admin_referer( 'wc-setup' );
$enable_shipping = isset( $_POST['woocommerce_calc_shipping'] );
$enable_taxes = isset( $_POST['woocommerce_calc_taxes'] );
$enable_shipping = isset( $_POST['woocommerce_calc_shipping'] );
$enable_taxes = isset( $_POST['woocommerce_calc_taxes'] );
$current_shipping = get_option( 'woocommerce_ship_to_countries' );
if ( $enable_shipping ) {
update_option( 'woocommerce_ship_to_countries', '' );
WC_Admin_Notices::add_notice( 'no_shipping_methods' );
/*
* If this is the initial shipping setup, create a shipping
* zone containing the country the store is located in, with
* a "free shipping" method preconfigured.
*/
if ( false === $current_shipping ) {
$default_country = get_option( 'woocommerce_default_country' );
$location = wc_format_country_state_string( $default_country );
$zone = new WC_Shipping_Zone( null );
$zone->set_zone_order( 0 );
$zone->add_location( $location['country'], 'country' );
$zone->set_zone_name( $zone->get_formatted_location() );
$zone->add_shipping_method( 'free_shipping' );
$zone->save();
}
} else {
update_option( 'woocommerce_ship_to_countries', 'disabled' );
}
@ -587,14 +605,14 @@ class WC_Admin_Setup_Wizard {
'paypal-braintree' => array(
'name' => __( 'PayPal by Braintree', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/paypal-braintree.png',
'description' => sprintf( __( 'Safe and secure payments using credit cards or your customer\'s PayPal account. <a href="%s" target="_blank">Learn more about PayPal</a>.', 'woocommerce' ), 'https://wordpress.org/plugins/woocommerce-gateway-paypal-powered-by-braintree/' ),
'description' => __( "Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce' ) . ' <a href="https://wordpress.org/plugins/woocommerce-gateway-paypal-powered-by-braintree/" target="_blank">' . __( 'Learn more about PayPal', 'woocommerce' ) . '</a>',
'class' => 'featured featured-row-last',
'repo-slug' => 'woocommerce-gateway-paypal-powered-by-braintree',
),
'paypal-ec' => array(
'name' => __( 'PayPal Express Checkout', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/paypal.png',
'description' => sprintf( __( 'Safe and secure payments using credit cards or your customer\'s PayPal account. <a href="%s" target="_blank">Learn more about PayPal</a>.', 'woocommerce' ), 'https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/' ),
'description' => __( "Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce' ) . ' <a href="https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/" target="_blank">' . __( 'Learn more about PayPal', 'woocommerce' ) . '</a>',
'class' => 'featured featured-row-last',
'repo-slug' => 'woocommerce-gateway-paypal-express-checkout',
),

View File

@ -35,8 +35,6 @@ class WC_Admin_Status {
* Handles output of tools.
*/
public static function status_tools() {
global $wpdb;
$tools = self::get_tools();
if ( ! empty( $_GET['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) ) {
@ -153,8 +151,9 @@ class WC_Admin_Status {
$file_data = str_replace( "\r", "\n", $file_data );
$version = '';
if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] )
if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) {
$version = _cleanup_header_comment( $match[1] );
}
return $version ;
}

View File

@ -203,7 +203,7 @@ class WC_Admin_Webhooks {
}
if ( ! current_user_can( 'publish_shop_webhooks' ) ) {
wp_die( __( 'You don\'t have permissions to create Webhooks!', 'woocommerce' ) );
wp_die( __( 'You do not have permissions to create Webhooks!', 'woocommerce' ) );
}
$webhook_id = wp_insert_post( array(
@ -288,7 +288,7 @@ class WC_Admin_Webhooks {
}
if ( ! current_user_can( 'edit_shop_webhooks' ) ) {
wp_die( __( 'You don\'t have permissions to edit Webhooks!', 'woocommerce' ) );
wp_die( __( 'You do not have permissions to edit Webhooks!', 'woocommerce' ) );
}
$webhooks = array_map( 'absint', (array) $_GET['webhook'] );
@ -317,7 +317,7 @@ class WC_Admin_Webhooks {
}
if ( ! current_user_can( 'delete_shop_webhooks' ) ) {
wp_die( __( 'You don\'t have permissions to delete Webhooks!', 'woocommerce' ) );
wp_die( __( 'You do not have permissions to delete Webhooks!', 'woocommerce' ) );
}
$webhooks = get_posts( array(
@ -430,16 +430,28 @@ class WC_Admin_Webhooks {
private static function table_list_output() {
echo '<h2>' . __( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( wp_nonce_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&create-webhook=1' ), 'create-webhook' ) ) . '" class="add-new-h2">' . __( 'Add webhook', 'woocommerce' ) . '</a></h2>';
$webhooks_table_list = new WC_Admin_Webhooks_Table_List();
$webhooks_table_list->prepare_items();
// Get the webhooks count
$count = array_sum( (array) wp_count_posts( 'shop_webhook', 'readable' ) );
echo '<input type="hidden" name="page" value="wc-settings" />';
echo '<input type="hidden" name="tab" value="api" />';
echo '<input type="hidden" name="section" value="webhooks" />';
if ( absint( $count ) && $count > 0 ) {
$webhooks_table_list = new WC_Admin_Webhooks_Table_List();
$webhooks_table_list->prepare_items();
$webhooks_table_list->views();
$webhooks_table_list->search_box( __( 'Search webhooks', 'woocommerce' ), 'webhook' );
$webhooks_table_list->display();
echo '<input type="hidden" name="page" value="wc-settings" />';
echo '<input type="hidden" name="tab" value="api" />';
echo '<input type="hidden" name="section" value="webhooks" />';
$webhooks_table_list->views();
$webhooks_table_list->search_box( __( 'Search webhooks', 'woocommerce' ), 'webhook' );
$webhooks_table_list->display();
} else {
echo '<div class="woocommerce-BlankState woocommerce-BlankState--webhooks">';
?>
<h2 class="woocommerce-BlankState-message"><?php _e( 'Webhooks are event notifications sent to URLs of your choice. They can be used to integrate with third-party services which support them.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&create-webhook=1' ), 'create-webhook' ) ); ?>"><?php _e( 'Create a new webhook', 'woocommerce' ); ?></a>
<?php echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; } </style></div>';
}
}
/**

View File

@ -192,8 +192,10 @@ class WC_Meta_Box_Coupon_Data {
$category_ids = $coupon->get_product_categories();
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
if ( $categories ) foreach ( $categories as $cat ) {
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
if ( $categories ) {
foreach ( $categories as $cat ) {
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
}
}
?>
</select> <?php echo wc_help_tip( __( 'A product must be in this category for the coupon to remain valid or, for "Product Discounts", products in these categories will be discounted.', 'woocommerce' ) ); ?></p>
@ -207,8 +209,10 @@ class WC_Meta_Box_Coupon_Data {
$category_ids = $coupon->get_excluded_product_categories();
$categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0' );
if ( $categories ) foreach ( $categories as $cat ) {
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
if ( $categories ) {
foreach ( $categories as $cat ) {
echo '<option value="' . esc_attr( $cat->term_id ) . '"' . selected( in_array( $cat->term_id, $category_ids ), true, false ) . '>' . esc_html( $cat->name ) . '</option>';
}
}
?>
</select> <?php echo wc_help_tip( __( 'Product must not be in this category for the coupon to remain valid or, for "Product Discounts", products in these categories will not be discounted.', 'woocommerce' ) ); ?></p>
@ -221,7 +225,7 @@ class WC_Meta_Box_Coupon_Data {
'id' => 'customer_email',
'label' => __( 'Email restrictions', 'woocommerce' ),
'placeholder' => __( 'No restrictions', 'woocommerce' ),
'description' => __( 'List of allowed emails to check against the customer\'s billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ),
'description' => __( 'List of allowed emails to check against the customer billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ),
'value' => implode( ', ', (array) get_post_meta( $post->ID, 'customer_email', true ) ),
'desc_tip' => true,
'type' => 'email',
@ -306,8 +310,6 @@ class WC_Meta_Box_Coupon_Data {
* @param WP_Post $post
*/
public static function save( $post_id, $post ) {
global $wpdb;
// Check for dupe coupons
$coupon_code = wc_format_coupon_code( $post->post_title );
$id_from_code = wc_get_coupon_id_by_code( $coupon_code, $post_id );

View File

@ -31,8 +31,6 @@ class WC_Meta_Box_Order_Actions {
if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $post->ID );
}
$order_type_object = get_post_type_object( $post->post_type );
?>
<ul class="order_actions submitbox">
@ -83,7 +81,7 @@ class WC_Meta_Box_Order_Actions {
}
?></div>
<input type="submit" class="button save_order button-primary tips" name="save" value="<?php printf( __( 'Save %s', 'woocommerce' ), strtolower( $order_type_object->labels->singular_name ) ); ?>" data-tip="<?php printf( __( 'Save/update the %s', 'woocommerce' ), strtolower( $order_type_object->labels->singular_name ) ); ?>" />
<input type="submit" class="button save_order button-primary" name="save" value="<?php echo 'auto-draft' === $post->post_status ? esc_attr__( 'Create', 'woocommerce' ) : esc_attr__( 'Update', 'woocommerce' ); ?>" />
</li>
<?php do_action( 'woocommerce_order_actions_end', $post->ID ); ?>
@ -99,8 +97,6 @@ class WC_Meta_Box_Order_Actions {
* @param WP_Post $post
*/
public static function save( $post_id, $post ) {
global $wpdb;
// Order data saved, now get it so we can manipulate status
$order = wc_get_order( $post_id );

View File

@ -427,7 +427,7 @@ class WC_Meta_Box_Order_Data {
if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' == get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) {
?>
<p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer provided note', 'woocommerce' ) ?>:</label>
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php esc_attr_e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php esc_attr_e( 'Customer notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
<?php
}
@ -449,8 +449,6 @@ class WC_Meta_Box_Order_Data {
* @param int $order_id Order ID.
*/
public static function save( $order_id ) {
global $wpdb;
self::init_address_fields();
// Ensure gateways are loaded in case they need to insert data into the emails.
@ -467,7 +465,7 @@ class WC_Meta_Box_Order_Data {
}
// Update customer.
$customer_id = absint( $_POST['customer_user'] );
$customer_id = isset( $_POST['customer_user'] ) ? absint( $_POST['customer_user'] ) : 0;
if ( $customer_id !== $order->get_customer_id() ) {
$props['customer_id'] = $customer_id;
}

View File

@ -23,7 +23,6 @@ class WC_Meta_Box_Order_Downloads {
* @param WP_Post $post
*/
public static function output( $post ) {
global $post, $wpdb;
?>
<div class="order_download_permissions wc-metaboxes-wrapper">

View File

@ -25,7 +25,7 @@ class WC_Meta_Box_Product_Data {
* @param WP_Post $post
*/
public static function output( $post ) {
global $post, $thepostid, $product_object;
global $thepostid, $product_object;
$thepostid = $post->ID;
$product_object = $thepostid ? wc_get_product( $thepostid ) : new WC_Product;
@ -57,7 +57,7 @@ class WC_Meta_Box_Product_Data {
'id' => '_virtual',
'wrapper_class' => 'show_if_simple',
'label' => __( 'Virtual', 'woocommerce' ),
'description' => __( 'Virtual products are intangible and aren\'t shipped.', 'woocommerce' ),
'description' => __( 'Virtual products are intangible and are not shipped.', 'woocommerce' ),
'default' => 'no',
),
'downloadable' => array(
@ -225,9 +225,14 @@ class WC_Meta_Box_Product_Data {
if ( empty( $attribute_names[ $i ] ) || ! isset( $attribute_values[ $i ] ) ) {
continue;
}
$attribute_id = 0;
$attribute_name = wc_clean( $attribute_names[ $i ] );
$attribute_id = wc_attribute_taxonomy_id_by_name( $attribute_name );
$options = isset( $attribute_values[ $i ] ) ? $attribute_values[ $i ] : '';
if ( 'pa_' === substr( $attribute_name, 0, 3 ) ) {
$attribute_id = wc_attribute_taxonomy_id_by_name( $attribute_name );
}
$options = isset( $attribute_values[ $i ] ) ? $attribute_values[ $i ] : '';
if ( is_array( $options ) ) {
// Term ids sent as array.
@ -316,9 +321,9 @@ class WC_Meta_Box_Product_Data {
'date_on_sale_from' => wc_clean( $_POST['_sale_price_dates_from'] ),
'date_on_sale_to' => wc_clean( $_POST['_sale_price_dates_to'] ),
'manage_stock' => ! empty( $_POST['_manage_stock'] ),
'backorders' => wc_clean( $_POST['_backorders'] ),
'backorders' => isset( $_POST['_backorders'] ) ? wc_clean( $_POST['_backorders'] ) : null,
'stock_status' => wc_clean( $_POST['_stock_status'] ),
'stock_quantity' => wc_stock_amount( $_POST['_stock'] ),
'stock_quantity' => isset( $_POST['_stock'] ) ? wc_stock_amount( $_POST['_stock'] ) : null,
'download_limit' => '' === $_POST['_download_limit'] ? '' : absint( $_POST['_download_limit'] ),
'download_expiry' => '' === $_POST['_download_expiry'] ? '' : absint( $_POST['_download_expiry'] ),
'downloads' => self::prepare_downloads(
@ -393,8 +398,8 @@ class WC_Meta_Box_Product_Data {
isset( $_POST['_wc_variation_file_hashes'][ $variation_id ] ) ? $_POST['_wc_variation_file_hashes'][ $variation_id ] : array()
),
'manage_stock' => isset( $_POST['variable_manage_stock'][ $i ] ),
'stock_quantity' => wc_clean( $_POST['variable_stock'][ $i ] ),
'backorders' => wc_clean( $_POST['variable_backorders'][ $i ] ),
'stock_quantity' => isset( $_POST['variable_stock'][ $i ] ) ? wc_clean( $_POST['variable_stock'][ $i ] ) : null,
'backorders' => isset( $_POST['variable_backorders'][ $i ] ) ? wc_clean( $_POST['variable_backorders'][ $i ] ) : null,
'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 ),

View File

@ -38,8 +38,9 @@ class WC_Meta_Box_Product_Reviews {
*/
public static function save( $location, $comment_id ) {
// Not allowed, return regular value without updating meta
if ( ! wp_verify_nonce( $_POST['woocommerce_meta_nonce'], 'woocommerce_save_data' ) && ! isset( $_POST['rating'] ) )
if ( ! wp_verify_nonce( $_POST['woocommerce_meta_nonce'], 'woocommerce_save_data' ) && ! isset( $_POST['rating'] ) ) {
return $location;
}
// Update meta
update_comment_meta(

View File

@ -38,8 +38,8 @@ $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', arr
?>
<tr data-meta_id="<?php echo esc_attr( $meta_id ); ?>">
<td>
<input type="text" name="meta_key[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]" value="<?php echo esc_attr( $meta->key ); ?>" />
<textarea name="meta_value[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]"><?php echo esc_textarea( rawurldecode( $meta->value ) ); ?></textarea>
<input type="text" placeholder="<?php esc_attr_e( 'Name (required)', 'woocommerce' ); ?>" name="meta_key[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]" value="<?php echo esc_attr( $meta->key ); ?>" />
<textarea placeholder="<?php esc_attr_e( 'Value (required)', 'woocommerce' ); ?>" name="meta_value[<?php echo esc_attr( $item_id ); ?>][<?php echo esc_attr( $meta_id ); ?>]"><?php echo esc_textarea( rawurldecode( $meta->value ) ); ?></textarea>
</td>
<td width="1%"><button class="remove_order_item_meta button">&times;</button></td>
</tr>

View File

@ -58,6 +58,8 @@
<optgroup label="<?php esc_attr_e( 'Inventory', 'woocommerce' ); ?>">
<option value="toggle_manage_stock"><?php _e( 'Toggle &quot;Manage stock&quot;', 'woocommerce' ); ?></option>
<option value="variable_stock"><?php _e( 'Stock', 'woocommerce' ); ?></option>
<option value="variable_stock_status_instock"><?php _e( 'Set Status - In stock', 'woocommerce' ); ?></option>
<option value="variable_stock_status_outofstock"><?php _e( 'Set Status - Out of stock', 'woocommerce' ); ?></option>
</optgroup>
<optgroup label="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>">
<option value="variable_length"><?php _e( 'Length', 'woocommerce' ); ?></option>

View File

@ -161,7 +161,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'value' => $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 quantity to enable stock management at variation level, or leave blank to use the parent product's options.", 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any',

View File

@ -300,8 +300,9 @@ class WC_Admin_Report {
$where_value = "{$value['operator']} '{$value['value']}'";
}
if ( ! empty( $where_value ) )
if ( ! empty( $where_value ) ) {
$query['where'] .= " AND {$value['key']} {$where_value}";
}
}
}

View File

@ -208,12 +208,12 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
?>
</select>
<input type="submit" class="submit button" value="<?php esc_attr_e( 'Show', 'woocommerce' ); ?>" />
<input type="hidden" name="range" value="<?php if ( ! empty( $_GET['range'] ) ) echo esc_attr( $_GET['range'] ) ?>" />
<input type="hidden" name="start_date" value="<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ) ?>" />
<input type="hidden" name="end_date" value="<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ) ?>" />
<input type="hidden" name="page" value="<?php if ( ! empty( $_GET['page'] ) ) echo esc_attr( $_GET['page'] ) ?>" />
<input type="hidden" name="tab" value="<?php if ( ! empty( $_GET['tab'] ) ) echo esc_attr( $_GET['tab'] ) ?>" />
<input type="hidden" name="report" value="<?php if ( ! empty( $_GET['report'] ) ) echo esc_attr( $_GET['report'] ) ?>" />
<input type="hidden" name="range" value="<?php echo ( ! empty( $_GET['range'] ) ) ? esc_attr( $_GET['range'] ) : ''; ?>" />
<input type="hidden" name="start_date" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( $_GET['start_date'] ) : ''; ?>" />
<input type="hidden" name="end_date" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( $_GET['end_date'] ) : ''; ?>" />
<input type="hidden" name="page" value="<?php echo ( ! empty( $_GET['page'] ) ) ? esc_attr( $_GET['page'] ) : ''; ?>" />
<input type="hidden" name="tab" value="<?php echo ( ! empty( $_GET['tab'] ) ) ? esc_attr( $_GET['tab'] ) : ''; ?>" />
<input type="hidden" name="report" value="<?php echo ( ! empty( $_GET['report'] ) ) ? esc_attr( $_GET['report'] ) : ''; ?>" />
<?php else : ?>
<span><?php _e( 'No used coupons found', 'woocommerce' ); ?></span>
<?php endif; ?>

View File

@ -78,8 +78,6 @@ class WC_Report_Customer_List extends WP_List_Table {
* @return string
*/
public function column_default( $user, $column_name ) {
global $wpdb;
switch ( $column_name ) {
case 'customer_name' :
@ -245,8 +243,6 @@ class WC_Report_Customer_List extends WP_List_Table {
* Prepare customer list items.
*/
public function prepare_items() {
global $wpdb;
$current_page = absint( $this->get_pagenum() );
$per_page = 20;

View File

@ -223,12 +223,12 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
<a href="#" class="select_none"><?php _e( 'None', 'woocommerce' ); ?></a>
<a href="#" class="select_all"><?php _e( 'All', 'woocommerce' ); ?></a>
<input type="submit" class="submit button" value="<?php esc_attr_e( 'Show', 'woocommerce' ); ?>" />
<input type="hidden" name="range" value="<?php if ( ! empty( $_GET['range'] ) ) echo esc_attr( $_GET['range'] ) ?>" />
<input type="hidden" name="start_date" value="<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ) ?>" />
<input type="hidden" name="end_date" value="<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ) ?>" />
<input type="hidden" name="page" value="<?php if ( ! empty( $_GET['page'] ) ) echo esc_attr( $_GET['page'] ) ?>" />
<input type="hidden" name="tab" value="<?php if ( ! empty( $_GET['tab'] ) ) echo esc_attr( $_GET['tab'] ) ?>" />
<input type="hidden" name="report" value="<?php if ( ! empty( $_GET['report'] ) ) echo esc_attr( $_GET['report'] ) ?>" />
<input type="hidden" name="range" value="<?php echo ( ! empty( $_GET['range'] ) ) ? esc_attr( $_GET['range'] ) : ''; ?>" />
<input type="hidden" name="start_date" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( $_GET['start_date'] ) : ''; ?>" />
<input type="hidden" name="end_date" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( $_GET['end_date'] ) : ''; ?>" />
<input type="hidden" name="page" value="<?php echo ( ! empty( $_GET['page'] ) ) ? esc_attr( $_GET['page'] ) : ''; ?>" />
<input type="hidden" name="tab" value="<?php echo ( ! empty( $_GET['tab'] ) ) ? esc_attr( $_GET['tab'] ) : ''; ?>" />
<input type="hidden" name="report" value="<?php echo ( ! empty( $_GET['report'] ) ) ? esc_attr( $_GET['report'] ) : ''; ?>" />
</div>
<script type="text/javascript">
jQuery(function(){

View File

@ -205,12 +205,12 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
<div>
<select class="wc-product-search" style="width:203px;" multiple="multiple" id="product_ids" name="product_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product&hellip;', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations"></select>
<input type="submit" class="submit button" value="<?php esc_attr_e( 'Show', 'woocommerce' ); ?>" />
<input type="hidden" name="range" value="<?php if ( ! empty( $_GET['range'] ) ) echo esc_attr( $_GET['range'] ) ?>" />
<input type="hidden" name="start_date" value="<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ) ?>" />
<input type="hidden" name="end_date" value="<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ) ?>" />
<input type="hidden" name="page" value="<?php if ( ! empty( $_GET['page'] ) ) echo esc_attr( $_GET['page'] ) ?>" />
<input type="hidden" name="tab" value="<?php if ( ! empty( $_GET['tab'] ) ) echo esc_attr( $_GET['tab'] ) ?>" />
<input type="hidden" name="report" value="<?php if ( ! empty( $_GET['report'] ) ) echo esc_attr( $_GET['report'] ) ?>" />
<input type="hidden" name="range" value="<?php echo ( ! empty( $_GET['range'] ) ) ? esc_attr( $_GET['range'] ) : ''; ?>" />
<input type="hidden" name="start_date" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( $_GET['start_date'] ) : ''; ?>" />
<input type="hidden" name="end_date" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( $_GET['end_date'] ) : ''; ?>" />
<input type="hidden" name="page" value="<?php echo ( ! empty( $_GET['page'] ) ) ? esc_attr( $_GET['page'] ) : ''; ?>" />
<input type="hidden" name="tab" value="<?php echo ( ! empty( $_GET['tab'] ) ) ? esc_attr( $_GET['tab'] ) : ''; ?>" />
<input type="hidden" name="report" value="<?php echo ( ! empty( $_GET['report'] ) ) ? esc_attr( $_GET['report'] ) : ''; ?>" />
</div>
</form>
</div>

View File

@ -61,191 +61,195 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
*
* @return array
*/
public function get_settings() {
$settings = apply_filters( 'woocommerce_payment_gateways_settings', array(
public function get_settings( $current_section = '' ) {
$settings = array();
array(
'title' => __( 'Checkout process', 'woocommerce' ),
'type' => 'title',
'id' => 'checkout_process_options',
),
if ( '' === $current_section ) {
$settings = apply_filters( 'woocommerce_payment_gateways_settings', array(
array(
'title' => __( 'Coupons', 'woocommerce' ),
'desc' => __( 'Enable the use of coupons', 'woocommerce' ),
'id' => 'woocommerce_enable_coupons',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ),
),
array(
'title' => __( 'Checkout process', 'woocommerce' ),
'type' => 'title',
'id' => 'checkout_process_options',
),
array(
'desc' => __( 'Calculate coupon discounts sequentially', 'woocommerce' ),
'id' => 'woocommerce_calc_discounts_sequentially',
'default' => 'no',
'type' => 'checkbox',
'desc_tip' => __( 'When applying multiple coupons, apply the first coupon to the full price and the second coupon to the discounted price and so on.', 'woocommerce' ),
'checkboxgroup' => 'end',
'autoload' => false,
),
array(
'title' => __( 'Coupons', 'woocommerce' ),
'desc' => __( 'Enable the use of coupons', 'woocommerce' ),
'id' => 'woocommerce_enable_coupons',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ),
),
array(
'title' => __( 'Checkout process', 'woocommerce' ),
'desc' => __( 'Enable guest checkout', 'woocommerce' ),
'desc_tip' => __( 'Allows customers to checkout without creating an account.', 'woocommerce' ),
'id' => 'woocommerce_enable_guest_checkout',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false,
),
array(
'desc' => __( 'Calculate coupon discounts sequentially', 'woocommerce' ),
'id' => 'woocommerce_calc_discounts_sequentially',
'default' => 'no',
'type' => 'checkbox',
'desc_tip' => __( 'When applying multiple coupons, apply the first coupon to the full price and the second coupon to the discounted price and so on.', 'woocommerce' ),
'checkboxgroup' => 'end',
'autoload' => false,
),
array(
'desc' => __( 'Force secure checkout', 'woocommerce' ),
'id' => 'woocommerce_force_ssl_checkout',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
'show_if_checked' => 'option',
'desc_tip' => sprintf( __( 'Force SSL (HTTPS) on the checkout pages (<a href="%s" target="_blank">an SSL Certificate is required</a>).', 'woocommerce' ), 'https://docs.woocommerce.com/document/ssl-and-https/#section-3' ),
),
array(
'title' => __( 'Checkout process', 'woocommerce' ),
'desc' => __( 'Enable guest checkout', 'woocommerce' ),
'desc_tip' => __( 'Allows customers to checkout without creating an account.', 'woocommerce' ),
'id' => 'woocommerce_enable_guest_checkout',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false,
),
'unforce_ssl_checkout' => array(
'desc' => __( 'Force HTTP when leaving the checkout', 'woocommerce' ),
'id' => 'woocommerce_unforce_ssl_checkout',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'show_if_checked' => 'yes',
),
array(
'desc' => __( 'Force secure checkout', 'woocommerce' ),
'id' => 'woocommerce_force_ssl_checkout',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
'show_if_checked' => 'option',
'desc_tip' => sprintf( __( 'Force SSL (HTTPS) on the checkout pages (<a href="%s" target="_blank">an SSL Certificate is required</a>).', 'woocommerce' ), 'https://docs.woocommerce.com/document/ssl-and-https/#section-3' ),
),
array(
'type' => 'sectionend',
'id' => 'checkout_process_options',
),
'unforce_ssl_checkout' => array(
'desc' => __( 'Force HTTP when leaving the checkout', 'woocommerce' ),
'id' => 'woocommerce_unforce_ssl_checkout',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'show_if_checked' => 'yes',
),
array(
'title' => __( 'Checkout pages', 'woocommerce' ),
'desc' => __( 'These pages need to be set so that WooCommerce knows where to send users to checkout.', 'woocommerce' ),
'type' => 'title',
'id' => 'checkout_page_options',
),
array(
'type' => 'sectionend',
'id' => 'checkout_process_options',
),
array(
'title' => __( 'Cart page', 'woocommerce' ),
'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) ),
'id' => 'woocommerce_cart_page_id',
'type' => 'single_select_page',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'desc_tip' => true,
),
array(
'title' => __( 'Checkout pages', 'woocommerce' ),
'desc' => __( 'These pages need to be set so that WooCommerce knows where to send users to checkout.', 'woocommerce' ),
'type' => 'title',
'id' => 'checkout_page_options',
),
array(
'title' => __( 'Checkout page', 'woocommerce' ),
'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) ),
'id' => 'woocommerce_checkout_page_id',
'type' => 'single_select_page',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'desc_tip' => true,
),
array(
'title' => __( 'Cart page', 'woocommerce' ),
'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) ),
'id' => 'woocommerce_cart_page_id',
'type' => 'single_select_page',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'desc_tip' => true,
),
array(
'title' => __( 'Terms and conditions', 'woocommerce' ),
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woocommerce' ),
'id' => 'woocommerce_terms_page_id',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'type' => 'single_select_page',
'desc_tip' => true,
'autoload' => false,
),
array(
'title' => __( 'Checkout page', 'woocommerce' ),
'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) ),
'id' => 'woocommerce_checkout_page_id',
'type' => 'single_select_page',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'desc_tip' => true,
),
array(
'type' => 'sectionend',
'id' => 'checkout_page_options',
),
array(
'title' => __( 'Terms and conditions', 'woocommerce' ),
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woocommerce' ),
'id' => 'woocommerce_terms_page_id',
'default' => '',
'class' => 'wc-enhanced-select-nostd',
'css' => 'min-width:300px;',
'type' => 'single_select_page',
'desc_tip' => true,
'autoload' => false,
),
array( 'title' => __( 'Checkout endpoints', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions during the checkout process. They should be unique.', 'woocommerce' ), 'id' => 'account_endpoint_options' ),
array(
'type' => 'sectionend',
'id' => 'checkout_page_options',
),
array(
'title' => __( 'Pay', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Pay" page.', 'woocommerce' ),
'id' => 'woocommerce_checkout_pay_endpoint',
'type' => 'text',
'default' => 'order-pay',
'desc_tip' => true,
),
array( 'title' => __( 'Checkout endpoints', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions during the checkout process. They should be unique.', 'woocommerce' ), 'id' => 'account_endpoint_options' ),
array(
'title' => __( 'Order received', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Order received" page.', 'woocommerce' ),
'id' => 'woocommerce_checkout_order_received_endpoint',
'type' => 'text',
'default' => 'order-received',
'desc_tip' => true,
),
array(
'title' => __( 'Pay', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Pay" page.', 'woocommerce' ),
'id' => 'woocommerce_checkout_pay_endpoint',
'type' => 'text',
'default' => 'order-pay',
'desc_tip' => true,
),
array(
'title' => __( 'Add payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Add payment method" page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_add_payment_method_endpoint',
'type' => 'text',
'default' => 'add-payment-method',
'desc_tip' => true,
),
array(
'title' => __( 'Order received', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Order received" page.', 'woocommerce' ),
'id' => 'woocommerce_checkout_order_received_endpoint',
'type' => 'text',
'default' => 'order-received',
'desc_tip' => true,
),
array(
'title' => __( 'Delete payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the delete payment method page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_delete_payment_method_endpoint',
'type' => 'text',
'default' => 'delete-payment-method',
'desc_tip' => true,
),
array(
'title' => __( 'Add payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the "Checkout &rarr; Add payment method" page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_add_payment_method_endpoint',
'type' => 'text',
'default' => 'add-payment-method',
'desc_tip' => true,
),
array(
'title' => __( 'Set default payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the setting a default payment method page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_set_default_payment_method_endpoint',
'type' => 'text',
'default' => 'set-default-payment-method',
'desc_tip' => true,
),
array(
'title' => __( 'Delete payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the delete payment method page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_delete_payment_method_endpoint',
'type' => 'text',
'default' => 'delete-payment-method',
'desc_tip' => true,
),
array(
'type' => 'sectionend',
'id' => 'checkout_endpoint_options',
),
array(
'title' => __( 'Set default payment method', 'woocommerce' ),
'desc' => __( 'Endpoint for the setting a default payment method page.', 'woocommerce' ),
'id' => 'woocommerce_myaccount_set_default_payment_method_endpoint',
'type' => 'text',
'default' => 'set-default-payment-method',
'desc_tip' => true,
),
array(
'title' => __( 'Payment gateways', 'woocommerce' ),
'desc' => __( 'Installed gateways are listed below. Drag and drop gateways to control their display order on the frontend.', 'woocommerce' ),
'type' => 'title',
'id' => 'payment_gateways_options',
),
array(
'type' => 'sectionend',
'id' => 'checkout_endpoint_options',
),
array(
'type' => 'payment_gateways',
),
array(
'title' => __( 'Payment gateways', 'woocommerce' ),
'desc' => __( 'Installed gateways are listed below. Drag and drop gateways to control their display order on the frontend.', 'woocommerce' ),
'type' => 'title',
'id' => 'payment_gateways_options',
),
array(
'type' => 'sectionend',
'id' => 'payment_gateways_options',
),
array(
'type' => 'payment_gateways',
),
) );
array(
'type' => 'sectionend',
'id' => 'payment_gateways_options',
),
if ( wc_site_is_https() ) {
unset( $settings['unforce_ssl_checkout'] );
) );
if ( wc_site_is_https() ) {
unset( $settings['unforce_ssl_checkout'] );
}
}
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings );
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
}
/**

View File

@ -65,7 +65,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( '"From" name', 'woocommerce' ),
'desc' => __( 'How the sender\'s name appears in outgoing WooCommerce emails.', 'woocommerce' ),
'desc' => __( 'How the sender name appears in outgoing WooCommerce emails.', 'woocommerce' ),
'id' => 'woocommerce_email_from_name',
'type' => 'text',
'css' => 'min-width:300px;',
@ -76,7 +76,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( '"From" address', 'woocommerce' ),
'desc' => __( 'How the sender\'s email appears in outgoing WooCommerce emails.', 'woocommerce' ),
'desc' => __( 'How the sender email appears in outgoing WooCommerce emails.', 'woocommerce' ),
'id' => 'woocommerce_email_from_address',
'type' => 'email',
'custom_attributes' => array(

View File

@ -71,8 +71,9 @@ class WC_Settings_Integrations extends WC_Settings_Page {
$integrations = WC()->integrations->get_integrations();
if ( isset( $integrations[ $current_section ] ) )
if ( isset( $integrations[ $current_section ] ) ) {
$integrations[ $current_section ]->admin_options();
}
}
}

View File

@ -71,61 +71,65 @@ class WC_Settings_Shipping extends WC_Settings_Page {
*
* @return array
*/
public function get_settings() {
$settings = apply_filters( 'woocommerce_shipping_settings', array(
public function get_settings( $current_section = '' ) {
$settings = array();
array( 'title' => __( 'Shipping options', 'woocommerce' ), 'type' => 'title', 'id' => 'shipping_options' ),
if ( '' === $current_section ) {
$settings = apply_filters( 'woocommerce_shipping_settings', array(
array(
'title' => __( 'Calculations', 'woocommerce' ),
'desc' => __( 'Enable the shipping calculator on the cart page', 'woocommerce' ),
'id' => 'woocommerce_enable_shipping_calc',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false,
),
array( 'title' => __( 'Shipping options', 'woocommerce' ), 'type' => 'title', 'id' => 'shipping_options' ),
array(
'desc' => __( 'Hide shipping costs until an address is entered', 'woocommerce' ),
'id' => 'woocommerce_shipping_cost_requires_address',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false,
),
array(
'title' => __( 'Shipping destination', 'woocommerce' ),
'desc' => __( 'This controls which shipping address is used by default.', 'woocommerce' ),
'id' => 'woocommerce_ship_to_destination',
'default' => 'billing',
'type' => 'radio',
'options' => array(
'shipping' => __( 'Default to customer shipping address', 'woocommerce' ),
'billing' => __( 'Default to customer billing address', 'woocommerce' ),
'billing_only' => __( 'Force shipping to the customer billing address', 'woocommerce' ),
array(
'title' => __( 'Calculations', 'woocommerce' ),
'desc' => __( 'Enable the shipping calculator on the cart page', 'woocommerce' ),
'id' => 'woocommerce_enable_shipping_calc',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false,
),
'autoload' => false,
'desc_tip' => true,
'show_if_checked' => 'option',
),
array(
'title' => __( 'Debug mode', 'woocommerce' ),
'desc' => __( 'Enable debug mode', 'woocommerce' ),
'desc_tip' => __( 'Enable shipping debug mode to show matching shipping zones and to bypass shipping rate cache.', 'woocommerce' ),
'id' => 'woocommerce_shipping_debug_mode',
'default' => 'no',
'type' => 'checkbox',
'autoload' => false,
),
array(
'desc' => __( 'Hide shipping costs until an address is entered', 'woocommerce' ),
'id' => 'woocommerce_shipping_cost_requires_address',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
array(
'title' => __( 'Shipping destination', 'woocommerce' ),
'desc' => __( 'This controls which shipping address is used by default.', 'woocommerce' ),
'id' => 'woocommerce_ship_to_destination',
'default' => 'billing',
'type' => 'radio',
'options' => array(
'shipping' => __( 'Default to customer shipping address', 'woocommerce' ),
'billing' => __( 'Default to customer billing address', 'woocommerce' ),
'billing_only' => __( 'Force shipping to the customer billing address', 'woocommerce' ),
),
'autoload' => false,
'desc_tip' => true,
'show_if_checked' => 'option',
),
) );
array(
'title' => __( 'Debug mode', 'woocommerce' ),
'desc' => __( 'Enable debug mode', 'woocommerce' ),
'desc_tip' => __( 'Enable shipping debug mode to show matching shipping zones and to bypass shipping rate cache.', 'woocommerce' ),
'id' => 'woocommerce_shipping_debug_mode',
'default' => 'no',
'type' => 'checkbox',
'autoload' => false,
),
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings );
array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
) );
}
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
}
/**
@ -255,8 +259,6 @@ class WC_Settings_Shipping extends WC_Settings_Page {
* Show zones
*/
protected function zones_screen() {
global $wpdb;
$allowed_countries = WC()->countries->get_allowed_countries();
$continents = WC()->countries->get_continents();
$method_count = wc_get_shipping_method_count();

View File

@ -96,8 +96,6 @@ class WC_Settings_Tax extends WC_Settings_Page {
* Save settings.
*/
public function save() {
global $current_section, $wpdb;
if ( ! $current_section ) {
$settings = $this->get_settings();
WC_Admin_Settings::save_fields( $settings );
@ -113,7 +111,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
* Output tax rate tables.
*/
public function output_tax_rates() {
global $wpdb, $current_section;
global $current_section;
$current_class = $this->get_current_tax_class();

View File

@ -51,21 +51,24 @@ if ( ! defined( 'ABSPATH' ) ) {
$topic_data = WC_Admin_Webhooks::get_topic_data( $webhook );
$topics = apply_filters( 'woocommerce_webhook_topics', array(
'' => __( 'Select an option&hellip;', 'woocommerce' ),
'coupon.created' => __( 'Coupon created', 'woocommerce' ),
'coupon.updated' => __( 'Coupon updated', 'woocommerce' ),
'coupon.deleted' => __( 'Coupon deleted', 'woocommerce' ),
'customer.created' => __( 'Customer created', 'woocommerce' ),
'customer.updated' => __( 'Customer updated', 'woocommerce' ),
'customer.deleted' => __( 'Customer deleted', 'woocommerce' ),
'order.created' => __( 'Order created', 'woocommerce' ),
'order.updated' => __( 'Order updated', 'woocommerce' ),
'order.deleted' => __( 'Order deleted', 'woocommerce' ),
'product.created' => __( 'Product created', 'woocommerce' ),
'product.updated' => __( 'Product updated', 'woocommerce' ),
'product.deleted' => __( 'Product deleted', 'woocommerce' ),
'action' => __( 'Action', 'woocommerce' ),
'custom' => __( 'Custom', 'woocommerce' ),
'' => __( 'Select an option&hellip;', 'woocommerce' ),
'coupon.created' => __( 'Coupon created', 'woocommerce' ),
'coupon.updated' => __( 'Coupon updated', 'woocommerce' ),
'coupon.deleted' => __( 'Coupon deleted', 'woocommerce' ),
'coupon.restored' => __( 'Coupon restored', 'woocommerce' ),
'customer.created' => __( 'Customer created', 'woocommerce' ),
'customer.updated' => __( 'Customer updated', 'woocommerce' ),
'customer.deleted' => __( 'Customer deleted', 'woocommerce' ),
'order.created' => __( 'Order created', 'woocommerce' ),
'order.updated' => __( 'Order updated', 'woocommerce' ),
'order.deleted' => __( 'Order deleted', 'woocommerce' ),
'order.restored' => __( 'Order restored', 'woocommerce' ),
'product.created' => __( 'Product created', 'woocommerce' ),
'product.updated' => __( 'Product updated', 'woocommerce' ),
'product.deleted' => __( 'Product deleted', 'woocommerce' ),
'product.restored' => __( 'Product restored', 'woocommerce' ),
'action' => __( 'Action', 'woocommerce' ),
'custom' => __( 'Custom', 'woocommerce' ),
) );
foreach ( $topics as $topic_slug => $topic_name ) : ?>

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $sections ) : ?>
<ul class="subsubsub">
<?php foreach ( $sections as $section_id => $section ) : ?>
<li><a class="<?php echo $current_section === $section_id ? 'current' : ''; ?>" href="<?php echo admin_url( 'admin.php?page=wc-addons&section=' . esc_attr( $section_id ) ); ?>"><?php echo esc_html( $section->title ); ?></a><?php if ( end( $section_keys ) !== $section_id ) echo ' |'; ?></li>
<li><a class="<?php echo $current_section === $section_id ? 'current' : ''; ?>" href="<?php echo admin_url( 'admin.php?page=wc-addons&section=' . esc_attr( $section_id ) ); ?>"><?php echo esc_html( $section->title ); ?></a><?php echo ( end( $section_keys ) !== $section_id ) ? ' |' : ''; ?></li>
<?php endforeach; ?>
</ul>
<br class="clear" />

View File

@ -41,7 +41,7 @@ $pages = $system_status->get_pages();
<tbody>
<tr>
<td data-export-label="Home URL"><?php _e( 'Home URL', 'woocommerce' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( __( 'The URL of your site\'s homepage.', 'woocommerce' ) ); ?></td>
<td class="help"><?php echo wc_help_tip( __( 'The homepage URL of your site.', 'woocommerce' ) ); ?></td>
<td><?php echo esc_html( $environment['home_url'] ) ?></td>
</tr>
<tr>
@ -516,7 +516,7 @@ $pages = $system_status->get_pages();
}
echo '<tr><td data-export-label="' . esc_attr( $page_name ) . '">' . $page_name . ':</td>';
echo '<td class="help">' . wc_help_tip( sprintf( __( 'The URL of your WooCommerce shop\'s %s (along with the Page ID).', 'woocommerce' ), $page_name ) ) . '</td><td>';
echo '<td class="help">' . wc_help_tip( sprintf( __( 'The URL of your %s page (along with the Page ID).', 'woocommerce' ), $page_name ) ) . '</td><td>';
// Page ID check.
if ( ! $page['page_set'] ) {
@ -538,7 +538,9 @@ $pages = $system_status->get_pages();
}
}
if ( ! $error ) echo '<mark class="yes">#' . absint( $page['page_id'] ) . ' - ' . str_replace( home_url(), '', get_permalink( $page['page_id'] ) ) . '</mark>';
if ( ! $error ) {
echo '<mark class="yes">#' . absint( $page['page_id'] ) . ' - ' . str_replace( home_url(), '', get_permalink( $page['page_id'] ) ) . '</mark>';
}
echo '</td></tr>';
}
@ -577,7 +579,7 @@ $pages = $system_status->get_pages();
<td data-export-label="Child Theme"><?php _e( 'Child theme', 'woocommerce' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not the current theme is a child theme.', 'woocommerce' ) ); ?></td>
<td><?php
echo $theme['is_child_theme'] ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>' : '<span class="dashicons dashicons-no-alt"></span> &ndash; ' . sprintf( __( 'If you\'re modifying WooCommerce on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'woocommerce' ), 'https://codex.wordpress.org/Child_Themes' );
echo $theme['is_child_theme'] ? '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>' : '<span class="dashicons dashicons-no-alt"></span> &ndash; ' . sprintf( __( 'If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: <a href="%s" target="_blank">How to create a child theme</a>', 'woocommerce' ), 'https://codex.wordpress.org/Child_Themes' );
?></td>
</tr>
<?php
@ -608,13 +610,13 @@ $pages = $system_status->get_pages();
<tr>
<td data-export-label="WooCommerce Support"><?php _e( 'WooCommerce support', 'woocommerce' ); ?>:</td>
<td class="help"><?php echo wc_help_tip( __( 'Displays whether or not the current active theme declares WooCommerce support.', 'woocommerce' ) ); ?></td>
<td><?php
if ( ! $theme['has_woocommerce_support'] ) {
<td>
<?php if ( ! $theme['has_woocommerce_support'] ) {
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . __( 'Not declared', 'woocommerce' ) . '</mark>';
} else {
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
}
?></td>
} ?>
</td>
</tr>
</tbody>
</table>

View File

@ -20,7 +20,9 @@ $tabs = apply_filters( 'woocommerce_admin_status_tabs', $tabs );
<?php
foreach ( $tabs as $name => $label ) {
echo '<a href="' . admin_url( 'admin.php?page=wc-status&tab=' . $name ) . '" class="nav-tab ';
if ( $current_tab == $name ) echo 'nav-tab-active';
if ( $current_tab == $name ) {
echo 'nav-tab-active';
}
echo '">' . $label . '</a>';
}
?>

View File

@ -97,10 +97,11 @@ if ( ! defined( 'ABSPATH' ) ) {
$tax_classes = WC_Tax::get_tax_classes();
if ( ! empty( $tax_classes ) )
if ( ! empty( $tax_classes ) ) {
foreach ( $tax_classes as $class ) {
$options[ sanitize_title( $class ) ] = esc_html( $class );
}
}
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';

View File

@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'no_shipping_methods' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'woocommerce' ); ?></a>
<p class="main"><strong><?php _e( 'Add shipping methods &amp; zones', 'woocommerce' ); ?></strong></p>
<p><?php _e( 'Shipping is currently enabled, but you haven\'t added any shipping methods to your shipping zones.', 'woocommerce' ); ?></p>
<p><?php _e( 'Shipping is currently enabled, but you have not added any shipping methods to your shipping zones.', 'woocommerce' ); ?></p>
<p><?php _e( 'Customers will not be able to purchase physical goods from your store until a shipping method is available.', 'woocommerce' ); ?></p>
<p class="submit">

View File

@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p><strong><?php _e( 'WooCommerce data update', 'woocommerce' ); ?></strong> &#8211; <?php _e( 'We need to update your store\'s database to the latest version.', 'woocommerce' ); ?></p>
<p><strong><?php _e( 'WooCommerce data update', 'woocommerce' ); ?></strong> &#8211; <?php _e( 'We need to update your store database to the latest version.', 'woocommerce' ); ?></p>
<p class="submit"><a href="<?php echo esc_url( add_query_arg( 'do_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ) ); ?>" class="wc-update-now button-primary"><?php _e( 'Run the updater', 'woocommerce' ); ?></a></p>
</div>
<script type="text/javascript">

View File

@ -75,10 +75,11 @@ if ( ! defined( 'ABSPATH' ) ) {
$tax_classes = WC_Tax::get_tax_classes();
if ( ! empty( $tax_classes ) )
if ( ! empty( $tax_classes ) ) {
foreach ( $tax_classes as $class ) {
$options[ sanitize_title( $class ) ] = esc_html( $class );
}
}
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';

View File

@ -50,9 +50,9 @@ if ( ! defined( 'ABSPATH' ) ) {
}
?>
<input type="hidden" name="range" value="custom" />
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ); ?>" name="start_date" class="range_datepicker from" />
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( $_GET['start_date'] ) : ''; ?>" name="start_date" class="range_datepicker from" />
<span>&ndash;</span>
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ); ?>" name="end_date" class="range_datepicker to" />
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( $_GET['end_date'] ) : ''; ?>" name="end_date" class="range_datepicker to" />
<input type="submit" class="button" value="<?php esc_attr_e( 'Go', 'woocommerce' ); ?>" />
<?php wp_nonce_field( 'custom_range', 'wc_reports_nonce', false ); ?>
</div>
@ -66,6 +66,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $legends = $this->get_chart_legend() ) : ?>
<ul class="chart-legend">
<?php foreach ( $legends as $legend ) : ?>
<?php // @codingStandardsIgnoreLine ?>
<li style="border-color: <?php echo $legend['color']; ?>" <?php if ( isset( $legend['highlight_series'] ) ) echo 'class="highlight_series ' . ( isset( $legend['placeholder'] ) ? 'tips' : '' ) . '" data-series="' . esc_attr( $legend['highlight_series'] ) . '"'; ?> data-tip="<?php echo isset( $legend['placeholder'] ) ? $legend['placeholder'] : ''; ?>">
<?php echo $legend['title']; ?>
</li>

View File

@ -44,6 +44,12 @@ function wc_get_screen_ids() {
$screen_ids[] = 'edit-' . $type;
}
if ( $attributes = wc_get_attribute_taxonomies() ) {
foreach ( $attributes as $attribute ) {
$screen_ids[] = 'edit-' . wc_attribute_taxonomy_name( $attribute->attribute_name );
}
}
return apply_filters( 'woocommerce_screen_ids', $screen_ids );
}

View File

@ -353,7 +353,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
$args['post_status'] = 'any';
}
if ( ! empty( $request['customer'] ) ) {
if ( isset( $request['customer'] ) ) {
if ( ! empty( $args['meta_query'] ) ) {
$args['meta_query'] = array();
}

View File

@ -453,7 +453,6 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
* @return WP_Error|boolean
*/
public function delete_item( $request ) {
$id = absint( is_array( $request['id'] ) ? $request['id']['id'] : $request['id'] );
$force = (bool) $request['force'];
$object = $this->get_object( (int) $request['id'] );
$result = false;

View File

@ -178,6 +178,9 @@ class WC_REST_Setting_Options_Controller extends WC_REST_Controller {
if ( 'multi_select_countries' === $setting['type'] ) {
$setting['options'] = WC()->countries->get_countries();
$setting['type'] = 'multiselect';
} elseif ( 'single_select_country' === $setting['type'] ) {
$setting['type'] = 'select';
$setting['options'] = $this->get_countries_and_states();
}
$filtered_settings[] = $setting;
@ -186,6 +189,33 @@ class WC_REST_Setting_Options_Controller extends WC_REST_Controller {
return $filtered_settings;
}
/**
* Returns a list of countries and states for use in the base location setting.
*
* @since 3.0.7
* @return array Array of states and countries.
*/
private function get_countries_and_states() {
$countries = WC()->countries->get_countries();
if ( ! $countries ) {
return array();
}
$output = array();
foreach ( $countries as $key => $value ) {
if ( $states = WC()->countries->get_states( $key ) ) {
foreach ( $states as $state_key => $state_value ) {
$output[ $key . ':' . $state_key ] = $value . ' - ' . $state_value;
}
} else {
$output[ $key ] = $value;
}
}
return $output;
}
/**
* Get setting data.
*

View File

@ -26,7 +26,7 @@ class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_
* Register the routes for Shipping Zone Locations.
*/
public function register_routes() {
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d-]+)/locations', array(
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)/locations', array(
'args' => array(
'id' => array(
'description' => __( 'Unique ID for the resource.', 'woocommerce' ),
@ -86,6 +86,10 @@ class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_
return $zone;
}
if ( 0 === $zone->get_id() ) {
return new WP_Error( "woocommerce_rest_shipping_zone_locations_invalid_zone", __( 'The "rest of the world" zone cannot be updated.', 'woocommerce' ), array( 'status' => 403 ) );
}
$raw_locations = $request->get_json_params();
$locations = array();

View File

@ -26,7 +26,7 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
* Register the routes for Shipping Zone Methods.
*/
public function register_routes() {
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<zone_id>[\d-]+)/methods', array(
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<zone_id>[\d]+)/methods', array(
'args' => array(
'zone_id' => array(
'description' => __( 'Unique ID for the zone.', 'woocommerce' ),
@ -53,7 +53,7 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
'schema' => array( $this, 'get_public_item_schema' ),
) );
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<zone_id>[\d-]+)/methods/(?P<instance_id>[\d-]+)', array(
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<zone_id>[\d]+)/methods/(?P<instance_id>[\d]+)', array(
'args' => array(
'zone_id' => array(
'description' => __( 'Unique ID for the zone.', 'woocommerce' ),
@ -155,8 +155,6 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
* @return WP_REST_Request|WP_Error
*/
public function create_item( $request ) {
global $wpdb;
$method_id = $request['method_id'];
$zone = $this->get_zone( $request['zone_id'] );
if ( is_wp_error( $zone ) ) {
@ -193,8 +191,6 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
* @return WP_Error|boolean
*/
public function delete_item( $request ) {
global $wpdb;
$zone = $this->get_zone( $request['zone_id'] );
if ( is_wp_error( $zone ) ) {
return $zone;
@ -251,8 +247,6 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
* @return WP_REST_Response|WP_Error
*/
public function update_item( $request ) {
global $wpdb;
$zone = $this->get_zone( $request['zone_id'] );
if ( is_wp_error( $zone ) ) {
return $zone;
@ -346,6 +340,7 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
*/
public function prepare_item_for_response( $item, $request ) {
$method = array(
'id' => $item->instance_id,
'instance_id' => $item->instance_id,
'title' => $item->instance_settings['title'],
'order' => $item->method_order,
@ -430,6 +425,12 @@ class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Co
'title' => 'shipping_zone_method',
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'Shipping method instance ID.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'instance_id' => array(
'description' => __( 'Shipping method instance ID.', 'woocommerce' ),
'type' => 'integer',

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