Merge branch 'master' into pr/18596

This commit is contained in:
Mike Jolley 2018-03-02 19:31:37 +00:00
commit 85450f60ec
237 changed files with 8713 additions and 3773 deletions

2
.gitattributes vendored
View File

@ -1,9 +1,11 @@
/.* export-ignore
apigen* export-ignore
CODE_OF_CONDUCT.md export-ignore
CHANGELOG.txt export-ignore
composer.* export-ignore
Gruntfile.js export-ignore
package.json export-ignore
package-lock.json export-ignore
phpcs.xml export-ignore
phpunit.* export-ignore
README.md export-ignore

View File

@ -6,7 +6,7 @@ When contributing please ensure you follow the guidelines below to help us keep
__Please Note:__
GitHub is for _bug reports and contributions only_ - if you have a support question or a request for a customization this is not the right place to post it. Use [WooCommerce Support](https://support.woocommerce.com) for customer support, [WordPress.org](https://wordpress.org/support/plugin/woocommerce) for community support, and for customizations we recommend one of the following services:
GitHub is for _bug reports and contributions only_ - if you have a support question or a request for a customization this is not the right place to post it. Use [WooCommerce Support](https://woocommerce.com/contact-us/) for customer support, [WordPress.org](https://wordpress.org/support/plugin/woocommerce) for community support, and for customizations we recommend one of the following services:
- [WooExperts](https://woocommerce.com/experts/)
- [Codeable](https://codeable.io/)

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,209 @@
== 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.
* Feature - Products shortcodes; support for pagination.
* Feature - Added new options to the WordPress Appearance Customizer; control the product grid (rows and columns), and image sizes.
* Feature - Improved how image sizes are defined and calculated. Set an aspect ratio (custom, 1:1, uncropped) and image sizes will be automagically calculated based on widths.
* Feature - Changing image sizes will trigger automatic thumbnail regeneration in the background.
* Feature - Improved how downloads are stored within products, and added new reporting/logging features to track who downloaded what, when.
* Feature - Improved the overall appearance of the backend orders list, and added a new 'preview' button to quickly see order details.
* Feature - New default sample data and placeholders.
* Feature - Added sandbox and live API details to the PayPal standard data, as well as an indication on the checkout to what mode is currently active. PayPal IPN email notifications are also now optional.
* Feature - Introduced product category threshold filter (`woocommerce_product_category_filter_threshold`). AJAX powered select will kick in when you have over 100 categories.
* Feature - Added `add_to_cart_description` method and aria-labels to cart buttons in the loop for accessibility.
* Feature - Ability to search in logs when the database logger is used.
* Performance - Adjusted how permalinks are retrieved and saved to avoid switching locales on each page load.
* Performance - Added cache when loading product variation attributes.
* Fix - Fix wc_notice_count logic.
* Fix - Correct bulk edit price formatting.
* Fix - Ajax add-to-cart button shortcode fix for variations.
* Tweak - Update billing if account form changes.
* Tweak - Remove videos from help sections.
* Tweak - Preserve seconds when saving order date.
* Tweak - Allow quantities less than 1, but not 0, in admin.
* Tweak - Post types with no archives should not show in breadcrumb.
* Tweak - Only load session handler class on frontend not during cron.
* Tweak - Moved the 'Store Notice" option into the customizer.
* Tweak - Checkout Postcode / Zip validation error message was missing Billing / Shipping Identification.
* Tweak - Added Iris color picker validation.
* Tweak - Use scrollIntoView on checkout.
* Tweak - Converted input submit elements to button submit elements across the entire codebase for consistency.
* Tweak - Added `{site_title}` replacement for email footers.
* Tweak - Added delete product confirmation if a product has had sales.
* Tweak - Improved when "incl. VAT" is displayed in cart totals.
* Tweak - Use base text color for links in email templates.
* Tweak - Show theme overrides that are done through the wc_get_template filter in the system status report.
* Tweak - Added nofollow tags in layered nav to prevent duplicate indexed content.
* Tweak - Hide "incl. VAT" when no rates are defined in "single total" display mode.
* Tweak - Added replay protection for refunds.
* Tweak - GeoDB empty file handling.
* Tweak - Let wp_signon handle email to username conversion.
* Tweak - Made email field wider on checkout.
* Tweak - Post entire shipping selection when showing multiple packages.
* Dev - REST API - Orders should be created for users who exist on the site only.
* Dev - REST API - Fixed default value of "dp" on orders and refunds endpoints.
* Dev - Theming - Added theme support variables to declare image sizes used for products.
* Dev - Theming - Added support for single-product-postname.php template files.
* Dev - Added actions before calculations order totals and taxes and is_vat_excempt support.
* Dev - Add filter 'woocommerce_coupon_get_apply_quantity'.
* Dev - Grouped products; added filters to allow custom columns and changes to values.
* Dev - Allow for cloning the WC_Cart object
* Dev - Apply filters to registration-error-email-exists error.
* Dev - Added `woocommerce_cross_sells_order` filter.
* Dev - Add order-details `before` hooks to complement existing hooks.
* Dev - WC_CHUNK_SIZE constant for controlling readfile.
* Dev - Add short circuit to customer bought product function.
* Dev - Added a `wc_caught_exception` method to aid with logging.
* Dev - Added Data stores and CRUD for working with Webhooks.
* Dev - Bumped minimum WP version requirement to 4.5 and removed legacy API files.
* Dev - New actions - `woocommerce_order_details_before_order_table_items`, `woocommerce_order_details_after_order_table_items` and `woocommerce_order_details_before_order_table`
* Dev - Passed `widget_id` to `content-widget-product.php` so actions can be ran conditionally, and added sanitisation to `woocommerce_before_widget_product_list` and `woocommerce_after_widget_product_list`.
* Dev - Improved the `is_internal_meta_key` checks to consider getters and setters.
* Dev - Cleaned up the Order Customer Details template.
* Dev - JavaScript payment_method_selected events on checkout.
* Dev - Add new `$order->get_edit_order_url()` method.
* Dev - Pass through options to zoom, flexslider, and photoswipe.
* Dev - Added actions before and after scheduled sales initiation and completion.
* Localization - Add direction character to currency output.
* Localization - States for Tanzania and Moldova.
= 3.2.6 - 2017-12-13 =
* Fix - CSV Importer - Fix ID mapping to existing IDs.
* Fix - CSV Importer - Unslash header fields to avoid extra slashes.
* Fix - CSV Importer - Allow import and export of draft products.
* Fix - CSV Importer - Get global attribute ID only when is a global attribute.
* Fix - Remove URL fragment when appending geolocation hash.
* Fix - Additional cart rounding fixes so rounding before subtotal works again. Added more unit tests.
* Fix - Add BOM to exported report CSVs.
* Fix - is_visible should ensure product is is not trashed before returning true.
* Fix - Return packages with no rates back to the cart so the shipping calculator is displayed even when the current country is not shippable.
* Fix - Merge session and persistent carts when both exists after login.
* Fix - Remove "wc_error" query string after login.
* Fix - Allow woocommerce_form_field() have 'custom_attributes' equal 0.
* Fix - Bulk actions in status logs table.
* Fix - Exclude add-to-cart from pagination links.
* Fix - Updated $GLOBALS['post'] data in products shortcode to prevent theme conflicts.
* Fix - Only remove base taxes in cart totals class if item is taxable.
* Fix - REST API - Fixed date format in reports schema.
* Fix - REST API - Updated product categories image schema.
* Fix - REST API - UUse KSES for purchase_note like in admin.
* Fix - REST API - Filter passed images before processing so they can be unset via querystring.
* Tweak - Use protected instead of private methods to allow easy override in session handler.
* Tweak - wc_lostpassword_url should not be used before init - added warning.
* Localization - Update Japanese prefectures to include prefecture type.
= 3.2.5 - 2017-11-22 =
* Fix - WordPress 4.9 - REST API - Updated schema, sanitization, and validation callbacks to support correct data types.
* Fix - WordPress 4.9 - Fix an issue saving variation attributes on new products and with attributes containing slashes.
* Fix - Save fee tax lines to new orders on checkout.
* Fix - Restore the post global after rendering product shortcodes.
* Fix - Fix product filtering when searching for a string including quote characters.
* Fix - Fix layered nav drop-downs containing unicode characters.
* Fix - Fix an edge case rounding bug with shipping taxes, and another with non-integer quantities.
* Fix - Set correct defaults when adding a new shipping class in admin.
= 3.2.4 - 2017-11-16 =
* Fix - Cache IDs in shortcodes rather than query objects.
* Fix - Fix float rounding issues in cart with currencies like Bitcoin.
* Fix - Prevent slashes appearing in shipping fields and inside meta keys when using quotes.
* Fix - Check valid data when filtering `wp_nav_menu_objects` to prevent conflicts.
* Fix - `get_total_ex_tax` should exclude fee taxes.
* Fix - Fix orders count in tax reports.
* Fix - Allow removing coupons from the cart, even if coupons are disabled.
* Fix - Prevent calculate_totals totals running too often.
* Fix - Set attributes during variation creation so all options are correctly displayed in cart forms.
* Fix - Grab description directly to pass through wc_format_content to prevent double sanitization.
* Fix - Fix db warnings when using the "Add Order Indexes" tool.
* Fix - Remove unnecessary html formatting in variation dimensions field.
* Fix - Fix WC_Customer_Download isset method.
* Fix - Removed class within class in admin meta boxes HTML.
* Fix - Fixed wrong `flex-control-nav` selector scope in `add-to-cart-variation.js`
* Fix - Allow variations to be added to cart from query string.
* Fix - Use `add_filter` for `comment_feed_where` hook.
* Fix - Change nocache_headers hook firing in the cache helper.
* Fix - Coupon min/max spend based on displayed subtotal.
* Fix - Fix event propagation on click in setup wizard and improve validation.
* Fix - API - Change how line items are saved in API so calculations are correct.
* Tweak - Hide downloads from admin emails.
* Tweak - Set placeholder for variation lxwxh field to that of the parent.
* Tweak - Improve the Add Payment Methods display so buttons are not shown when no payment methods support the feature.
* Localization - Update NJ tax rate.
* Localization - Add Belarusian ruble BYN.
= 3.2.3 - 2017-11-02 =
* Fix - Fixed a conflict with some slider plugins due to sanitization of archive/term descriptions.
* Fix - Fixed a flexslider bug when there is only 1 image on the product page (no gallery).

View File

@ -230,12 +230,13 @@ module.exports = function( grunt ) {
},
files: {
src: [
'**/*.php', // Include all files
'!apigen/**', // Exclude apigen/
'!node_modules/**', // Exclude node_modules/
'!tests/**', // Exclude tests/
'!vendor/**', // Exclude vendor/
'!tmp/**' // Exclude tmp/
'**/*.php', // Include all files
'!apigen/**', // Exclude apigen/
'!includes/libraries/**', // Exclude libraries/
'!node_modules/**', // Exclude node_modules/
'!tests/**', // Exclude tests/
'!vendor/**', // Exclude vendor/
'!tmp/**' // Exclude tmp/
],
expand: true
}
@ -247,9 +248,9 @@ module.exports = function( grunt ) {
stdout: true,
stderr: true
},
apigen: {
apidocs: {
command: [
'apigen generate -q',
'vendor/bin/apigen generate -q',
'cd apigen',
'php hook-docs.php'
].join( '&&' )
@ -267,7 +268,7 @@ module.exports = function( grunt ) {
// Clean the directory.
clean: {
apigen: {
apidocs: {
src: [ 'wc-apidocs' ]
}
},
@ -351,8 +352,8 @@ module.exports = function( grunt ) {
]);
grunt.registerTask( 'docs', [
'clean:apigen',
'shell:apigen'
'clean:apidocs',
'shell:apidocs'
]);
// Only an alias to 'default' task.

View File

@ -1,53 +1,20 @@
source: ./
destination: wc-apidocs
templateConfig: apigen/theme-woocommerce/config.neon
# list of scanned file extensions (e.g. php5, phpt...)
extensions: [php]
# directories and files matching this file mask will not be parsed
source:
- woocommerce.php
- includes
exclude:
- includes/libraries/
- includes/api/legacy/
- i18n/
- node_modules/
- wc-apidocs/
- tmp/
- tests/
- .sass-cache/
- apigen/
# character set of source files; if you use only one across your files, we recommend you name it
charset: [UTF-8]
# elements with this name prefix will be considered as the "main project" (the rest will be considered as libraries)
main: WC
# title of generated documentation
title: WooCommerce 3.0.x Code Reference
# base url used for sitemap (useful for public doc)
title: WooCommerce Code Reference
baseUrl: https://docs.woocommerce.com/wc-apidocs/
# choose ApiGen template theme
templateTheme: default
# generate documentation for PHP internal classes
php: false
# generate highlighted source code for elements
sourceCode: true
# generate tree view of classes, interfaces, traits and exceptions
tree: true
# generate documentation for deprecated elements
deprecated: true
# generate list of tasks with @ todo annotation
todo: true
# add link to ZIP archive of documentation
download: false

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

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

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;
@ -903,8 +913,7 @@ ul.wc_coupon_list {
&.code {
display: inline-block;
position: relative;
padding-right: 2em;
padding-left: .5em;
padding: 0 .5em;
background-color: #fff;
border: 1px solid #aaa;
-webkit-box-shadow: 0 1px 0 #dfdfdf;
@ -914,6 +923,10 @@ ul.wc_coupon_list {
margin-right: 5px;
margin-top: 5px;
&.editable {
padding-right: 2em;
}
.tips {
cursor: pointer;
@ -1139,6 +1152,7 @@ ul.wc_coupon_list_block {
.wc-customer-user, .wc-order-status {
label a {
float: right;
margin-left: 8px;
}
}
@ -1976,6 +1990,7 @@ ul.wc_coupon_list_block {
}
a.link::after {
font-family: 'WooCommerce';
content: '\e00d';
}
@ -2044,9 +2059,12 @@ ul.wc_coupon_list_block {
tbody tr {
border-top: 1px solid #f5f5f5;
}
tbody tr:hover:not(.status-trash) td {
tbody tr:hover:not(.status-trash):not(.no-link) td {
cursor: pointer;
}
.no-link {
cursor: default !important;
}
// Columns.
td,
@ -2068,7 +2086,7 @@ ul.wc_coupon_list_block {
}
}
.column-order_number {
width: 35ch;
width: 20ch;
}
.column-order_total {
width: 8ch;
@ -2191,7 +2209,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;
@ -2230,11 +2247,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;
@ -2243,22 +2263,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;
}
}
@ -2266,28 +2292,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 {
@ -2304,6 +2336,42 @@ 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;
}
}
.post-type-shop_order .wp-list-table {
td.column-order_number {
padding-bottom: .5em;
}
td.column-order_status,
td.column-order_date {
display: inline-block !important;
padding: 0 1em 1em 1em !important;
&:before {
display: none !important;
}
}
td.column-order_status {
float: right;
}
}
}
.column-customer_message .note-on {
@include ir();
@ -2442,6 +2510,7 @@ table.wp-list-table {
.column-handle {
width: 17px;
display: none;
}
tbody {
@ -2692,10 +2761,19 @@ a.import_rates {
}
}
.wc_input_table_wrapper {
overflow-x: auto;
display: block;
}
table.wc_tax_rates,
table.wc_input_table {
width: 100%;
th, td {
display: table-cell !important;
}
span.tips {
color: $blue;
}
@ -2713,9 +2791,10 @@ table.wc_input_table {
background: #fff;
cursor: default;
input[type='text'],
input[type='number'] {
width: 100%;
input[type=text],
input[type=number] {
width: 100% !important;
min-width: 100px;
padding: 8px 10px;
margin: 0;
border: 0;
@ -2830,6 +2909,10 @@ table.wc_emails,
table.wc_shipping {
position: relative;
th, td {
display: table-cell !important;
}
td {
vertical-align: middle;
padding: 7px;
@ -2922,7 +3005,6 @@ table.wc_shipping {
padding: 24px 24px 24px 0;
}
td.forminp {
padding: 15px 10px;
input, textarea {
padding: 8px;
width: 448px;
@ -2989,6 +3071,7 @@ table.wc-shipping-zones, table.wc-shipping-zone-methods, table.wc-shipping-class
padding: 1em !important;
font-size: 14px;
background: #fff;
display: table-cell !important;
li {
line-height: 24px;
font-size: 14px;
@ -3405,6 +3488,7 @@ img.help_tip {
table.form-table {
margin: 0;
position: relative;
table-layout: fixed;
.forminp-radio ul {
margin: 0;
@ -5679,7 +5763,8 @@ table.bar_chart {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 500px;
max-width: 100%;
min-width: 500px;
article {
overflow: auto;
}
@ -5903,7 +5988,7 @@ table.bar_chart {
}
.select2-container {
float: left;
width: 200px !important;
width: 240px !important;
font-size: 14px;
vertical-align: middle;
margin: 1px 6px 4px 1px;

View File

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

View File

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

View File

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

View File

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

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

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -639,6 +639,8 @@ body {
// Toggle display a list of services.
.wc-wizard-services-list-toggle {
cursor: pointer;
.wc-wizard-service-enable::before {
content: "\f343"; // up chevron
font-family: "dashicons";
@ -658,7 +660,6 @@ body {
.wc-wizard-service-enable input {
visibility: hidden;
position: relative;
cursor: pointer;
}
}

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

@ -98,18 +98,16 @@
/**
* Products
*/
&, &[class*='columns-'] {
ul.products {
li.product {
width: 48%;
float: left;
clear: both;
margin: 0 0 2.992em;
ul.products[class*='columns-'] {
li.product {
width: 48%;
float: left;
clear: both;
margin: 0 0 2.992em;
&:nth-child( 2n ) {
float: right;
clear: none !important; // This should never clear.
}
&:nth-child( 2n ) {
float: right;
clear: none !important; // This should never clear.
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -2114,6 +2114,13 @@ button.pswp__button--zoom:hover {
background: rgba(0,0,0,.05);
}
.woocommerce-invalid {
#terms {
outline: 2px solid red;
outline-offset: 2px;
}
}
/**
* Password strength meter
*/

View File

@ -6,7 +6,7 @@
<![CDATA[
{
"fontFamily": "WooCommerce",
"fontURL": "https://woothemes.com",
"fontURL": "https://woocommerce.com",
"designer": "James Koster",
"designerURL": "http://jameskoster.co.uk",
"license": "SIL OFL",

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

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' );
}
},

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,90 @@
/*global woocommerce_network_orders */
(function( $, _, undefined ) {
if ( 'undefined' === typeof woocommerce_network_orders ) {
return;
}
var orders = [],
promises = [], // Track completion (pass or fail) of ajax requests.
deferred = [], // Tracks the ajax deferreds.
$tbody = $( document.getElementById( 'network-orders-tbody' ) ),
template = _.template( $( document.getElementById( 'network-orders-row-template') ).text() ),
$loadingIndicator = $( document.getElementById( 'woocommerce-network-order-table-loading' ) ),
$orderTable = $( document.getElementById( 'woocommerce-network-order-table' ) ),
$noneFound = $( document.getElementById( 'woocommerce-network-orders-no-orders' ) );
// No sites, so bail.
if ( ! woocommerce_network_orders.sites.length ) {
$loadingIndicator.removeClass( 'is-active' );
$orderTable.removeClass( 'is-active' );
$noneFound.addClass( 'is-active' );
return;
}
$.each( woocommerce_network_orders.sites, function( index, value ) {
promises[ index ] = $.Deferred();
deferred.push( $.ajax( {
url : woocommerce_network_orders.order_endpoint,
data: {
_wpnonce: woocommerce_network_orders.nonce,
network_orders: true,
blog_id: value
},
type: 'GET'
} ).success(function( response ) {
var orderindex;
for ( orderindex in response ) {
orders.push( response[ orderindex ] );
}
promises[ index ].resolve();
}).fail(function (){
promises[ index ].resolve();
}) );
} );
if ( promises.length > 0 ) {
$.when.apply( $, promises ).done( function() {
var orderindex,
currentOrder;
// Sort orders, newest first
orders.sort(function( a, b ) {
var adate, bdate;
adate = Date.parse( a.date_created_gmt );
bdate = Date.parse( b.date_created_gmt );
if ( adate === bdate ) {
return 0;
}
if ( adate < bdate ) {
return 1;
} else {
return -1;
}
});
if ( orders.length > 0 ) {
for ( orderindex in orders ) {
currentOrder = orders[ orderindex ];
$tbody.append( template( currentOrder ) );
}
$noneFound.removeClass( 'is-active' );
$loadingIndicator.removeClass( 'is-active' );
$orderTable.addClass( 'is-active' );
} else {
$noneFound.addClass( 'is-active' );
$loadingIndicator.removeClass( 'is-active' );
$orderTable.removeClass( 'is-active' );
}
} );
}
})( jQuery, _ );

1
assets/js/admin/network-orders.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(e,o,r){if("undefined"!=typeof woocommerce_network_orders){var t=[],n=[],s=[],a=e(document.getElementById("network-orders-tbody")),d=o.template(e(document.getElementById("network-orders-row-template")).text()),c=e(document.getElementById("woocommerce-network-order-table-loading")),i=e(document.getElementById("woocommerce-network-order-table")),m=e(document.getElementById("woocommerce-network-orders-no-orders"));if(!woocommerce_network_orders.sites.length)return c.removeClass("is-active"),i.removeClass("is-active"),void m.addClass("is-active");e.each(woocommerce_network_orders.sites,function(o,r){n[o]=e.Deferred(),s.push(e.ajax({url:woocommerce_network_orders.order_endpoint,data:{_wpnonce:woocommerce_network_orders.nonce,network_orders:!0,blog_id:r},type:"GET"}).success(function(e){var r;for(r in e)t.push(e[r]);n[o].resolve()}).fail(function(){n[o].resolve()}))}),n.length>0&&e.when.apply(e,n).done(function(){var e,o;if(t.sort(function(e,o){var r,t;return r=Date.parse(e.date_created_gmt),t=Date.parse(o.date_created_gmt),r===t?0:r<t?1:-1}),t.length>0){for(e in t)o=t[e],a.append(d(o));m.removeClass("is-active"),c.removeClass("is-active"),i.addClass("is-active")}else m.addClass("is-active"),c.removeClass("is-active"),i.removeClass("is-active")})}}(jQuery,_);

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 ) {

File diff suppressed because one or more lines are too long

View File

@ -3,12 +3,27 @@
/* Modifided script from the simple-page-ordering plugin */
jQuery( function( $ ) {
$( 'table.widefat.wp-list-table tr' ).append(
'<td class="column-handle"></td>'
);
var table_selector = 'table.wp-list-table',
item_selector = 'tbody tr:not(.inline-edit-row)',
term_id_selector = '.column-handle input[name="term_id"]';
$( 'table.widefat.wp-list-table' ).sortable({
items: 'tbody tr:not(.inline-edit-row)',
if ( 0 === $( table_selector ).find( '.column-handle' ).length ) {
$( table_selector ).find( 'tr:not(.inline-edit-row)' ).append( '<td class="column-handle"></td>' );
term_id_selector = '.check-column input';
}
$( 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',
handle: '.column-handle',
axis: 'y',
@ -29,11 +44,11 @@ jQuery( function( $ ) {
ui.item.children( 'td, th' ).css( 'border-bottom-width', '1px' );
},
update: function( event, ui ) {
var termid = ui.item.find( '.check-column input' ).val(); // this post id
var termid = ui.item.find( term_id_selector ).val(); // this post id
var termparent = ui.item.find( '.parent' ).html(); // post parent
var prevtermid = ui.item.prev().find( '.check-column input' ).val();
var nexttermid = ui.item.next().find( '.check-column input' ).val();
var prevtermid = ui.item.prev().find( term_id_selector ).val();
var nexttermid = ui.item.next().find( term_id_selector ).val();
// Can only sort in same tree
var prevtermparent, nexttermparent;
@ -53,19 +68,21 @@ jQuery( function( $ ) {
// If previous and next not at same tree level, or next not at same tree level and the previous is the parent of the next, or just moved item beneath its own children
if ( ( prevtermid === undefined && nexttermid === undefined ) || ( nexttermid === undefined && nexttermparent === prevtermid ) || ( nexttermid !== undefined && prevtermparent === termid ) ) {
$( 'table.widefat.wp-list-table' ).sortable( 'cancel' );
$( table_selector ).sortable( 'cancel' );
return;
}
// Show Spinner
ui.item.find( '.check-column input' ).hide().after( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );
ui.item.find( '.check-column input' ).hide();
ui.item.find( '.check-column' ).append( '<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />' );
// Go do the sorting stuff via ajax
$.post( ajaxurl, { action: 'woocommerce_term_ordering', id: termid, nextid: nexttermid, thetaxonomy: woocommerce_term_ordering_params.taxonomy }, function(response){
if ( response === 'children' ) {
window.location.reload();
} else {
ui.item.find( '.check-column input' ).show().siblings( 'img' ).remove();
ui.item.find( '.check-column input' ).show();
ui.item.find( '.check-column' ).find( 'img' ).remove();
}
});

View File

@ -1 +1 @@
jQuery(function(e){e("table.widefat.wp-list-table tr").append('<td class="column-handle"></td>'),e("table.widefat.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",handle:".column-handle",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(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(t,i){var n,a,d=i.item.find(".check-column input").val(),o=i.item.find(".parent").html(),l=i.item.prev().find(".check-column input").val(),r=i.item.next().find(".check-column input").val();l!==undefined&&(n=i.item.prev().find(".parent").html())!==o&&(l=undefined),r!==undefined&&(a=i.item.next().find(".parent").html())!==o&&(r=undefined),l===undefined&&r===undefined||r===undefined&&a===l||r!==undefined&&n===d?e("table.widefat.wp-list-table").sortable("cancel"):(i.item.find(".check-column input").hide().after('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),e.post(ajaxurl,{action:"woocommerce_term_ordering",id:d,nextid:r,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(e){"children"===e?window.location.reload():i.item.find(".check-column input").show().siblings("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(n,i,d){i&&4===i.readyState&&200===i.status&&d.data&&0<=d.data.indexOf("_inline_edit")&&(e(t).find(".column-handle").show(),e(document.body).trigger("init_tooltips"))}),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(),r=d.item.find(".parent").html(),c=d.item.prev().find(n).val(),m=d.item.next().find(n).val();c!==undefined&&(o=d.item.prev().find(".parent").html())!==r&&(c=undefined),m!==undefined&&(a=d.item.next().find(".parent").html())!==r&&(m=undefined),c===undefined&&m===undefined||m===undefined&&a===c||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

@ -18,17 +18,21 @@ jQuery( function( $ ) {
* Click a row.
*/
WCOrdersTable.prototype.onRowClick = function( e ) {
if ( $( e.target ).filter( 'a' ).length ) {
if ( $( e.target ).filter( 'a, a *, .no-link, .no-link *' ).length ) {
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 ) {
if ( e.metaKey || e.ctrlKey ) {
window.open( href, '_blank' );
} else {
window.location = href;

View File

@ -1 +1 @@
jQuery(function(e){if("undefined"==typeof wc_orders_params)return!1;var r=function(){e(document).on("click",".post-type-shop_order .wp-list-table tbody td",this.onRowClick).on("click",".order-preview:not(.disabled)",this.onPreview)};r.prototype.onRowClick=function(r){if(e(r.target).filter("a").length)return!0;var a=e(this).closest("tr").find("a.order-view").attr("href");a.length&&(r.preventDefault(),r.metaKey?window.open(a,"_blank"):window.location=a)},r.prototype.onPreview=function(){var r=e(this),a=r.data("order-id");return r.data("order-data")?e(this).WCBackboneModal({template:"wc-modal-view-order",variable:r.data("order-data")}):(r.addClass("disabled"),e.ajax({url:wc_orders_params.ajax_url,data:{order_id:a,action:"woocommerce_get_order_details",security:wc_orders_params.preview_nonce},type:"GET",success:function(a){e(".order-preview").removeClass("disabled"),a.success&&(r.data("order-data",a.data),e(this).WCBackboneModal({template:"wc-modal-view-order",variable:a.data}))}})),!1},new r});
jQuery(function(e){if("undefined"==typeof wc_orders_params)return!1;var t=function(){e(document).on("click",".post-type-shop_order .wp-list-table tbody td",this.onRowClick).on("click",".order-preview:not(.disabled)",this.onPreview)};t.prototype.onRowClick=function(t){if(e(t.target).filter("a, a *, .no-link, .no-link *").length)return!0;if(window.getSelection&&window.getSelection().toString().length)return!0;var r=e(this).closest("tr").find("a.order-view").attr("href");r&&r.length&&(t.preventDefault(),t.metaKey||t.ctrlKey?window.open(r,"_blank"):window.location=r)},t.prototype.onPreview=function(){var t=e(this),r=t.data("order-id");return t.data("order-data")?e(this).WCBackboneModal({template:"wc-modal-view-order",variable:t.data("order-data")}):(t.addClass("disabled"),e.ajax({url:wc_orders_params.ajax_url,data:{order_id:r,action:"woocommerce_get_order_details",security:wc_orders_params.preview_nonce},type:"GET",success:function(r){e(".order-preview").removeClass("disabled"),r.success&&(t.data("order-data",r.data),e(this).WCBackboneModal({template:"wc-modal-view-order",variable:r.data}))}})),!1},new t});

View File

@ -48,7 +48,7 @@ jQuery( function( $ ) {
$checkbox.prop( 'checked', ! $checkbox.prop( 'checked' ) ).change();
} );
$( '.wc-wizard-services-list-toggle' ).on( 'change', '.wc-wizard-service-enable input', function() {
$( '.wc-wizard-services-list-toggle' ).on( 'click', function() {
$( this ).closest( '.wc-wizard-services-list-toggle' ).toggleClass( 'closed' );
$( this ).closest( '.wc-wizard-services' ).find( '.wc-wizard-service-item' )
.slideToggle()

View File

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

View File

@ -134,6 +134,7 @@ jQuery( function ( $ ) {
})
.on( 'init_tooltips', function() {
$( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( {
'attribute': 'data-tip',
'fadeIn': 50,
@ -281,15 +282,6 @@ jQuery( function ( $ ) {
}).change();
});
// Demo store notice
$( 'input#woocommerce_demo_store' ).change(function() {
if ( $( this ).is( ':checked' ) ) {
$( '#woocommerce_demo_store_notice' ).closest( 'tr' ).show();
} else {
$( '#woocommerce_demo_store_notice' ).closest( 'tr' ).hide();
}
}).change();
// Reviews.
$( 'input#woocommerce_enable_reviews' ).change(function() {
if ( $( this ).is( ':checked' ) ) {

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*
* jQuery FlexSlider v2.6.1
* jQuery FlexSlider v2.7.0
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/
@ -15,15 +15,15 @@
// making variables public
//if rtl value was not passed and html is in rtl..enable it by default.
if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){
options.rtl=true;
if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){
options.rtl=true;
}
slider.vars = $.extend({}, $.flexslider.defaults, options);
var namespace = slider.vars.namespace,
msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture,
touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch,
// depricating this idea, as devices are being released with both of these events
// deprecating this idea, as devices are being released with both of these events
eventType = "click touchend MSPointerUp keyup",
watchedEvent = "",
watchedEventClearTimer,
@ -176,14 +176,14 @@
e.preventDefault();
var $slide = $(this),
target = $slide.index();
var posFromX;
var posFromX;
if(slider.vars.rtl){
posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container
}
else
{
posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
}
posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container
}
else
{
posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
}
if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
slider.flexAnimate(slider.getTarget("prev"), true);
} else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) {
@ -792,12 +792,8 @@
}
} else { // FADE:
if (!touch) {
//slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing);
//slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing);
slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
} else {
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
@ -894,7 +890,7 @@
}
}());
return (posCalc * -1) + "px";
return (posCalc * ((slider.vars.rtl)?1:-1)) + "px";
}());
if (slider.transitions) {
@ -954,7 +950,7 @@
setTimeout(function(){
slider.doMath();
if(slider.vars.rtl){
slider.newSlides.css({"width": slider.computedW, "marginLeft" : slider.computedM, "float": "right", "display": "block"});
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
}
else{
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
@ -1143,7 +1139,7 @@
// Usability features
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage.
pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage.
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
@ -1185,7 +1181,7 @@
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed
init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup
rtl: false //{NEW} Boolean: Whether or not to enable RTL mode
rtl: false //{NEW} Boolean: Whether or not to enable RTL mode
};
//FlexSlider: Plugin Function

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
jQuery(function(e){function t(){o&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function n(e){o&&(localStorage.setItem(a,e),sessionStorage.setItem(a,e))}function r(){e.ajax(s)}if("undefined"==typeof wc_cart_fragments_params)return!1;var o=!0,a=wc_cart_fragments_params.cart_hash_key;try{o="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(w){o=!1}var s={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",success:function(r){r&&r.fragments&&(e.each(r.fragments,function(t,n){e(t).replaceWith(n)}),o&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(r.fragments)),n(r.cart_hash),r.cart_hash&&t()),e(document.body).trigger("wc_fragments_refreshed"))}};if(o){var i=null;e(document.body).on("wc_fragment_refresh updated_wc_div",function(){r()}),e(document.body).on("added_to_cart",function(e,r,o){var s=sessionStorage.getItem(a);null!==s&&s!==undefined&&""!==s||t(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(r)),n(o)}),e(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(r,864e5)}),e(window).on("storage onstorage",function(e){a===e.originalEvent.key&&localStorage.getItem(a)!==sessionStorage.getItem(a)&&r()}),e(window).on("pageshow",function(t){t.originalEvent.persisted&&(e(".widget_shopping_cart_content").empty(),e(document.body).trigger("wc_fragment_refresh"))});try{var c=e.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(a),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=1*m+864e5,f=(new Date).getTime();if(d<f)throw"Fragment expired";i=setTimeout(r,d-f)}if(!c||!c["div.widget_shopping_cart_content"]||_!==g)throw"No fragment";e.each(c,function(t,n){e(t).replaceWith(n)}),e(document.body).trigger("wc_fragments_loaded")}catch(w){r()}}else r();Cookies.get("woocommerce_items_in_cart")>0?e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),e(document.body).on("adding_to_cart",function(){e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()})});
jQuery(function(e){function t(){o&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function n(e){o&&(localStorage.setItem(a,e),sessionStorage.setItem(a,e))}function r(){e.ajax(s)}if("undefined"==typeof wc_cart_fragments_params)return!1;var o=!0,a=wc_cart_fragments_params.cart_hash_key;try{o="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(w){o=!1}var s={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",success:function(r){r&&r.fragments&&(e.each(r.fragments,function(t,n){e(t).replaceWith(n)}),o&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(r.fragments)),n(r.cart_hash),r.cart_hash&&t()),e(document.body).trigger("wc_fragments_refreshed"))}};if(o){var i=null;e(document.body).on("wc_fragment_refresh updated_wc_div",function(){r()}),e(document.body).on("added_to_cart removed_from_cart",function(e,r,o){var s=sessionStorage.getItem(a);null!==s&&s!==undefined&&""!==s||t(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(r)),n(o)}),e(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(r,864e5)}),e(window).on("storage onstorage",function(e){a===e.originalEvent.key&&localStorage.getItem(a)!==sessionStorage.getItem(a)&&r()}),e(window).on("pageshow",function(t){t.originalEvent.persisted&&(e(".widget_shopping_cart_content").empty(),e(document.body).trigger("wc_fragment_refresh"))});try{var c=e.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(a),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=1*m+864e5,f=(new Date).getTime();if(d<f)throw"Fragment expired";i=setTimeout(r,d-f)}if(!c||!c["div.widget_shopping_cart_content"]||_!==g)throw"No fragment";e.each(c,function(t,n){e(t).replaceWith(n)}),e(document.body).trigger("wc_fragments_loaded")}catch(w){r()}}else r();Cookies.get("woocommerce_items_in_cart")>0?e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show():e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").hide(),e(document.body).on("adding_to_cart",function(){e(".hide_cart_widget_if_empty").closest(".widget_shopping_cart").show()})});

View File

@ -1742,7 +1742,10 @@ S2.define('select2/selection/multiple',[
var selection = data[d];
var $selection = this.selectionContainer();
var formatted = this.display(selection, $selection).trim();
var formatted = this.display(selection, $selection);
if ('string' === typeof formatted) {
formatted = formatted.trim();
}
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);

File diff suppressed because one or more lines are too long

View File

@ -1742,7 +1742,10 @@ S2.define('select2/selection/multiple',[
var selection = data[d];
var $selection = this.selectionContainer();
var formatted = this.display(selection, $selection).trim();
var formatted = this.display(selection, $selection);
if ('string' === typeof formatted) {
formatted = formatted.trim();
}
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);

File diff suppressed because one or more lines are too long

View File

@ -4,17 +4,21 @@
"homepage": "https://woocommerce.com/",
"type": "wordpress-plugin",
"license": "GPL-3.0-or-later",
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"composer/installers": "~1.2"
},
"require-dev": {
"squizlabs/php_codesniffer": "*",
"wp-coding-standards/wpcs": "^0.14",
"phpunit/phpunit": "6.2.3",
"phpunit/phpunit": "6.*",
"woocommerce/woocommerce-git-hooks": "*",
"woocommerce/woocommerce-sniffs": "*",
"wimg/php-compatibility": "^8.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
"apigen/apigen": "^4",
"nette/utils": "~2.3.0"
},
"scripts": {
"pre-update-cmd": [

2116
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,4 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
include_once( WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-order.php' );
<?php // @codingStandardsIgnoreLine
/**
* Abstract Order
*
@ -14,8 +8,14 @@ include_once( WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-order.php' );
* @class WC_Abstract_Order
* @version 3.0.0
* @package WooCommerce/Classes
* @category Class
* @author WooThemes
*/
defined( 'ABSPATH' ) || exit;
require_once WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-order.php';
/**
* WC_Abstract_Order class.
*/
abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
@ -65,6 +65,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Stores meta in cache for future reads.
*
* A group must be set to to enable caching.
*
* @var string
*/
protected $cache_group = 'orders';
@ -78,6 +79,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* This is the name of this object type.
*
* @var string
*/
protected $object_type = 'order';
@ -181,8 +183,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Save all order items which are part of this order.
*/
protected function save_items() {
$items_changed = false;
foreach ( $this->items_to_delete as $item ) {
$item->delete();
$items_changed = true;
}
$this->items_to_delete = array();
@ -200,10 +205,16 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$this->items[ $item_group ][ $item_id ] = $item;
unset( $this->items[ $item_group ][ $item_key ] );
$items_changed = true;
}
}
}
}
if ( $items_changed ) {
delete_transient( 'wc_order_' . $this->get_id() . '_needs_processing' );
}
}
/*
@ -216,7 +227,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Get parent order ID.
*
* @since 3.0.0
* @param string $context
* @param string $context View or edit context.
* @return integer
*/
public function get_parent_id( $context = 'view' ) {
@ -226,7 +237,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets order currency.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_currency( $context = 'view' ) {
@ -236,7 +247,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get order_version.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_version( $context = 'view' ) {
@ -246,7 +257,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get prices_include_tax.
*
* @param string $context
* @param string $context View or edit context.
* @return bool
*/
public function get_prices_include_tax( $context = 'view' ) {
@ -256,7 +267,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get date_created.
*
* @param string $context
* @param string $context View or edit context.
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
*/
public function get_date_created( $context = 'view' ) {
@ -266,7 +277,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get date_modified.
*
* @param string $context
* @param string $context View or edit context.
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
*/
public function get_date_modified( $context = 'view' ) {
@ -276,7 +287,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Return the order statuses without wc- internal prefix.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_status( $context = 'view' ) {
@ -292,7 +303,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get discount_total.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_discount_total( $context = 'view' ) {
@ -302,7 +313,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get discount_tax.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_discount_tax( $context = 'view' ) {
@ -312,7 +323,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get shipping_total.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_shipping_total( $context = 'view' ) {
@ -322,7 +333,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get shipping_tax.
*
* @param string $context
* @param string $context View or edit context.
* @return string
*/
public function get_shipping_tax( $context = 'view' ) {
@ -332,7 +343,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets cart tax amount.
*
* @param string $context
* @param string $context View or edit context.
* @return float
*/
public function get_cart_tax( $context = 'view' ) {
@ -342,7 +353,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets order grand total. incl. taxes. Used in gateways.
*
* @param string $context
* @param string $context View or edit context.
* @return float
*/
public function get_total( $context = 'view' ) {
@ -352,7 +363,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get total tax amount. Alias for get_order_tax().
*
* @param string $context
* @param string $context View or edit context.
* @return float
*/
public function get_total_tax( $context = 'view' ) {
@ -382,6 +393,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets order subtotal.
*
* @return float
*/
public function get_subtotal() {
@ -406,16 +418,16 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$code = $tax->get_rate_code();
if ( ! isset( $tax_totals[ $code ] ) ) {
$tax_totals[ $code ] = new stdClass();
$tax_totals[ $code ] = new stdClass();
$tax_totals[ $code ]->amount = 0;
}
$tax_totals[ $code ]->id = $key;
$tax_totals[ $code ]->rate_id = $tax->get_rate_id();
$tax_totals[ $code ]->is_compound = $tax->is_compound();
$tax_totals[ $code ]->label = $tax->get_label();
$tax_totals[ $code ]->amount += (float) $tax->get_tax_total() + (float) $tax->get_shipping_tax_total();
$tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ), array( 'currency' => $this->get_currency() ) );
$tax_totals[ $code ]->id = $key;
$tax_totals[ $code ]->rate_id = $tax->get_rate_id();
$tax_totals[ $code ]->is_compound = $tax->is_compound();
$tax_totals[ $code ]->label = $tax->get_label();
$tax_totals[ $code ]->amount += (float) $tax->get_tax_total() + (float) $tax->get_shipping_tax_total();
$tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ), array( 'currency' => $this->get_currency() ) );
}
if ( apply_filters( 'woocommerce_order_hide_zero_taxes', true ) ) {
@ -439,7 +451,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get user ID. Used by orders, not other order types like refunds.
*
* @param string $context
* @param string $context View or edit context.
* @return int
*/
public function get_user_id( $context = 'view' ) {
@ -470,8 +482,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Set parent order ID.
*
* @since 3.0.0
* @param int $value
* @throws WC_Data_Exception
* @param int $value Value to set.
* @throws WC_Data_Exception Exception thrown if parent ID does not exist or is invalid.
*/
public function set_parent_id( $value ) {
if ( $value && ( $value === $this->get_id() || ! wc_get_order( $value ) ) ) {
@ -493,13 +505,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
// If setting the status, ensure it's set to a valid status.
if ( true === $this->object_read ) {
// Only allow valid new status
if ( ! in_array( 'wc-' . $new_status, $this->get_valid_statuses() ) && 'trash' !== $new_status ) {
// Only allow valid new status.
if ( ! in_array( 'wc-' . $new_status, $this->get_valid_statuses(), true ) && 'trash' !== $new_status ) {
$new_status = 'pending';
}
// If the old status is set but unknown (e.g. draft) assume its pending for action usage.
if ( $old_status && ! in_array( 'wc-' . $old_status, $this->get_valid_statuses() ) && 'trash' !== $old_status ) {
if ( $old_status && ! in_array( 'wc-' . $old_status, $this->get_valid_statuses(), true ) && 'trash' !== $old_status ) {
$old_status = 'pending';
}
}
@ -515,8 +527,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set order_version.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_version( $value ) {
$this->set_prop( 'version', $value );
@ -525,11 +537,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set order_currency.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_currency( $value ) {
if ( $value && ! in_array( $value, array_keys( get_woocommerce_currencies() ) ) ) {
if ( $value && ! in_array( $value, array_keys( get_woocommerce_currencies() ), true ) ) {
$this->error( 'order_invalid_currency', __( 'Invalid currency code', 'woocommerce' ) );
}
$this->set_prop( 'currency', $value ? $value : get_woocommerce_currency() );
@ -538,8 +550,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set prices_include_tax.
*
* @param bool $value
* @throws WC_Data_Exception
* @param bool $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_prices_include_tax( $value ) {
$this->set_prop( 'prices_include_tax', (bool) $value );
@ -549,7 +561,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Set date_created.
*
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
* @throws WC_Data_Exception
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_date_created( $date = null ) {
$this->set_date_prop( 'date_created', $date );
@ -559,7 +571,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Set date_modified.
*
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
* @throws WC_Data_Exception
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_date_modified( $date = null ) {
$this->set_date_prop( 'date_modified', $date );
@ -568,8 +580,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set discount_total.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_discount_total( $value ) {
$this->set_prop( 'discount_total', wc_format_decimal( $value ) );
@ -578,8 +590,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set discount_tax.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_discount_tax( $value ) {
$this->set_prop( 'discount_tax', wc_format_decimal( $value ) );
@ -588,8 +600,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set shipping_total.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_shipping_total( $value ) {
$this->set_prop( 'shipping_total', wc_format_decimal( $value ) );
@ -598,8 +610,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set shipping_tax.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_shipping_tax( $value ) {
$this->set_prop( 'shipping_tax', wc_format_decimal( $value ) );
@ -609,8 +621,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set cart tax.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_cart_tax( $value ) {
$this->set_prop( 'cart_tax', wc_format_decimal( $value ) );
@ -620,8 +632,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Sets order tax (sum of cart and shipping tax). Used internally only.
*
* @param string $value
* @throws WC_Data_Exception
* @param string $value Value to set.
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
protected function set_total_tax( $value ) {
$this->set_prop( 'total_tax', wc_format_decimal( $value ) );
@ -630,11 +642,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Set total.
*
* @param string $value
* @param string $value Value to set.
* @param string $deprecated Function used to set different totals based on this.
*
* @return bool|void
* @throws WC_Data_Exception
* @throws WC_Data_Exception Exception may be thrown if value is invalid.
*/
public function set_total( $value, $deprecated = '' ) {
if ( $deprecated ) {
@ -662,7 +674,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( ! empty( $type ) ) {
$this->data_store->delete_items( $this, $type );
if ( $group = $this->type_to_group( $type ) ) {
$group = $this->type_to_group( $type );
if ( $group ) {
unset( $this->items[ $group ] );
}
} else {
@ -674,8 +688,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Convert a type to a types group.
*
* @param string $type
* @return string group
* @param string $type type to lookup.
* @return string
*/
protected function type_to_group( $type ) {
$type_to_group = apply_filters( 'woocommerce_order_type_to_group', array(
@ -699,11 +713,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$types = array_filter( (array) $types );
foreach ( $types as $type ) {
if ( $group = $this->type_to_group( $type ) ) {
$group = $this->type_to_group( $type );
if ( $group ) {
if ( ! isset( $this->items[ $group ] ) ) {
$this->items[ $group ] = array_filter( $this->data_store->read_items( $this, $type ) );
}
// Don't use array_merge here because keys are numeric
// Don't use array_merge here because keys are numeric.
$items = $items + $this->items[ $group ];
}
}
@ -758,7 +774,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*/
public function get_used_coupons() {
$coupon_codes = array();
if ( $coupons = $this->get_items( 'coupon' ) ) {
$coupons = $this->get_items( 'coupon' );
if ( $coupons ) {
foreach ( $coupons as $coupon ) {
$coupon_codes[] = $coupon->get_code();
}
@ -769,7 +787,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets the count of order items of a certain type.
*
* @param string $item_type
* @param string $item_type Item type to lookup.
* @return string
*/
public function get_item_count( $item_type = '' ) {
@ -821,7 +839,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Get key for where a certain item type is stored in _items.
*
* @since 3.0.0
* @param $item object Order item (product, shipping, fee, coupon, tax)
* @param string $item object Order item (product, shipping, fee, coupon, tax).
* @return string
*/
protected function get_items_key( $item ) {
@ -846,9 +864,10 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @return false|void
*/
public function remove_item( $item_id ) {
$item = $this->get_item( $item_id, false );
$item = $this->get_item( $item_id, false );
$items_key = $item ? $this->get_items_key( $item ) : false;
if ( ! $item || ! ( $items_key = $this->get_items_key( $item ) ) ) {
if ( ! $items_key ) {
return false;
}
@ -861,12 +880,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Adds an order item to this order. The order item will not persist until save.
*
* @since 3.0.0
* @param WC_Order_Item Order item object (product, shipping, fee, coupon, tax)
*
* @param WC_Order_Item $item Order item object (product, shipping, fee, coupon, tax).
* @return false|void
*/
public function add_item( $item ) {
if ( ! $items_key = $this->get_items_key( $item ) ) {
$items_key = $this->get_items_key( $item );
if ( ! $items_key ) {
return false;
}
@ -879,10 +899,12 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$item->set_order_id( $this->get_id() );
// Append new row with generated temporary ID.
if ( $item_id = $item->get_id() ) {
$item_id = $item->get_id();
if ( $item_id ) {
$this->items[ $items_key ][ $item_id ] = $item;
} else {
$this->items[ $items_key ][ 'new:' . $items_key . sizeof( $this->items[ $items_key ] ) ] = $item;
$this->items[ $items_key ][ 'new:' . $items_key . count( $this->items[ $items_key ] ) ] = $item;
}
}
@ -897,8 +919,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( is_a( $raw_coupon, 'WC_Coupon' ) ) {
$coupon = $raw_coupon;
} elseif ( is_string( $raw_coupon ) ) {
$code = wc_format_coupon_code( $raw_coupon );
$coupon = new WC_Coupon( $code );
$code = wc_format_coupon_code( $raw_coupon );
$coupon = new WC_Coupon( $code );
if ( $coupon->get_code() !== $code ) {
return new WP_Error( 'invalid_coupon', __( 'Invalid coupon code', 'woocommerce' ) );
@ -936,7 +958,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$this->calculate_totals( true );
// Record usage so counts and validation is correct.
if ( ! $used_by = $this->get_user_id() ) {
$used_by = $this->get_user_id();
if ( ! $used_by ) {
$used_by = $this->get_billing_email();
}
@ -990,8 +1014,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$discounts = new WC_Discounts( $this );
foreach ( $this->get_items( 'coupon' ) as $coupon_item ) {
$coupon_code = $coupon_item->get_code();
$coupon_id = wc_get_coupon_id_by_code( $coupon_code );
$coupon_code = $coupon_item->get_code();
$coupon_id = wc_get_coupon_id_by_code( $coupon_code );
// If we have a coupon ID (loaded via wc_get_coupon_id_by_code) we can simply load the new coupon object using the ID.
if ( $coupon_id ) {
@ -1044,7 +1068,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @param WC_Discounts $discounts Discounts class.
*/
protected function set_item_discount_amounts( $discounts ) {
if ( $item_discounts = $discounts->get_discounts_by_item() ) {
$item_discounts = $discounts->get_discounts_by_item();
if ( $item_discounts ) {
foreach ( $item_discounts as $item_id => $amount ) {
$item = $this->get_item( $item_id, false );
@ -1110,11 +1136,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Add a product line item to the order. This is the only line item type with
* it's own method because it saves looking up order amounts (costs are added up for you).
*
* @param \WC_Product $product
* @param int $qty
* @param array $args
* @return int order item ID
* @throws WC_Data_Exception
* @param WC_Product $product Product object.
* @param int $qty Quantity to add.
* @param array $args Args for the added product.
* @return int
* @throws WC_Data_Exception Exception thrown if the item cannot be added to the cart.
*/
public function add_product( $product, $qty = 1, $args = array() ) {
if ( $product ) {
@ -1130,13 +1156,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
);
} else {
$default_args = array(
'quantity' => $qty,
'quantity' => $qty,
);
}
$args = wp_parse_args( $args, $default_args );
// BW compatibility with old args
// BW compatibility with old args.
if ( isset( $args['totals'] ) ) {
foreach ( $args['totals'] as $key => $value ) {
if ( 'tax' === $key ) {
@ -1172,7 +1198,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Add a payment token to an order
*
* @since 2.6
* @param WC_Payment_Token $token Payment token object
* @param WC_Payment_Token $token Payment token object.
* @return boolean|int The new token ID or false if it failed.
*/
public function add_payment_token( $token ) {
@ -1247,8 +1273,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get tax location for this order.
*
* @since 3.2.0
* @param $args array Override the location.
* @since 3.2.0
* @param array $args array Override the location.
* @return array
*/
protected function get_tax_location( $args = array() ) {
@ -1259,13 +1285,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
$args = wp_parse_args( $args, array(
'country' => 'billing' === $tax_based_on ? $this->get_billing_country() : $this->get_shipping_country(),
'state' => 'billing' === $tax_based_on ? $this->get_billing_state() : $this->get_shipping_state(),
'country' => 'billing' === $tax_based_on ? $this->get_billing_country() : $this->get_shipping_country(),
'state' => 'billing' === $tax_based_on ? $this->get_billing_state() : $this->get_shipping_state(),
'postcode' => 'billing' === $tax_based_on ? $this->get_billing_postcode() : $this->get_shipping_postcode(),
'city' => 'billing' === $tax_based_on ? $this->get_billing_city() : $this->get_shipping_city(),
'city' => 'billing' === $tax_based_on ? $this->get_billing_city() : $this->get_shipping_city(),
) );
// Default to base
// Default to base.
if ( 'base' === $tax_based_on || empty( $args['country'] ) ) {
$default = wc_get_base_location();
$args['country'] = $default['country'];
@ -1294,8 +1320,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$shipping_tax_class = get_option( 'woocommerce_shipping_tax_class' );
if ( 'inherit' === $shipping_tax_class ) {
$found_classes = array_intersect( array_merge( array( '' ), WC_Tax :: get_tax_class_slugs() ), $this->get_items_tax_classes() );
$shipping_tax_class = count( $found_classes ) ? current( $found_classes ): false;
$found_classes = array_intersect( array_merge( array( '' ), WC_Tax::get_tax_class_slugs() ), $this->get_items_tax_classes() );
$shipping_tax_class = count( $found_classes ) ? current( $found_classes ) : false;
}
$is_vat_exempt = apply_filters( 'woocommerce_order_is_vat_exempt', 'yes' === $this->get_meta( 'is_vat_exempt' ) );
@ -1345,7 +1371,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
foreach ( $existing_taxes as $tax ) {
// Remove taxes which no longer exist for cart/shipping.
if ( ( ! array_key_exists( $tax->get_rate_id(), $cart_taxes ) && ! array_key_exists( $tax->get_rate_id(), $shipping_taxes ) ) || in_array( $tax->get_rate_id(), $saved_rate_ids ) ) {
if ( ( ! array_key_exists( $tax->get_rate_id(), $cart_taxes ) && ! array_key_exists( $tax->get_rate_id(), $shipping_taxes ) ) || in_array( $tax->get_rate_id(), $saved_rate_ids, true ) ) {
$this->remove_item( $tax->get_id() );
continue;
}
@ -1387,12 +1413,12 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
public function calculate_totals( $and_taxes = true ) {
do_action( 'woocommerce_order_before_calculate_totals', $and_taxes, $this );
$cart_subtotal = 0;
$cart_total = 0;
$fee_total = 0;
$shipping_total = 0;
$cart_subtotal_tax = 0;
$cart_total_tax = 0;
$cart_subtotal = 0;
$cart_total = 0;
$fee_total = 0;
$shipping_total = 0;
$cart_subtotal_tax = 0;
$cart_total_tax = 0;
// Sum line item costs.
foreach ( $this->get_items() as $item ) {
@ -1423,7 +1449,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();
}
@ -1448,9 +1474,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get item subtotal - this is the cost before discount.
*
* @param object $item
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @param object $item Item to get total from.
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @return float
*/
public function get_item_subtotal( $item, $inc_tax = false, $round = true ) {
@ -1472,9 +1498,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get line subtotal - this is the cost before discount.
*
* @param object $item
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @param object $item Item to get total from.
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @return float
*/
public function get_line_subtotal( $item, $inc_tax = false, $round = true ) {
@ -1496,9 +1522,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Calculate item cost - useful for gateways.
*
* @param object $item
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @param object $item Item to get total from.
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @return float
*/
public function get_item_total( $item, $inc_tax = false, $round = true ) {
@ -1520,9 +1546,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Calculate line total - useful for gateways.
*
* @param object $item
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @param object $item Item to get total from.
* @param bool $inc_tax (default: false).
* @param bool $round (default: true).
* @return float
*/
public function get_line_total( $item, $inc_tax = false, $round = true ) {
@ -1542,8 +1568,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get item tax - useful for gateways.
*
* @param mixed $item
* @param bool $round (default: true).
* @param mixed $item Item to get total from.
* @param bool $round (default: true).
* @return float
*/
public function get_item_tax( $item, $round = true ) {
@ -1560,7 +1586,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get line tax - useful for gateways.
*
* @param mixed $item
* @param mixed $item Item to get total from.
* @return float
*/
public function get_line_tax( $item ) {
@ -1570,17 +1596,20 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets line subtotal - formatted for display.
*
* @param array $item
* @param string $tax_display
* @param array $item Item to get total from.
* @param string $tax_display Incl or excl tax display mode.
* @return string
*/
public function get_formatted_line_subtotal( $item, $tax_display = '' ) {
$tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' );
if ( 'excl' == $tax_display ) {
if ( 'excl' === $tax_display ) {
$ex_tax_label = $this->get_prices_include_tax() ? 1 : 0;
$subtotal = wc_price( $this->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $this->get_currency() ) );
$subtotal = wc_price( $this->get_line_subtotal( $item ), array(
'ex_tax_label' => $ex_tax_label,
'currency' => $this->get_currency(),
) );
} else {
$subtotal = wc_price( $this->get_line_subtotal( $item, true ), array( 'currency' => $this->get_currency() ) );
}
@ -1590,6 +1619,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets order total - formatted for display.
*
* @return string
*/
public function get_formatted_order_total() {
@ -1600,7 +1630,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets subtotal - subtotal is shown before discounts, but with localised taxes.
*
* @param bool $compound (default: false).
* @param bool $compound (default: false).
* @param string $tax_display (default: the tax_display_cart value).
* @return string
*/
@ -1653,21 +1683,20 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Gets shipping (formatted).
*
* @param string $tax_display
*
* @param string $tax_display Excl or incl tax display mode.
* @return string
*/
public function get_shipping_to_display( $tax_display = '' ) {
$tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' );
if ( $this->get_shipping_total() != 0 ) {
if ( $this->get_shipping_total() !== 0 ) {
if ( 'excl' === $tax_display ) {
// Show shipping excluding tax.
$shipping = wc_price( $this->get_shipping_total(), array( 'currency' => $this->get_currency() ) );
if ( $this->get_shipping_tax() != 0 && $this->get_prices_include_tax() ) {
if ( $this->get_shipping_tax() !== 0 && $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>', $this, $tax_display );
}
} else {
@ -1675,7 +1704,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
// Show shipping including tax.
$shipping = wc_price( $this->get_shipping_total() + $this->get_shipping_tax(), array( 'currency' => $this->get_currency() ) );
if ( $this->get_shipping_tax() != 0 && ! $this->get_prices_include_tax() ) {
if ( $this->get_shipping_tax() !== 0 && ! $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>', $this, $tax_display );
}
}
@ -1694,10 +1723,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get the discount amount (formatted).
*
* @since 2.3.0
*
* @param string $tax_display
*
* @param string $tax_display Excl or incl tax display mode.
* @return string
*/
public function get_discount_to_display( $tax_display = '' ) {
@ -1708,14 +1736,16 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for subtotal.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_subtotal_row( &$total_rows, $tax_display ) {
if ( $subtotal = $this->get_subtotal_to_display( false, $tax_display ) ) {
$subtotal = $this->get_subtotal_to_display( false, $tax_display );
if ( $subtotal ) {
$total_rows['cart_subtotal'] = array(
'label' => __( 'Subtotal:', 'woocommerce' ),
'value' => $subtotal,
'value' => $subtotal,
);
}
}
@ -1723,14 +1753,14 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for discounts.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_discount_row( &$total_rows, $tax_display ) {
if ( $this->get_total_discount() > 0 ) {
$total_rows['discount'] = array(
'label' => __( 'Discount:', 'woocommerce' ),
'value' => '-' . $this->get_discount_to_display( $tax_display ),
'value' => '-' . $this->get_discount_to_display( $tax_display ),
);
}
}
@ -1738,14 +1768,14 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for shipping.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_shipping_row( &$total_rows, $tax_display ) {
if ( $this->get_shipping_method() ) {
$total_rows['shipping'] = array(
'label' => __( 'Shipping:', 'woocommerce' ),
'value' => $this->get_shipping_to_display( $tax_display ),
'value' => $this->get_shipping_to_display( $tax_display ),
);
}
}
@ -1753,11 +1783,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for fees.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_fee_rows( &$total_rows, $tax_display ) {
if ( $fees = $this->get_fees() ) {
$fees = $this->get_fees();
if ( $fees ) {
foreach ( $fees as $id => $fee ) {
if ( apply_filters( 'woocommerce_get_order_item_totals_excl_free_fees', empty( $fee['line_total'] ) && empty( $fee['line_tax'] ), $id ) ) {
continue;
@ -1773,8 +1805,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for taxes.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_tax_rows( &$total_rows, $tax_display ) {
// Tax for tax exclusive prices.
@ -1783,13 +1815,13 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
foreach ( $this->get_tax_totals() as $code => $tax ) {
$total_rows[ sanitize_title( $code ) ] = array(
'label' => $tax->label . ':',
'value' => $tax->formatted_amount,
'value' => $tax->formatted_amount,
);
}
} else {
$total_rows['tax'] = array(
'label' => WC()->countries->tax_or_vat() . ':',
'value' => wc_price( $this->get_total_tax(), array( 'currency' => $this->get_currency() ) ),
'value' => wc_price( $this->get_total_tax(), array( 'currency' => $this->get_currency() ) ),
);
}
}
@ -1798,20 +1830,20 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Add total row for grand total.
*
* @param array $total_rows
* @param string $tax_display
* @param array $total_rows Reference to total rows array.
* @param string $tax_display Excl or incl tax display mode.
*/
protected function add_order_item_totals_total_row( &$total_rows, $tax_display ) {
$total_rows['order_total'] = array(
'label' => __( 'Total:', 'woocommerce' ),
'value' => $this->get_formatted_order_total( $tax_display ),
'value' => $this->get_formatted_order_total( $tax_display ),
);
}
/**
* Get totals for display on pages and in emails.
*
* @param mixed $tax_display
* @param mixed $tax_display Excl or incl tax display mode.
* @return array
*/
public function get_order_item_totals( $tax_display = '' ) {
@ -1840,18 +1872,17 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Checks the order status against a passed in status.
*
* @param array|string $status
*
* @param array|string $status Status to check.
* @return bool
*/
public function has_status( $status ) {
return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status ) ) || $this->get_status() === $status ? true : false, $this, $status );
return apply_filters( 'woocommerce_order_has_status', ( is_array( $status ) && in_array( $this->get_status(), $status, true ) ) || $this->get_status() === $status ? true : false, $this, $status );
}
/**
* Check whether this order has a specific shipping method or not.
*
* @param string $method_id
* @param string $method_id Method ID to check.
* @return bool
*/
public function has_shipping_method( $method_id ) {
@ -1865,6 +1896,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Returns true if the order contains a free product.
*
* @since 2.5.0
* @return bool
*/

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

@ -1,60 +1,64 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
<?php // @codingStandardsIgnoreLine.
/**
* Abstract Settings API Class
*
* Admin Settings API used by Integrations, Shipping Methods, and Payment Gateways.
*
* @class WC_Settings_API
* @version 2.6.0
* @package WooCommerce/Abstracts
* @category Abstract Class
* @author WooThemes
*/
defined( 'ABSPATH' ) || exit;
/**
* WC_Settings_API class.
*/
abstract class WC_Settings_API {
/**
* The plugin ID. Used for option names.
*
* @var string
*/
public $plugin_id = 'woocommerce_';
/**
* ID of the class extending the settings API. Used in option names.
*
* @var string
*/
public $id = '';
/**
* Validation errors.
*
* @var array of strings
*/
public $errors = array();
/**
* Setting values.
*
* @var array
*/
public $settings = array();
/**
* Form option fields.
*
* @var array
*/
public $form_fields = array();
/**
* The posted settings data. When empty, $_POST data will be used.
*
* @var array
*/
protected $data = array();
/**
* Get the form fields after they are initialized.
*
* @return array of options
*/
public function get_form_fields() {
@ -64,8 +68,7 @@ abstract class WC_Settings_API {
/**
* Set default required properties for each field.
*
* @param array $field
*
* @param array $field Setting field array.
* @return array
*/
protected function set_defaults( $field ) {
@ -79,14 +82,13 @@ abstract class WC_Settings_API {
* Output the admin options table.
*/
public function admin_options() {
echo '<table class="form-table">' . $this->generate_settings_html( $this->get_form_fields(), false ) . '</table>';
echo '<table class="form-table">' . $this->generate_settings_html( $this->get_form_fields(), false ) . '</table>'; // WPCS: XSS ok.
}
/**
* Initialise settings form fields.
*
* Add an array of fields to be displayed
* on the gateway's settings screen.
* Add an array of fields to be displayed on the gateway's settings screen.
*
* @since 1.0.0
*/
@ -94,6 +96,7 @@ abstract class WC_Settings_API {
/**
* Return the name of the option in the WP DB.
*
* @since 2.6.0
* @return string
*/
@ -103,7 +106,8 @@ abstract class WC_Settings_API {
/**
* Get a fields type. Defaults to "text" if not set.
* @param array $field
*
* @param array $field Field key.
* @return string
*/
public function get_field_type( $field ) {
@ -112,7 +116,8 @@ abstract class WC_Settings_API {
/**
* Get a fields default value. Defaults to "" if not set.
* @param array $field
*
* @param array $field Field key.
* @return string
*/
public function get_field_default( $field ) {
@ -121,35 +126,40 @@ abstract class WC_Settings_API {
/**
* Get a field's posted and validated value.
* @param string $key
* @param array $field
* @param array $post_data
*
* @param string $key Field key.
* @param array $field Field array.
* @param array $post_data Posted data.
* @return string
*/
public function get_field_value( $key, $field, $post_data = array() ) {
$type = $this->get_field_type( $field );
$field_key = $this->get_field_key( $key );
$post_data = empty( $post_data ) ? $_POST : $post_data;
$post_data = empty( $post_data ) ? $_POST : $post_data; // WPCS: CSRF ok, input var ok.
$value = isset( $post_data[ $field_key ] ) ? $post_data[ $field_key ] : null;
// Look for a validate_FIELDID_field method for special handling
if ( isset( $field['sanitize_callback'] ) && is_callable( $field['sanitize_callback'] ) ) {
return call_user_func( $field['sanitize_callback'], $value );
}
// Look for a validate_FIELDID_field method for special handling.
if ( is_callable( array( $this, 'validate_' . $key . '_field' ) ) ) {
return $this->{'validate_' . $key . '_field'}( $key, $value );
}
// Look for a validate_FIELDTYPE_field method
// Look for a validate_FIELDTYPE_field method.
if ( is_callable( array( $this, 'validate_' . $type . '_field' ) ) ) {
return $this->{'validate_' . $type . '_field'}( $key, $value );
}
// Fallback to text
// Fallback to text.
return $this->validate_text_field( $key, $value );
}
/**
* Sets the POSTed data. This method can be used to set specific data, instead
* of taking it from the $_POST array.
* @param array data
* Sets the POSTed data. This method can be used to set specific data, instead of taking it from the $_POST array.
*
* @param array $data Posted data.
*/
public function set_post_data( $data = array() ) {
$this->data = $data;
@ -157,18 +167,20 @@ abstract class WC_Settings_API {
/**
* Returns the POSTed data, to be used to save the settings.
*
* @return array
*/
public function get_post_data() {
if ( ! empty( $this->data ) && is_array( $this->data ) ) {
return $this->data;
}
return $_POST;
return $_POST; // WPCS: CSRF ok, input var ok.
}
/**
* Processes and saves options.
* If there is an error thrown, will continue to save and validate fields, but will leave the erroring field out.
*
* @return bool was anything saved?
*/
public function process_admin_options() {
@ -191,7 +203,8 @@ abstract class WC_Settings_API {
/**
* Add an error message for display in admin on save.
* @param string $error
*
* @param string $error Error message.
*/
public function add_error( $error ) {
$this->errors[] = $error;
@ -238,12 +251,12 @@ abstract class WC_Settings_API {
}
/**
* get_option function.
* Get option from DB.
*
* Gets an option from the settings API, using defaults if necessary to prevent undefined notices.
*
* @param string $key
* @param mixed $empty_value
* @param string $key Option key.
* @param mixed $empty_value Value when empty.
* @return string The value specified for the option or a default value for the option.
*/
public function get_option( $key, $empty_value = null ) {
@ -267,7 +280,7 @@ abstract class WC_Settings_API {
/**
* Prefix key for settings.
*
* @param mixed $key
* @param string $key Field key.
* @return string
*/
public function get_field_key( $key ) {
@ -279,9 +292,8 @@ abstract class WC_Settings_API {
*
* Generate the HTML for the fields on the "settings" screen.
*
* @param array $form_fields (default: array())
* @param bool $echo
*
* @param array $form_fields (default: array()) Array of form fields.
* @param bool $echo Echo or return.
* @return string the html for the settings
* @since 1.0.0
* @uses method_exists()
@ -303,7 +315,7 @@ abstract class WC_Settings_API {
}
if ( $echo ) {
echo $html;
echo $html; // WPCS: XSS ok.
} else {
return $html;
}
@ -312,7 +324,7 @@ abstract class WC_Settings_API {
/**
* Get HTML for tooltips.
*
* @param array $data
* @param array $data Data for the tooltip.
* @return string
*/
public function get_tooltip_html( $data ) {
@ -330,7 +342,7 @@ abstract class WC_Settings_API {
/**
* Get HTML for descriptions.
*
* @param array $data
* @param array $data Data for the description.
* @return string
*/
public function get_description_html( $data ) {
@ -350,7 +362,7 @@ abstract class WC_Settings_API {
/**
* Get custom attributes.
*
* @param array $data
* @param array $data Field data.
* @return string
*/
public function get_custom_attribute_html( $data ) {
@ -368,8 +380,8 @@ abstract class WC_Settings_API {
/**
* Generate Text Input HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -393,14 +405,14 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<input class="input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
<?php echo $this->get_description_html( $data ); ?>
<input class="input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?> />
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -412,8 +424,8 @@ abstract class WC_Settings_API {
/**
* Generate Price Input HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -437,14 +449,14 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<input class="wc_input_price input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
<?php echo $this->get_description_html( $data ); ?>
<input class="wc_input_price input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?> />
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -456,8 +468,8 @@ abstract class WC_Settings_API {
/**
* Generate Decimal Input HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -481,14 +493,14 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<input class="wc_input_decimal input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_decimal( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
<?php echo $this->get_description_html( $data ); ?>
<input class="wc_input_decimal input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_decimal( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?> />
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -500,8 +512,8 @@ abstract class WC_Settings_API {
/**
* Generate Password Input HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -513,8 +525,8 @@ abstract class WC_Settings_API {
/**
* Generate Color Picker Input HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -537,16 +549,16 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<span class="colorpickpreview" style="background:<?php echo esc_attr( $this->get_option( $key ) ); ?>;"></span>
<input class="colorpick <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
<input class="colorpick <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?> />
<div id="colorPickerDiv_<?php echo esc_attr( $field_key ); ?>" class="colorpickdiv" style="z-index: 100; background: #eee; border: 1px solid #ccc; position: absolute; display: none;"></div>
<?php echo $this->get_description_html( $data ); ?>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -558,8 +570,8 @@ abstract class WC_Settings_API {
/**
* Generate Textarea HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -583,14 +595,14 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<textarea rows="3" cols="20" class="input-text wide-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?>><?php echo esc_textarea( $this->get_option( $key ) ); ?></textarea>
<?php echo $this->get_description_html( $data ); ?>
<textarea rows="3" cols="20" class="input-text wide-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>><?php echo esc_textarea( $this->get_option( $key ) ); ?></textarea>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -602,8 +614,8 @@ abstract class WC_Settings_API {
/**
* Generate Checkbox HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -631,15 +643,15 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<label for="<?php echo esc_attr( $field_key ); ?>">
<input <?php disabled( $data['disabled'], true ); ?> class="<?php echo esc_attr( $data['class'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="1" <?php checked( $this->get_option( $key ), 'yes' ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> /> <?php echo wp_kses_post( $data['label'] ); ?></label><br/>
<?php echo $this->get_description_html( $data ); ?>
<input <?php disabled( $data['disabled'], true ); ?> class="<?php echo esc_attr( $data['class'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="1" <?php checked( $this->get_option( $key ), 'yes' ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?> /> <?php echo wp_kses_post( $data['label'] ); ?></label><br/>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -651,8 +663,8 @@ abstract class WC_Settings_API {
/**
* Generate Select HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -677,18 +689,18 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<select class="select <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?>>
<select class="select <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>>
<?php foreach ( (array) $data['options'] as $option_key => $option_value ) : ?>
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( $option_key, esc_attr( $this->get_option( $key ) ) ); ?>><?php echo esc_attr( $option_value ); ?></option>
<?php endforeach; ?>
</select>
<?php echo $this->get_description_html( $data ); ?>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
</fieldset>
</td>
</tr>
@ -700,8 +712,8 @@ abstract class WC_Settings_API {
/**
* Generate Multiselect HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -728,28 +740,28 @@ abstract class WC_Settings_API {
?>
<tr valign="top">
<th scope="row" class="titledesc">
<?php echo $this->get_tooltip_html( $data ); ?>
<?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?>
<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
</th>
<td class="forminp">
<fieldset>
<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
<select multiple="multiple" class="multiselect <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>[]" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?>>
<select multiple="multiple" class="multiselect <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>[]" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>>
<?php foreach ( (array) $data['options'] as $option_key => $option_value ) : ?>
<?php if ( is_array( $option_value ) ) : ?>
<optgroup label="<?php echo esc_attr( $option_key ); ?>">
<?php foreach ( $option_value as $option_key_inner => $option_value_inner ) : ?>
<option value="<?php echo esc_attr( $option_key_inner ); ?>" <?php selected( in_array( $option_key_inner, $value ), true ); ?>><?php echo esc_attr( $option_value_inner ); ?></option>
<option value="<?php echo esc_attr( $option_key_inner ); ?>" <?php selected( in_array( $option_key_inner, $value, true ), true ); ?>><?php echo esc_attr( $option_value_inner ); ?></option>
<?php endforeach; ?>
</optgroup>
<?php else : ?>
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $value ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
<option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( in_array( $option_key, $value, true ), true ); ?>><?php echo esc_attr( $option_value ); ?></option>
<?php endif; ?>
<?php endforeach; ?>
</select>
<?php echo $this->get_description_html( $data ); ?>
<?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
<?php if ( $data['select_buttons'] ) : ?>
<br/><a class="select_all button" href="#"><?php _e( 'Select all', 'woocommerce' ); ?></a> <a class="select_none button" href="#"><?php _e( 'Select none', 'woocommerce' ); ?></a>
<br/><a class="select_all button" href="#"><?php esc_html_e( 'Select all', 'woocommerce' ); ?></a> <a class="select_none button" href="#"><?php esc_html_e( 'Select none', 'woocommerce' ); ?></a>
<?php endif; ?>
</fieldset>
</td>
@ -762,8 +774,8 @@ abstract class WC_Settings_API {
/**
* Generate Title HTML.
*
* @param mixed $key
* @param mixed $data
* @param string $key Field key.
* @param array $data Field data.
* @since 1.0.0
* @return string
*/
@ -794,8 +806,8 @@ abstract class WC_Settings_API {
*
* Make sure the data is escaped correctly, etc.
*
* @param string $key Field key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_text_field( $key, $value ) {
@ -808,8 +820,8 @@ abstract class WC_Settings_API {
*
* Make sure the data is escaped correctly, etc.
*
* @param string $key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_price_field( $key, $value ) {
@ -822,8 +834,8 @@ abstract class WC_Settings_API {
*
* Make sure the data is escaped correctly, etc.
*
* @param string $key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_decimal_field( $key, $value ) {
@ -834,8 +846,8 @@ abstract class WC_Settings_API {
/**
* Validate Password Field. No input sanitization is used to avoid corrupting passwords.
*
* @param string $key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_password_field( $key, $value ) {
@ -846,8 +858,8 @@ abstract class WC_Settings_API {
/**
* Validate Textarea Field.
*
* @param string $key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_textarea_field( $key, $value ) {
@ -855,7 +867,12 @@ abstract class WC_Settings_API {
return wp_kses( trim( stripslashes( $value ) ),
array_merge(
array(
'iframe' => array( 'src' => true, 'style' => true, 'id' => true, 'class' => true ),
'iframe' => array(
'src' => true,
'style' => true,
'id' => true,
'class' => true,
),
),
wp_kses_allowed_html( 'post' )
)
@ -867,8 +884,8 @@ abstract class WC_Settings_API {
*
* If not set, return "no", otherwise return "yes".
*
* @param string $key
* @param string|null $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_checkbox_field( $key, $value ) {
@ -878,8 +895,8 @@ abstract class WC_Settings_API {
/**
* Validate Select Field.
*
* @param string $key
* @param string $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string
*/
public function validate_select_field( $key, $value ) {
@ -890,8 +907,8 @@ abstract class WC_Settings_API {
/**
* Validate Multiselect Field.
*
* @param string $key
* @param string $value Posted Value
* @param string $key Field key.
* @param string $value Posted Value.
* @return string|array
*/
public function validate_multiselect_field( $key, $value ) {
@ -900,9 +917,9 @@ abstract class WC_Settings_API {
/**
* Validate the data on the "Settings" form.
* @deprecated 2.6.0 No longer used
*
* @param array $form_fields
* @deprecated 2.6.0 No longer used.
* @param array $form_fields Array of fields.
*/
public function validate_settings_fields( $form_fields = array() ) {
wc_deprecated_function( 'validate_settings_fields', '2.6' );
@ -910,8 +927,9 @@ abstract class WC_Settings_API {
/**
* Format settings if needed.
* @deprecated 2.6.0 Unused
* @param array $value
*
* @deprecated 2.6.0 Unused.
* @param array $value Value to format.
* @return array
*/
public function format_settings( $value ) {

View File

@ -0,0 +1,212 @@
<?php
/**
* Abstract WP_Background_Process class.
*
* Uses https://github.com/A5hleyRich/wp-background-processing to handle DB
* updates in the background.
*
* @package WooCommerce/Classes
*/
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'WP_Async_Request', false ) ) {
include_once dirname( WC_PLUGIN_FILE ) . '/includes/libraries/wp-async-request.php';
}
if ( ! class_exists( 'WP_Background_Process', false ) ) {
include_once dirname( WC_PLUGIN_FILE ) . '/includes/libraries/wp-background-process.php';
}
/**
* WC_Background_Process class.
*/
abstract class WC_Background_Process extends WP_Background_Process {
/**
* Is queue empty.
*
* @return bool
*/
protected function is_queue_empty() {
global $wpdb;
$table = $wpdb->options;
$column = 'option_name';
if ( is_multisite() ) {
$table = $wpdb->sitemeta;
$column = 'meta_key';
}
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$table} WHERE {$column} LIKE %s", $key ) ); // @codingStandardsIgnoreLine.
return ( $count > 0 ) ? false : true;
}
/**
* Get batch.
*
* @return stdClass Return the first batch from the queue.
*/
protected function get_batch() {
global $wpdb;
$table = $wpdb->options;
$column = 'option_name';
$key_column = 'option_id';
$value_column = 'option_value';
if ( is_multisite() ) {
$table = $wpdb->sitemeta;
$column = 'meta_key';
$key_column = 'meta_id';
$value_column = 'meta_value';
}
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
$query = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$table} WHERE {$column} LIKE %s ORDER BY {$key_column} ASC LIMIT 1", $key ) ); // @codingStandardsIgnoreLine.
$batch = new stdClass();
$batch->key = $query->$column;
$batch->data = maybe_unserialize( $query->$value_column );
return $batch;
}
/**
* See if the batch limit has been exceeded.
*
* @return bool
*/
protected function batch_limit_exceeded() {
return $this->time_exceeded() || $this->memory_exceeded();
}
/**
* Handle.
*
* Pass each queue item to the task handler, while remaining
* within server memory and time limit constraints.
*/
protected function handle() {
$this->lock_process();
do {
$batch = $this->get_batch();
foreach ( $batch->data as $key => $value ) {
$task = $this->task( $value );
if ( false !== $task ) {
$batch->data[ $key ] = $task;
} else {
unset( $batch->data[ $key ] );
}
if ( $this->batch_limit_exceeded() ) {
// Batch limits reached.
break;
}
}
// Update or delete current batch.
if ( ! empty( $batch->data ) ) {
$this->update( $batch->key, $batch->data );
} else {
$this->delete( $batch->key );
}
} while ( ! $this->batch_limit_exceeded() && ! $this->is_queue_empty() );
$this->unlock_process();
// Start next batch or complete process.
if ( ! $this->is_queue_empty() ) {
$this->dispatch();
} else {
$this->complete();
}
}
/**
* Get memory limit.
*
* @return int
*/
protected function get_memory_limit() {
if ( function_exists( 'ini_get' ) ) {
$memory_limit = ini_get( 'memory_limit' );
} else {
// Sensible default.
$memory_limit = '128M';
}
if ( ! $memory_limit || -1 === intval( $memory_limit ) ) {
// Unlimited, set to 32GB.
$memory_limit = '32000M';
}
return intval( $memory_limit ) * 1024 * 1024;
}
/**
* Schedule cron healthcheck.
*
* @param array $schedules Schedules.
* @return array
*/
public function schedule_cron_healthcheck( $schedules ) {
$interval = apply_filters( $this->identifier . '_cron_interval', 5 );
if ( property_exists( $this, 'cron_interval' ) ) {
$interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval_identifier );
}
// Adds every 5 minutes to the existing schedules.
$schedules[ $this->identifier . '_cron_interval' ] = array(
'interval' => MINUTE_IN_SECONDS * $interval,
/* translators: %d: interval */
'display' => sprintf( __( 'Every %d minutes', 'woocommerce' ), $interval ),
);
return $schedules;
}
/**
* Delete all batches.
*
* @return WC_Background_Process
*/
public function delete_all_batches() {
global $wpdb;
$table = $wpdb->options;
$column = 'option_name';
if ( is_multisite() ) {
$table = $wpdb->sitemeta;
$column = 'meta_key';
}
$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';
$wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE {$column} LIKE %s", $key ) ); // @codingStandardsIgnoreLine.
return $this;
}
/**
* Kill process.
*
* Stop processing queue items, clear cronjob and delete all batches.
*/
public function kill_process() {
if ( ! $this->is_queue_empty() ) {
$this->delete_all_batches();
wp_clear_scheduled_hook( $this->cron_hook_identifier );
}
}
}

View File

@ -2,24 +2,23 @@
/**
* WooCommerce API Keys Table List
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 2.4.0
* @package WooCommerce\Admin
* @version 2.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
/**
* API Keys table list class.
*/
class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Initialize the webhook table list.
* Initialize the API key table list.
*/
public function __construct() {
parent::__construct( array(
@ -29,6 +28,13 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
) );
}
/**
* No items found text.
*/
public function no_items() {
esc_html_e( 'No keys found.', 'woocommerce' );
}
/**
* Get list columns.
*
@ -37,7 +43,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
public function get_columns() {
return array(
'cb' => '<input type="checkbox" />',
'description' => __( 'Description', 'woocommerce' ),
'title' => __( 'Description', 'woocommerce' ),
'truncated_key' => __( 'Consumer key ending in', 'woocommerce' ),
'user' => __( 'User', 'woocommerce' ),
'permissions' => __( 'Permissions', 'woocommerce' ),
@ -48,7 +54,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Column cb.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_cb( $key ) {
@ -56,15 +62,15 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
}
/**
* Return description column.
* Return title column.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_description( $key ) {
public function column_title( $key ) {
$url = admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&edit-key=' . $key['key_id'] );
$output = '<strong>';
$output = '<strong>';
$output .= '<a href="' . esc_url( $url ) . '" class="row-title">';
if ( empty( $key['description'] ) ) {
$output .= esc_html__( 'API key', 'woocommerce' );
@ -74,11 +80,14 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$output .= '</a>';
$output .= '</strong>';
// Get actions
// Get actions.
$actions = array(
/* translators: %s: API key ID. */
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $key['key_id'] ),
'edit' => '<a href="' . esc_url( $url ) . '">' . __( 'View/Edit', 'woocommerce' ) . '</a>',
'trash' => '<a class="submitdelete" aria-label="' . esc_attr__( 'Revoke API key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'revoke-key' => $key['key_id'] ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . __( 'Revoke', 'woocommerce' ) . '</a>',
'trash' => '<a class="submitdelete" aria-label="' . esc_attr__( 'Revoke API key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array(
'revoke-key' => $key['key_id'],
), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . esc_html__( 'Revoke', 'woocommerce' ) . '</a>',
);
$row_actions = array();
@ -95,7 +104,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Return truncated consumer key column.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_truncated_key( $key ) {
@ -105,7 +114,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Return user column.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_user( $key ) {
@ -125,7 +134,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Return permissions column.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_permissions( $key ) {
@ -146,7 +155,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
/**
* Return last access column.
*
* @param array $key
* @param array $key Key data.
* @return string
*/
public function column_last_access( $key ) {
@ -177,15 +186,9 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
public function prepare_items() {
global $wpdb;
$per_page = apply_filters( 'woocommerce_api_keys_settings_items_per_page', 10 );
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
// Column headers
$this->_column_headers = array( $columns, $hidden, $sortable );
$per_page = $this->get_items_per_page( 'woocommerce_keys_per_page' );
$current_page = $this->get_pagenum();
if ( 1 < $current_page ) {
$offset = $per_page * ( $current_page - 1 );
} else {
@ -194,21 +197,21 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$search = '';
if ( ! empty( $_REQUEST['s'] ) ) {
$search = "AND description LIKE '%" . esc_sql( $wpdb->esc_like( wc_clean( $_REQUEST['s'] ) ) ) . "%' ";
if ( ! empty( $_REQUEST['s'] ) ) { // WPCS: input var okay, CSRF ok.
$search = "AND description LIKE '%" . esc_sql( $wpdb->esc_like( wc_clean( wp_unslash( $_REQUEST['s'] ) ) ) ) . "%' "; // WPCS: input var okay, CSRF ok.
}
// Get the API keys
// Get the API keys.
$keys = $wpdb->get_results(
"SELECT key_id, user_id, description, permissions, truncated_key, last_access FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1 {$search}" .
$wpdb->prepare( "ORDER BY key_id DESC LIMIT %d OFFSET %d;", $per_page, $offset ), ARRAY_A
);
$wpdb->prepare( 'ORDER BY key_id DESC LIMIT %d OFFSET %d;', $per_page, $offset ), ARRAY_A
); // WPCS: unprepared SQL ok.
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1 {$search};" );
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1 {$search};" ); // WPCS: unprepared SQL ok.
$this->items = $keys;
// Set the pagination
// Set the pagination.
$this->set_pagination_args( array(
'total_items' => $count,
'per_page' => $per_page,

View File

@ -2,15 +2,11 @@
/**
* WooCommerce Admin API Keys Class
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 2.4.0
* @package WooCommerce\Admin
* @version 2.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
/**
* WC_Admin_API_Keys.
@ -22,52 +18,64 @@ class WC_Admin_API_Keys {
*/
public function __construct() {
add_action( 'admin_init', array( $this, 'actions' ) );
add_action( 'woocommerce_settings_page_init', array( $this, 'screen_option' ) );
}
/**
* Check if is API Keys settings page.
*
* @return bool
*/
private function is_api_keys_settings_page() {
return isset( $_GET['page'] )
&& 'wc-settings' === $_GET['page']
&& isset( $_GET['tab'] )
&& 'api' === $_GET['tab']
&& isset( $_GET['section'] )
&& 'keys' === $_GET['section'];
return isset( $_GET['page'], $_GET['tab'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'api' === $_GET['tab'] && 'keys' === $_GET['section']; // WPCS: input var okay, CSRF ok.
}
/**
* Page output.
*/
public static function page_output() {
// Hide the save button
// Hide the save button.
$GLOBALS['hide_save_button'] = true;
if ( isset( $_GET['create-key'] ) || isset( $_GET['edit-key'] ) ) {
$key_id = isset( $_GET['edit-key'] ) ? absint( $_GET['edit-key'] ) : 0;
$key_id = isset( $_GET['edit-key'] ) ? absint( $_GET['edit-key'] ) : 0; // WPCS: input var okay, CSRF ok.
$key_data = self::get_key_data( $key_id );
include( 'settings/views/html-keys-edit.php' );
include 'settings/views/html-keys-edit.php';
} else {
self::table_list_output();
}
}
/**
* Add screen option.
*/
public function screen_option() {
global $keys_table_list;
if ( ! isset( $_GET['create-key'] ) && ! isset( $_GET['edit-key'] ) && $this->is_api_keys_settings_page() ) { // WPCS: input var okay, CSRF ok.
$keys_table_list = new WC_Admin_API_Keys_Table_List();
// Add screen option.
add_screen_option( 'per_page', array(
'default' => 10,
'option' => 'woocommerce_keys_per_page',
) );
}
}
/**
* Table list output.
*/
private static function table_list_output() {
global $wpdb, $keys_table_list;
global $wpdb;
echo '<h2>' . esc_html__( 'Keys/Apps', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . esc_html__( 'Add key', 'woocommerce' ) . '</a></h2>';
echo '<h2>' . __( 'Keys/Apps', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ) . '" class="add-new-h2">' . __( 'Add key', 'woocommerce' ) . '</a></h2>';
// Get the API keys count
// Get the API keys count.
$count = $wpdb->get_var( "SELECT COUNT(key_id) FROM {$wpdb->prefix}woocommerce_api_keys WHERE 1 = 1;" );
if ( absint( $count ) && $count > 0 ) {
$keys_table_list = new WC_Admin_API_Keys_Table_List();
$keys_table_list->prepare_items();
echo '<input type="hidden" name="page" value="wc-settings" />';
@ -80,17 +88,17 @@ class WC_Admin_API_Keys {
} else {
echo '<div class="woocommerce-BlankState woocommerce-BlankState--api">';
?>
<h2 class="woocommerce-BlankState-message"><?php _e( 'The WooCommerce REST API allows external apps to view and manage store data. Access is granted only to those with valid API keys.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ); ?>"><?php _e( 'Create an API key', 'woocommerce' ); ?></a>
<?php echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; } </style></div>';
<h2 class="woocommerce-BlankState-message"><?php esc_html_e( 'The WooCommerce REST API allows external apps to view and manage store data. Access is granted only to those with valid API keys.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=keys&create-key=1' ) ); ?>"><?php esc_html_e( 'Create an API key', 'woocommerce' ); ?></a>
<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; }</style>
<?php
}
}
/**
* Get key data.
*
* @param int $key_id
* @param int $key_id API Key ID.
* @return array
*/
private static function get_key_data( $key_id ) {
@ -105,7 +113,7 @@ class WC_Admin_API_Keys {
'last_access' => '',
);
if ( 0 == $key_id ) {
if ( 0 === $key_id ) {
return $empty;
}
@ -127,13 +135,13 @@ class WC_Admin_API_Keys {
*/
public function actions() {
if ( $this->is_api_keys_settings_page() ) {
// Revoke key
if ( isset( $_GET['revoke-key'] ) ) {
// Revoke key.
if ( isset( $_GET['revoke-key'] ) ) { // WPCS: input var okay, CSRF ok.
$this->revoke_key();
}
// Bulk actions
if ( isset( $_GET['action'] ) && isset( $_GET['key'] ) ) {
// Bulk actions.
if ( isset( $_GET['action'] ) && isset( $_GET['key'] ) ) { // WPCS: input var okay, CSRF ok.
$this->bulk_actions();
}
}
@ -143,7 +151,7 @@ class WC_Admin_API_Keys {
* Notices.
*/
public static function notices() {
if ( isset( $_GET['revoked'] ) && 1 == $_GET['revoked'] ) {
if ( isset( $_GET['revoked'] ) && 1 === $_GET['revoked'] ) { // WPCS: input var okay, CSRF ok.
WC_Admin_Settings::add_message( __( 'API key revoked successfully.', 'woocommerce' ) );
}
}
@ -152,12 +160,15 @@ class WC_Admin_API_Keys {
* Revoke key.
*/
private function revoke_key() {
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'revoke' ) ) {
wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
}
check_admin_referer( 'revoke' );
$key_id = absint( $_GET['revoke-key'] );
$this->remove_key( $key_id );
if ( isset( $_GET['revoke-key'] ) ) { // WPCS: input var okay, CSRF ok.
$key_id = absint( $_GET['revoke-key'] ); // WPCS: input var okay, CSRF ok.
if ( $key_id ) {
$this->remove_key( $key_id );
}
}
wp_redirect( esc_url_raw( add_query_arg( array( 'revoked' => 1 ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ) ) );
exit();
@ -167,21 +178,26 @@ class WC_Admin_API_Keys {
* Bulk actions.
*/
private function bulk_actions() {
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) ) {
wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
check_admin_referer( 'woocommerce-settings' );
if ( ! current_user_can( 'manage_woocommerce' ) ) {
wp_die( esc_html__( 'You do not have permission to edit API Keys', 'woocommerce' ) );
}
$keys = array_map( 'absint', (array) $_GET['key'] );
if ( isset( $_GET['action'] ) ) { // WPCS: input var okay, CSRF ok.
$action = sanitize_text_field( wp_unslash( $_GET['action'] ) ); // WPCS: input var okay, CSRF ok.
$keys = isset( $_GET['key'] ) ? array_map( 'absint', (array) $_GET['key'] ) : array(); // WPCS: input var okay, CSRF ok.
if ( 'revoke' == $_GET['action'] ) {
$this->bulk_revoke_key( $keys );
if ( 'revoke' === $action ) {
$this->bulk_revoke_key( $keys );
}
}
}
/**
* Bulk revoke key.
*
* @param array $keys
* @param array $keys API Keys.
*/
private function bulk_revoke_key( $keys ) {
foreach ( $keys as $key_id ) {
@ -192,7 +208,7 @@ class WC_Admin_API_Keys {
/**
* Remove key.
*
* @param int $key_id
* @param int $key_id API Key ID.
* @return bool
*/
private function remove_key( $key_id ) {

View File

@ -111,7 +111,7 @@ class WC_Admin_Assets {
wp_register_script( 'wc-shipping-classes', WC()->plugin_url() . '/assets/js/admin/wc-shipping-classes' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone' ), WC_VERSION );
wp_register_script( 'wc-clipboard', WC()->plugin_url() . '/assets/js/admin/wc-clipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
wp_register_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.2' );
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.3' );
wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
wp_localize_script( 'wc-enhanced-select', 'wc_enhanced_select_params', array(
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),

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

@ -25,7 +25,12 @@ class WC_Admin_Dashboard {
public function __construct() {
// Only hook in admin parts if the user has admin access
if ( current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'publish_shop_orders' ) ) {
add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
// If on network admin, only load the widget that works in that context and skip the rest.
if ( is_multisite() && is_network_admin() ) {
add_action( 'wp_network_dashboard_setup', array( $this, 'register_network_order_widget' ) );
} else {
add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
}
}
}
@ -37,6 +42,18 @@ class WC_Admin_Dashboard {
wp_add_dashboard_widget( 'woocommerce_dashboard_recent_reviews', __( 'WooCommerce recent reviews', 'woocommerce' ), array( $this, 'recent_reviews' ) );
}
wp_add_dashboard_widget( 'woocommerce_dashboard_status', __( 'WooCommerce status', 'woocommerce' ), array( $this, 'status_widget' ) );
// Network Order Widget.
if ( is_multisite() ) {
$this->register_network_order_widget();
}
}
/**
* Register the network order dashboard widget.
*/
public function register_network_order_widget() {
wp_add_dashboard_widget( 'woocommerce_network_orders', __( 'WooCommerce network orders', 'woocommerce' ), array( $this, 'network_orders' ) );
}
/**
@ -286,6 +303,72 @@ class WC_Admin_Dashboard {
echo '<p>' . __( 'There are no product reviews yet.', 'woocommerce' ) . '</p>';
}
}
/**
* Network orders widget.
*/
public function network_orders() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style( 'wc-network-orders', WC()->plugin_url() . '/assets/css/network-order-widget.css', array(), WC_VERSION );
wp_enqueue_script( 'wc-network-orders', WC()->plugin_url() . '/assets/js/admin/network-orders' . $suffix . '.js', array( 'jquery', 'underscore' ), WC_VERSION, true );
$user = wp_get_current_user();
$blogs = get_blogs_of_user( $user->ID );
$blog_ids = wp_list_pluck( $blogs, 'userblog_id' );
wp_localize_script( 'wc-network-orders', 'woocommerce_network_orders', array(
'nonce' => wp_create_nonce( 'wp_rest' ),
'sites' => array_values( $blog_ids ),
'order_endpoint' => get_rest_url( null, 'wc/v2/orders/network' ),
) );
?>
<div class="post-type-shop_order">
<div id="woocommerce-network-order-table-loading" class="woocommerce-network-order-table-loading is-active">
<p>
<span class="spinner is-active"></span> <?php esc_html_e( 'Loading network orders', 'woocommerce' ); ?>
</p>
</div>
<table id="woocommerce-network-order-table" class="woocommerce-network-order-table">
<thead>
<tr>
<td><?php esc_html_e( 'Order', 'woocommerce' ); ?></td>
<td><?php esc_html_e( 'Status', 'woocommerce' ); ?></td>
<td><?php esc_html_e( 'Total', 'woocommerce' ); ?></td>
</tr>
</thead>
<tbody id="network-orders-tbody">
</tbody>
</table>
<div id="woocommerce-network-orders-no-orders" class="woocommerce-network-orders-no-orders">
<p>
<?php esc_html_e( 'No orders found', 'woocommerce' ); ?>
</p>
</div>
<script type="text/template" id="network-orders-row-template">
<tr>
<td>
<a href="<%- edit_url %>" class="order-view"><strong>#<%- id %> <%- customer %></strong></a>
<br>
<em>
<%- blog.blogname %>
</em>
</td>
<td>
<mark class="order-status status-<%- status %>"><span><%- status_name %></span></mark>
</td>
<td>
<%= formatted_total %>
</td>
</tr>
</script>
</div>
<?php
}
}
endif;

View File

@ -2,15 +2,11 @@
/**
* Setup menus in WP admin.
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin
* @version 2.5.0
* @package WooCommerce\Admin
* @version 2.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'WC_Admin_Menus', false ) ) {
return new WC_Admin_Menus();
@ -39,6 +35,7 @@ class WC_Admin_Menus {
add_action( 'admin_head', array( $this, 'menu_order_count' ) );
add_filter( 'menu_order', array( $this, 'menu_order' ) );
add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) );
add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 );
// Add endpoints custom URLs in Appearance > Menus > Pages.
add_action( 'admin_head-nav-menus.php', array( $this, 'add_nav_menu_meta_boxes' ) );
@ -69,9 +66,9 @@ class WC_Admin_Menus {
*/
public function reports_menu() {
if ( current_user_can( 'manage_woocommerce' ) ) {
add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ) , 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ) );
add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ), 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ) );
} else {
add_menu_page( __( 'Sales reports', 'woocommerce' ), __( 'Sales reports', 'woocommerce' ) , 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ), null, '55.6' );
add_menu_page( __( 'Sales reports', 'woocommerce' ), __( 'Sales reports', 'woocommerce' ), 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ), null, '55.6' );
}
}
@ -79,7 +76,7 @@ class WC_Admin_Menus {
* Add menu item.
*/
public function settings_menu() {
$settings_page = add_submenu_page( 'woocommerce', __( 'WooCommerce settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ) , 'manage_woocommerce', 'wc-settings', array( $this, 'settings_page' ) );
$settings_page = add_submenu_page( 'woocommerce', __( 'WooCommerce settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ), 'manage_woocommerce', 'wc-settings', array( $this, 'settings_page' ) );
add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) );
}
@ -113,13 +110,15 @@ class WC_Admin_Menus {
if ( ! empty( $_GET['wc_message'] ) ) { // WPCS: input var okay, CSRF ok.
WC_Admin_Settings::add_message( wp_kses_post( wp_unslash( $_GET['wc_message'] ) ) ); // WPCS: input var okay, CSRF ok.
}
do_action( 'woocommerce_settings_page_init' );
}
/**
* Add menu item.
*/
public function status_menu() {
add_submenu_page( 'woocommerce', __( 'WooCommerce status', 'woocommerce' ), __( 'Status', 'woocommerce' ) , 'manage_woocommerce', 'wc-status', array( $this, 'status_page' ) );
add_submenu_page( 'woocommerce', __( 'WooCommerce status', 'woocommerce' ), __( 'Status', 'woocommerce' ), 'manage_woocommerce', 'wc-status', array( $this, 'status_page' ) );
}
/**
@ -220,6 +219,21 @@ class WC_Admin_Menus {
return current_user_can( 'manage_woocommerce' );
}
/**
* Validate screen options on update.
*
* @param bool|int $status Screen option value. Default false to skip.
* @param string $option The option name.
* @param int $value The number of rows to use.
*/
public function set_screen_option( $status, $option, $value ) {
if ( in_array( $option, array( 'woocommerce_keys_per_page', 'woocommerce_webhooks_per_page' ), true ) ) {
return $value;
}
return $status;
}
/**
* Init the reports page.
*/
@ -310,6 +324,7 @@ class WC_Admin_Menus {
</span>
<span class="add-to-menu">
<button type="submit" class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to menu', 'woocommerce' ); ?>" name="add-post-type-menu-item" id="submit-posttype-woocommerce-endpoints"><?php esc_html_e( 'Add to menu', 'woocommerce' ); ?></button>
<span class="spinner"></span>
</span>
</p>
</div>

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

@ -101,6 +101,10 @@ class WC_Admin_Post_Types {
new WC_Admin_List_Table_Products();
break;
}
// Ensure the table handler is only loaded once. Prevents multiple loads if a plugin calls check_ajax_referer many times.
remove_action( 'current_screen', array( $this, 'setup_screen' ) );
remove_action( 'check_ajax_referer', array( $this, 'setup_screen' ) );
}
/**
@ -507,23 +511,25 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['change_regular_price'] ) && isset( $_REQUEST['_regular_price'] ) ) { // WPCS: input var ok, sanitization ok.
$change_regular_price = absint( $_REQUEST['change_regular_price'] ); // WPCS: input var ok, sanitization ok.
$regular_price = wc_format_decimal( wc_clean( wp_unslash( $_REQUEST['_regular_price'] ) ) ); // WPCS: input var ok, sanitization ok.
$raw_regular_price = wc_clean( wp_unslash( $_REQUEST['_regular_price'] ) ); // WPCS: input var ok, sanitization ok.
$is_percentage = (bool) strstr( $raw_regular_price, '%' );
$regular_price = wc_format_decimal( $raw_regular_price );
switch ( $change_regular_price ) {
case 1:
$new_price = $regular_price;
break;
case 2:
if ( strstr( $regular_price, '%' ) ) {
$percent = str_replace( '%', '', $regular_price ) / 100;
if ( $is_percentage ) {
$percent = $regular_price / 100;
$new_price = $old_regular_price + ( round( $old_regular_price * $percent, wc_get_price_decimals() ) );
} else {
$new_price = $old_regular_price + $regular_price;
}
break;
case 3:
if ( strstr( $regular_price, '%' ) ) {
$percent = str_replace( '%', '', $regular_price ) / 100;
if ( $is_percentage ) {
$percent = $regular_price / 100;
$new_price = max( 0, $old_regular_price - ( round( $old_regular_price * $percent, wc_get_price_decimals() ) ) );
} else {
$new_price = max( 0, $old_regular_price - $regular_price );
@ -543,31 +549,33 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['change_sale_price'] ) && isset( $_REQUEST['_sale_price'] ) ) { // WPCS: input var ok, sanitization ok.
$change_sale_price = absint( $_REQUEST['change_sale_price'] ); // WPCS: input var ok, sanitization ok.
$sale_price = wc_format_decimal( wc_clean( wp_unslash( $_REQUEST['_sale_price'] ) ) ); // WPCS: input var ok, sanitization ok.
$raw_sale_price = wc_clean( wp_unslash( $_REQUEST['_sale_price'] ) ); // WPCS: input var ok, sanitization ok.
$is_percentage = (bool) strstr( $raw_sale_price, '%' );
$sale_price = wc_format_decimal( $raw_sale_price );
switch ( $change_sale_price ) {
case 1:
$new_price = $sale_price;
break;
case 2:
if ( strstr( $sale_price, '%' ) ) {
$percent = str_replace( '%', '', $sale_price ) / 100;
if ( $is_percentage ) {
$percent = $sale_price / 100;
$new_price = $old_sale_price + ( $old_sale_price * $percent );
} else {
$new_price = $old_sale_price + $sale_price;
}
break;
case 3:
if ( strstr( $sale_price, '%' ) ) {
$percent = str_replace( '%', '', $sale_price ) / 100;
if ( $is_percentage ) {
$percent = $sale_price / 100;
$new_price = max( 0, $old_sale_price - ( $old_sale_price * $percent ) );
} else {
$new_price = max( 0, $old_sale_price - $sale_price );
}
break;
case 4:
if ( strstr( $sale_price, '%' ) ) {
$percent = str_replace( '%', '', $sale_price ) / 100;
if ( $is_percentage ) {
$percent = $sale_price / 100;
$new_price = max( 0, $product->regular_price - ( $product->regular_price * $percent ) );
} else {
$new_price = max( 0, $product->regular_price - $sale_price );

View File

@ -2,10 +2,8 @@
/**
* WooCommerce Admin Settings Class
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin
* @version 3.3.0
* @version 3.4.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -31,7 +29,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
*
* @var array
*/
private static $errors = array();
private static $errors = array();
/**
* Update messages.
@ -47,17 +45,17 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
if ( empty( self::$settings ) ) {
$settings = array();
include_once( dirname( __FILE__ ) . '/settings/class-wc-settings-page.php' );
include_once dirname( __FILE__ ) . '/settings/class-wc-settings-page.php';
$settings[] = include( 'settings/class-wc-settings-general.php' );
$settings[] = include( 'settings/class-wc-settings-products.php' );
$settings[] = include( 'settings/class-wc-settings-tax.php' );
$settings[] = include( 'settings/class-wc-settings-shipping.php' );
$settings[] = include( 'settings/class-wc-settings-checkout.php' );
$settings[] = include( 'settings/class-wc-settings-accounts.php' );
$settings[] = include( 'settings/class-wc-settings-emails.php' );
$settings[] = include( 'settings/class-wc-settings-integrations.php' );
$settings[] = include( 'settings/class-wc-settings-rest-api.php' );
$settings[] = include 'settings/class-wc-settings-general.php';
$settings[] = include 'settings/class-wc-settings-products.php';
$settings[] = include 'settings/class-wc-settings-tax.php';
$settings[] = include 'settings/class-wc-settings-shipping.php';
$settings[] = include 'settings/class-wc-settings-checkout.php';
$settings[] = include 'settings/class-wc-settings-accounts.php';
$settings[] = include 'settings/class-wc-settings-emails.php';
$settings[] = include 'settings/class-wc-settings-integrations.php';
$settings[] = include 'settings/class-wc-settings-rest-api.php';
self::$settings = apply_filters( 'woocommerce_get_settings_pages', $settings );
}
@ -82,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();
@ -136,14 +134,16 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'selectWoo' ), WC()->version, true );
wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ),
) );
wp_localize_script(
'woocommerce_settings', 'woocommerce_settings_params', array(
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ),
)
);
// Get tabs for the settings page.
$tabs = apply_filters( 'woocommerce_settings_tabs_array', array() );
include( dirname( __FILE__ ) . '/views/html-admin-settings.php' );
include dirname( __FILE__ ) . '/views/html-admin-settings.php';
}
/**
@ -270,9 +270,17 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
// Standard text inputs and subtypes like 'number'.
case 'text':
case 'email':
case 'number':
case 'password':
case 'datetime':
case 'datetime-local':
case 'date':
case 'month':
case 'time':
case 'week':
case 'number':
case 'email':
case 'url':
case 'tel':
$option_value = self::get_option( $value['id'], $value['default'] );
?><tr valign="top">
@ -378,9 +386,9 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
<?php
if ( is_array( $option_value ) ) {
selected( in_array( $key, $option_value, true ), true );
selected( in_array( (string) $key, $option_value, true ), true );
} else {
selected( $option_value, $key );
selected( $option_value, (string) $key );
}
?>
@ -511,7 +519,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
$disabled_message = '';
if ( has_filter( 'woocommerce_get_image_size_' . $image_size ) ) {
$disabled_attr = 'disabled="disabled"';
$disabled_attr = 'disabled="disabled"';
$disabled_message = '<p><small>' . esc_html__( 'The settings of this image size have been disabled because its values are being overwritten by a filter.', 'woocommerce' ) . '</small></p>';
}
@ -539,7 +547,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => absint( self::get_option( $value['id'] ) ),
'selected' => absint( self::get_option( $value['id'], $value['default'] ) ),
);
if ( isset( $value['args'] ) ) {
@ -558,7 +566,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
// Single country selects.
case 'single_select_country':
$country_setting = (string) self::get_option( $value['id'] );
$country_setting = (string) self::get_option( $value['id'], $value['default'] );
if ( strstr( $country_setting, ':' ) ) {
$country_setting = explode( ':', $country_setting );
@ -584,7 +592,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
// Country multiselects.
case 'multi_select_countries':
$selections = (array) self::get_option( $value['id'] );
$selections = (array) self::get_option( $value['id'], $value['default'] );
if ( ! empty( $value['options'] ) ) {
$countries = $value['options'];
@ -640,7 +648,7 @@ if ( ! class_exists( 'WC_Admin_Settings', false ) ) :
$description = $value['desc'];
$tooltip_html = $value['desc_tip'];
} elseif ( ! empty( $value['desc'] ) ) {
$description = $value['desc'];
$description = $value['desc'];
}
if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ), true ) ) {

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();
@ -1109,12 +1114,12 @@ class WC_Admin_Setup_Wizard {
$klarna_checkout_description = '<p>' . sprintf(
/* translators: %s: URL */
__( 'Full checkout experience with pay now, pay later and slice it. No credit card numbers, no passwords, no worries. <a href="%s" target="_blank">Learn more about Klarna</a>.', 'woocommerce' ),
'https://woocommerce.com/products/klarna/'
'https://woocommerce.com/products/klarna-checkout/'
) . '</p>';
$klarna_payments_description = '<p>' . sprintf(
/* translators: %s: URL */
__( 'Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries. <a href="%s" target="_blank">Learn more about Klarna</a>.', 'woocommerce' ),
'https://woocommerce.com/products/klarna/'
'https://woocommerce.com/products/klarna-payments/ '
) . '</p>';
$square_description = '<p>' . sprintf(
/* translators: %s: URL */
@ -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.
*/
@ -318,7 +346,46 @@ class WC_Admin_Taxonomies {
$new_columns['thumb'] = __( 'Image', 'woocommerce' );
return array_merge( $new_columns, $columns );
$columns = array_merge( $new_columns, $columns );
$columns['handle'] = '';
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 );
}
}
}
/**
@ -331,8 +398,13 @@ class WC_Admin_Taxonomies {
* @return string
*/
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 ( 'thumb' == $column ) {
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 );
@ -342,14 +414,13 @@ class WC_Admin_Taxonomies {
$image = wc_placeholder_img_src();
}
// Prevent esc_url from breaking spaces in urls for image embeds
// Ref: https://core.trac.wordpress.org/ticket/23605
$image = str_replace( ' ', '%20', $image );
// Prevent esc_url from breaking spaces in urls for image embeds. Ref: https://core.trac.wordpress.org/ticket/23605
$image = str_replace( ' ', '%20', $image );
$columns .= '<img src="' . esc_url( $image ) . '" alt="' . esc_attr__( 'Thumbnail', 'woocommerce' ) . '" class="wp-post-image" height="48" width="48" />';
}
if ( 'handle' === $column ) {
$columns .= '<input type="hidden" name="term_id" value="' . esc_attr( $id ) . '" />';
}
return $columns;
}

View File

@ -2,18 +2,14 @@
/**
* WooCommerce Webhooks Table List
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin
* @version 3.3.0
* @package WooCommerce\Admin
* @version 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
/**
@ -32,6 +28,13 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
) );
}
/**
* No items found text.
*/
public function no_items() {
esc_html_e( 'No webhooks found.', 'woocommerce' );
}
/**
* Get list columns.
*
@ -244,15 +247,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
* Prepare table list items.
*/
public function prepare_items() {
$per_page = absint( apply_filters( 'woocommerce_webhooks_settings_posts_per_page', 10 ) );
$per_page = 0 === $per_page ? 10 : $per_page;
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
// Column headers.
$this->_column_headers = array( $columns, $hidden, $sortable );
$per_page = $this->get_items_per_page( 'woocommerce_webhooks_per_page' );
$current_page = $this->get_pagenum();
// Query args.
@ -278,7 +273,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
// Get total items.
$args['limit'] = -1;
$args['offset'] = 0;
$total_items = count( $data_store->search_webhooks( $args ) );
$total_items = count( $data_store->search_webhooks( $args ) );
// Set the pagination.
$this->set_pagination_args( array(

View File

@ -2,15 +2,11 @@
/**
* WooCommerce Admin Webhooks Class
*
* @author Automattic
* @category Admin
* @package WooCommerce/Admin
* @version 3.3.0
* @package WooCommerce\Admin
* @version 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
defined( 'ABSPATH' ) || exit;
/**
* WC_Admin_Webhooks.
@ -21,8 +17,9 @@ class WC_Admin_Webhooks {
* Initialize the webhooks admin actions.
*/
public function __construct() {
add_action( 'woocommerce_save_settings_api_webhooks', array( $this, 'allow_save_settings' ) );
add_action( 'admin_init', array( $this, 'actions' ) );
add_action( 'woocommerce_settings_page_init', array( $this, 'screen_option' ) );
add_filter( 'woocommerce_save_settings_api_webhooks', array( $this, 'allow_save_settings' ) );
}
/**
@ -269,10 +266,29 @@ class WC_Admin_Webhooks {
}
}
/**
* Add screen option.
*/
public function screen_option() {
global $webhooks_table_list;
if ( ! isset( $_GET['edit-webhook'] ) && $this->is_webhook_settings_page() ) { // WPCS: input var okay, CSRF ok.
$webhooks_table_list = new WC_Admin_Webhooks_Table_List();
// Add screen option.
add_screen_option( 'per_page', array(
'default' => 10,
'option' => 'woocommerce_webhooks_per_page',
) );
}
}
/**
* Table list output.
*/
private static function table_list_output() {
global $webhooks_table_list;
echo '<h2>' . esc_html__( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=0' ) ) . '" class="add-new-h2">' . esc_html__( 'Add webhook', 'woocommerce' ) . '</a></h2>';
// Get the webhooks count.
@ -280,7 +296,6 @@ class WC_Admin_Webhooks {
$count = count( $data_store->get_webhooks_ids() );
if ( 0 < $count ) {
$webhooks_table_list = new WC_Admin_Webhooks_Table_List();
$webhooks_table_list->prepare_items();
echo '<input type="hidden" name="page" value="wc-settings" />';
@ -295,9 +310,8 @@ class WC_Admin_Webhooks {
?>
<h2 class="woocommerce-BlankState-message"><?php esc_html_e( 'Webhooks are event notifications sent to URLs of your choice. They can be used to integrate with third-party services which support them.', 'woocommerce' ); ?></h2>
<a class="woocommerce-BlankState-cta button-primary button" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=0' ) ); ?>"><?php esc_html_e( 'Create a new webhook', 'woocommerce' ); ?></a>
<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; }</style>
<?php
echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions { display: none; } </style></div>';
}
}

View File

@ -96,6 +96,7 @@ class WC_Admin {
switch ( $screen->id ) {
case 'dashboard' :
case 'dashboard-network' :
include( 'class-wc-admin-dashboard.php' );
break;
case 'options-permalink' :

View File

@ -286,7 +286,8 @@ class WC_Helper {
$data['_actions'][] = $action;
} else {
$action = array(
'message' => sprintf( __( 'To receive updates and support for this extension, you need to <strong>purchase</strong> a new subscription or consolidate your extensions to one connected account by <strong><a href="%s" title="Sharing Docs">sharing</a> or <a href="%s" title="Transferring Docs">transferring</a></strong> this extension to this connected account.', 'woocommerce' ), 'https://docs.woocommerce.com/document/managing-woocommerce-com-subscriptions/#section-10', 'https://docs.woocommerce.com/document/managing-woocommerce-com-subscriptions/#section-5' ),
/* translators: 1: subscriptions docs 2: subscriptions docs */
'message' => sprintf( __( 'To receive updates and support for this extension, you need to <strong>purchase</strong> a new subscription or consolidate your extensions to one connected account by <strong><a href="%1$s" title="Sharing Docs">sharing</a> or <a href="%2$s" title="Transferring Docs">transferring</a></strong> this extension to this connected account.', 'woocommerce' ), 'https://docs.woocommerce.com/document/managing-woocommerce-com-subscriptions/#section-10', 'https://docs.woocommerce.com/document/managing-woocommerce-com-subscriptions/#section-5' ),
'button_label' => __( 'Purchase', 'woocommerce' ),
'button_url' => $data['_product_url'],
'status' => 'expired',

View File

@ -1,21 +1,30 @@
<?php defined( 'ABSPATH' ) or exit(); ?>
<?php
/**
* Admin -> WooCommerce -> Extensions -> WooCommerce.com Subscriptions main page.
*
* @package WooCommerce\Views
*/
defined( 'ABSPATH' ) || exit();
?>
<div class="wrap woocommerce wc_addons_wrap wc-helper">
<?php include( WC_Helper::get_view_filename( 'html-section-nav.php' ) ); ?>
<h1 class="screen-reader-text"><?php _e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
<?php include( WC_Helper::get_view_filename( 'html-section-notices.php' ) ); ?>
<?php require WC_Helper::get_view_filename( 'html-section-nav.php' ); ?>
<h1 class="screen-reader-text"><?php esc_html_e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
<?php require WC_Helper::get_view_filename( 'html-section-notices.php' ); ?>
<div class="start-container">
<div class="text">
<img src="https://woocommerce.com/wp-content/themes/woo/images/logo-woocommerce@2x.png" alt="WooCommerce" style="width:180px;">
<img src="<?php echo esc_url( WC()->plugin_url() . '/assets/images/woocommerce_logo.png' ); ?>" alt="WooCommerce" style="width:180px;">
<?php if ( ! empty( $_GET['wc-helper-status'] ) && 'helper-disconnected' === $_GET['wc-helper-status'] ) : ?>
<p><?php _e( '<strong>Sorry to see you go</strong>. Feel free to reconnect again using the button below.', 'woocommerce' ); ?></p>
<p><?php esc_html_e( '<strong>Sorry to see you go</strong>. Feel free to reconnect again using the button below.', 'woocommerce' ); ?></p>
<?php endif; ?>
<h2><?php _e( 'Manage your subscriptions, get important product notifications, and updates, all from the convenience of your WooCommerce dashboard', 'woocommerce' ); ?></h2>
<p><?php _e( 'Once connected, your WooCommerce.com purchases will be listed here.', 'woocommerce' ); ?></p>
<p><a class="button button-primary" href="<?php echo esc_url( $connect_url ); ?>"><?php _e( 'Connect', 'woocommerce' ); ?></a></p>
<h2><?php esc_html_e( 'Manage your subscriptions, get important product notifications, and updates, all from the convenience of your WooCommerce dashboard', 'woocommerce' ); ?></h2>
<p><?php esc_html_e( 'Once connected, your WooCommerce.com purchases will be listed here.', 'woocommerce' ); ?></p>
<p><a class="button button-primary" href="<?php echo esc_url( $connect_url ); ?>"><?php esc_html_e( 'Connect', 'woocommerce' ); ?></a></p>
</div>
</div>
</div>

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',
);
}
@ -712,7 +716,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
);
}
?>
<select class="wc-customer-search" name="_customer_user" data-placeholder="<?php esc_attr_e( 'Search for a customer&hellip;', 'woocommerce' ); ?>" data-allow_clear="true">
<select class="wc-customer-search" name="_customer_user" data-placeholder="<?php esc_attr_e( 'Filter by registered customer', 'woocommerce' ); ?>" data-allow_clear="true">
<option value="<?php echo esc_attr( $user_id ); ?>" selected="selected"><?php echo wp_kses_post( $user_string ); ?><option>
</select>
<?php

View File

@ -2,8 +2,6 @@
/**
* List tables: products.
*
* @author WooCommerce
* @category Admin
* @package WooCommerce/Admin
* @version 3.3.0
*/
@ -17,7 +15,7 @@ if ( class_exists( 'WC_Admin_List_Table_Products', false ) ) {
}
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
include_once( 'abstract-class-wc-admin-list-table.php' );
include_once 'abstract-class-wc-admin-list-table.php';
}
/**
@ -39,8 +37,8 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
parent::__construct();
add_filter( 'disable_months_dropdown', '__return_true' );
add_filter( 'query_vars', array( $this, 'add_custom_query_var' ) );
add_filter( 'posts_search', array( $this, 'sku_search' ) );
add_filter( 'views_edit-product', array( $this, 'product_views' ) );
add_filter( 'get_search_query', array( $this, 'search_label' ) );
}
/**
@ -63,6 +61,18 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
return 'name';
}
/**
* Get row actions to show in the list table.
*
* @param array $actions Array of actions.
* @param WP_Post $post Current post object.
* @return array
*/
protected function get_row_actions( $actions, $post ) {
/* translators: %d: product ID. */
return array_merge( array( 'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $post->ID ) ), $actions );
}
/**
* Define which columns are sortable.
*
@ -71,9 +81,9 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
*/
public function define_sortable_columns( $columns ) {
$custom = array(
'price' => 'price',
'sku' => 'sku',
'name' => 'title',
'price' => 'price',
'sku' => 'sku',
'name' => 'title',
);
return wp_parse_args( $custom, $columns );
}
@ -123,7 +133,8 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
global $the_product;
if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
$this->object = $the_product = wc_get_product( $post_id );
$the_product = wc_get_product( $post_id );
$this->object = $the_product;
}
}
@ -131,7 +142,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
* Render columm: thumb.
*/
protected function render_thumb_column() {
echo '<a href="' . esc_url( get_edit_post_link( $this->object->get_id() ) ) . '">' . $this->object->get_image( 'thumbnail' ) . '</a>';
echo '<a href="' . esc_url( get_edit_post_link( $this->object->get_id() ) ) . '">' . $this->object->get_image( 'thumbnail' ) . '</a>'; // WPCS: XSS ok.
}
/**
@ -224,7 +235,8 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
* Render columm: product_cat.
*/
protected function render_product_cat_column() {
if ( ! $terms = get_the_terms( $this->object->get_id(), 'product_cat' ) ) {
$terms = get_the_terms( $this->object->get_id(), 'product_cat' );
if ( ! $terms ) {
echo '<span class="na">&ndash;</span>';
} else {
$termlist = array();
@ -240,7 +252,8 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
* Render columm: product_tag.
*/
protected function render_product_tag_column() {
if ( ! $terms = get_the_terms( $this->object->get_id(), 'product_tag' ) ) {
$terms = get_the_terms( $this->object->get_id(), 'product_tag' );
if ( ! $terms ) {
echo '<span class="na">&ndash;</span>';
} else {
$termlist = array();
@ -303,9 +316,11 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
$categories_count = (int) wp_count_terms( 'product_cat' );
if ( $categories_count <= apply_filters( 'woocommerce_product_category_filter_threshold', 100 ) ) {
wc_product_dropdown_categories( array(
'option_select_text' => __( 'Filter by category', 'woocommerce' ),
) );
wc_product_dropdown_categories(
array(
'option_select_text' => __( 'Filter by category', 'woocommerce' ),
)
);
} else {
$current_category_slug = isset( $_GET['product_cat'] ) ? wc_clean( wp_unslash( $_GET['product_cat'] ) ) : false; // WPCS: input var ok, CSRF ok.
$current_category = $current_category_slug ? get_term_by( 'slug', $current_category_slug, 'product_cat' ) : false;
@ -328,19 +343,19 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
$output .= '>';
switch ( $term->name ) {
case 'grouped' :
case 'grouped':
$output .= __( 'Grouped product', 'woocommerce' );
break;
case 'external' :
case 'external':
$output .= __( 'External/Affiliate product', 'woocommerce' );
break;
case 'variable' :
case 'variable':
$output .= __( 'Variable product', 'woocommerce' );
break;
case 'simple' :
case 'simple':
$output .= __( 'Simple product', 'woocommerce' );
break;
default :
default:
// Assuming that we have other types in future.
$output .= ucfirst( $term->name );
break;
@ -368,7 +383,7 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
$output .= '</select>';
$current_stock_status = isset( $_REQUEST['stock_status'] ) ? wc_clean( wp_unslash( $_REQUEST['stock_status'] ) ): false; // WPCS: input var ok, sanitization ok.
$current_stock_status = isset( $_REQUEST['stock_status'] ) ? wc_clean( wp_unslash( $_REQUEST['stock_status'] ) ) : false; // WPCS: input var ok, sanitization ok.
$stock_statuses = wc_get_product_stock_status_options();
$output .= '<select name="stock_status"><option value="">' . esc_html__( 'Filter by stock status', 'woocommerce' ) . '</option>';
@ -388,7 +403,6 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
* @return array
*/
protected function query_filters( $query_vars ) {
if ( isset( $query_vars['orderby'] ) ) {
if ( 'price' === $query_vars['orderby'] ) {
// @codingStandardsIgnoreStart
@ -437,48 +451,32 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
}
$query_vars['meta_query'][] = array(
'key' => '_stock_status',
'key' => '_stock_status',
'value' => wc_clean( wp_unslash( $_GET['stock_status'] ) ),
);
}
// Search using CRUD.
if ( ! empty( $query_vars['s'] ) ) {
$data_store = WC_Data_Store::load( 'product' );
$ids = $data_store->search_products( wc_clean( $query_vars['s'] ), '', true, true );
$query_vars['post__in'] = array_merge( $ids, array( 0 ) );
// So we know we are searching products.
$query_vars['product_search'] = true;
unset( $query_vars['s'] );
}
return $query_vars;
}
/**
* Search by SKU or ID for products.
*
* @deprecated Logic moved to query_filters.
* @param string $where Where clause SQL.
* @return string
*/
public function sku_search( $where ) {
global $pagenow, $wpdb, $wp;
if ( 'edit.php' !== $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'product' !== $wp->query_vars['post_type'] ) {
return $where;
}
$search_ids = array();
$terms = explode( ',', $wp->query_vars['s'] );
foreach ( $terms as $term ) {
if ( is_numeric( $term ) ) {
$search_ids[] = absint( $term );
} else {
$id_from_sku = wc_get_product_id_by_sku( wc_clean( $term ) );
if ( $id_from_sku ) {
$search_ids[] = absint( $id_from_sku );
}
}
}
$search_ids = array_filter( array_unique( array_map( 'absint', $search_ids ) ) );
if ( count( $search_ids ) > 0 ) {
$where = str_replace( 'AND (((', "AND ( ({$wpdb->posts}.ID IN (" . implode( ',', $search_ids ) . ')) OR ((', $where );
}
return $where;
}
@ -505,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

@ -258,7 +258,11 @@ class WC_Meta_Box_Order_Data {
);
printf( '<a href="%s">%s</a>',
esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ),
__( 'View other orders &rarr;', 'woocommerce' )
' ' . __( 'View other orders &rarr;', 'woocommerce' )
);
printf( '<a href="%s">%s</a>',
esc_url( add_query_arg( 'user_id', $order->get_user_id( 'edit' ), admin_url( 'user-edit.php' ) ) ),
' ' . __( 'Profile &rarr;', 'woocommerce' )
);
}
?></label>

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,32 +98,42 @@ 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">
<?php
$coupons = $order->get_items( 'coupon' );
if ( $coupons ) {
?>
if ( $coupons ) : ?>
<div class="wc-used-coupons">
<ul class="wc_coupon_list"><?php
echo '<li><strong>' . esc_html__( 'Coupon(s)', 'woocommerce' ) . '</strong></li>';
foreach ( $coupons as $item_id => $item ) {
<ul class="wc_coupon_list">
<li><strong><?php esc_html_e( 'Coupon(s)', 'woocommerce' ) ?></strong></li>
<?php foreach ( $coupons as $item_id => $item ) :
$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_title = %s AND post_type = 'shop_coupon' AND post_status = 'publish' LIMIT 1;", $item->get_code() ) );
if ( $post_id ) {
echo '<li class="code"><a href="' . esc_url( add_query_arg( array( 'post' => $post_id, 'action' => 'edit' ), admin_url( 'post.php' ) ) ) . '" class="tips" data-tip="' . esc_attr( wc_price( $item->get_discount(), array( 'currency' => $order->get_currency() ) ) ) . '"><span>' . esc_html( $item->get_code() ) . '</span></a> <a class="remove-coupon" href="javascript:void(0)" aria-label="Remove" data-code="' . esc_attr( $item->get_code() ) . '"></a></li>';
} else {
echo '<li class="code"><span class="tips" data-tip="' . esc_attr( wc_price( $item->get_discount(), array( 'currency' => $order->get_currency() ) ) ) . '"><span>' . esc_html( $item->get_code() ) . '</span></span> <a class="remove-coupon" href="javascript:void(0)" aria-label="Remove" data-code="' . esc_attr( $item->get_code() ) . '"></a></li>';
}
}
?></ul>
$class = $order->is_editable() ? 'code editable' : 'code';
?>
<li class="<?php echo $class ?>">
<?php if ( $post_id ) : ?>
<a href="<?php echo esc_url( add_query_arg( array( 'post' => $post_id, 'action' => 'edit' ), admin_url( 'post.php' ) ) ) ?>" class="tips" data-tip="<?php echo esc_attr( wc_price( $item->get_discount(), array( 'currency' => $order->get_currency() ) ) ) ?>">
<span><?php echo esc_html( $item->get_code() ) ?></span>
</a>
<?php else : ?>
<span class="tips" data-tip="<?php echo esc_attr( wc_price( $item->get_discount(), array( 'currency' => $order->get_currency() ) ) ) ?>">
<span><?php echo esc_html( $item->get_code() ) ?></span>
</span>
<?php endif; ?>
<?php if ( $order->is_editable() ) : ?>
<a class="remove-coupon" href="javascript:void(0)" aria-label="Remove" data-code="<?php echo esc_attr( $item->get_code() ) ?>"></a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php
}
?>
<?php endif; ?>
<table class="wc-order-totals">
<?php if ( 0 < $order->get_total_discount() ) : ?>
<tr>

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

@ -269,6 +269,49 @@ class WC_Settings_General extends WC_Settings_Page {
</div>';
}
/**
* Show a notice showing where the store notice setting has moved.
*
* @since 3.3.1
* @todo remove in next major release.
*/
private function store_notice_setting_moved_notice() {
if ( get_user_meta( get_current_user_id(), 'dismissed_store_notice_setting_moved_notice', true ) ) {
return;
}
?>
<div id="message" class="updated woocommerce-message inline">
<a class="woocommerce-message-close notice-dismiss" style="top:0;" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-hide-notice', 'store_notice_setting_moved' ), 'woocommerce_hide_notices_nonce', '_wc_notice_nonce' ) ); ?>"><?php esc_html_e( 'Dismiss', 'woocommerce' ); ?></a>
<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( 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(),
),
) );
?></p>
</div>
<?php
}
/**
* Output the settings.
*/
public function output() {
$settings = $this->get_settings();
$this->store_notice_setting_moved_notice();
WC_Admin_Settings::output_fields( $settings );
}
/**
* Save settings.
*/

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

@ -71,16 +71,16 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
),
array(
'title' => __( 'API', 'woocommerce' ),
'desc' => __( 'Enable the REST API', 'woocommerce' ),
'title' => __( 'Legacy API', 'woocommerce' ),
'desc' => __( 'Enable the legacy REST API', 'woocommerce' ),
'id' => 'woocommerce_api_enabled',
'type' => 'checkbox',
'default' => 'yes',
'default' => 'no',
),
array(
'type' => 'sectionend',
'id' => 'general_options',
'id' => 'general_options',
),
) );
}
@ -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 );
}
@ -240,7 +244,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
}
wp_localize_script( 'wc-shipping-zone-methods', 'shippingZoneMethodsLocalizeScript', array(
'methods' => $zone->get_shipping_methods(),
'methods' => $zone->get_shipping_methods( false, 'json' ),
'zone_name' => $zone->get_zone_name(),
'zone_id' => $zone->get_id(),
'wc_shipping_zones_nonce' => wp_create_nonce( 'wc_shipping_zones_nonce' ),

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