Merge remote-tracking branch 'upstream/master' into feature/screen-option

This commit is contained in:
Shiva Poudel 2018-02-22 09:52:59 +05:45
commit f1e2c0cf83
125 changed files with 1878 additions and 1105 deletions

View File

@ -1,24 +1,22 @@
<!-- Hi there! This form is for reporting bugs and issues specific to the WooCommerce plugin. This is not a support portal. If you need technical support from a human being, please submit a ticket via the helpdesk instead: https://woocommerce.com/contact-us/ -->
<!-- This form is for reporting bugs and issues specific to the WooCommerce plugin. This is not a support portal. If you need technical support from a human being, please submit a ticket via the helpdesk instead: https://woocommerce.com/contact-us/ -->
<!-- Usage questions can also be directed to the public support forum here: https://wordpress.org/support/plugin/woocommerce, unless this is a question about a premium extension in which case you should use the helpdesk. -->
<!-- If you have a feature request, submit it to: http://ideas.woocommerce.com/forums/133476-woocommerce -->
<!-- If you are a developer who needs a new filter/hook raise a PR instead :) -->
<!-- Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action. -->
## Prerequisites
<!-- Mark completed items with an [x] -->
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate
- [ ] The issue still exists against the latest `master` branch of WooCommerce on Github (this is **not** the same version as on WordPress.org!)
- [ ] I have attempted to find the simplest possible steps to reproduce the issue
- [ ] I have included a failing test as a pull request (Optional)
## Steps to reproduce the issue
<!-- We need to be able to reproduce the bug in order to fix it so please be descriptive! -->
@ -27,26 +25,20 @@
2.
3.
## Expected/actual behavior
When I follow those steps, I see...
I was expecting to see...
## Isolating the problem
<!-- Mark completed items with an [x] -->
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] This bug happens with only WooCommerce plugin active
- [ ] This bug happens with a default WordPress theme active, or [Storefront](https://woocommerce.com/storefront/)
- [ ] I can reproduce this bug consistently using the steps above
## WordPress Environment
<details>

View File

@ -1,5 +1,77 @@
== Changelog ==
= 3.3.3 - 2018-02-21 =
* Fix - Fixed is_numeric check which was affecting order subtotals/totals when using comma decimal separator.
* Fix - Add missing direct script access checks to loop templates.
* Fix - Added wp-post-image class to main image so variation images are swapped correctly.
* Fix - API - Adjusted schema for products shipping_class_id to integer.
* Fix - Made init tooltips event more specific to avoid conflict with Product Invoices extension.
= 3.3.2 - 2018-02-20 =
* Fix - Fixed admin product SKU searching and searching non-published products.
* Fix - PHP7.1 notice when image height is empty.
* Fix - Prevent repeated update_option calls on page load due to php type juggling.
* Fix - Only do unsupported template rendering in the loop to prevent conflicts with other shortcodes on the shop page.
* Fix - Don't prepend regular shortcodes with categories.
* Fix - If using get_catalog_ordering_args. remove the args when finished.
* Fix - Remove "Type" column on attributes table by default unless custom types are defined.
* Fix - Use verbose page rules when shop is in the URL, including shop base with category, to prevent 404s.
* Fix - Set woocommerce_hide_invisible_variations to true so disabled variation attributes are hidden on product pages.
* Fix - Help tip for webhook status.
* Fix - Shipping zone documentation help link was printing wrong.
* Fix - Stop background processing images when disabled via the filter.
* Fix - Only search when a search term is provided. Ignore empty strings.
* Fix - Fix check for external resources.
* Fix - Show full date for future orders.
* Fix - Prevent JS error is 'orders' row is disabled on order screen.
* Fix - Fix save of tax settings when no changes have been made.
* Fix - Add nonce to logout link on my account page so you do not need to confirm the action.
* Fix - Fix plain text entity replacement so currency symbols are included.
* Fix - API - Set status after order is created/updated so triggered emails are current.
* Fix - API - Fix single webhook endpoint.
* Tweak - Added help text for background image processing.
* Tweak - Added notice when background image processing is running, with cancel button.
* Tweak - Run background image processing less often by tracking changes.
* Tweak - Added system status tool to run background image processing manually.
* Tweak - If using Jetpack Photon, use that instead of background image processing.
* Tweak - Gallery thumbnail image size to handle small, square cropped images.
* Tweak - Helper function (and template version bump for image templates) to render gallery images.
* Tweak - Add help text for the default category to explain usage.
* Tweak - Allow changing the default product category.
* Tweak - Tweak mobile view of order preview to improve layout in non-english.
* Tweak - If selecting text, don't link to order on row click.
* Localization - Remove isle of man state.
= 3.3.1 - 2018-02-06 =
* Fix - Added `woocommerce_output_product_categories` to replace `woocommerce_product_subcategories` function to prevent outdated theme template files from outputting categories on the shop and category pages in err.
* Fix - Prevented columns from being set to anything lower than 1.
* Fix - Added extra error checking in Webhooks API to prevent notices when deleting Webhooks.
* Fix - Prevented list table classes being loaded multiple times. This also fixes compatibility with Smart Coupons extension.
* Fix - Removed stray debug string from order email template and fixed some typos.
* Fix - Set up the loop when calling wc_get_loop_prop. Fixes compatibility with some themes.
* Fix - Remove multiple application of filter 'woocommerce_order_item_product'.
* Fix - Protect against theme support being defined too late. Fixes some issues with custom themes defining WooCommerce support incorrectly.
* Fix - Add fallback for themes that just get the pagination template.
* Fix - Made the on-the-fly image regen also regenerate missing sizes.
* Fix - Fixed missing user_id in webhook migration script.
* Fix - Allow uncategorized category to be sorted like the others.
* Fix - If theme support changes, we may need to flush permalinks since some are changed based on this flag.
* Fix - Fire hooks for pagination etc only when pagination is enabled.
* Fix - Default HTML in end wrapper template.
* Fix - Prevent regular pagination showing on archives for unsupported themes.
* Fix - Fix shop when shown as homepage in unsupported themes.
* Fix - Fix SKU mapping for placeholders during CSV import.
* Fix - Use CRUD search helper in admin products table so partial SKU search works.
* Fix - Fix bulk sale/regular price percentage handling.
* Fix - More specificity on smallscreen style override for columns.
* Tweak - Add notice for moved store notice setting.
* Tweak - Allow removing coupons on editable orders only.
* Tweak - Extended the background processing library to avoid changing methods in the library.
* Tweak - Do not show row settings if something is managing the number of products per page.
* Tweak - Allow devs to add 'no-link' class to elements to prevent order view link being triggered on row click.
* Tweak - Made woocommerce_resize_images filter more useful by calling it later.
* Tweak - Revert default columns back to 4 so it's consistent with 3.2.
= 3.3.0 - 2018-01-30 =
* Feature - Improved default appearance in themes which do not support WooCommerce, making the shop page shortcode based.
* Feature - Products shortcodes; improved random sorting, with some caching.

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

View File

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

View File

@ -13,6 +13,9 @@ div.woocommerce-message {
p {
max-width: 700px;
}
p:last-child {
max-width: inherit;
}
}
p.woocommerce-actions,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -692,6 +692,16 @@ table.wc_status_table--tools {
}
}
.taxonomy-product_cat {
.column-thumb .woocommerce-help-tip {
font-size: 1.5em;
margin: 0 0 0 -34px;
padding: 0px 2px 5px;
display: block;
position: absolute;
}
}
#debug-report {
display: none;
margin: 10px 0;
@ -2198,7 +2208,6 @@ ul.wc_coupon_list_block {
.wc-order-preview-table {
width: 100%;
margin: 0;
border-bottom: 1px solid #ccc;
th, td {
padding: 1em 1.5em;
text-align: left;
@ -2237,11 +2246,14 @@ ul.wc_coupon_list_block {
}
}
.wc-order-preview-addresses {
overflow:hidden;
.wc-order-preview-address {
overflow: hidden;
padding-bottom: 1.5em;
.wc-order-preview-address,
.wc-order-preview-note {
width: 50%;
float: left;
padding: 1.5em;
padding: 1.5em 1.5em 0;
box-sizing: border-box;
word-wrap: break-word;
@ -2250,22 +2262,28 @@ ul.wc_coupon_list_block {
}
strong {
display: block;
margin-top: 1em;
margin-top: 1.5em;
}
strong:first-child {
margin-top: 0;
}
}
}
.wc-action-button,
.wc-action-button-group {
float: left;
margin-right: 4px;
}
}
@media screen and (max-width: 782px) {
.wc-action-button-group {
label {
display: none;
footer {
.wc-action-button-group {
display: inline-block;
float: left;
}
.button.button-large {
margin-left: 10px;
padding: 0 10px !important;
line-height: 28px;
height: auto;
display: inline-block;
}
}
.wc-action-button-group label {
display: none;
}
}
@ -2273,28 +2291,34 @@ ul.wc_coupon_list_block {
vertical-align: middle;
line-height: 26px;
text-align: left;
margin-bottom: 4px;
label {
margin-right: 6px;
cursor: default;
font-weight: bold;
line-height: 28px;
}
.wc-action-button-group__items {
white-space: nowrap;
display: inline-flex;
flex-flow: row wrap;
align-content: flex-start;
justify-content: flex-start;
}
.wc-action-button {
margin: 0 0 0 -1px !important;
border: 1px solid #ccc;
padding: 1px 10px !important;
padding: 0 10px !important;
border-radius: 0 !important;
float: none;
line-height: 28px;
height: auto;
z-index: 1;
position:relative;
max-width: 175px;
overflow: hidden;
text-overflow: ellipsis;
flex: 1 0 auto;
box-sizing: border-box;
text-align: center;
white-space: nowrap;
}
.wc-action-button:hover,
.wc-action-button:focus {
@ -2311,6 +2335,25 @@ ul.wc_coupon_list_block {
border-bottom-right-radius: 3px !important;
}
}
@media screen and (max-width: 782px) {
.wc-order-preview footer {
.wc-action-button-group .wc-action-button-group__items {
display: flex;
}
.wc-action-button-group {
float: none;
display: block;
margin-bottom: 4px;
}
.button.button-large {
width: 100%;
float: none;
text-align: center;
margin: 0;
display: block;
}
}
}
.column-customer_message .note-on {
@include ir();
@ -5702,7 +5745,8 @@ table.bar_chart {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 500px;
max-width: 100%;
min-width: 500px;
article {
overflow: auto;
}

View File

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

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -882,7 +882,7 @@ jQuery( function ( $ ) {
var index = $items.find('tr').length + 1;
var $row = '<tr data-meta_id="0">' +
'<td>' +
'<input type="text" placeholder="' + woocommerce_admin_meta_boxes_order.placeholder_name + '" name="meta_key[' + $item.attr( 'data-order_item_id' ) + '][new-' + index + ']" />' +
'<input type="text" maxlength="255" 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>' +
@ -918,9 +918,10 @@ jQuery( function ( $ ) {
}
var $rows = $table.find( 'tr.selected' );
var $bulk_edit_wraper = $( 'div.wc-order-item-bulk-edit' );
if ( $rows.length ) {
$( 'div.wc-order-item-bulk-edit' ).slideDown();
if ( $rows.length && $bulk_edit_wraper.children().length > 0 ) {
$bulk_edit_wraper.slideDown();
var selected_product = false;
@ -1006,10 +1007,18 @@ jQuery( function ( $ ) {
}
},
do_increase_stock: function( e ) {
modify_stock: function( e, action ) {
e.preventDefault();
wc_meta_boxes_order_items.block();
$( '#woocommerce-order-notes' ).block({
message: null,
overlayCSS: {
background: '#fff',
opacity: 0.6
}
});
var $table = $( 'table.woocommerce_order_items' );
var $rows = $table.find( 'tr.selected' );
var quantities = {};
@ -1027,7 +1036,7 @@ jQuery( function ( $ ) {
order_id: woocommerce_admin_meta_boxes.post_id,
order_item_ids: item_ids,
order_item_qty: quantities,
action: 'woocommerce_increase_order_item_stock',
action: action,
security: woocommerce_admin_meta_boxes.order_item_nonce
};
@ -1036,46 +1045,42 @@ jQuery( function ( $ ) {
data: data,
type: 'POST',
success: function( response ) {
window.alert( response );
wc_meta_boxes_order_items.unblock();
if ( true === response.success ) {
$.map( response.data, function( item ) {
// No items were updated.
if ( ! item.success ) {
window.alert( item.note );
return;
}
var order_note_data = {
action: 'woocommerce_add_order_note',
post_id: woocommerce_admin_meta_boxes.post_id,
note: item.note,
note_type: '',
security: woocommerce_admin_meta_boxes.add_order_note_nonce
};
$.post( woocommerce_admin_meta_boxes.ajax_url, order_note_data, function( response ) {
$( 'ul.order_notes' ).prepend( response );
});
});
}
$( '#woocommerce-order-notes' ).unblock();
}
});
},
do_increase_stock: function( e ) {
wc_meta_boxes_order_items.bulk_actions.modify_stock( e, 'woocommerce_increase_order_item_stock' );
},
do_reduce_stock: function( e ) {
e.preventDefault();
wc_meta_boxes_order_items.block();
var $table = $( 'table.woocommerce_order_items' );
var $rows = $table.find( 'tr.selected' );
var quantities = {};
var item_ids = $.map( $rows, function( $row ) {
return parseInt( $( $row ).data( 'order_item_id' ), 10 );
});
$rows.each(function() {
if ( $( this ).find( 'input.quantity' ).length ) {
quantities[ $( this ).attr( 'data-order_item_id' ) ] = $( this ).find( 'input.quantity' ).val();
}
});
var data = {
order_id: woocommerce_admin_meta_boxes.post_id,
order_item_ids: item_ids,
order_item_qty: quantities,
action: 'woocommerce_reduce_order_item_stock',
security: woocommerce_admin_meta_boxes.order_item_nonce
};
$.ajax({
url: woocommerce_admin_meta_boxes.ajax_url,
data: data,
type: 'POST',
success: function( response ) {
window.alert( response );
wc_meta_boxes_order_items.unblock();
}
});
wc_meta_boxes_order_items.bulk_actions.modify_stock( e, 'woocommerce_reduce_order_item_stock' );
}
},

View File

@ -17,7 +17,7 @@
paginationTemplate = wp.template( 'wc-tax-table-pagination' ),
$table = $( '.wc_tax_rates' ),
$tbody = $( '#rates' ),
$save_button = $( 'input[name="save"]' ),
$save_button = $( ':input[name="save"]' ),
$pagination = $( '#rates-pagination' ),
$search_field = $( '#rates-search .wc-tax-rates-search-field' ),
$submit = $( '.submit .button-primary[type=submit]' ),
@ -91,7 +91,7 @@
changes: self.changes
},
success: function( response, textStatus ) {
if ( 'success' === textStatus ) {
if ( 'success' === textStatus && response.success ) {
WCTaxTableModelInstance.set( 'rates', response.data.rates );
WCTaxTableModelInstance.trigger( 'change:rates' );
@ -125,7 +125,7 @@
$pagination.on( 'change', 'input', { view: this }, this.onPageChange );
$( window ).on( 'beforeunload', { view: this }, this.unloadConfirmation );
$submit.on( 'click', { view: this }, this.onSubmit );
$save_button.attr( 'disabled','disabled' );
$save_button.prop( 'disabled', true );
// Can bind these directly to the buttons, as they won't get overwritten.
$table.find( '.insert' ).on( 'click', { view: this }, this.onAddNewRow );
@ -319,11 +319,11 @@
},
setUnloadConfirmation: function() {
this.needsUnloadConfirm = true;
$save_button.removeAttr( 'disabled' );
$save_button.prop( 'disabled', false );
},
clearUnloadConfirmation: function() {
this.needsUnloadConfirm = false;
$save_button.attr( 'disabled', 'disabled' );
$save_button.prop( 'disabled', true );
},
unloadConfirmation: function( event ) {
if ( event.data.view.needsUnloadConfirm ) {

View File

@ -15,6 +15,13 @@ jQuery( function( $ ) {
$( table_selector ).find( '.column-handle' ).show();
$( document ).ajaxComplete( function( event, request, options ) {
if ( request && 4 === request.readyState && 200 === request.status && options.data && 0 <= options.data.indexOf( '_inline_edit' ) ) {
$( table_selector ).find( '.column-handle' ).show();
$( document.body ).trigger( 'init_tooltips' );
}
} );
$( table_selector ).sortable({
items: item_selector,
cursor: 'move',

View File

@ -1 +1 @@
jQuery(function(e){var t='.column-handle input[name="term_id"]';0===e("table.wp-list-table").find(".column-handle").length&&(e("table.wp-list-table").find("tr:not(.inline-edit-row)").append('<td class="column-handle"></td>'),t=".check-column input"),e("table.wp-list-table").find(".column-handle").show(),e("table.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(e,t){t.item.hasClass("alternate")||t.item.css("background-color","#ffffff"),t.item.children("td, th").css("border-bottom-width","0"),t.item.css("outline","1px solid #aaa")},stop:function(e,t){t.item.removeAttr("style"),t.item.children("td, th").css("border-bottom-width","1px")},update:function(n,i){var l,d,a=i.item.find(t).val(),o=i.item.find(".parent").html(),r=i.item.prev().find(t).val(),c=i.item.next().find(t).val();r!==undefined&&(l=i.item.prev().find(".parent").html())!==o&&(r=undefined),c!==undefined&&(d=i.item.next().find(".parent").html())!==o&&(c=undefined),r===undefined&&c===undefined||c===undefined&&d===r||c!==undefined&&l===a?e("table.wp-list-table").sortable("cancel"):(i.item.find(".check-column input").hide(),i.item.find(".check-column").append('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),e.post(ajaxurl,{action:"woocommerce_term_ordering",id:a,nextid:c,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(e){"children"===e?window.location.reload():(i.item.find(".check-column input").show(),i.item.find(".check-column").find("img").remove())}),e("table.widefat tbody tr").each(function(){jQuery("table.widefat tbody tr").index(this)%2==0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});
jQuery(function(e){var t="table.wp-list-table",n='.column-handle input[name="term_id"]';0===e(t).find(".column-handle").length&&(e(t).find("tr:not(.inline-edit-row)").append('<td class="column-handle"></td>'),n=".check-column input"),e(t).find(".column-handle").show(),e(document).ajaxComplete(function(){e(t).find(".column-handle").show()}),e(t).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(e,t){t.item.hasClass("alternate")||t.item.css("background-color","#ffffff"),t.item.children("td, th").css("border-bottom-width","0"),t.item.css("outline","1px solid #aaa")},stop:function(e,t){t.item.removeAttr("style"),t.item.children("td, th").css("border-bottom-width","1px")},update:function(i,d){var o,a,l=d.item.find(n).val(),c=d.item.find(".parent").html(),r=d.item.prev().find(n).val(),m=d.item.next().find(n).val();r!==undefined&&(o=d.item.prev().find(".parent").html())!==c&&(r=undefined),m!==undefined&&(a=d.item.next().find(".parent").html())!==c&&(m=undefined),r===undefined&&m===undefined||m===undefined&&a===r||m!==undefined&&o===l?e(t).sortable("cancel"):(d.item.find(".check-column input").hide(),d.item.find(".check-column").append('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),e.post(ajaxurl,{action:"woocommerce_term_ordering",id:l,nextid:m,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(e){"children"===e?window.location.reload():(d.item.find(".check-column input").show(),d.item.find(".check-column").find("img").remove())}),e("table.widefat tbody tr").each(function(){jQuery("table.widefat tbody tr").index(this)%2==0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});

View File

@ -22,10 +22,14 @@ jQuery( function( $ ) {
return true;
}
if ( window.getSelection && window.getSelection().toString().length ) {
return true;
}
var $row = $( this ).closest( 'tr' ),
href = $row.find( 'a.order-view' ).attr( 'href' );
if ( href.length ) {
if ( href && href.length ) {
e.preventDefault();
if ( e.metaKey || e.ctrlKey ) {

View File

@ -134,6 +134,7 @@ jQuery( function ( $ ) {
})
.on( 'init_tooltips', function() {
$( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( {
'attribute': 'data-tip',
'fadeIn': 50,

File diff suppressed because one or more lines are too long

View File

@ -1423,7 +1423,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$fee_total += $item->get_total();
}
// Calculate taxes for items, shipping, discounts.
// Calculate taxes for items, shipping, discounts. Note; this also triggers save().
if ( $and_taxes ) {
$this->calculate_taxes();
}

View File

@ -1808,7 +1808,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
} else {
$image = '';
}
return apply_filters( 'woocommerce_product_get_image', wc_get_relative_url( $image ), $this, $size, $attr, $placeholder );
return apply_filters( 'woocommerce_product_get_image', wc_get_relative_url( $image ), $this, $size, $attr, $placeholder, $image );
}
/**

View File

@ -221,9 +221,7 @@ class WC_Admin_Attributes {
* `product_attributes_type_selector` filter. If there is only the default type registered,
* this setting will be hidden.
*/
$attribute_types = wc_get_attribute_types();
if ( 1 < count( $attribute_types ) || ! array_key_exists( 'select', $attribute_types ) ) {
if ( wc_has_custom_attribute_types() ) {
?>
<tr class="form-field form-required">
<th scope="row" valign="top">
@ -294,7 +292,9 @@ class WC_Admin_Attributes {
<tr>
<th scope="col"><?php esc_html_e( 'Name', 'woocommerce' ); ?></th>
<th scope="col"><?php esc_html_e( 'Slug', 'woocommerce' ); ?></th>
<th scope="col"><?php esc_html_e( 'Type', 'woocommerce' ); ?></th>
<?php if ( wc_has_custom_attribute_types() ) : ?>
<th scope="col"><?php esc_html_e( 'Type', 'woocommerce' ); ?></th>
<?php endif; ?>
<th scope="col"><?php esc_html_e( 'Order by', 'woocommerce' ); ?></th>
<th scope="col"><?php esc_html_e( 'Terms', 'woocommerce' ); ?></th>
</tr>
@ -310,7 +310,9 @@ class WC_Admin_Attributes {
<div class="row-actions"><span class="edit"><a href="<?php echo esc_url( add_query_arg( 'edit', $tax->attribute_id, 'edit.php?post_type=product&amp;page=product_attributes' ) ); ?>"><?php esc_html_e( 'Edit', 'woocommerce' ); ?></a> | </span><span class="delete"><a class="delete" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'delete', $tax->attribute_id, 'edit.php?post_type=product&amp;page=product_attributes' ), 'woocommerce-delete-attribute_' . $tax->attribute_id ) ); ?>"><?php esc_html_e( 'Delete', 'woocommerce' ); ?></a></span></div>
</td>
<td><?php echo esc_html( $tax->attribute_name ); ?></td>
<td><?php echo esc_html( wc_get_attribute_type_label( $tax->attribute_type ) ); ?> <?php echo $tax->attribute_public ? esc_html__( '(Public)', 'woocommerce' ) : ''; ?></td>
<?php if ( wc_has_custom_attribute_types() ) : ?>
<td><?php echo esc_html( wc_get_attribute_type_label( $tax->attribute_type ) ); ?> <?php echo $tax->attribute_public ? esc_html__( '(Public)', 'woocommerce' ) : ''; ?></td>
<?php endif; ?>
<td><?php
switch ( $tax->attribute_orderby ) {
case 'name' :
@ -405,9 +407,7 @@ class WC_Admin_Attributes {
* `product_attributes_type_selector` filter. If there is only the default type registered,
* this setting will be hidden.
*/
$attribute_types = wc_get_attribute_types();
if ( 1 < count( $attribute_types ) || ! array_key_exists( 'select', $attribute_types ) ) {
if ( wc_has_custom_attribute_types() ) {
?>
<div class="form-field">
<label for="attribute_type"><?php esc_html_e( 'Type', 'woocommerce' ); ?></label>

View File

@ -28,12 +28,13 @@ class WC_Admin_Notices {
* @var array
*/
private static $core_notices = array(
'install' => 'install_notice',
'update' => 'update_notice',
'template_files' => 'template_file_check_notice',
'legacy_shipping' => 'legacy_shipping_notice',
'no_shipping_methods' => 'no_shipping_methods_notice',
'simplify_commerce' => 'simplify_commerce_notice',
'install' => 'install_notice',
'update' => 'update_notice',
'template_files' => 'template_file_check_notice',
'legacy_shipping' => 'legacy_shipping_notice',
'no_shipping_methods' => 'no_shipping_methods_notice',
'simplify_commerce' => 'simplify_commerce_notice',
'regenerating_thumbnails' => 'regenerating_thumbnails_notice',
);
/**
@ -124,7 +125,7 @@ class WC_Admin_Notices {
}
if ( ! current_user_can( 'manage_woocommerce' ) ) {
wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce' ) );
wp_die( __( 'You don&#8217;t have permission to do this.', 'woocommerce' ) );
}
$hide_notice = sanitize_text_field( $_GET['wc-hide-notice'] );
@ -315,6 +316,13 @@ class WC_Admin_Notices {
include( 'views/html-notice-simplify-commerce.php' );
}
}
/**
* Notice shown when regenerating thumbnails background process is running.
*/
public static function regenerating_thumbnails_notice() {
include( 'views/html-notice-regenerating-thumbnails.php' );
}
}
WC_Admin_Notices::init();

View File

@ -204,7 +204,7 @@ class WC_Admin_Permalink_Settings {
$shop_page_id = wc_get_page_id( 'shop' );
$shop_permalink = ( $shop_page_id > 0 && get_post( $shop_page_id ) ) ? get_page_uri( $shop_page_id ) : _x( 'shop', 'default-slug', 'woocommerce' );
if ( $shop_page_id && trim( $permalinks['product_base'], '/' ) === $shop_permalink ) {
if ( $shop_page_id && stristr( trim( $permalinks['product_base'], '/' ), $shop_permalink ) ) {
$permalinks['use_verbose_page_rules'] = true;
}

View File

@ -80,7 +80,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
self::check_download_folder_protection();
// Clear any unwanted data and flush rules.
add_option( 'woocommerce_queue_flush_rewrite_rules', 'true' );
update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
WC()->query->init_query_vars();
WC()->query->add_endpoints();

View File

@ -427,7 +427,12 @@ class WC_Admin_Setup_Wizard {
>
<option value=""><?php esc_html_e( 'Choose a currency&hellip;', 'woocommerce' ); ?></option>
<?php foreach ( get_woocommerce_currencies() as $code => $name ) : ?>
<option value="<?php echo esc_attr( $code ); ?>" <?php selected( $currency, $code ); ?>><?php printf( esc_html__( '%1$s (%2$s)', 'woocommerce' ), $name, get_woocommerce_currency_symbol( $code ) ); ?></option>
<option value="<?php echo esc_attr( $code ); ?>" <?php selected( $currency, $code ); ?>>
<?php
/* translators: 1: currency name 2: currency code */
echo esc_html( sprintf( __( '%1$s (%2$s)', 'woocommerce' ), $name, get_woocommerce_currency_symbol( $code ) ) );
?>
</option>
<?php endforeach; ?>
</select>
<script type="text/javascript">
@ -904,9 +909,9 @@ class WC_Admin_Setup_Wizard {
// @codingStandardsIgnoreStart
$setup_domestic = isset( $_POST['shipping_zones']['domestic']['enabled'] ) && ( 'yes' === $_POST['shipping_zones']['domestic']['enabled'] );
$domestic_method = sanitize_text_field( wp_unslash( $_POST['shipping_zones']['domestic']['method'] ) );
$domestic_method = isset( $_POST['shipping_zones']['domestic']['method'] ) ? sanitize_text_field( wp_unslash( $_POST['shipping_zones']['domestic']['method'] ) ) : '';
$setup_intl = isset( $_POST['shipping_zones']['intl']['enabled'] ) && ( 'yes' === $_POST['shipping_zones']['intl']['enabled'] );
$intl_method = sanitize_text_field( wp_unslash( $_POST['shipping_zones']['intl']['method'] ) );
$intl_method = isset( $_POST['shipping_zones']['intl']['method'] ) ? sanitize_text_field( wp_unslash( $_POST['shipping_zones']['intl']['method'] ) ) : '';
$weight_unit = sanitize_text_field( wp_unslash( $_POST['weight_unit'] ) );
$dimension_unit = sanitize_text_field( wp_unslash( $_POST['dimension_unit'] ) );
$existing_zones = WC_Shipping_Zones::get_zones();
@ -1304,7 +1309,7 @@ class WC_Admin_Setup_Wizard {
// Show the user-saved state if it was previously saved.
// Otherwise, rely on the item info.
if ( is_array( $previously_saved_settings ) ) {
$should_enable_toggle = 'yes' === $previously_saved_settings['enabled'];
$should_enable_toggle = isset( $previously_saved_settings['enabled'] ) && 'yes' === $previously_saved_settings['enabled'];
} else {
$should_enable_toggle = isset( $item_info['enabled'] ) && $item_info['enabled'];
}
@ -1884,8 +1889,8 @@ class WC_Admin_Setup_Wizard {
<li class="wc-wizard-next-step-item">
<div class="wc-wizard-next-step-description">
<p class="next-step-heading"><?php esc_html_e( 'Next step', 'woocommerce' ); ?></p>
<h3 class="next-step-description"><?php esc_html_e( 'Create your first product', 'woocommerce' ); ?></h3>
<p class="next-step-extra-info"><?php esc_html_e( "You're ready to add your first product.", 'woocommerce' ); ?></p>
<h3 class="next-step-description"><?php esc_html_e( 'Create some products', 'woocommerce' ); ?></h3>
<p class="next-step-extra-info"><?php esc_html_e( "You're ready to add products to your store.", 'woocommerce' ); ?></p>
</div>
<div class="wc-wizard-next-step-action">
<p class="wc-setup-actions step">

View File

@ -2,8 +2,6 @@
/**
* Debug/Status page
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/System Status
* @version 2.2.0
*/

View File

@ -36,8 +36,13 @@ class WC_Admin_Taxonomies {
add_filter( 'manage_edit-product_cat_columns', array( $this, 'product_cat_columns' ) );
add_filter( 'manage_product_cat_custom_column', array( $this, 'product_cat_column' ), 10, 3 );
// Add row actions.
add_filter( 'product_cat_row_actions', array( $this, 'product_cat_row_actions' ), 10, 2 );
add_filter( 'admin_init', array( $this, 'handle_product_cat_row_actions' ) );
// Taxonomy page descriptions
add_action( 'product_cat_pre_add_form', array( $this, 'product_cat_description' ) );
add_action( 'after-product_cat-table', array( $this, 'product_cat_notes' ) );
$attribute_taxonomies = wc_get_attribute_taxonomies();
@ -295,6 +300,29 @@ class WC_Admin_Taxonomies {
echo wpautop( __( 'Product categories for your store can be managed here. To change the order of categories on the front-end you can drag and drop to sort them. To see more categories listed click the "screen options" link at the top-right of this page.', 'woocommerce' ) );
}
/**
* Add some notes to describe the behavior of the default category.
*/
public function product_cat_notes() {
$category_id = get_option( 'default_product_cat', 0 );
$category = get_term( $category_id, 'product_cat' );
$category_name = ( ! $category || is_wp_error( $category ) ) ? _x( 'Uncategorized', 'Default category slug', 'woocommerce' ) : $category->name;
?>
<div class="form-wrap edit-term-notes">
<p>
<strong><?php _e( 'Note:', 'woocommerce' ) ?></strong><br>
<?php
printf(
/* translators: %s: default category */
__( 'Deleting a category does not delete the products in that category. Instead, products that were only assigned to the deleted category are set to the category %s.', 'woocommerce' ),
'<strong>' . esc_html( $category_name ) . '</strong>'
);
?>
</p>
</div>
<?php
}
/**
* Description for shipping class page to aid users.
*/
@ -324,6 +352,42 @@ class WC_Admin_Taxonomies {
return $columns;
}
/**
* Adjust row actions.
*
* @param array $actions Array of actions.
* @param object $term Term object.
* @return array
*/
public function product_cat_row_actions( $actions = array(), $term ) {
$default_category_id = absint( get_option( 'default_product_cat', 0 ) );
if ( $default_category_id !== $term->term_id && current_user_can( 'edit_term', $term->term_id ) ) {
$actions['make_default'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
wp_nonce_url( 'edit-tags.php?action=make_default&amp;taxonomy=product_cat&amp;tag_ID=' . absint( $term->term_id ), 'make_default_' . absint( $term->term_id ) ),
/* translators: %s: taxonomy term name */
esc_attr( sprintf( __( 'Make &#8220;%s&#8221; the default category', 'woocommerce' ), $term->name ) ),
__( 'Make default', 'woocommerce' )
);
}
return $actions;
}
/**
* Handle custom row actions.
*/
public function handle_product_cat_row_actions() {
if ( isset( $_GET['action'], $_GET['tag_ID'], $_GET['_wpnonce'] ) && 'make_default' === $_GET['action'] ) {
$make_default_id = absint( $_GET['tag_ID'] );
if ( wp_verify_nonce( $_GET['_wpnonce'], 'make_default_' . $make_default_id ) && current_user_can( 'edit_term', $make_default_id ) ) {
update_option( 'default_product_cat', $make_default_id );
}
}
}
/**
* Thumbnail column value added to category admin.
*
@ -335,6 +399,13 @@ class WC_Admin_Taxonomies {
*/
public function product_cat_column( $columns, $column, $id ) {
if ( 'thumb' === $column ) {
// Prepend tooltip for default category.
$default_category_id = absint( get_option( 'default_product_cat', 0 ) );
if ( $default_category_id === $id ) {
$columns .= wc_help_tip( __( 'This is the default category and it cannot be deleted. It will be automatically assigned to products with no category.', 'woocommerce' ) );
}
$thumbnail_id = get_woocommerce_term_meta( $id, 'thumbnail_id', true );
if ( $thumbnail_id ) {

View File

@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/* translators: %s: maximum upload size */
printf(
esc_html__( 'Maximum size: %s', 'woocommerce' ),
absint( $size )
$size
);
?>
</small>
@ -95,4 +95,4 @@ if ( ! defined( 'ABSPATH' ) ) {
<button type="submit" class="button button-primary button-next" value="<?php esc_attr_e( 'Continue', 'woocommerce' ); ?>" name="save_step"><?php esc_html_e( 'Continue', 'woocommerce' ); ?></button>
<?php wp_nonce_field( 'woocommerce-csv-importer' ); ?>
</div>
</form>
</form>

View File

@ -3,8 +3,6 @@
* List tables: orders.
*
* @author WooCommerce
* @category Admin
* @package WooCommerce/Admin
* @version 3.3.0
*/
@ -225,7 +223,8 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
protected function render_order_date_column() {
$order_timestamp = $this->object->get_date_created()->getTimestamp();
if ( $order_timestamp > strtotime( '-1 day', current_time( 'timestamp', true ) ) ) {
// Check if the order was created within the last 24 hours, and not in the future.
if ( $order_timestamp > strtotime( '-1 day', current_time( 'timestamp', true ) ) && $order_timestamp <= current_time( 'timestamp', true ) ) {
$show_date = sprintf(
/* translators: %s: human-readable time difference */
_x( '%s ago', '%s = human-readable time difference', 'woocommerce' ),
@ -375,17 +374,19 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
<a href="{{ data.shipping_address_map_url }}" target="_blank">{{{ data.formatted_shipping_address }}}</a>
<# } #>
<# if ( data.data.customer_note ) { #>
<strong><?php esc_html_e( 'Note', 'woocommerce' ); ?></strong>
{{ data.data.customer_note }}
<# } #>
<# if ( data.shipping_via ) { #>
<strong><?php esc_html_e( 'Shipping method', 'woocommerce' ); ?></strong>
{{ data.shipping_via }}
<# } #>
</div>
<# } #>
<# if ( data.data.customer_note ) { #>
<div class="wc-order-preview-note">
<strong><?php esc_html_e( 'Note', 'woocommerce' ); ?></strong>
{{ data.data.customer_note }}
</div>
<# } #>
</div>
{{{ data.item_html }}}
@ -396,7 +397,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
<div class="inner">
{{{ data.actions_html }}}
<a class="button button-primary button-large" href="<?php echo esc_url( admin_url( 'post.php?action=edit' ) ); ?>&post={{ data.data.id }}"><?php esc_html_e( 'Edit order', 'woocommerce' ); ?></a>
<a class="button button-primary button-large" aria-label="<?php esc_attr_e( 'Edit this order', 'woocommerce' ); ?>" href="<?php echo esc_url( admin_url( 'post.php?action=edit' ) ); ?>&post={{ data.data.id }}"><?php esc_html_e( 'Edit', 'woocommerce' ); ?></a>
</div>
</footer>
</section>
@ -530,6 +531,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
$status_actions['on-hold'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=on-hold&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
'name' => __( 'On-hold', 'woocommerce' ),
'title' => __( 'Change order status to on-hold', 'woocommerce' ),
'action' => 'on-hold',
);
}
@ -538,6 +540,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
$status_actions['processing'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=processing&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
'name' => __( 'Processing', 'woocommerce' ),
'title' => __( 'Change order status to processing', 'woocommerce' ),
'action' => 'processing',
);
}
@ -546,6 +549,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
$status_actions['complete'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
'name' => __( 'Completed', 'woocommerce' ),
'title' => __( 'Change order status to completed', 'woocommerce' ),
'action' => 'complete',
);
}

View File

@ -38,6 +38,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
add_filter( 'disable_months_dropdown', '__return_true' );
add_filter( 'query_vars', array( $this, 'add_custom_query_var' ) );
add_filter( 'views_edit-product', array( $this, 'product_views' ) );
add_filter( 'get_search_query', array( $this, 'search_label' ) );
}
/**
@ -456,10 +457,13 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
}
// Search using CRUD.
if ( isset( $query_vars['s'] ) ) {
if ( ! empty( $query_vars['s'] ) ) {
$data_store = WC_Data_Store::load( 'product' );
$ids = $data_store->search_products( wc_clean( $query_vars['s'] ), '', true );
$ids = $data_store->search_products( wc_clean( $query_vars['s'] ), '', true, true );
$query_vars['post__in'] = array_merge( $ids, array( 0 ) );
// So we know we are searching products.
$query_vars['product_search'] = true;
unset( $query_vars['s'] );
}
return $query_vars;
@ -499,4 +503,20 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
return $views;
}
/**
* Change the label when searching products
*
* @param string $query Search Query.
* @return string
*/
public function search_label( $query ) {
global $pagenow, $typenow;
if ( 'edit.php' !== $pagenow || 'product' !== $typenow || ! get_query_var( 'product_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.
return $query;
}
return wc_clean( wp_unslash( $_GET['s'] ) ); // WPCS: input var ok, sanitization ok.
}
}

View File

@ -25,21 +25,18 @@ class WC_Meta_Box_Product_Images {
* @param WP_Post $post
*/
public static function output( $post ) {
global $thepostid, $product_object;
$thepostid = $post->ID;
$product_object = $thepostid ? wc_get_product( $thepostid ) : new WC_Product;
wp_nonce_field( 'woocommerce_save_data', 'woocommerce_meta_nonce' );
?>
<div id="product_images_container">
<ul class="product_images">
<?php
if ( metadata_exists( 'post', $post->ID, '_product_image_gallery' ) ) {
$product_image_gallery = get_post_meta( $post->ID, '_product_image_gallery', true );
} else {
// Backwards compatibility.
$attachment_ids = get_posts( 'post_parent=' . $post->ID . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids&meta_key=_woocommerce_exclude_image&meta_value=0' );
$attachment_ids = array_diff( $attachment_ids, array( get_post_thumbnail_id() ) );
$product_image_gallery = implode( ',', $attachment_ids );
}
$product_image_gallery = $product_object->get_gallery_image_ids( 'edit' );
$attachments = array_filter( explode( ',', $product_image_gallery ) );
$attachments = array_filter( $product_image_gallery );
$update_meta = false;
$updated_gallery_ids = array();
@ -72,7 +69,7 @@ class WC_Meta_Box_Product_Images {
?>
</ul>
<input type="hidden" id="product_image_gallery" name="product_image_gallery" value="<?php echo esc_attr( $product_image_gallery ); ?>" />
<input type="hidden" id="product_image_gallery" name="product_image_gallery" value="<?php echo esc_attr( implode( ',', $updated_gallery_ids ) ) ?>" />
</div>
<p class="add_product_images hide-if-no-js">
@ -88,8 +85,12 @@ class WC_Meta_Box_Product_Images {
* @param WP_Post $post
*/
public static function save( $post_id, $post ) {
$product_type = empty( $_POST['product-type'] ) ? WC_Product_Factory::get_product_type( $post_id ) : sanitize_title( stripslashes( $_POST['product-type'] ) );
$classname = WC_Product_Factory::get_product_classname( $post_id, $product_type ? $product_type : 'simple' );
$product = new $classname( $post_id );
$attachment_ids = isset( $_POST['product_image_gallery'] ) ? array_filter( explode( ',', wc_clean( $_POST['product_image_gallery'] ) ) ) : array();
update_post_meta( $post_id, '_product_image_gallery', implode( ',', $attachment_ids ) );
$product->set_gallery_image_ids( $attachment_ids );
$product->save();
}
}

View File

@ -44,7 +44,7 @@ $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', arr
?>
<tr data-meta_id="<?php echo esc_attr( $meta_id ); ?>">
<td>
<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 ); ?>" />
<input type="text" maxlength="255" 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>

View File

@ -98,8 +98,11 @@ if ( wc_tax_enabled() ) {
<button type="button" class="button bulk-delete-items"><?php esc_html_e( 'Delete selected row(s)', 'woocommerce' ); ?></button>
<?php endif; ?>
<button type="button" class="button bulk-decrease-stock"><?php esc_html_e( 'Reduce stock', 'woocommerce' ); ?></button>
<button type="button" class="button bulk-increase-stock"><?php esc_html_e( 'Increase stock', 'woocommerce' ); ?></button>
<?php if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) : ?>
<button type="button" class="button bulk-decrease-stock"><?php esc_html_e( 'Reduce stock', 'woocommerce' ); ?></button>
<button type="button" class="button bulk-increase-stock"><?php esc_html_e( 'Increase stock', 'woocommerce' ); ?></button>
<?php endif; ?>
<?php do_action( 'woocommerce_admin_order_item_bulk_actions', $order ); ?>
</div>
<div class="wc-order-data-row wc-order-totals-items wc-order-items-editable">

View File

@ -151,17 +151,31 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
$tax_rows = array();
foreach ( $tax_rows_orders + $tax_rows_partial_refunds as $tax_row ) {
$key = date( ( 'month' === $this->chart_groupby ) ? 'Ym' : 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ] = isset( $tax_rows[ $key ] ) ? $tax_rows[ $key ] : (object) array( 'tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0 );
$key = date( ( 'month' === $this->chart_groupby ) ? 'Ym': 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ] = isset( $tax_rows[ $key ] ) ? $tax_rows[ $key ]: (object) array(
'tax_amount' => 0,
'shipping_tax_amount' => 0,
'total_sales' => 0,
'total_shipping' => 0,
'total_orders' => 0,
);
}
foreach ( $tax_rows_orders as $tax_row ) {
$key = date( ( 'month' === $this->chart_groupby ) ? 'Ym': 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ]->total_orders += $tax_row->total_orders;
$tax_rows[ $key ]->tax_amount += $tax_row->tax_amount;
$tax_rows[ $key ]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[ $key ]->total_sales += $tax_row->total_sales;
$tax_rows[ $key ]->total_shipping += $tax_row->total_shipping;
}
foreach ( $tax_rows_orders as $tax_row ) {
$key = date( ( 'month' === $this->chart_groupby ) ? 'Ym': 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ]->total_orders += $tax_row->total_orders;
foreach ( $tax_rows_partial_refunds as $tax_row ) {
$key = date( ( 'month' === $this->chart_groupby ) ? 'Ym': 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ]->tax_amount += $tax_row->tax_amount;
$tax_rows[ $key ]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[ $key ]->total_sales += $tax_row->total_sales;
$tax_rows[ $key ]->total_shipping += $tax_row->total_shipping;
}
foreach ( $tax_rows_full_refunds as $tax_row ) {

View File

@ -373,6 +373,10 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
}
}
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
}

View File

@ -285,7 +285,12 @@ class WC_Settings_General extends WC_Settings_Page {
<p><?php
/* translators: %s: URL to customizer. */
echo wp_kses( sprintf( __( 'Looking for the store notice setting? It can now be found <a href="%s">in the Customizer</a>.', 'woocommerce' ), esc_url( admin_url( 'customize.php?url=' . wc_get_page_permalink( 'shop' ) . '&autofocus[panel]=woocommerce' ) ) ), array(
echo wp_kses( sprintf( __( 'Looking for the store notice setting? It can now be found <a href="%s">in the Customizer</a>.', 'woocommerce' ), esc_url( add_query_arg( array(
'autofocus' => array(
'panel' => 'woocommerce',
),
'url' => wc_get_page_permalink( 'shop' ),
), admin_url( 'customize.php' ) ) ) ), array(
'a' => array(
'href' => array(),
'title' => array(),

View File

@ -75,7 +75,12 @@ class WC_Settings_Products extends WC_Settings_Page {
<p><?php
/* translators: %s: URL to customizer. */
echo wp_kses( sprintf( __( 'Looking for the product display options? They can now be found in the Customizer. <a href="%s">Go see them in action here.</a>', 'woocommerce' ), esc_url( admin_url( 'customize.php?url=' . wc_get_page_permalink( 'shop' ) . '&autofocus[panel]=woocommerce' ) ) ), array(
echo wp_kses( sprintf( __( 'Looking for the product display options? They can now be found in the Customizer. <a href="%s">Go see them in action here.</a>', 'woocommerce' ), esc_url( add_query_arg( array(
'autofocus' => array(
'panel' => 'woocommerce',
),
'url' => wc_get_page_permalink( 'shop' ),
), admin_url( 'customize.php' ) ) ) ), array(
'a' => array(
'href' => array(),
'title' => array(),
@ -94,6 +99,10 @@ class WC_Settings_Products extends WC_Settings_Page {
$settings = $this->get_settings( $current_section );
WC_Admin_Settings::save_fields( $settings );
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
/**

View File

@ -146,6 +146,10 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
if ( apply_filters( 'woocommerce_rest_api_valid_to_save', ! in_array( $current_section, array( 'keys', 'webhooks' ), true ) ) ) {
$settings = $this->get_settings();
WC_Admin_Settings::save_fields( $settings );
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
}
}
}

View File

@ -186,6 +186,10 @@ class WC_Settings_Shipping extends WC_Settings_Page {
break;
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
// Increments the transient version to invalidate cache.
WC_Cache_Helper::get_transient_version( 'shipping', true );
}

View File

@ -118,6 +118,10 @@ class WC_Settings_Tax extends WC_Settings_Page {
$this->save_tax_rates();
}
if ( $current_section ) {
do_action( 'woocommerce_update_options_' . $this->id . '_' . $current_section );
}
// Invalidate caches.
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
WC_Cache_Helper::get_transient_version( 'shipping', true );

View File

@ -60,8 +60,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="wc-shipping-zone-postcodes">
<textarea name="zone_postcodes" data-attribute="zone_postcodes" id="zone_postcodes" placeholder="<?php esc_attr_e( 'List 1 postcode per line', 'woocommerce' ); ?>" class="input-text large-text" cols="25" rows="5"><?php echo esc_textarea( implode( "\n", $postcodes ) ); ?></textarea>
<?php /* translators: WooCommerce link to setting up shipping zones */ ?>
<span class="description"><?php sprintf( _e( 'Postcodes containing wildcards (e.g. CB23*) or fully numeric ranges (e.g. <code>90210...99000</code>) are also supported. Please see the shipping zones <a href="%s" target="_blank">documentation</a>) for more information.', 'woocommerce' ), 'https://docs.woocommerce.com/document/setting-up-shipping-zones/#section-3' ); ?></span><?php // @codingStandardsIgnoreLine. ?>
?>
<span class="description"><?php printf( __( 'Postcodes containing wildcards (e.g. CB23*) or fully numeric ranges (e.g. <code>90210...99000</code>) are also supported. Please see the shipping zones <a href="%s" target="_blank">documentation</a>) for more information.', 'woocommerce' ), 'https://docs.woocommerce.com/document/setting-up-shipping-zones/#section-3' ); ?></span><?php // @codingStandardsIgnoreLine. ?>
</div>
</td>
<?php endif; ?>

View File

@ -31,7 +31,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<tr valign="top">
<th scope="row" class="titledesc">
<label for="webhook_status"><?php esc_html_e( 'Status', 'woocommerce' ); ?></label>
<?php wc_help_tip( __( 'The options are &quot;Active&quot; (delivers payload), &quot;Paused&quot; (does not deliver), or &quot;Disabled&quot; (does not deliver due delivery failures).', 'woocommerce' ) ); ?>
<?php echo wc_help_tip( __( 'The options are &quot;Active&quot; (delivers payload), &quot;Paused&quot; (does not deliver), or &quot;Disabled&quot; (does not deliver due delivery failures).', 'woocommerce' ) ); ?>
</th>
<td class="forminp">
<select name="webhook_status" id="webhook_status" class="wc-enhanced-select">

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
<?php
/**
* Admin View: Notice - Regenerating thumbnails.
*/
defined( 'ABSPATH' ) || exit;
?>
<div id="message" class="updated woocommerce-message">
<a class="woocommerce-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'regenerating_thumbnails' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php _e( 'Cancel thumbnail regeneration', 'woocommerce' ); ?></a>
<p><?php esc_html_e( 'Thumbnail regeneration is running in the background. Depending on the amount of images in your store this may take a while.', 'woocommerce' ); ?></p>
</div>

View File

@ -234,7 +234,7 @@ function wc_save_order_items( $order_id, $items ) {
if ( isset( $items['meta_key'][ $item_id ], $items['meta_value'][ $item_id ] ) ) {
foreach ( $items['meta_key'][ $item_id ] as $meta_id => $meta_key ) {
$meta_key = wp_unslash( $meta_key );
$meta_key = substr( wp_unslash( $meta_key ), 0, 255 );
$meta_value = isset( $items['meta_value'][ $item_id ][ $meta_id ] ) ? wp_unslash( $items['meta_value'][ $item_id ][ $meta_id ] ): '';
if ( '' === $meta_key && '' === $meta_value ) {
@ -324,7 +324,7 @@ function wc_render_action_buttons( $actions ) {
if ( isset( $action['group'] ) ) {
$actions_html .= '<div class="wc-action-button-group"><label>' . $action['group'] . '</label> <span class="wc-action-button-group__items">' . wc_render_action_buttons( $action['actions'] ) . '</span></div>';
} elseif ( isset( $action['action'], $action['url'], $action['name'] ) ) {
$actions_html .= sprintf( '<a class="button wc-action-button wc-action-button-%s %s" href="%s" title="%s">%s</a>', esc_attr( $action['action'] ), esc_attr( $action['action'] ), esc_url( $action['url'] ), esc_attr( $action['name'] ), esc_attr( $action['name'] ) );
$actions_html .= sprintf( '<a class="button wc-action-button wc-action-button-%1$s %1$s" href="%2$s" aria-label="%3$s" title="%3$s">%4$s</a>', esc_attr( $action['action'] ), esc_url( $action['url'] ), esc_attr( isset( $action['title'] ) ? $action['title'] : $action['name'] ), esc_html( $action['name'] ) );
}
}

View File

@ -433,6 +433,9 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
if ( ! is_null( $value ) ) {
switch ( $key ) {
case 'status' :
// Status change should be done later so transitions have new data.
break;
case 'billing' :
case 'shipping' :
$this->update_address( $order, $value, $key );
@ -514,25 +517,25 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
$object->set_created_via( 'rest-api' );
$object->set_prices_include_tax( 'yes' === get_option( 'woocommerce_prices_include_tax' ) );
$object->calculate_totals();
} else {
// If items have changed, recalculate order totals.
if ( isset( $request['billing'] ) || isset( $request['shipping'] ) || isset( $request['line_items'] ) || isset( $request['shipping_lines'] ) || isset( $request['fee_lines'] ) || isset( $request['coupon_lines'] ) ) {
$object->calculate_totals();
}
}
// Set status.
if ( ! empty( $request['status'] ) ) {
$object->set_status( $request['status'] );
}
$object->save();
// Actions for after the order is saved.
if ( $creating ) {
if ( true === $request['set_paid'] ) {
if ( true === $request['set_paid'] ) {
if ( $creating || $object->needs_payment() ) {
$object->payment_complete( $request['transaction_id'] );
}
} else {
// Handle set paid.
if ( $object->needs_payment() && true === $request['set_paid'] ) {
$object->payment_complete( $request['transaction_id'] );
}
// If items have changed, recalculate order totals.
if ( isset( $request['billing'] ) || isset( $request['shipping'] ) || isset( $request['line_items'] ) || isset( $request['shipping_lines'] ) || isset( $request['fee_lines'] ) || isset( $request['coupon_lines'] ) ) {
$object->calculate_totals();
}
}
return $this->get_object( $object->get_id() );

View File

@ -1740,7 +1740,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
),
'shipping_class_id' => array(
'description' => __( 'Shipping class ID.', 'woocommerce' ),
'type' => 'string',
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),

View File

@ -38,15 +38,18 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
* Register the route for /system_status
*/
public function register_routes() {
register_rest_route( $this->namespace, '/' . $this->rest_base, array(
register_rest_route(
$this->namespace, '/' . $this->rest_base,
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
) );
array(
'methods' => WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, 'get_items_permissions_check' ),
'args' => $this->get_collection_params(),
),
'schema' => array( $this, 'get_public_item_schema' ),
)
);
}
/**
@ -69,9 +72,9 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
* @return WP_Error|WP_REST_Response
*/
public function get_items( $request ) {
$schema = $this->get_item_schema();
$mappings = $this->get_item_mappings();
$response = array();
$schema = $this->get_item_schema();
$mappings = $this->get_item_mappings();
$response = array();
foreach ( $mappings as $section => $values ) {
foreach ( $values as $key => $value ) {
@ -99,135 +102,135 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'title' => 'system_status',
'type' => 'object',
'properties' => array(
'environment' => array(
'environment' => array(
'description' => __( 'Environment.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view' ),
'readonly' => true,
'properties' => array(
'home_url' => array(
'home_url' => array(
'description' => __( 'Home URL.', 'woocommerce' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'view' ),
'readonly' => true,
),
'site_url' => array(
'site_url' => array(
'description' => __( 'Site URL.', 'woocommerce' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'view' ),
'readonly' => true,
),
'wc_version' => array(
'wc_version' => array(
'description' => __( 'WooCommerce version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'log_directory' => array(
'log_directory' => array(
'description' => __( 'Log directory.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'log_directory_writable' => array(
'log_directory_writable' => array(
'description' => __( 'Is log directory writable?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'wp_version' => array(
'wp_version' => array(
'description' => __( 'WordPress version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'wp_multisite' => array(
'wp_multisite' => array(
'description' => __( 'Is WordPress multisite?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'wp_memory_limit' => array(
'wp_memory_limit' => array(
'description' => __( 'WordPress memory limit.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'wp_debug_mode' => array(
'wp_debug_mode' => array(
'description' => __( 'Is WordPress debug mode active?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'wp_cron' => array(
'wp_cron' => array(
'description' => __( 'Are WordPress cron jobs enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'language' => array(
'language' => array(
'description' => __( 'WordPress language.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'server_info' => array(
'server_info' => array(
'description' => __( 'Server info.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'php_version' => array(
'php_version' => array(
'description' => __( 'PHP version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'php_post_max_size' => array(
'php_post_max_size' => array(
'description' => __( 'PHP post max size.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'php_max_execution_time' => array(
'php_max_execution_time' => array(
'description' => __( 'PHP max execution time.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'php_max_input_vars' => array(
'php_max_input_vars' => array(
'description' => __( 'PHP max input vars.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'curl_version' => array(
'curl_version' => array(
'description' => __( 'cURL version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'suhosin_installed' => array(
'suhosin_installed' => array(
'description' => __( 'Is SUHOSIN installed?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'max_upload_size' => array(
'max_upload_size' => array(
'description' => __( 'Max upload size.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'mysql_version' => array(
'mysql_version' => array(
'description' => __( 'MySQL version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'default_timezone' => array(
'default_timezone' => array(
'description' => __( 'Default timezone.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
@ -239,49 +242,49 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'soapclient_enabled' => array(
'soapclient_enabled' => array(
'description' => __( 'Is SoapClient class enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'domdocument_enabled' => array(
'domdocument_enabled' => array(
'description' => __( 'Is DomDocument class enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'gzip_enabled' => array(
'gzip_enabled' => array(
'description' => __( 'Is GZip enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'mbstring_enabled' => array(
'mbstring_enabled' => array(
'description' => __( 'Is mbstring enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'remote_post_successful' => array(
'remote_post_successful' => array(
'description' => __( 'Remote POST successful?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'remote_post_response' => array(
'remote_post_response' => array(
'description' => __( 'Remote POST response.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'remote_get_successful' => array(
'remote_get_successful' => array(
'description' => __( 'Remote GET successful?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'remote_get_response' => array(
'remote_get_response' => array(
'description' => __( 'Remote GET response.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
@ -289,19 +292,19 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
),
),
),
'database' => array(
'database' => array(
'description' => __( 'Database.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view' ),
'readonly' => true,
'properties' => array(
'wc_database_version' => array(
'wc_database_version' => array(
'description' => __( 'WC database version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'database_prefix' => array(
'database_prefix' => array(
'description' => __( 'Database prefix.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
@ -313,13 +316,13 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'database_tables' => array(
'database_tables' => array(
'description' => __( 'Database tables.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
),
@ -330,41 +333,41 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
'theme' => array(
'theme' => array(
'description' => __( 'Theme.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view' ),
'readonly' => true,
'properties' => array(
'name' => array(
'name' => array(
'description' => __( 'Theme name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'version' => array(
'version' => array(
'description' => __( 'Theme version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'version_latest' => array(
'version_latest' => array(
'description' => __( 'Latest version of theme.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'author_url' => array(
'author_url' => array(
'description' => __( 'Theme author URL.', 'woocommerce' ),
'type' => 'string',
'format' => 'uri',
'context' => array( 'view' ),
'readonly' => true,
),
'is_child_theme' => array(
'is_child_theme' => array(
'description' => __( 'Is this theme a child theme?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
@ -376,40 +379,40 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'has_woocommerce_file' => array(
'has_woocommerce_file' => array(
'description' => __( 'Does the theme have a woocommerce.php file?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'has_outdated_templates' => array(
'has_outdated_templates' => array(
'description' => __( 'Does this theme have outdated templates?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'overrides' => array(
'overrides' => array(
'description' => __( 'Template overrides.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
'parent_name' => array(
'parent_name' => array(
'description' => __( 'Parent theme name.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'parent_version' => array(
'parent_version' => array(
'description' => __( 'Parent theme version.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'parent_author_url' => array(
'parent_author_url' => array(
'description' => __( 'Parent theme author URL.', 'woocommerce' ),
'type' => 'string',
'format' => 'uri',
@ -418,73 +421,73 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
),
),
),
'settings' => array(
'settings' => array(
'description' => __( 'Settings.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view' ),
'readonly' => true,
'properties' => array(
'api_enabled' => array(
'api_enabled' => array(
'description' => __( 'REST API enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'force_ssl' => array(
'force_ssl' => array(
'description' => __( 'SSL forced?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'currency' => array(
'currency' => array(
'description' => __( 'Currency.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'currency_symbol' => array(
'currency_symbol' => array(
'description' => __( 'Currency symbol.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'currency_position' => array(
'currency_position' => array(
'description' => __( 'Currency position.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'thousand_separator' => array(
'thousand_separator' => array(
'description' => __( 'Thousand separator.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'decimal_separator' => array(
'decimal_separator' => array(
'description' => __( 'Decimal separator.', 'woocommerce' ),
'type' => 'string',
'context' => array( 'view' ),
'readonly' => true,
),
'number_of_decimals' => array(
'number_of_decimals' => array(
'description' => __( 'Number of decimals.', 'woocommerce' ),
'type' => 'integer',
'context' => array( 'view' ),
'readonly' => true,
),
'geolocation_enabled' => array(
'geolocation_enabled' => array(
'description' => __( 'Geolocation enabled?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
'readonly' => true,
),
'taxonomies' => array(
'taxonomies' => array(
'description' => __( 'Taxonomy terms for product/order statuses.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
'product_visibility_terms' => array(
@ -493,12 +496,12 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
),
),
'security' => array(
'security' => array(
'description' => __( 'Security.', 'woocommerce' ),
'type' => 'object',
'context' => array( 'view' ),
@ -510,7 +513,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'hide_errors' => array(
'hide_errors' => array(
'description' => __( 'Hide errors from visitors?', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view' ),
@ -518,13 +521,13 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
),
),
),
'pages' => array(
'pages' => array(
'description' => __( 'WooCommerce pages.', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view' ),
'readonly' => true,
'items' => array(
'type' => 'string',
'type' => 'string',
),
),
),
@ -573,21 +576,24 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
}
// Test POST requests
$post_response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array(
'timeout' => 10,
'user-agent' => 'WooCommerce/' . WC()->version,
'httpversion' => '1.1',
'body' => array(
'cmd' => '_notify-validate',
),
) );
$post_response = wp_safe_remote_post(
'https://www.paypal.com/cgi-bin/webscr',
array(
'timeout' => 10,
'user-agent' => 'WooCommerce/' . WC()->version,
'httpversion' => '1.1',
'body' => array(
'cmd' => '_notify-validate',
),
)
);
$post_response_successful = false;
if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) {
$post_response_successful = true;
}
// Test GET requests
$get_response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) );
$get_response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) );
$get_response_successful = false;
if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) {
$get_response_successful = true;
@ -597,7 +603,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
return array(
'home_url' => get_option( 'home' ),
'site_url' => get_option( 'siteurl' ),
'version' => WC()->version,
'version' => WC()->version,
'log_directory' => WC_LOG_DIR,
'log_directory_writable' => ( @fopen( WC_LOG_DIR . 'test-log.log', 'a' ) ? true : false ),
'wp_version' => get_bloginfo( 'version' ),
@ -606,6 +612,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'wp_debug_mode' => ( defined( 'WP_DEBUG' ) && WP_DEBUG ),
'wp_cron' => ! ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ),
'language' => get_locale(),
'external_object_cache' => wp_using_ext_object_cache(),
'server_info' => $_SERVER['SERVER_SOFTWARE'],
'php_version' => phpversion(),
'php_post_max_size' => wc_let_to_num( ini_get( 'post_max_size' ) ),
@ -647,33 +654,39 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
public function get_database_info() {
global $wpdb;
$database_table_sizes = $wpdb->get_results( $wpdb->prepare( "
SELECT
table_name AS 'name',
round( ( data_length / 1024 / 1024 ), 2 ) 'data',
round( ( index_length / 1024 / 1024 ), 2 ) 'index'
FROM information_schema.TABLES
WHERE table_schema = %s
ORDER BY name ASC;
", DB_NAME ) );
$database_table_sizes = $wpdb->get_results(
$wpdb->prepare(
"SELECT
table_name AS 'name',
round( ( data_length / 1024 / 1024 ), 2 ) 'data',
round( ( index_length / 1024 / 1024 ), 2 ) 'index'
FROM information_schema.TABLES
WHERE table_schema = %s
ORDER BY name ASC;",
DB_NAME
)
);
// WC Core tables to check existence of
$core_tables = apply_filters( 'woocommerce_database_tables', array(
'woocommerce_sessions',
'woocommerce_api_keys',
'woocommerce_attribute_taxonomies',
'woocommerce_downloadable_product_permissions',
'woocommerce_order_items',
'woocommerce_order_itemmeta',
'woocommerce_tax_rates',
'woocommerce_tax_rate_locations',
'woocommerce_shipping_zones',
'woocommerce_shipping_zone_locations',
'woocommerce_shipping_zone_methods',
'woocommerce_payment_tokens',
'woocommerce_payment_tokenmeta',
'woocommerce_log',
) );
$core_tables = apply_filters(
'woocommerce_database_tables',
array(
'woocommerce_sessions',
'woocommerce_api_keys',
'woocommerce_attribute_taxonomies',
'woocommerce_downloadable_product_permissions',
'woocommerce_order_items',
'woocommerce_order_itemmeta',
'woocommerce_tax_rates',
'woocommerce_tax_rate_locations',
'woocommerce_shipping_zones',
'woocommerce_shipping_zone_locations',
'woocommerce_shipping_zone_methods',
'woocommerce_payment_tokens',
'woocommerce_payment_tokenmeta',
'woocommerce_log',
)
);
if ( get_option( 'db_version' ) < 34370 ) {
$core_tables[] = 'woocommerce_termmeta';
@ -693,12 +706,12 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
*/
$tables = array(
'woocommerce' => array_fill_keys( $core_tables, false ),
'other' => array()
'other' => array(),
);
$database_size = array(
'data' => 0,
'index' => 0
'data' => 0,
'index' => 0,
);
foreach ( $database_table_sizes as $table ) {
@ -706,11 +719,11 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
$tables[ $table_type ][ $table->name ] = array(
'data' => $table->data,
'index' => $table->index
'index' => $table->index,
);
$database_size[ 'data' ] += $table->data;
$database_size[ 'index' ] += $table->index;
$database_size['data'] += $table->data;
$database_size['index'] += $table->index;
}
// Return all database info. Described by JSON Schema.
@ -742,8 +755,8 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
* @return array
*/
public function get_active_plugins() {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
require_once( ABSPATH . 'wp-admin/includes/update.php' );
require_once ABSPATH . 'wp-admin/includes/plugin.php';
require_once ABSPATH . 'wp-admin/includes/update.php';
if ( ! function_exists( 'get_plugin_updates' ) ) {
return array();
@ -774,10 +787,15 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
if ( ! empty( $cl_lines ) ) {
foreach ( $cl_lines as $line_num => $cl_line ) {
if ( preg_match( '/^[0-9]/', $cl_line ) ) {
$date = str_replace( '.' , '-' , trim( substr( $cl_line , 0 , strpos( $cl_line , '-' ) ) ) );
$version = preg_replace( '~[^0-9,.]~' , '' ,stristr( $cl_line , "version" ) );
$update = trim( str_replace( "*" , "" , $cl_lines[ $line_num + 1 ] ) );
$version_data = array( 'date' => $date , 'version' => $version , 'update' => $update , 'changelog' => $changelog );
$date = str_replace( '.', '-', trim( substr( $cl_line, 0, strpos( $cl_line, '-' ) ) ) );
$version = preg_replace( '~[^0-9,.]~', '', stristr( $cl_line, 'version' ) );
$update = trim( str_replace( '*', '', $cl_lines[ $line_num + 1 ] ) );
$version_data = array(
'date' => $date,
'version' => $version,
'update' => $update,
'changelog' => $changelog,
);
set_transient( md5( $plugin ) . '_version_data', $version_data, DAY_IN_SECONDS );
break;
}
@ -825,7 +843,12 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'parent_author_url' => $parent_theme->{'Author URI'},
);
} else {
$parent_theme_info = array( 'parent_name' => '', 'parent_version' => '', 'parent_version_latest' => '', 'parent_author_url' => '' );
$parent_theme_info = array(
'parent_name' => '',
'parent_version' => '',
'parent_version_latest' => '',
'parent_author_url' => '',
);
}
/**
@ -966,8 +989,8 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
$pages_output = array();
foreach ( $check_pages as $page_name => $values ) {
$page_id = get_option( $values['option'] );
$page_set = $page_exists = $page_visible = false;
$page_id = get_option( $values['option'] );
$page_set = $page_exists = $page_visible = false;
$shortcode_present = $shortcode_required = false;
// Page checks
@ -982,9 +1005,9 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
}
// Shortcode checks
if ( $values['shortcode'] && get_post( $page_id ) ) {
if ( $values['shortcode'] && get_post( $page_id ) ) {
$shortcode_required = true;
$page = get_post( $page_id );
$page = get_post( $page_id );
if ( strstr( $page->post_content, $values['shortcode'] ) ) {
$shortcode_present = true;
}
@ -1020,7 +1043,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
/**
* Prepare the system status response
*
* @param array $system_status
* @param array $system_status
* @param WP_REST_Request $request Request object.
* @return WP_REST_Response $response Response data.
*/

View File

@ -4,15 +4,11 @@
*
* Handles requests to the /system_status/tools/* endpoints.
*
* @author WooThemes
* @category API
* @package WooCommerce/API
* @since 3.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
/**
* @package WooCommerce/API
@ -179,8 +175,18 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
'button' => __( 'Reset', 'woocommerce' ),
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
),
'regenerate_thumbnails' => array(
'name' => __( 'Regenerate shop thumbnails', 'woocommerce' ),
'button' => __( 'Regenerate', 'woocommerce' ),
'desc' => __( 'This will regenerate all shop thumbnails to match your theme and/or image settings.', 'woocommerce' ),
)
);
// Jetpack does the image resizing heavy lifting so you don't have to.
if ( ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) || ! apply_filters( 'woocommerce_background_image_regeneration', true ) ) {
unset( $tools['regenerate_thumbnails'] );
}
return apply_filters( 'woocommerce_debug_tools', $tools );
}
@ -468,6 +474,11 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
$message = __( 'Usage tracking settings successfully reset.', 'woocommerce' );
break;
case 'regenerate_thumbnails':
WC_Regenerate_Images::queue_image_regeneration();
$message = __( 'Thumbnail regeneration has been scheduled to run in the background.', 'woocommerce' );
break;
default:
$tools = $this->get_tools();
if ( isset( $tools[ $tool ]['callback'] ) ) {

View File

@ -2029,7 +2029,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
),
'shipping_class_id' => array(
'description' => __( 'Shipping class ID.', 'woocommerce' ),
'type' => 'string',
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
@ -2471,7 +2471,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
),
'shipping_class_id' => array(
'description' => __( 'Shipping class ID.', 'woocommerce' ),
'type' => 'string',
'type' => 'integer',
'context' => array( 'view', 'edit' ),
'readonly' => true,
),

View File

@ -290,6 +290,25 @@ class WC_REST_Webhooks_V1_Controller extends WC_REST_Controller {
return $response;
}
/**
* Get a single item.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_Error|WP_REST_Response
*/
public function get_item( $request ) {
$id = (int) $request['id'];
if ( empty( $id ) ) {
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
}
$data = $this->prepare_item_for_response( $id, $request );
$response = rest_ensure_response( $data );
return $response;
}
/**
* Create a single webhook.
*

View File

@ -1126,19 +1126,25 @@ class WC_AJAX {
if ( $_product && $_product->exists() && $_product->managing_stock() && isset( $order_item_qty[ $item_id ] ) && $order_item_qty[ $item_id ] > 0 ) {
$stock_change = apply_filters( 'woocommerce_reduce_order_stock_quantity', $order_item_qty[ $item_id ], $item_id );
$new_stock = wc_update_product_stock( $_product, $stock_change, 'decrease' );
$item_name = $_product->get_sku() ? $_product->get_sku() : $_product->get_id();
$note = sprintf( __( 'Item %1$s stock reduced from %2$s to %3$s.', 'woocommerce' ), $item_name, $new_stock + $stock_change, $new_stock );
$return[] = $note;
$order->add_order_note( $note );
$item_name = $_product->get_formatted_name();
$return[] = array(
'note' => sprintf( wp_kses_post( __( '%1$s stock reduced from %2$s to %3$s.', 'woocommerce' ) ), $item_name, $new_stock + $stock_change, $new_stock ),
'success' => true,
);
}
}
do_action( 'woocommerce_reduce_order_stock', $order );
if ( empty( $return ) ) {
$return[] = __( 'No products had their stock reduced - they may not have stock management enabled.', 'woocommerce' );
$return[] = array(
'note' => wp_kses_post( __( 'No products had their stock reduced - they may not have stock management enabled.', 'woocommerce' ) ),
'success' => false,
);
}
echo wp_kses_post( implode( ', ', $return ) );
wp_send_json_success( $return );
}
wp_die();
wp_send_json_error();
}
/**
@ -1166,19 +1172,24 @@ class WC_AJAX {
$old_stock = $_product->get_stock_quantity();
$stock_change = apply_filters( 'woocommerce_restore_order_stock_quantity', $order_item_qty[ $item_id ], $item_id );
$new_quantity = wc_update_product_stock( $_product, $stock_change, 'increase' );
$item_name = $_product->get_sku() ? $_product->get_sku() : $_product->get_id();
$note = sprintf( __( 'Item %1$s stock increased from %2$s to %3$s.', 'woocommerce' ), $item_name, $old_stock, $new_quantity );
$return[] = $note;
$order->add_order_note( $note );
$item_name = $_product->get_formatted_name();
$return[] = array(
'note' => sprintf( wp_kses_post( __( '%1$s stock increased from %2$s to %3$s.', 'woocommerce' ) ), $item_name, $old_stock, $new_quantity ),
'success' => true,
);
}
}
do_action( 'woocommerce_restore_order_stock', $order );
if ( empty( $return ) ) {
$return[] = __( 'No products had their stock increased - they may not have stock management enabled.', 'woocommerce' );
$return[] = array(
'note' => wp_kses_post( __( 'No products had their stock increased - they may not have stock management enabled.', 'woocommerce' ) ),
'success' => false,
);
}
echo wp_kses_post( implode( ', ', $return ) );
wp_send_json_success( $return );
}
wp_die();
wp_send_json_error();
}
/**

View File

@ -144,7 +144,13 @@ class WC_Breadcrumb {
if ( 'product' === get_post_type( $post ) ) {
$this->prepend_shop_page();
if ( $terms = wc_get_product_terms( $post->ID, 'product_cat', array( 'orderby' => 'parent', 'order' => 'DESC' ) ) ) {
$terms = wc_get_product_terms( $post->ID, 'product_cat', apply_filters( 'woocommerce_breadcrumb_product_terms_args', array(
'orderby' => 'parent',
'order' => 'DESC',
) ) );
if ( $terms ) {
$main_term = apply_filters( 'woocommerce_breadcrumb_main_term', $terms[0], $terms );
$this->term_ancestors( $main_term->term_id, 'product_cat' );
$this->add_crumb( $main_term->name, get_term_link( $main_term ) );

View File

@ -71,12 +71,18 @@ final class WC_Cart_Session {
$this->cart->set_coupon_discount_tax_totals( WC()->session->get( 'coupon_discount_tax_totals', array() ) );
$this->cart->set_removed_cart_contents( WC()->session->get( 'removed_cart_contents', array() ) );
if ( is_null( $cart ) && ( $saved_cart = get_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id(), true ) ) ) { // @codingStandardsIgnoreLine
if ( apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
$saved_cart = get_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id(), true );
} else {
$saved_cart = false;
}
if ( is_null( $cart ) && $saved_cart ) {
$cart = $saved_cart['cart'];
$update_cart_session = true;
} elseif ( is_null( $cart ) ) {
$cart = array();
} elseif ( is_array( $cart ) && ( $saved_cart = get_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id(), true ) ) ) { // @codingStandardsIgnoreLine
} elseif ( is_array( $cart ) && $saved_cart ) {
$cart = array_merge( $saved_cart['cart'], $cart );
$update_cart_session = true;
}
@ -184,7 +190,7 @@ final class WC_Cart_Session {
* Save the persistent cart when the cart is updated.
*/
public function persistent_cart_update() {
if ( get_current_user_id() ) {
if ( get_current_user_id() && apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
update_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id(), array(
'cart' => $this->get_cart_for_session(),
) );
@ -195,7 +201,7 @@ final class WC_Cart_Session {
* Delete the persistent cart permanently.
*/
public function persistent_cart_destroy() {
if ( get_current_user_id() ) {
if ( get_current_user_id() && apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
delete_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id() );
}
}

View File

@ -153,14 +153,14 @@ class WC_Checkout {
* Cloning is forbidden.
*/
public function __clone() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' );
}
/**
* Unserializing instances of this class is forbidden.
*/
public function __wakeup() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' );
}
/**

View File

@ -115,6 +115,7 @@ class WC_Countries {
'GF' => array(),
'IS' => array(),
'IL' => array(),
'IM' => array(),
'KR' => array(),
'KW' => array(),
'LB' => array(),
@ -926,6 +927,11 @@ class WC_Countries {
'required' => false,
),
),
'IM' => array(
'state' => array(
'required' => false,
),
),
'IT' => array(
'postcode' => array(
'priority' => 65,

View File

@ -50,7 +50,7 @@ class WC_Emails {
* @since 2.1
*/
public function __clone() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' );
}
/**
@ -59,7 +59,7 @@ class WC_Emails {
* @since 2.1
*/
public function __wakeup() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' );
}
/**

View File

@ -2,8 +2,6 @@
/**
* Installation related functions and actions.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Classes
* @version 3.0.0
*/
@ -141,7 +139,7 @@ class WC_Install {
* This check is done on all requests and runs if the versions do not match.
*/
public static function check_version() {
if ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'woocommerce_version' ) !== WC()->version ) {
if ( ! defined( 'IFRAME_REQUEST' ) && version_compare( get_option( 'woocommerce_version' ), WC()->version, '<' ) ) {
self::install();
do_action( 'woocommerce_updated' );
}
@ -541,6 +539,8 @@ class WC_Install {
* Changing indexes may cause duplicate index notices in logs due to https://core.trac.wordpress.org/ticket/34870 but dropping
* indexes first causes too much load on some servers/larger DB.
*
* When adding or removing a table, make sure to update the list of tables in WC_Install::get_tables().
*
* @return string
*/
private static function get_schema() {
@ -747,6 +747,67 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
return $tables;
}
/**
* Return a list of WooCommerce tables. Used to make sure all WC tables are dropped when uninstalling the plugin
* in a single site or multi site environment.
*
* @return array WC tables.
*/
public static function get_tables() {
global $wpdb;
$tables = array(
"{$wpdb->prefix}wc_download_log",
"{$wpdb->prefix}wc_webhooks",
"{$wpdb->prefix}woocommerce_api_keys",
"{$wpdb->prefix}woocommerce_attribute_taxonomies",
"{$wpdb->prefix}woocommerce_downloadable_product_permissions",
"{$wpdb->prefix}woocommerce_log",
"{$wpdb->prefix}woocommerce_order_itemmeta",
"{$wpdb->prefix}woocommerce_order_items",
"{$wpdb->prefix}woocommerce_payment_tokenmeta",
"{$wpdb->prefix}woocommerce_payment_tokens",
"{$wpdb->prefix}woocommerce_sessions",
"{$wpdb->prefix}woocommerce_shipping_zone_locations",
"{$wpdb->prefix}woocommerce_shipping_zone_methods",
"{$wpdb->prefix}woocommerce_shipping_zones",
"{$wpdb->prefix}woocommerce_tax_rate_locations",
"{$wpdb->prefix}woocommerce_tax_rates",
);
if ( ! function_exists( 'get_term_meta' ) ) {
// This table is only needed for old installs and is now @deprecated by WordPress term meta.
$tables[] = "{$wpdb->prefix}woocommerce_termmeta";
}
return $tables;
}
/**
* Drop WooCommerce tables.
*
* @return void
*/
public static function drop_tables() {
global $wpdb;
$tables = self::get_tables();
foreach ( $tables as $table ) {
$wpdb->query( "DROP TABLE IF EXISTS {$table}" ); // phpcs:ignore WordPress.WP.PreparedSQL.NotPrepared
}
}
/**
* Uninstall tables when MU blog is deleted.
*
* @param array $tables List of tables that will be deleted by WP.
* @return string[]
*/
public static function wpmu_drop_tables( $tables ) {
return array_merge( $tables, self::get_tables() );
}
/**
* Create roles and capabilities.
*/
@ -983,32 +1044,6 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
return (array) $links;
}
/**
* Uninstall tables when MU blog is deleted.
*
* @param array $tables List of tables that will be deleted by WP.
* @return string[]
*/
public static function wpmu_drop_tables( $tables ) {
global $wpdb;
$tables[] = $wpdb->prefix . 'woocommerce_sessions';
$tables[] = $wpdb->prefix . 'woocommerce_api_keys';
$tables[] = $wpdb->prefix . 'woocommerce_attribute_taxonomies';
$tables[] = $wpdb->prefix . 'woocommerce_downloadable_product_permissions';
$tables[] = $wpdb->prefix . 'woocommerce_termmeta';
$tables[] = $wpdb->prefix . 'woocommerce_tax_rates';
$tables[] = $wpdb->prefix . 'woocommerce_tax_rate_locations';
$tables[] = $wpdb->prefix . 'woocommerce_order_items';
$tables[] = $wpdb->prefix . 'woocommerce_order_itemmeta';
$tables[] = $wpdb->prefix . 'woocommerce_payment_tokens';
$tables[] = $wpdb->prefix . 'woocommerce_shipping_zones';
$tables[] = $wpdb->prefix . 'woocommerce_shipping_zone_locations';
$tables[] = $wpdb->prefix . 'woocommerce_shipping_zone_methods';
return $tables;
}
/**
* Get slug from path
*

View File

@ -96,7 +96,13 @@ class WC_Order_Item_Product extends WC_Order_Item {
* @throws WC_Data_Exception
*/
public function set_subtotal( $value ) {
$this->set_prop( 'subtotal', wc_format_decimal( $value ) );
$value = wc_format_decimal( $value );
if ( ! is_numeric( $value ) ) {
$value = 0;
}
$this->set_prop( 'subtotal', $value );
}
/**
@ -106,7 +112,13 @@ class WC_Order_Item_Product extends WC_Order_Item {
* @throws WC_Data_Exception
*/
public function set_total( $value ) {
$this->set_prop( 'total', wc_format_decimal( $value ) );
$value = wc_format_decimal( $value );
if ( ! is_numeric( $value ) ) {
$value = 0;
}
$this->set_prop( 'total', $value );
// Subtotal cannot be less than total
if ( '' === $this->get_subtotal() || $this->get_subtotal() < $this->get_total() ) {

View File

@ -1377,6 +1377,10 @@ class WC_Order extends WC_Abstract_Order {
'order_key' => $this->get_order_key(),
'downloads_remaining' => $file['downloads_remaining'],
'access_expires' => $file['access_expires'],
'file' => array(
'name' => $file['name'],
'file' => $file['file'],
),
);
}
}

View File

@ -48,7 +48,7 @@ class WC_Payment_Gateways {
* @since 2.1
*/
public function __clone() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' );
}
/**
@ -57,7 +57,7 @@ class WC_Payment_Gateways {
* @since 2.1
*/
public function __wakeup() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' );
}
/**

View File

@ -265,8 +265,8 @@ class WC_Post_types {
}
// If theme support changes, we may need to flush permalinks since some are changed based on this flag.
if ( update_option( 'current_theme_supports_woocommerce', current_theme_supports( 'woocommerce' ) ? 1 : 0 ) ) {
add_option( 'woocommerce_queue_flush_rewrite_rules', 'true' );
if ( update_option( 'current_theme_supports_woocommerce', current_theme_supports( 'woocommerce' ) ? 'yes' : 'no' ) ) {
update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
}
register_post_type( 'product',
@ -511,8 +511,8 @@ class WC_Post_types {
* @since 3.3.0
*/
public static function maybe_flush_rewrite_rules() {
if ( 'true' === get_option( 'woocommerce_queue_flush_rewrite_rules' ) ) {
delete_option( 'woocommerce_queue_flush_rewrite_rules' );
if ( 'yes' === get_option( 'woocommerce_queue_flush_rewrite_rules' ) ) {
update_option( 'woocommerce_queue_flush_rewrite_rules', 'no' );
self::flush_rewrite_rules();
}
}

View File

@ -96,7 +96,7 @@ class WC_Product_Download implements ArrayAccess {
$file_url = $this->get_file();
if ( '..' === substr( $file_url, 0, 2 ) || '/' !== substr( $file_url, 0, 1 ) ) {
$file_url = realpath( ABSPATH . $file_url );
} elseif ( '/wp-content' === substr( $file_url, 0, 11 ) ) {
} elseif ( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) === substr( $file_url, 0, strlen( substr( WP_CONTENT_DIR, strlen( untrailingslashit( ABSPATH ) ) ) ) ) ) {
$file_url = realpath( WP_CONTENT_DIR . substr( $file_url, 11 ) );
}
return apply_filters( 'woocommerce_downloadable_file_exists', file_exists( $file_url ), $this->get_file() );

View File

@ -272,8 +272,8 @@ class WC_Product_Variable extends WC_Product {
continue;
}
// Filter 'woocommerce_hide_invisible_variations' to optionally hide invisible variations (disabled variations and variations with empty price)
if ( apply_filters( 'woocommerce_hide_invisible_variations', false, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {
// Filter 'woocommerce_hide_invisible_variations' to optionally hide invisible variations (disabled variations and variations with empty price).
if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {
continue;
}

View File

@ -473,7 +473,7 @@ class WC_Product_Variation extends WC_Product_Simple {
* @return bool
*/
public function is_purchasable() {
return apply_filters( 'woocommerce_variation_is_purchasable', $this->variation_is_visible() && parent::is_purchasable(), $this );
return apply_filters( 'woocommerce_variation_is_purchasable', $this->variation_is_visible() && parent::is_purchasable() && ( 'publish' === $this->parent_data['status'] || current_user_can( 'edit_post', $this->get_parent_id() ) ), $this );
}
/**

View File

@ -39,6 +39,15 @@ class WC_Regenerate_Images_Request extends WC_Background_Process {
parent::__construct();
}
/**
* Is job running?
*
* @return boolean
*/
public function is_running() {
return $this->is_queue_empty();
}
/**
* Limit each task ran per batch to 1 for image regen.
*
@ -132,6 +141,16 @@ class WC_Regenerate_Images_Request extends WC_Background_Process {
$new_metadata['sizes'][ $old_size ] = $old_metadata['sizes'][ $old_size ];
}
}
// Handle legacy sizes.
if ( isset( $new_metadata['sizes']['shop_thumbnail'], $new_metadata['sizes']['woocommerce_gallery_thumbnail'] ) ) {
$new_metadata['sizes']['shop_thumbnail'] = $new_metadata['sizes']['woocommerce_gallery_thumbnail'];
}
if ( isset( $new_metadata['sizes']['shop_catalog'], $new_metadata['sizes']['woocommerce_thumbnail'] ) ) {
$new_metadata['sizes']['shop_catalog'] = $new_metadata['sizes']['woocommerce_thumbnail'];
}
if ( isset( $new_metadata['sizes']['shop_single'], $new_metadata['sizes']['woocommerce_single'] ) ) {
$new_metadata['sizes']['shop_single'] = $new_metadata['sizes']['woocommerce_single'];
}
}
// Update the meta data with the new size values.
@ -213,7 +232,7 @@ class WC_Regenerate_Images_Request extends WC_Background_Process {
* @return array
*/
public function adjust_intermediate_image_sizes( $sizes ) {
return apply_filters( 'woocommerce_regenerate_images_intermediate_image_sizes', array( 'woocommerce_thumbnail', 'woocommerce_thumbnail_2x', 'woocommerce_single' ) );
return apply_filters( 'woocommerce_regenerate_images_intermediate_image_sizes', array( 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail', 'woocommerce_single' ) );
}
/**

View File

@ -23,24 +23,166 @@ class WC_Regenerate_Images {
*/
protected static $background_process;
/**
* Stores size being generated on the fly.
*
* @var string
*/
protected static $regenerate_size;
/**
* Init function
*/
public static function init() {
include_once WC_ABSPATH . 'includes/class-wc-regenerate-images-request.php';
self::$background_process = new WC_Regenerate_Images_Request();
add_action( 'image_get_intermediate_size', array( __CLASS__, 'filter_image_get_intermediate_size' ), 10, 3 );
add_filter( 'wp_generate_attachment_metadata', array( __CLASS__, 'add_uncropped_metadata' ) );
if ( ! is_admin() ) {
// Handle on-the-fly image resizing.
// Resize WooCommerce images on the fly when browsing site through customizer as to showcase image setting changes in real time.
if ( is_customize_preview() ) {
add_filter( 'wp_get_attachment_image_src', array( __CLASS__, 'maybe_resize_image' ), 10, 4 );
}
// Not required when Jetpack Photon is in use.
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
return;
}
if ( apply_filters( 'woocommerce_background_image_regeneration', true ) ) {
// Actions to handle image generation when settings change.
add_action( 'update_option_woocommerce_thumbnail_cropping', array( __CLASS__, 'maybe_regenerate_images_option_update' ), 10, 3 );
add_action( 'update_option_woocommerce_thumbnail_image_width', array( __CLASS__, 'maybe_regenerate_images_option_update' ), 10, 3 );
add_action( 'update_option_woocommerce_single_image_width', array( __CLASS__, 'maybe_regenerate_images_option_update' ), 10, 3 );
add_action( 'after_switch_theme', array( __CLASS__, 'maybe_regenerate_image_theme_switch' ) );
include_once WC_ABSPATH . 'includes/class-wc-regenerate-images-request.php';
self::$background_process = new WC_Regenerate_Images_Request();
add_action( 'admin_init', array( __CLASS__, 'regenerating_notice' ) );
add_action( 'woocommerce_hide_regenerating_thumbnails_notice', array( __CLASS__, 'dismiss_regenerating_notice' ) );
// Regenerate thumbnails in the background after settings changes. Not ran on multisite to avoid multiple simultanious jobs.
if ( ! is_multisite() ) {
add_action( 'customize_save_after', array( __CLASS__, 'maybe_regenerate_images' ) );
add_action( 'after_switch_theme', array( __CLASS__, 'maybe_regenerate_images' ) );
}
}
}
/**
* If an intermediate size meta differs from the actual image size (settings were changed?) return false so the wrong size is not used.
*
* @param array $data Size data.
* @param int $attachment_id Attachment ID.
* @param string $size Size name.
* @return array
*/
public static function filter_image_get_intermediate_size( $data, $attachment_id, $size ) {
if ( ! is_string( $size ) || ! in_array( $size, apply_filters( 'woocommerce_image_sizes_to_resize', array( 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail', 'woocommerce_single', 'shop_thumbnail', 'shop_catalog', 'shop_single' ) ), true ) ) {
return $data;
}
// If we don't have sizes, we cannot proceed.
if ( ! isset( $data['width'], $data['height'] ) ) {
return $data;
}
// See if the image size has changed from our settings.
if ( ! self::image_size_matches_settings( $data, $size ) ) {
// If Photon is running we can just return false and let Jetpack handle regeneration.
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
return false;
} else {
// If we get here, Jetpack is not running and we don't have the correct image sized stored. Try to return closest match.
$size_data = wc_get_image_size( $size );
return image_get_intermediate_size( $attachment_id, array( absint( $size_data['width'] ), absint( $size_data['height'] ) ) );
}
return false;
}
return $data;
}
/**
* We need to track if uncropped was on or off when generating the images.
*
* @param array $meta_data Array of meta data.
* @return array
*/
public static function add_uncropped_metadata( $meta_data ) {
$size_data = wc_get_image_size( 'woocommerce_thumbnail' );
if ( isset( $meta_data['sizes'], $meta_data['sizes']['woocommerce_thumbnail'] ) ) {
$meta_data['sizes']['woocommerce_thumbnail']['uncropped'] = empty( $size_settings['height'] );
}
return $meta_data;
}
/**
* See if an image's dimensions match actual settings.
*
* @param array $image Image dimensions array.
* @param string $size Named size.
* @return bool
*/
protected static function image_size_matches_settings( $image, $size ) {
$size_data = wc_get_image_size( $size );
// Size is invalid if the widths or crop setting don't match.
if ( $size_data['width'] !== $image['width'] ) {
return false;
}
// Size is invalid if the heights don't match.
if ( $size_data['height'] && $size_data['height'] !== $image['height'] ) {
return false;
}
// If cropping mode has changed, regenerate the image.
if ( '' === $size_data['height'] && empty( $image['uncropped'] ) ) {
return false;
}
return true;
}
/**
* Show notice when job is running in background.
*/
public static function regenerating_notice() {
if ( ! self::$background_process->is_running() ) {
WC_Admin_Notices::add_notice( 'regenerating_thumbnails' );
} else {
WC_Admin_Notices::remove_notice( 'regenerating_thumbnails' );
}
}
/**
* Dismiss notice and cancel jobs.
*/
public static function dismiss_regenerating_notice() {
if ( self::$background_process ) {
self::$background_process->kill_process();
$log = wc_get_logger();
$log->info( __( 'Cancelled product image regeneration job.', 'woocommerce' ),
array(
'source' => 'wc-image-regeneration',
)
);
}
WC_Admin_Notices::remove_notice( 'regenerating_thumbnails' );
}
/**
* Regenerate images if the settings have changed since last re-generation.
*
* @return void
*/
public static function maybe_regenerate_images() {
$size_hash = md5( wp_json_encode( array(
wc_get_image_size( 'thumbnail' ),
wc_get_image_size( 'single' ),
wc_get_image_size( 'gallery_thumbnail' ),
) ) );
if ( update_option( 'woocommerce_maybe_regenerate_images_hash', $size_hash ) ) {
// Size settings have changed. Trigger regen.
self::queue_image_regeneration();
}
}
@ -54,33 +196,91 @@ class WC_Regenerate_Images {
* @return array
*/
public static function maybe_resize_image( $image, $attachment_id, $size, $icon ) {
if ( ! apply_filters( 'woocommerce_resize_images', true ) ) {
return $image;
}
// Use a whitelist of sizes we want to resize. Ignore others.
if ( ! in_array( $size, apply_filters( 'woocommerce_image_sizes_to_resize', array( 'woocommerce_thumbnail', 'woocommerce_single', 'shop_thumbnail', 'shop_catalog', 'shop_single' ) ), true ) ) {
if ( ! in_array( $size, apply_filters( 'woocommerce_image_sizes_to_resize', array( 'woocommerce_thumbnail', 'woocommerce_gallery_thumbnail', 'woocommerce_single', 'shop_thumbnail', 'shop_catalog', 'shop_single' ) ), true ) ) {
return $image;
}
// Get image metadata - we need it to proceed.
$imagemeta = wp_get_attachment_metadata( $attachment_id );
if ( false === $imagemeta || empty( $imagemeta ) ) {
if ( empty( $imagemeta ) ) {
return $image;
}
$size_settings = wc_get_image_size( $size );
// If size differs from image meta, regen.
if ( ! isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) || $imagemeta['sizes'][ $size ]['width'] !== $size_settings['width'] || ( $size_settings['crop'] && $imagemeta['sizes'][ $size ]['height'] !== $size_settings['height'] ) ) {
$image = self::resize_and_return_image( $attachment_id, $image, $size, $icon );
if ( ! isset( $imagemeta['sizes'], $imagemeta['sizes'][ $size ] ) || ! self::image_size_matches_settings( $imagemeta['sizes'][ $size ], $size ) ) {
return self::resize_and_return_image( $attachment_id, $image, $size, $icon );
}
return $image;
}
/**
* Ensure we are dealing with the correct image attachment
*
* @param WP_Post $attachment Attachment object.
* @return boolean
*/
public static function is_regeneratable( $attachment ) {
if ( 'site-icon' === get_post_meta( $attachment->ID, '_wp_attachment_context', true ) ) {
return false;
}
if ( wp_attachment_is_image( $attachment ) ) {
return true;
}
return false;
}
/**
* Only regenerate images for the requested size.
*
* @param array $sizes Array of image sizes.
* @return array
*/
public static function adjust_intermediate_image_sizes( $sizes ) {
return array( self::$regenerate_size );
}
/**
* Generate the thumbnail filename and dimensions for a given file.
*
* @param string $fullsizepath Path to full size image.
* @param int $thumbnail_width The width of the thumbnail.
* @param int $thumbnail_height The height of the thumbnail.
* @param bool $crop Whether to crop or not.
* @return array|false An array of the filename, thumbnail width, and thumbnail height, or false on failure to resize such as the thumbnail being larger than the fullsize image.
*/
private static function get_image( $fullsizepath, $thumbnail_width, $thumbnail_height, $crop ) {
list( $fullsize_width, $fullsize_height ) = getimagesize( $fullsizepath );
$dimensions = image_resize_dimensions( $fullsize_width, $fullsize_height, $thumbnail_width, $thumbnail_height, $crop );
$editor = wp_get_image_editor( $fullsizepath );
if ( is_wp_error( $editor ) ) {
return false;
}
if ( ! $dimensions || ! is_array( $dimensions ) ) {
return false;
}
list( , , , , $dst_w, $dst_h ) = $dimensions;
$suffix = "{$dst_w}x{$dst_h}";
$file_ext = strtolower( pathinfo( $fullsizepath, PATHINFO_EXTENSION ) );
return array(
'filename' => $editor->generate_filename( $suffix, null, $file_ext ),
'width' => $dst_w,
'height' => $dst_h,
);
}
/**
* Regenerate the image according to the required size
*
@ -91,8 +291,19 @@ class WC_Regenerate_Images {
* @return string
*/
private static function resize_and_return_image( $attachment_id, $image, $size, $icon ) {
$attachment = get_post( $attachment_id );
if ( ! $attachment || 'attachment' !== $attachment->post_type || 'image/' !== substr( $attachment->post_mime_type, 0, 6 ) ) {
$image_size = wc_get_image_size( $size );
$wp_uploads = wp_upload_dir( null, false );
$wp_uploads_dir = $wp_uploads['basedir'];
$wp_uploads_url = $wp_uploads['baseurl'];
$attachment = get_post( $attachment_id );
if ( ! $attachment || 'attachment' !== $attachment->post_type || ! self::is_regeneratable( $attachment ) ) {
return $image;
}
$fullsizepath = get_attached_file( $attachment_id );
if ( false === $fullsizepath || is_wp_error( $fullsizepath ) || ! file_exists( $fullsizepath ) ) {
return $image;
}
@ -100,83 +311,52 @@ class WC_Regenerate_Images {
include ABSPATH . 'wp-admin/includes/image.php';
}
$wp_uploads = wp_upload_dir( null, false );
$wp_uploads_dir = $wp_uploads['basedir'];
$wp_uploads_url = $wp_uploads['baseurl'];
$original_image_file_path = get_attached_file( $attachment->ID );
if ( ! file_exists( $original_image_file_path ) || ! getimagesize( $original_image_file_path ) ) {
return $image;
}
$info = pathinfo( $original_image_file_path );
$ext = $info['extension'];
list( $orig_w, $orig_h ) = getimagesize( $original_image_file_path );
// Get image size after cropping.
$image_size = wc_get_image_size( $size );
$dimensions = image_resize_dimensions( $orig_w, $orig_h, $image_size['width'], $image_size['height'], $image_size['crop'] );
if ( ! $dimensions || ! is_array( $dimensions ) ) {
return $image;
}
$dst_w = $dimensions[4];
$dst_h = $dimensions[5];
$suffix = "{$dst_w}x{$dst_h}";
$dst_rel_path = str_replace( '.' . $ext, '', $original_image_file_path );
$destfilename = "{$dst_rel_path}-{$suffix}.{$ext}";
$thumbnail = self::get_image( $fullsizepath, $image_size['width'], $image_size['height'], $image_size['crop'] );
// If the file is already there perhaps just load it.
if ( file_exists( $destfilename ) ) {
if ( $thumbnail && file_exists( $thumbnail['filename'] ) ) {
$wp_uploads = wp_upload_dir( null, false );
$wp_uploads_dir = $wp_uploads['basedir'];
$wp_uploads_url = $wp_uploads['baseurl'];
return array(
0 => str_replace( $wp_uploads_dir, $wp_uploads_url, $destfilename ),
1 => $image_size['width'],
2 => $image_size['height'],
0 => str_replace( $wp_uploads_dir, $wp_uploads_url, $thumbnail['filename'] ),
1 => $thumbnail['width'],
2 => $thumbnail['height'],
);
}
// Lets resize the image if it does not exist yet.
$editor = wp_get_image_editor( $original_image_file_path );
if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $image_size['width'], $image_size['height'], $image_size['crop'] ) ) ) {
$metadata = wp_get_attachment_metadata( $attachment_id );
// Make sure registered image size matches the size we're requesting.
add_image_size( $size . '_preview', $image_size['width'], $image_size['height'], $image_size['crop'] );
self::$regenerate_size = $size . '_preview';
// We only want to regen a specific image size.
add_filter( 'intermediate_image_sizes', array( __CLASS__, 'adjust_intermediate_image_sizes' ) );
// This function will generate the new image sizes.
$new_metadata = wp_generate_attachment_metadata( $attachment_id, $fullsizepath );
// Remove custom filter.
remove_filter( 'intermediate_image_sizes', array( __CLASS__, 'adjust_intermediate_image_sizes' ) );
// If something went wrong lets just return the original image.
if ( is_wp_error( $new_metadata ) || empty( $new_metadata ) ) {
return $image;
}
$resized_file = $editor->save();
if ( ! is_wp_error( $resized_file ) ) {
$img_url = str_replace( $wp_uploads_dir, $wp_uploads_url, $resized_file['path'] );
return array(
0 => $img_url,
1 => $image_size['width'],
2 => $image_size['height'],
);
// Since this is only a preview we should not update the actual size. That will be done later by the background job.
if ( isset( $new_metadata['sizes'][ $size . '_preview' ] ) ) {
$metadata['sizes'][ $size . '_preview' ] = $new_metadata['sizes'][ $size . '_preview' ];
wp_update_attachment_metadata( $attachment_id, $metadata );
}
// Lets just add this here as a fallback.
return $image;
}
// Now we've done our regen, attempt to return the new size.
$new_image = image_downsize( $attachment_id, $size . '_preview' );
/**
* Check if we should regenerate the product images when options change.
*
* @param mixed $old_value Old option value.
* @param mixed $new_value New option value.
* @param string $option Option name.
*/
public static function maybe_regenerate_images_option_update( $old_value, $new_value, $option ) {
if ( $new_value === $old_value ) {
return;
}
self::queue_image_regeneration();
}
/**
* Check if we should generate images when new themes declares custom sizes.
*/
public static function maybe_regenerate_image_theme_switch() {
if ( wc_get_theme_support( 'single_image_width' ) || wc_get_theme_support( 'thumbnail_image_width' ) ) {
self::queue_image_regeneration();
}
return $new_image ? $new_image : $image;
}
/**
@ -184,7 +364,7 @@ class WC_Regenerate_Images {
*
* @return void
*/
private static function queue_image_regeneration() {
public static function queue_image_regeneration() {
global $wpdb;
// First lets cancel existing running queue to avoid running it more than once.
self::$background_process->kill_process();
@ -207,4 +387,5 @@ class WC_Regenerate_Images {
self::$background_process->save()->dispatch();
}
}
WC_Regenerate_Images::init();
add_action( 'init', array( 'WC_Regenerate_Images', 'init' ) );

View File

@ -60,7 +60,7 @@ class WC_Shipping {
* @since 2.1
*/
public function __clone() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' );
}
/**
@ -69,7 +69,7 @@ class WC_Shipping {
* @since 2.1
*/
public function __wakeup() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' );
}
/**

View File

@ -502,6 +502,9 @@ class WC_Shortcodes {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
}
// Change form action to avoid redirect.
add_filter( 'woocommerce_add_to_cart_form_action', '__return_empty_string' );
$single_product = new WP_Query( $args );
$preselected_id = '0';
@ -574,6 +577,8 @@ class WC_Shortcodes {
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
}
remove_filter( 'woocommerce_add_to_cart_form_action', '__return_empty_string' );
return '<div class="woocommerce">' . ob_get_clean() . '</div>';
}

View File

@ -410,14 +410,14 @@ class WC_Template_Loader {
public static function unsupported_theme_shop_content_filter( $content ) {
global $wp_query;
if ( self::$theme_support || ! is_main_query() ) {
if ( self::$theme_support || ! is_main_query() || ! in_the_loop() ) {
return $content;
}
self::$in_content_filter = true;
// Remove the filter we're in to avoid nested calls.
remove_filter( 'the_content', array( __CLASS__, 'the_content_filter' ) );
remove_filter( 'the_content', array( __CLASS__, 'unsupported_theme_shop_content_filter' ) );
// Unsupported theme shop page.
if ( is_page( self::$shop_page_id ) ) {
@ -444,6 +444,7 @@ class WC_Template_Loader {
// Remove actions and self to avoid nested calls.
remove_action( 'pre_get_posts', array( wc()->query, 'product_query' ) );
WC()->query->remove_ordering_args();
}
self::$in_content_filter = false;
@ -463,14 +464,14 @@ class WC_Template_Loader {
public static function unsupported_theme_product_content_filter( $content ) {
global $wp_query;
if ( self::$theme_support || ! is_main_query() ) {
if ( self::$theme_support || ! is_main_query() || ! in_the_loop() ) {
return $content;
}
self::$in_content_filter = true;
// Remove the filter we're in to avoid nested calls.
remove_filter( 'the_content', array( __CLASS__, 'the_content_filter' ) );
remove_filter( 'the_content', array( __CLASS__, 'unsupported_theme_product_content_filter' ) );
if ( is_product() ) {
$content = do_shortcode( '[product_page id="' . get_the_ID() . '" show_title=0]' );
@ -481,6 +482,16 @@ class WC_Template_Loader {
return $content;
}
/**
* Are we filtering content for unsupported themes?
*
* @since 3.3.2
* @return bool
*/
public static function in_content_filter() {
return (bool) self::$in_content_filter;
}
/**
* Prevent the main featured image on product pages because there will be another featured image
* in the gallery.
@ -490,7 +501,7 @@ class WC_Template_Loader {
* @return string
*/
public static function unsupported_theme_single_featured_image_filter( $html ) {
if ( self::$in_content_filter || ! is_product() || ! is_main_query() ) {
if ( self::in_content_filter() || ! is_product() || ! is_main_query() ) {
return $html;
}

View File

@ -123,7 +123,7 @@ final class WooCommerce {
* @since 2.1
*/
public function __clone() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' );
}
/**
@ -132,7 +132,7 @@ final class WooCommerce {
* @since 2.1
*/
public function __wakeup() {
wc_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'woocommerce' ), '2.1' );
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' );
}
/**
@ -539,19 +539,18 @@ final class WooCommerce {
* @since 2.3
*/
public function add_image_sizes() {
$thumbnail = wc_get_image_size( 'thumbnail' );
$single = wc_get_image_size( 'single' );
$thumbnail = wc_get_image_size( 'thumbnail' );
$single = wc_get_image_size( 'single' );
$gallery_thumbnail = wc_get_image_size( 'gallery_thumbnail' );
add_image_size( 'woocommerce_thumbnail', $thumbnail['width'], $thumbnail['height'], $thumbnail['crop'] );
add_image_size( 'woocommerce_single', $single['width'], $single['height'], $single['crop'] );
// 2x thumbnail size for retina, and when showing less columns.
add_image_size( 'woocommerce_thumbnail_2x', $thumbnail['width'] * 2, $thumbnail['height'] * 2, $thumbnail['crop'] );
add_image_size( 'woocommerce_gallery_thumbnail', $gallery_thumbnail['width'], $gallery_thumbnail['height'], $gallery_thumbnail['crop'] );
// Registered for bw compat. @todo remove in 4.0.
add_image_size( 'shop_thumbnail', $thumbnail['width'], $thumbnail['height'], $thumbnail['crop'] );
add_image_size( 'shop_catalog', $thumbnail['width'], $thumbnail['height'], $thumbnail['crop'] );
add_image_size( 'shop_single', $single['width'], $single['height'], $single['crop'] );
add_image_size( 'shop_thumbnail', $gallery_thumbnail['width'], $gallery_thumbnail['height'], $gallery_thumbnail['crop'] );
}
/**

View File

@ -154,8 +154,10 @@ class WC_Shop_Customizer {
wp.customize( 'woocommerce_catalog_rows', function( setting ) {
setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_rows ); ?>';
var max = '<?php echo esc_js( $max_rows ); ?>';
var min = parseInt( '<?php echo esc_js( $min_rows ); ?>', 10 );
var max = parseInt( '<?php echo esc_js( $max_rows ); ?>', 10 );
value = parseInt( value, 10 );
if ( max && value > max ) {
setting.notifications.add( 'max_rows_error', new wp.customize.Notification(
@ -441,12 +443,23 @@ class WC_Shop_Customizer {
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
private function add_product_images_section( $wp_customize ) {
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
$regen_description = ''; // Nothing to report; Jetpack will handle magically.
} elseif ( apply_filters( 'woocommerce_background_image_regeneration', true ) && ! is_multisite() ) {
$regen_description = __( 'After publishing your changes, new image sizes will be generated automatically.', 'woocommerce' );
} elseif ( apply_filters( 'woocommerce_background_image_regeneration', true ) && is_multisite() ) {
$regen_description = sprintf( __( 'After publishing your changes, new image sizes may not be shown until you regenerate thumbnails. You can do this from the <a href="%1$s" target="_blank">tools section in WooCommerce</a> or by using a plugin such as <a href="%2$s" target="_blank">Regenerate Thumbnails</a>.', 'woocommerce' ), admin_url( 'admin.php?page=wc-status&tab=tools' ), 'https://en-gb.wordpress.org/plugins/regenerate-thumbnails/' );
} else {
$regen_description = sprintf( __( 'After publishing your changes, new image sizes may not be shown until you <a href="%2$s" target="_blank">Regenerate Thumbnails</a>.', 'woocommerce' ), 'https://en-gb.wordpress.org/plugins/regenerate-thumbnails/' );
}
$wp_customize->add_section(
'woocommerce_product_images',
array(
'title' => __( 'Product Images', 'woocommerce' ),
'priority' => 20,
'panel' => 'woocommerce',
'title' => __( 'Product Images', 'woocommerce' ),
'description' => $regen_description,
'priority' => 20,
'panel' => 'woocommerce',
)
);
@ -494,7 +507,7 @@ class WC_Shop_Customizer {
'woocommerce_thumbnail_image_width',
array(
'label' => __( 'Thumbnail width', 'woocommerce' ),
'description' => __( 'Image size used for products in the catalog and product gallery thumbnails.', 'woocommerce' ),
'description' => __( 'Image size used for products in the catalog.', 'woocommerce' ),
'section' => 'woocommerce_product_images',
'settings' => 'woocommerce_thumbnail_image_width',
'type' => 'number',

View File

@ -223,7 +223,7 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
'product_id' => '',
'download_id' => '',
'orderby' => 'permission_id',
'order' => 'DESC',
'order' => 'ASC',
'limit' => -1,
'return' => 'objects',
) );
@ -252,9 +252,9 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
}
$allowed_orders = array( 'permission_id', 'download_id', 'product_id', 'order_id', 'order_key', 'user_email', 'user_id', 'downloads_remaining', 'access_granted', 'access_expires', 'download_count' );
$order = in_array( $args['order'], $allowed_orders ) ? $args['order'] : 'permission_id';
$orderby = 'DESC' === strtoupper( $args['orderby'] ) ? 'DESC' : 'ASC';
$orderby_sql = sanitize_sql_orderby( "{$order} {$orderby}" );
$orderby = in_array( $args['orderby'], $allowed_orders, true ) ? $args['orderby'] : 'permission_id';
$order = 'DESC' === strtoupper( $args['order'] ) ? 'DESC' : 'ASC';
$orderby_sql = sanitize_sql_orderby( "{$orderby} {$order}" );
$query[] = "ORDER BY {$orderby_sql}";
if ( 0 < $args['limit'] ) {

View File

@ -1304,9 +1304,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
* @param string $term Search term.
* @param string $type Type of product.
* @param bool $include_variations Include variations in search or not.
* @param bool $all_statuses Should we search all statuses or limit to published?
* @return array of ids
*/
public function search_products( $term, $type = '', $include_variations = false ) {
public function search_products( $term, $type = '', $include_variations = false, $all_statuses = false ) {
global $wpdb;
$like_term = '%' . $wpdb->esc_like( $term ) . '%';
@ -1314,6 +1315,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$post_statuses = current_user_can( 'edit_private_products' ) ? array( 'private', 'publish' ) : array( 'publish' );
$type_join = '';
$type_where = '';
$status_where = '';
if ( $type ) {
if ( in_array( $type, array( 'virtual', 'downloadable' ), true ) ) {
@ -1322,11 +1324,15 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
}
}
if ( ! $all_statuses ) {
$status_where = " AND posts.post_status IN ('" . implode( "','", $post_statuses ) . "') ";
}
// phpcs:ignore WordPress.VIP.DirectDatabaseQuery.DirectQuery
$product_ids = $wpdb->get_col(
$search_results = $wpdb->get_results(
// phpcs:disable
$wpdb->prepare(
"SELECT DISTINCT posts.ID FROM {$wpdb->posts} posts
"SELECT DISTINCT posts.ID as product_id, posts.post_parent as parent_id FROM {$wpdb->posts} posts
LEFT JOIN {$wpdb->postmeta} postmeta ON posts.ID = postmeta.post_id
$type_join
WHERE (
@ -1337,7 +1343,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
)
)
AND posts.post_type IN ('" . implode( "','", $post_types ) . "')
AND posts.post_status IN ('" . implode( "','", $post_statuses ) . "')
$status_where
$type_where
ORDER BY posts.post_parent ASC, posts.post_title ASC",
$like_term,
@ -1347,6 +1353,8 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
// phpcs:enable
);
$product_ids = wp_parse_id_list( array_merge( wp_list_pluck( $search_results, 'product_id' ), wp_list_pluck( $search_results, 'parent_id' ) ) );
if ( is_numeric( $term ) ) {
$post_id = absint( $term );
$post_type = get_post_type( $post_id );

View File

@ -317,6 +317,7 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
$product->set_parent_data( array(
'title' => $parent_object ? $parent_object->post_title : '',
'status' => $parent_object ? $parent_object->post_status : '',
'sku' => get_post_meta( $product->get_parent_id(), '_sku', true ),
'manage_stock' => get_post_meta( $product->get_parent_id(), '_manage_stock', true ),
'backorders' => get_post_meta( $product->get_parent_id(), '_backorders', true ),

View File

@ -133,26 +133,25 @@ class WC_Email extends WC_Settings_API {
* @see $plain_replace
*/
public $plain_search = array(
"/\r/", // Non-legal carriage return
'/&(nbsp|#160);/i', // Non-breaking space
'/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i', // Double quotes
'/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes
'/&gt;/i', // Greater-than
'/&lt;/i', // Less-than
'/&#38;/i', // Ampersand
'/&#038;/i', // Ampersand
'/&amp;/i', // Ampersand
'/&(copy|#169);/i', // Copyright
'/&(trade|#8482|#153);/i', // Trademark
'/&(reg|#174);/i', // Registered
'/&(mdash|#151|#8212);/i', // mdash
'/&(ndash|minus|#8211|#8722);/i', // ndash
'/&(bull|#149|#8226);/i', // Bullet
'/&(pound|#163);/i', // Pound sign
'/&(euro|#8364);/i', // Euro sign
'/&#36;/', // Dollar sign
'/&[^&\s;]+;/i', // Unknown/unhandled entities
'/[ ]{2,}/', // Runs of spaces, post-handling
"/\r/", // Non-legal carriage return
'/&(nbsp|#0*160);/i', // Non-breaking space
'/&(quot|rdquo|ldquo|#0*8220|#0*8221|#0*147|#0*148);/i', // Double quotes
'/&(apos|rsquo|lsquo|#0*8216|#0*8217);/i', // Single quotes
'/&gt;/i', // Greater-than
'/&lt;/i', // Less-than
'/&#0*38;/i', // Ampersand
'/&amp;/i', // Ampersand
'/&(copy|#0*169);/i', // Copyright
'/&(trade|#0*8482|#0*153);/i', // Trademark
'/&(reg|#0*174);/i', // Registered
'/&(mdash|#0*151|#0*8212);/i', // mdash
'/&(ndash|minus|#0*8211|#0*8722);/i', // ndash
'/&(bull|#0*149|#0*8226);/i', // Bullet
'/&(pound|#0*163);/i', // Pound sign
'/&(euro|#0*8364);/i', // Euro sign
'/&(dollar|#0*36);/i', // Dollar sign
'/&[^&\s;]+;/i', // Unknown/unhandled entities
'/[ ]{2,}/', // Runs of spaces, post-handling
);
/**
@ -169,7 +168,6 @@ class WC_Email extends WC_Settings_API {
'<', // Less-than
'&', // Ampersand
'&', // Ampersand
'&', // Ampersand
'(c)', // Copyright
'(tm)', // Trademark
'(R)', // Registered
@ -771,7 +769,7 @@ class WC_Email extends WC_Settings_API {
}
if ( ! current_user_can( 'edit_themes' ) ) {
wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce' ) );
wp_die( __( 'You don&#8217;t have permission to do this.', 'woocommerce' ) );
}
if ( ! empty( $_GET['move_template'] ) ) {

View File

@ -525,10 +525,8 @@ class WC_Shortcode_Products {
set_transient( $transient_name, $results, DAY_IN_SECONDS * 30 );
}
}
// Remove ordering query arguments.
if ( ! empty( $this->attributes['category'] ) ) {
WC()->query->remove_ordering_args();
}
// Remove ordering query arguments which may have been added by get_catalog_ordering_args.
WC()->query->remove_ordering_args();
return $results;
}

View File

@ -173,6 +173,10 @@ function wc_get_account_endpoint_url( $endpoint ) {
return wc_get_page_permalink( 'myaccount' );
}
if ( 'customer-logout' === $endpoint ) {
return wc_logout_url();
}
return wc_get_endpoint_url( $endpoint, '', wc_get_page_permalink( 'myaccount' ) );
}

View File

@ -197,6 +197,18 @@ function wc_get_attribute_types() {
) );
}
/**
* Check if there are custom attribute types.
*
* @since 3.3.2
* @return bool True if there are custom types, otherwise false.
*/
function wc_has_custom_attribute_types() {
$types = wc_get_attribute_types();
return 1 < count( $types ) || ! array_key_exists( 'select', $types );
}
/**
* Get attribute type label.
*

View File

@ -48,7 +48,13 @@ function wc_empty_cart() {
* @deprecated 2.3
*/
function wc_load_persistent_cart( $user_login, $user ) {
if ( ! $user || ! ( $saved_cart = get_user_meta( $user->ID, '_woocommerce_persistent_cart_' . get_current_blog_id(), true ) ) ) {
if ( ! $user || ! apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
return;
}
$saved_cart = get_user_meta( $user->ID, '_woocommerce_persistent_cart_' . get_current_blog_id(), true );
if ( ! $saved_cart ) {
return;
}

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