Merge branch 'master' into feature/product-custom-tables-supporting-changes
This commit is contained in:
commit
780905cd0e
|
@ -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
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
language: php
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
apt:
|
||||
packages:
|
||||
- nginx
|
||||
|
||||
sudo: false
|
||||
|
||||
# Test main supported versions of PHP against latest WP.
|
||||
|
@ -21,7 +27,7 @@ matrix:
|
|||
- php: 5.2
|
||||
dist: precise
|
||||
- php: 7.2
|
||||
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
|
||||
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1 RUN_E2E=1
|
||||
- php: 7.2
|
||||
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
|
||||
allow_failures:
|
||||
|
@ -35,6 +41,7 @@ before_script:
|
|||
script:
|
||||
- bash tests/bin/phpunit.sh
|
||||
- bash tests/bin/phpcs.sh
|
||||
- bash tests/bin/run-e2e-CI.sh
|
||||
|
||||
after_script:
|
||||
- bash tests/bin/travis.sh after
|
||||
|
|
162
CHANGELOG.txt
162
CHANGELOG.txt
|
@ -1,5 +1,167 @@
|
|||
== Changelog ==
|
||||
|
||||
= 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).
|
||||
|
|
23
Gruntfile.js
23
Gruntfile.js
|
@ -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.
|
||||
|
|
41
apigen.neon
41
apigen.neon
|
@ -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
|
||||
|
|
|
@ -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}.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}
|
|
@ -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}.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}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -903,8 +903,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 +913,10 @@ ul.wc_coupon_list {
|
|||
margin-right: 5px;
|
||||
margin-top: 5px;
|
||||
|
||||
&.editable {
|
||||
padding-right: 2em;
|
||||
}
|
||||
|
||||
.tips {
|
||||
cursor: pointer;
|
||||
|
||||
|
@ -1976,6 +1979,7 @@ ul.wc_coupon_list_block {
|
|||
}
|
||||
|
||||
a.link::after {
|
||||
font-family: 'WooCommerce';
|
||||
content: '\e00d';
|
||||
}
|
||||
|
||||
|
@ -2044,9 +2048,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 +2075,7 @@ ul.wc_coupon_list_block {
|
|||
}
|
||||
}
|
||||
.column-order_number {
|
||||
width: 35ch;
|
||||
width: 20ch;
|
||||
}
|
||||
.column-order_total {
|
||||
width: 8ch;
|
||||
|
@ -2276,7 +2283,7 @@ ul.wc_coupon_list_block {
|
|||
white-space: nowrap;
|
||||
}
|
||||
.wc-action-button {
|
||||
margin: -1px !important;
|
||||
margin: 0 0 0 -1px !important;
|
||||
border: 1px solid #ccc;
|
||||
padding: 1px 10px !important;
|
||||
border-radius: 0 !important;
|
||||
|
@ -2285,6 +2292,9 @@ ul.wc_coupon_list_block {
|
|||
height: auto;
|
||||
z-index: 1;
|
||||
position:relative;
|
||||
max-width: 175px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.wc-action-button:hover,
|
||||
.wc-action-button:focus {
|
||||
|
@ -2292,6 +2302,7 @@ ul.wc_coupon_list_block {
|
|||
z-index: 2;
|
||||
}
|
||||
.wc-action-button:first-child {
|
||||
margin-left: 0 !important;
|
||||
border-top-left-radius: 3px !important;
|
||||
border-bottom-left-radius: 3px !important;
|
||||
}
|
||||
|
@ -2397,14 +2408,6 @@ ul.order_notes {
|
|||
border-color: #efefef transparent;
|
||||
}
|
||||
}
|
||||
li.customer-note {
|
||||
.note_content {
|
||||
background: #a7cedc;
|
||||
}
|
||||
.note_content::after {
|
||||
border-color: #a7cedc transparent;
|
||||
}
|
||||
}
|
||||
li.system-note {
|
||||
.note_content {
|
||||
background: #d7cad2;
|
||||
|
@ -2413,6 +2416,14 @@ ul.order_notes {
|
|||
border-color: #d7cad2 transparent;
|
||||
}
|
||||
}
|
||||
li.customer-note {
|
||||
.note_content {
|
||||
background: #a7cedc;
|
||||
}
|
||||
.note_content::after {
|
||||
border-color: #a7cedc transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add_note {
|
||||
|
@ -2438,6 +2449,7 @@ table.wp-list-table {
|
|||
|
||||
.column-handle {
|
||||
width: 17px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
tbody {
|
||||
|
@ -2688,10 +2700,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;
|
||||
}
|
||||
|
@ -2709,9 +2730,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;
|
||||
|
@ -2826,6 +2848,10 @@ table.wc_emails,
|
|||
table.wc_shipping {
|
||||
position: relative;
|
||||
|
||||
th, td {
|
||||
display: table-cell !important;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: middle;
|
||||
padding: 7px;
|
||||
|
@ -2918,7 +2944,6 @@ table.wc_shipping {
|
|||
padding: 24px 24px 24px 0;
|
||||
}
|
||||
td.forminp {
|
||||
padding: 15px 10px;
|
||||
input, textarea {
|
||||
padding: 8px;
|
||||
width: 448px;
|
||||
|
@ -2985,6 +3010,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;
|
||||
|
@ -3401,6 +3427,7 @@ img.help_tip {
|
|||
table.form-table {
|
||||
margin: 0;
|
||||
position: relative;
|
||||
table-layout: fixed;
|
||||
|
||||
.forminp-radio ul {
|
||||
margin: 0;
|
||||
|
@ -5899,7 +5926,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;
|
||||
|
|
|
@ -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}
|
|
@ -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}
|
|
@ -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'}
|
|
@ -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
|
@ -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}
|
|
@ -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}
|
|
@ -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
|
@ -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}
|
|
@ -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
|
@ -326,7 +326,7 @@ body {
|
|||
width:100%;
|
||||
display: inline-flex;
|
||||
li {
|
||||
width: 20%;
|
||||
width: 100%;
|
||||
float: left;
|
||||
padding: 0 0 0.8em;
|
||||
margin: 0;
|
||||
|
@ -508,7 +508,10 @@ body {
|
|||
align-self: stretch;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
|
||||
.wc-wizard-payment-gateway-form & {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 75px;
|
||||
|
@ -554,10 +557,6 @@ body {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings-description {
|
||||
display: block;
|
||||
font-style: italic;
|
||||
|
@ -673,11 +672,15 @@ body {
|
|||
.wc-wizard-service-name {
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
align-items: center;
|
||||
max-height: 5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// List header
|
||||
.wc-wizard-service-item {
|
||||
padding-left: 2em;
|
||||
padding-top: 0.67em;
|
||||
|
||||
&:first-child {
|
||||
border-bottom: 0;
|
||||
|
@ -713,7 +716,10 @@ body {
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #a6a6a6;
|
||||
}
|
||||
.wc-wizard-service-item:not(:first-child) .wc-wizard-service-description {
|
||||
font-size: 0.92em;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.shipping-method-setting {
|
||||
|
@ -838,7 +844,7 @@ h3.jetpack-reasons {
|
|||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 1em;
|
||||
margin-top: 0.85em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
|
@ -867,7 +873,7 @@ h3.jetpack-reasons {
|
|||
}
|
||||
|
||||
.store-address-container {
|
||||
margin-bottom: 24px; // match margin-bottom on top paragraph
|
||||
margin-top: 4px;
|
||||
|
||||
.city-and-postcode {
|
||||
display: flex;
|
||||
|
@ -882,6 +888,16 @@ h3.jetpack-reasons {
|
|||
}
|
||||
}
|
||||
}
|
||||
.store-currency-container {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.product-type-container {
|
||||
margin-top: 14px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
#woocommerce_sell_in_person {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings {
|
||||
.payment-email-input {
|
||||
|
@ -1032,11 +1048,12 @@ p.jetpack-terms {
|
|||
|
||||
.wc-wizard-service-setting-stripe_create_account, .wc-wizard-service-setting-ppec_paypal_reroute_requests {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
align-items: flex-start;
|
||||
margin-top: 0.75em;
|
||||
|
||||
.payment-checkbox-input {
|
||||
order: 1;
|
||||
margin-top: 5px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 1.5em;
|
||||
|
|
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
|
@ -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
|
@ -363,17 +363,18 @@ p.demo_store,
|
|||
width: 5px;
|
||||
height: 5px;
|
||||
content: ' ';
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&::before {
|
||||
left: -6px;
|
||||
left: -5px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-width: 0 1px 1px 0;
|
||||
box-shadow: 2px 2px 0 $secondary;
|
||||
}
|
||||
|
||||
&::after {
|
||||
right: -6px;
|
||||
right: -5px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-width: 0 0 1px 1px;
|
||||
box-shadow: -2px 2px 0 $secondary;
|
||||
|
@ -476,7 +477,7 @@ p.demo_store,
|
|||
}
|
||||
|
||||
.group_table {
|
||||
td.label {
|
||||
td.woocommerce-grouped-product-list-item__label {
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
|
|
@ -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 |
|
@ -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, _ );
|
|
@ -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,_);
|
|
@ -3,12 +3,20 @@
|
|||
/* 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();
|
||||
|
||||
$( table_selector ).sortable({
|
||||
items: item_selector,
|
||||
cursor: 'move',
|
||||
handle: '.column-handle',
|
||||
axis: 'y',
|
||||
|
@ -29,11 +37,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 +61,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();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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='.column-handle input[name="term_id"]';0===e("table.wp-list-table").find(".column-handle").length&&(e("table.wp-list-table").find("tr:not(.inline-edit-row)").append('<td class="column-handle"></td>'),t=".check-column input"),e("table.wp-list-table").find(".column-handle").show(),e("table.wp-list-table").sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",handle:".column-handle",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(e,t){t.item.hasClass("alternate")||t.item.css("background-color","#ffffff"),t.item.children("td, th").css("border-bottom-width","0"),t.item.css("outline","1px solid #aaa")},stop:function(e,t){t.item.removeAttr("style"),t.item.children("td, th").css("border-bottom-width","1px")},update:function(n,i){var l,d,a=i.item.find(t).val(),o=i.item.find(".parent").html(),r=i.item.prev().find(t).val(),c=i.item.next().find(t).val();r!==undefined&&(l=i.item.prev().find(".parent").html())!==o&&(r=undefined),c!==undefined&&(d=i.item.next().find(".parent").html())!==o&&(c=undefined),r===undefined&&c===undefined||c===undefined&&d===r||c!==undefined&&l===a?e("table.wp-list-table").sortable("cancel"):(i.item.find(".check-column input").hide(),i.item.find(".check-column").append('<img alt="processing" src="images/wpspin_light.gif" class="waiting" style="margin-left: 6px;" />'),e.post(ajaxurl,{action:"woocommerce_term_ordering",id:a,nextid:c,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(e){"children"===e?window.location.reload():(i.item.find(".check-column input").show(),i.item.find(".check-column").find("img").remove())}),e("table.widefat tbody tr").each(function(){jQuery("table.widefat tbody tr").index(this)%2==0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})});
|
|
@ -18,7 +18,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ jQuery( function( $ ) {
|
|||
if ( href.length ) {
|
||||
e.preventDefault();
|
||||
|
||||
if ( e.metaKey ) {
|
||||
if ( e.metaKey || e.ctrlKey ) {
|
||||
window.open( href, '_blank' );
|
||||
} else {
|
||||
window.location = href;
|
||||
|
|
|
@ -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 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, a *, .no-link, .no-link *").length)return!0;var a=e(this).closest("tr").find("a.order-view").attr("href");a.length&&(r.preventDefault(),r.metaKey||r.ctrlKey?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});
|
|
@ -74,7 +74,7 @@ jQuery( function( $ ) {
|
|||
.removeClass( 'hide' )
|
||||
.find( '.shipping-method-required-field' )
|
||||
.prop( 'required', true );
|
||||
} );
|
||||
} ).find( '.wc-wizard-shipping-method-select .method' ).change();
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-enable', function() {
|
||||
var checked = $( this ).is( ':checked' );
|
||||
|
|
|
@ -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("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)}).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()})});
|
|
@ -281,15 +281,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
|
@ -7,8 +7,8 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
/* Storage Handling */
|
||||
var $supports_html5_storage;
|
||||
var cart_hash_key = wc_cart_fragments_params.ajax_url.toString() + '-wc_cart_hash';
|
||||
var $supports_html5_storage = true,
|
||||
cart_hash_key = wc_cart_fragments_params.cart_hash_key;
|
||||
|
||||
try {
|
||||
$supports_html5_storage = ( 'sessionStorage' in window && window.sessionStorage !== null );
|
||||
|
@ -74,7 +74,7 @@ jQuery( function( $ ) {
|
|||
refresh_cart_fragment();
|
||||
});
|
||||
|
||||
$( document.body ).on( 'added_to_cart', function( event, fragments, cart_hash ) {
|
||||
$( document.body ).on( 'added_to_cart removed_from_cart', function( event, fragments, cart_hash ) {
|
||||
var prev_cart_hash = sessionStorage.getItem( cart_hash_key );
|
||||
|
||||
if ( prev_cart_hash === null || prev_cart_hash === undefined || prev_cart_hash === '' ) {
|
||||
|
|
|
@ -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,a=wc_cart_fragments_params.ajax_url.toString()+"-wc_cart_hash";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()})});
|
|
@ -102,7 +102,7 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
$( '.woocommerce-cart-form' ).replaceWith( $new_form );
|
||||
$( '.woocommerce-cart-form' ).find( 'input[name="update_cart"]' ).prop( 'disabled', true );
|
||||
$( '.woocommerce-cart-form' ).find( ':input[name="update_cart"]' ).prop( 'disabled', true );
|
||||
|
||||
if ( $notices.length > 0 ) {
|
||||
show_notice( $notices );
|
||||
|
@ -158,7 +158,7 @@ jQuery( function( $ ) {
|
|||
);
|
||||
$( document ).on(
|
||||
'change',
|
||||
'select.shipping_method, input[name^=shipping_method]',
|
||||
'select.shipping_method, :input[name^=shipping_method]',
|
||||
this.shipping_method_selected
|
||||
);
|
||||
$( document ).on(
|
||||
|
@ -185,7 +185,7 @@ jQuery( function( $ ) {
|
|||
shipping_method_selected: function() {
|
||||
var shipping_methods = {};
|
||||
|
||||
$( 'select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]' ).each( function() {
|
||||
$( 'select.shipping_method, :input[name^=shipping_method][type=radio]:checked, :input[name^=shipping_method][type=hidden]' ).each( function() {
|
||||
shipping_methods[ $( this ).data( 'index' ) ] = $( this ).val();
|
||||
} );
|
||||
|
||||
|
@ -271,11 +271,11 @@ jQuery( function( $ ) {
|
|||
function() { cart.update_cart.apply( cart, [].slice.call( arguments, 1 ) ); } );
|
||||
$( document ).on(
|
||||
'click',
|
||||
'.woocommerce-cart-form input[type=submit]',
|
||||
'.woocommerce-cart-form :input[type=submit]',
|
||||
this.submit_click );
|
||||
$( document ).on(
|
||||
'keypress',
|
||||
'.woocommerce-cart-form input[type=number]',
|
||||
'.woocommerce-cart-form :input[type=number]',
|
||||
this.input_keypress );
|
||||
$( document ).on(
|
||||
'submit',
|
||||
|
@ -298,14 +298,14 @@ jQuery( function( $ ) {
|
|||
'.woocommerce-cart-form .cart_item :input',
|
||||
this.input_changed );
|
||||
|
||||
$( '.woocommerce-cart-form input[name="update_cart"]' ).prop( 'disabled', true );
|
||||
$( '.woocommerce-cart-form :input[name="update_cart"]' ).prop( 'disabled', true );
|
||||
},
|
||||
|
||||
/**
|
||||
* After an input is changed, enable the update cart button.
|
||||
*/
|
||||
input_changed: function() {
|
||||
$( '.woocommerce-cart-form input[name="update_cart"]' ).prop( 'disabled', false );
|
||||
$( '.woocommerce-cart-form :input[name="update_cart"]' ).prop( 'disabled', false );
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -376,9 +376,9 @@ jQuery( function( $ ) {
|
|||
* @param {Object} evt The JQuery event
|
||||
*/
|
||||
cart_submit: function( evt ) {
|
||||
var $submit = $( document.activeElement );
|
||||
var $clicked = $( 'input[type=submit][clicked=true]' );
|
||||
var $form = $( evt.currentTarget );
|
||||
var $submit = $( document.activeElement ),
|
||||
$clicked = $( ':input[type=submit][clicked=true]' ),
|
||||
$form = $( evt.currentTarget );
|
||||
|
||||
// For submit events, currentTarget is form.
|
||||
// For keypress events, currentTarget is input.
|
||||
|
@ -394,11 +394,11 @@ jQuery( function( $ ) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( $clicked.is( 'input[name="update_cart"]' ) || $submit.is( 'input.qty' ) ) {
|
||||
if ( $clicked.is( ':input[name="update_cart"]' ) || $submit.is( 'input.qty' ) ) {
|
||||
evt.preventDefault();
|
||||
this.quantity_update( $form );
|
||||
|
||||
} else if ( $clicked.is( 'input[name="apply_coupon"]' ) || $submit.is( '#coupon_code' ) ) {
|
||||
} else if ( $clicked.is( ':input[name="apply_coupon"]' ) || $submit.is( '#coupon_code' ) ) {
|
||||
evt.preventDefault();
|
||||
this.apply_coupon( $form );
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ jQuery( function( $ ) {
|
|||
* @param {Object} evt The JQuery event
|
||||
*/
|
||||
submit_click: function( evt ) {
|
||||
$( 'input[type=submit]', $( evt.target ).parents( 'form' ) ).removeAttr( 'clicked' );
|
||||
$( ':input[type=submit]', $( evt.target ).parents( 'form' ) ).removeAttr( 'clicked' );
|
||||
$( evt.target ).attr( 'clicked', 'true' );
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,8 @@
|
|||
"homepage": "https://woocommerce.com/",
|
||||
"type": "wordpress-plugin",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"prefer-stable": true,
|
||||
"minimum-stability": "dev",
|
||||
"require": {
|
||||
"composer/installers": "~1.2"
|
||||
},
|
||||
|
@ -14,7 +16,9 @@
|
|||
"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": [
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,9 @@
|
|||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.0.0
|
||||
*
|
||||
* English notation of prefectures conform to the notation of Japan Post.
|
||||
* The suffix corresponds with the Japanese translation file.
|
||||
*/
|
||||
global $states;
|
||||
|
||||
|
@ -14,51 +17,51 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
$states['JP'] = array(
|
||||
'JP01' => __( 'Hokkai-do', 'woocommerce' ),
|
||||
'JP02' => __( 'Aomori-ken', 'woocommerce' ),
|
||||
'JP03' => __( 'Iwate-ken', 'woocommerce' ),
|
||||
'JP04' => __( 'Miyagi-ken', 'woocommerce' ),
|
||||
'JP05' => __( 'Akita-ken', 'woocommerce' ),
|
||||
'JP06' => __( 'Yamagata-ken', 'woocommerce' ),
|
||||
'JP07' => __( 'Fukushima-ken', 'woocommerce' ),
|
||||
'JP08' => __( 'Ibaraki-ken', 'woocommerce' ),
|
||||
'JP09' => __( 'Tochigi-ken', 'woocommerce' ),
|
||||
'JP10' => __( 'Gunma-ken', 'woocommerce' ),
|
||||
'JP11' => __( 'Saitama-ken', 'woocommerce' ),
|
||||
'JP12' => __( 'Chiba-ken', 'woocommerce' ),
|
||||
'JP13' => __( 'Tokyo-to', 'woocommerce' ),
|
||||
'JP14' => __( 'Kanagawa-ken', 'woocommerce' ),
|
||||
'JP15' => __( 'Niigata-ken', 'woocommerce' ),
|
||||
'JP16' => __( 'Toyama-ken', 'woocommerce' ),
|
||||
'JP17' => __( 'Ishikawa-ken', 'woocommerce' ),
|
||||
'JP18' => __( 'Fukui-ken', 'woocommerce' ),
|
||||
'JP19' => __( 'Yamanashi-ken', 'woocommerce' ),
|
||||
'JP20' => __( 'Nagano-ken', 'woocommerce' ),
|
||||
'JP21' => __( 'Gifu-ken', 'woocommerce' ),
|
||||
'JP22' => __( 'Shizuoka-ken', 'woocommerce' ),
|
||||
'JP23' => __( 'Aichi-ken', 'woocommerce' ),
|
||||
'JP24' => __( 'Mie-ken', 'woocommerce' ),
|
||||
'JP25' => __( 'Shiga-ken', 'woocommerce' ),
|
||||
'JP26' => __( 'Kyoto-fu', 'woocommerce' ),
|
||||
'JP27' => __( 'Osaka-fu', 'woocommerce' ),
|
||||
'JP28' => __( 'Hyogo-ken', 'woocommerce' ),
|
||||
'JP29' => __( 'Nara-ken', 'woocommerce' ),
|
||||
'JP30' => __( 'Wakayama-ken', 'woocommerce' ),
|
||||
'JP31' => __( 'Tottori-ken', 'woocommerce' ),
|
||||
'JP32' => __( 'Shimane-ken', 'woocommerce' ),
|
||||
'JP33' => __( 'Okayama-ken', 'woocommerce' ),
|
||||
'JP34' => __( 'Hiroshima-ken', 'woocommerce' ),
|
||||
'JP35' => __( 'Yamaguchi-ken', 'woocommerce' ),
|
||||
'JP36' => __( 'Tokushima-ken', 'woocommerce' ),
|
||||
'JP37' => __( 'Kagawa-ken', 'woocommerce' ),
|
||||
'JP38' => __( 'Ehime-ken', 'woocommerce' ),
|
||||
'JP39' => __( 'Kochi-ken', 'woocommerce' ),
|
||||
'JP40' => __( 'Fukuoka-ken', 'woocommerce' ),
|
||||
'JP41' => __( 'Saga-ken', 'woocommerce' ),
|
||||
'JP42' => __( 'Nagasaki-ken', 'woocommerce' ),
|
||||
'JP43' => __( 'Kumamoto-ken', 'woocommerce' ),
|
||||
'JP44' => __( 'Oita-ken', 'woocommerce' ),
|
||||
'JP45' => __( 'Miyazaki-ken', 'woocommerce' ),
|
||||
'JP46' => __( 'Kagoshima-ken', 'woocommerce' ),
|
||||
'JP47' => __( 'Okinawa-ken', 'woocommerce' ),
|
||||
'JP01' => __( 'Hokkaido', 'woocommerce' ),
|
||||
'JP02' => __( 'Aomori', 'woocommerce' ),
|
||||
'JP03' => __( 'Iwate', 'woocommerce' ),
|
||||
'JP04' => __( 'Miyagi', 'woocommerce' ),
|
||||
'JP05' => __( 'Akita', 'woocommerce' ),
|
||||
'JP06' => __( 'Yamagata', 'woocommerce' ),
|
||||
'JP07' => __( 'Fukushima', 'woocommerce' ),
|
||||
'JP08' => __( 'Ibaraki', 'woocommerce' ),
|
||||
'JP09' => __( 'Tochigi', 'woocommerce' ),
|
||||
'JP10' => __( 'Gunma', 'woocommerce' ),
|
||||
'JP11' => __( 'Saitama', 'woocommerce' ),
|
||||
'JP12' => __( 'Chiba', 'woocommerce' ),
|
||||
'JP13' => __( 'Tokyo', 'woocommerce' ),
|
||||
'JP14' => __( 'Kanagawa', 'woocommerce' ),
|
||||
'JP15' => __( 'Niigata', 'woocommerce' ),
|
||||
'JP16' => __( 'Toyama', 'woocommerce' ),
|
||||
'JP17' => __( 'Ishikawa', 'woocommerce' ),
|
||||
'JP18' => __( 'Fukui', 'woocommerce' ),
|
||||
'JP19' => __( 'Yamanashi', 'woocommerce' ),
|
||||
'JP20' => __( 'Nagano', 'woocommerce' ),
|
||||
'JP21' => __( 'Gifu', 'woocommerce' ),
|
||||
'JP22' => __( 'Shizuoka', 'woocommerce' ),
|
||||
'JP23' => __( 'Aichi', 'woocommerce' ),
|
||||
'JP24' => __( 'Mie', 'woocommerce' ),
|
||||
'JP25' => __( 'Shiga', 'woocommerce' ),
|
||||
'JP26' => __( 'Kyoto', 'woocommerce' ),
|
||||
'JP27' => __( 'Osaka', 'woocommerce' ),
|
||||
'JP28' => __( 'Hyogo', 'woocommerce' ),
|
||||
'JP29' => __( 'Nara', 'woocommerce' ),
|
||||
'JP30' => __( 'Wakayama', 'woocommerce' ),
|
||||
'JP31' => __( 'Tottori', 'woocommerce' ),
|
||||
'JP32' => __( 'Shimane', 'woocommerce' ),
|
||||
'JP33' => __( 'Okayama', 'woocommerce' ),
|
||||
'JP34' => __( 'Hiroshima', 'woocommerce' ),
|
||||
'JP35' => __( 'Yamaguchi', 'woocommerce' ),
|
||||
'JP36' => __( 'Tokushima', 'woocommerce' ),
|
||||
'JP37' => __( 'Kagawa', 'woocommerce' ),
|
||||
'JP38' => __( 'Ehime', 'woocommerce' ),
|
||||
'JP39' => __( 'Kochi', 'woocommerce' ),
|
||||
'JP40' => __( 'Fukuoka', 'woocommerce' ),
|
||||
'JP41' => __( 'Saga', 'woocommerce' ),
|
||||
'JP42' => __( 'Nagasaki', 'woocommerce' ),
|
||||
'JP43' => __( 'Kumamoto', 'woocommerce' ),
|
||||
'JP44' => __( 'Oita', 'woocommerce' ),
|
||||
'JP45' => __( 'Miyazaki', 'woocommerce' ),
|
||||
'JP46' => __( 'Kagoshima', 'woocommerce' ),
|
||||
'JP47' => __( 'Okinawa', 'woocommerce' ),
|
||||
);
|
||||
|
|
|
@ -1437,6 +1437,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
$this->set_discount_total( $cart_subtotal - $cart_total );
|
||||
$this->set_discount_tax( $cart_subtotal_tax - $cart_total_tax );
|
||||
$this->set_total( round( $cart_total + $fee_total + $this->get_shipping_total() + $this->get_cart_tax() + $this->get_shipping_tax(), wc_get_price_decimals() ) );
|
||||
|
||||
do_action( 'woocommerce_order_after_calculate_totals', $and_taxes, $this );
|
||||
|
||||
$this->save();
|
||||
|
||||
return $this->get_total();
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* Abstract Rest Terms Controller
|
||||
*
|
||||
* @package WooCommerce/Abstracts
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract Rest Terms Controller Class
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/Abstracts
|
||||
* @version 2.6.0
|
||||
* Terms controller class.
|
||||
*/
|
||||
abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
||||
|
||||
|
@ -32,73 +33,81 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
* Register the routes for terms.
|
||||
*/
|
||||
public function register_routes() {
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base, array(
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_items' ),
|
||||
'permission_callback' => array( $this, 'get_items_permissions_check' ),
|
||||
'args' => $this->get_collection_params(),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::CREATABLE,
|
||||
'callback' => array( $this, 'create_item' ),
|
||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||
'args' => array_merge( $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), array(
|
||||
'name' => array(
|
||||
'type' => 'string',
|
||||
'description' => __( 'Name for the resource.', 'woocommerce' ),
|
||||
'required' => true,
|
||||
),
|
||||
) ),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
));
|
||||
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
|
||||
'args' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
register_rest_route(
|
||||
$this->namespace, '/' . $this->rest_base, array(
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_items' ),
|
||||
'permission_callback' => array( $this, 'get_items_permissions_check' ),
|
||||
'args' => $this->get_collection_params(),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => array( $this, 'update_item' ),
|
||||
'permission_callback' => array( $this, 'update_item_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::DELETABLE,
|
||||
'callback' => array( $this, 'delete_item' ),
|
||||
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'force' => array(
|
||||
'default' => false,
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Required to be true, as resource does not support trashing.', 'woocommerce' ),
|
||||
array(
|
||||
'methods' => WP_REST_Server::CREATABLE,
|
||||
'callback' => array( $this, 'create_item' ),
|
||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||
'args' => array_merge(
|
||||
$this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), array(
|
||||
'name' => array(
|
||||
'type' => 'string',
|
||||
'description' => __( 'Name for the resource.', 'woocommerce' ),
|
||||
'required' => true,
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
) );
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/batch', array(
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => array( $this, 'batch_items' ),
|
||||
'permission_callback' => array( $this, 'batch_items_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_batch_schema' ),
|
||||
) );
|
||||
register_rest_route(
|
||||
$this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
|
||||
'args' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => array( $this, 'update_item' ),
|
||||
'permission_callback' => array( $this, 'update_item_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::DELETABLE,
|
||||
'callback' => array( $this, 'delete_item' ),
|
||||
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'force' => array(
|
||||
'default' => false,
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Required to be true, as resource does not support trashing.', 'woocommerce' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
$this->namespace, '/' . $this->rest_base . '/batch', array(
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => array( $this, 'batch_items' ),
|
||||
'permission_callback' => array( $this, 'batch_items_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_batch_schema' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -219,21 +228,22 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
* Check permissions.
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param string $context Request context.
|
||||
* @param string $context Request context.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
protected function check_permissions( $request, $context = 'read' ) {
|
||||
// Get taxonomy.
|
||||
$taxonomy = $this->get_taxonomy( $request );
|
||||
if ( ! $taxonomy ) {
|
||||
if ( ! $taxonomy || ! taxonomy_exists( $taxonomy ) ) {
|
||||
return new WP_Error( 'woocommerce_rest_taxonomy_invalid', __( 'Taxonomy does not exist.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
}
|
||||
|
||||
// Check permissions for a single term.
|
||||
if ( $id = intval( $request['id'] ) ) {
|
||||
$id = intval( $request['id'] );
|
||||
if ( $id ) {
|
||||
$term = get_term( $id, $taxonomy );
|
||||
|
||||
if ( ! $term || $term->taxonomy !== $taxonomy ) {
|
||||
if ( is_wp_error( $term ) || ! $term || $term->taxonomy !== $taxonomy ) {
|
||||
return new WP_Error( 'woocommerce_rest_term_invalid', __( 'Resource does not exist.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
}
|
||||
|
||||
|
@ -266,7 +276,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
if ( ! empty( $request['offset'] ) ) {
|
||||
$prepared_args['offset'] = $request['offset'];
|
||||
} else {
|
||||
$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];
|
||||
$prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number'];
|
||||
}
|
||||
|
||||
$taxonomy_obj = get_taxonomy( $taxonomy );
|
||||
|
@ -296,9 +306,9 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
*/
|
||||
$prepared_args = apply_filters( "woocommerce_rest_{$taxonomy}_query", $prepared_args, $request );
|
||||
|
||||
if ( ! empty( $prepared_args['product'] ) ) {
|
||||
if ( ! empty( $prepared_args['product'] ) ) {
|
||||
$query_result = $this->get_terms_for_product( $prepared_args, $request );
|
||||
$total_terms = $this->total_terms;
|
||||
$total_terms = $this->total_terms;
|
||||
} else {
|
||||
$query_result = get_terms( $taxonomy, $prepared_args );
|
||||
|
||||
|
@ -308,7 +318,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
$total_terms = wp_count_terms( $taxonomy, $count_args );
|
||||
|
||||
// Ensure we don't return results when offset is out of bounds.
|
||||
// See https://core.trac.wordpress.org/ticket/35935
|
||||
// See https://core.trac.wordpress.org/ticket/35935.
|
||||
if ( $prepared_args['offset'] >= $total_terms ) {
|
||||
$query_result = array();
|
||||
}
|
||||
|
@ -320,7 +330,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
}
|
||||
$response = array();
|
||||
foreach ( $query_result as $term ) {
|
||||
$data = $this->prepare_item_for_response( $term, $request );
|
||||
$data = $this->prepare_item_for_response( $term, $request );
|
||||
$response[] = $this->prepare_response_for_collection( $data );
|
||||
}
|
||||
|
||||
|
@ -328,7 +338,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
|
||||
// Store pagination values for headers then unset for count query.
|
||||
$per_page = (int) $prepared_args['number'];
|
||||
$page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
|
||||
$page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
|
||||
|
||||
$response->header( 'X-WP-Total', (int) $total_terms );
|
||||
$max_pages = ceil( $total_terms / $per_page );
|
||||
|
@ -392,7 +402,8 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
|
||||
// If we're going to inform the client that the term exists,
|
||||
// give them the identifier they can actually use.
|
||||
if ( $term_id = $term->get_error_data( 'term_exists' ) ) {
|
||||
$term_id = $term->get_error_data( 'term_exists' );
|
||||
if ( $term_id ) {
|
||||
$error_data['resource_id'] = $term_id;
|
||||
}
|
||||
|
||||
|
@ -567,7 +578,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare links for the request.
|
||||
*
|
||||
* @param object $term Term object.
|
||||
* @param object $term Term object.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array Links for the given term.
|
||||
*/
|
||||
|
@ -579,7 +590,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
}
|
||||
|
||||
$links = array(
|
||||
'self' => array(
|
||||
'self' => array(
|
||||
'href' => rest_url( trailingslashit( $base ) . $term->term_id ),
|
||||
),
|
||||
'collection' => array(
|
||||
|
@ -602,8 +613,8 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Update term meta fields.
|
||||
*
|
||||
* @param WP_Term $term
|
||||
* @param WP_REST_Request $request
|
||||
* @param WP_Term $term Term object.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
protected function update_term_meta_fields( $term, $request ) {
|
||||
|
@ -618,8 +629,8 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
* supported, notably `include`, `exclude`. In `self::get_items()` these
|
||||
* are instead treated as a full query.
|
||||
*
|
||||
* @param array $prepared_args Arguments for `get_terms()`.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param array $prepared_args Arguments for `get_terms()`.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array List of term objects. (Total count in `$this->total_terms`).
|
||||
*/
|
||||
protected function get_terms_for_product( $prepared_args, $request ) {
|
||||
|
@ -633,16 +644,15 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
|
||||
// get_items() verifies that we don't have `include` set, and default.
|
||||
// ordering is by `name`.
|
||||
if ( ! in_array( $prepared_args['orderby'], array( 'name', 'none', 'include' ) ) ) {
|
||||
if ( ! in_array( $prepared_args['orderby'], array( 'name', 'none', 'include' ), true ) ) {
|
||||
switch ( $prepared_args['orderby'] ) {
|
||||
case 'id' :
|
||||
case 'id':
|
||||
$this->sort_column = 'term_id';
|
||||
break;
|
||||
|
||||
case 'slug' :
|
||||
case 'term_group' :
|
||||
case 'description' :
|
||||
case 'count' :
|
||||
case 'slug':
|
||||
case 'term_group':
|
||||
case 'description':
|
||||
case 'count':
|
||||
$this->sort_column = $prepared_args['orderby'];
|
||||
break;
|
||||
}
|
||||
|
@ -654,7 +664,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
|
||||
// Pagination.
|
||||
$this->total_terms = count( $query_result );
|
||||
$query_result = array_slice( $query_result, $prepared_args['offset'], $prepared_args['number'] );
|
||||
$query_result = array_slice( $query_result, $prepared_args['offset'], $prepared_args['number'] );
|
||||
|
||||
return $query_result;
|
||||
}
|
||||
|
@ -688,10 +698,10 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
public function get_collection_params() {
|
||||
$params = parent::get_collection_params();
|
||||
|
||||
if ( '' !== $this->taxonomy ) {
|
||||
if ( '' !== $this->taxonomy && taxonomy_exists( $this->taxonomy ) ) {
|
||||
$taxonomy = get_taxonomy( $this->taxonomy );
|
||||
} else {
|
||||
$taxonomy = new stdClass();
|
||||
$taxonomy = new stdClass();
|
||||
$taxonomy->hierarchical = true;
|
||||
}
|
||||
|
||||
|
@ -701,7 +711,7 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
'description' => __( 'Ensure result set excludes specific ids.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'items' => array(
|
||||
'type' => 'integer',
|
||||
'type' => 'integer',
|
||||
),
|
||||
'default' => array(),
|
||||
'sanitize_callback' => 'wp_parse_id_list',
|
||||
|
@ -710,36 +720,36 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
'description' => __( 'Limit result set to specific ids.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'items' => array(
|
||||
'type' => 'integer',
|
||||
'type' => 'integer',
|
||||
),
|
||||
'default' => array(),
|
||||
'sanitize_callback' => 'wp_parse_id_list',
|
||||
);
|
||||
if ( ! $taxonomy->hierarchical ) {
|
||||
$params['offset'] = array(
|
||||
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'sanitize_callback' => 'absint',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'sanitize_callback' => 'absint',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
}
|
||||
$params['order'] = array(
|
||||
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'default' => 'asc',
|
||||
'enum' => array(
|
||||
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'default' => 'asc',
|
||||
'enum' => array(
|
||||
'asc',
|
||||
'desc',
|
||||
),
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
$params['orderby'] = array(
|
||||
'description' => __( 'Sort collection by resource attribute.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'default' => 'name',
|
||||
'enum' => array(
|
||||
'description' => __( 'Sort collection by resource attribute.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'default' => 'name',
|
||||
'enum' => array(
|
||||
'id',
|
||||
'include',
|
||||
'name',
|
||||
|
@ -748,32 +758,32 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
'description',
|
||||
'count',
|
||||
),
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
$params['hide_empty'] = array(
|
||||
'description' => __( 'Whether to hide resources not assigned to any products.', 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Whether to hide resources not assigned to any products.', 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'default' => false,
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
if ( $taxonomy->hierarchical ) {
|
||||
$params['parent'] = array(
|
||||
'description' => __( 'Limit result set to resources assigned to a specific parent.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'sanitize_callback' => 'absint',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Limit result set to resources assigned to a specific parent.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'sanitize_callback' => 'absint',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
}
|
||||
$params['product'] = array(
|
||||
'description' => __( 'Limit result set to resources assigned to a specific product.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'default' => null,
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Limit result set to resources assigned to a specific product.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'default' => null,
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
$params['slug'] = array(
|
||||
'description' => __( 'Limit result set to resources with a specific slug.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
'description' => __( 'Limit result set to resources with a specific slug.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'validate_callback' => 'rest_validate_request_arg',
|
||||
);
|
||||
|
||||
return $params;
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -128,7 +128,11 @@ class WC_Admin_Notices {
|
|||
}
|
||||
|
||||
$hide_notice = sanitize_text_field( $_GET['wc-hide-notice'] );
|
||||
|
||||
self::remove_notice( $hide_notice );
|
||||
|
||||
update_user_meta( get_current_user_id(), 'dismissed_' . $hide_notice . '_notice', true );
|
||||
|
||||
do_action( 'woocommerce_hide_' . $hide_notice . '_notice' );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
@ -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 ) ) {
|
||||
|
|
|
@ -414,6 +414,7 @@ class WC_Admin_Setup_Wizard {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="store-currency-container">
|
||||
<label class="location-prompt" for="currency_code">
|
||||
<?php esc_html_e( 'What currency do you use?', 'woocommerce' ); ?>
|
||||
</label>
|
||||
|
@ -426,19 +427,15 @@ class WC_Admin_Setup_Wizard {
|
|||
>
|
||||
<option value=""><?php esc_html_e( 'Choose a currency…', 'woocommerce' ); ?></option>
|
||||
<?php foreach ( get_woocommerce_currencies() as $code => $name ) : ?>
|
||||
<option value="<?php echo esc_attr( $code ); ?>" <?php selected( $currency, $code ); ?>>
|
||||
<?php
|
||||
// @codingStandardsIgnoreStart
|
||||
printf( esc_html__( '%1$s (%2$s)', 'woocommerce' ), $name, get_woocommerce_currency_symbol( $code ) );
|
||||
// // @codingStandardsIgnoreEnd
|
||||
?>
|
||||
</option>
|
||||
<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>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
var wc_setup_currencies = <?php echo wp_json_encode( $currency_by_country ); ?>;
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div class="product-type-container">
|
||||
<label class="location-prompt" for="product_type">
|
||||
<?php esc_html_e( 'What type of product do you plan to sell?', 'woocommerce' ); ?>
|
||||
</label>
|
||||
|
@ -452,6 +449,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<option value="physical" <?php selected( $product_type, 'physical' ); ?>><?php esc_html_e( 'I plan to sell physical products', 'woocommerce' ); ?></option>
|
||||
<option value="virtual" <?php selected( $product_type, 'virtual' ); ?>><?php esc_html_e( 'I plan to sell digital products', 'woocommerce' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="checkbox"
|
||||
|
@ -722,9 +720,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<div class="wc-wizard-shipping-method-dropdown">
|
||||
<select id="<?php echo esc_attr( "{$input_prefix}[method]" ); ?>" name="<?php echo esc_attr( "{$input_prefix}[method]" ); ?>" class="method wc-enhanced-select">
|
||||
<?php foreach ( $shipping_methods as $method_id => $method ) : ?>
|
||||
<option value="<?php echo esc_attr( $method_id ); ?>" <?php selected( $selected, $method_id ); ?>>
|
||||
<?php echo esc_html( $method['name'] ); ?>
|
||||
</option>
|
||||
<option value="<?php echo esc_attr( $method_id ); ?>" <?php selected( $selected, $method_id ); ?>><?php echo esc_html( $method['name'] ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -1108,17 +1104,17 @@ class WC_Admin_Setup_Wizard {
|
|||
$paypal_ec_description = '<p>' . sprintf(
|
||||
/* translators: %s: URL */
|
||||
__( 'Safe and secure payments using credit cards or your customer\'s PayPal account. <a href="%s" target="_blank">Learn more</a>.', 'woocommerce' ),
|
||||
'https://wordpress.org/plugins/woocommerce-gateway-paypal-express-checkout/'
|
||||
'https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/'
|
||||
) . '</p>';
|
||||
$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 */
|
||||
|
@ -1426,7 +1422,7 @@ class WC_Admin_Setup_Wizard {
|
|||
),
|
||||
)
|
||||
),
|
||||
esc_url( admin_url( 'admin.php?page=wc-addons&view=payment_gateways' ) )
|
||||
esc_url( admin_url( 'admin.php?page=wc-addons§ion=payment-gateways' ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
@ -1503,9 +1499,7 @@ class WC_Admin_Setup_Wizard {
|
|||
$this->install_plugin( $gateway_id, $gateway );
|
||||
}
|
||||
|
||||
$settings_key = 'woocommerce_' . $gateway_id . '_settings';
|
||||
$settings = array_filter( (array) get_option( $settings_key, array() ) );
|
||||
$settings['enabled'] = ! empty( $_POST[ 'wc-wizard-service-' . $gateway_id . '-enabled' ] ) ? 'yes' : 'no'; // WPCS: CSRF ok, input var ok.
|
||||
$settings = array( 'enabled' => ! empty( $_POST[ 'wc-wizard-service-' . $gateway_id . '-enabled' ] ) ? 'yes' : 'no' ); // WPCS: CSRF ok, input var ok.
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
if ( ! empty( $gateway['settings'] ) ) {
|
||||
|
@ -1517,7 +1511,13 @@ class WC_Admin_Setup_Wizard {
|
|||
}
|
||||
// @codingStandardsIgnoreSEnd
|
||||
|
||||
update_option( $settings_key, $settings );
|
||||
if ( 'ppec_paypal' === $gateway_id && empty( $settings['reroute_requests'] ) ) {
|
||||
unset( $settings['enabled'] );
|
||||
}
|
||||
|
||||
$settings_key = 'woocommerce_' . $gateway_id . '_settings';
|
||||
$previously_saved_settings = array_filter( (array) get_option( $settings_key, array() ) );
|
||||
update_option( $settings_key, array_merge( $previously_saved_settings, $settings ) );
|
||||
}
|
||||
|
||||
wp_redirect( esc_url_raw( $this->get_next_step_link() ) );
|
||||
|
@ -1659,13 +1659,13 @@ class WC_Admin_Setup_Wizard {
|
|||
$description_base = __( 'Your store is almost ready! To activate services like %s, just connect with Jetpack.', 'woocommerce' );
|
||||
|
||||
if ( $payment_enabled && $taxes_enabled && $rates_enabled ) {
|
||||
$description = sprintf( $description_base, __( 'payments, automated taxes, live rates and discounted shipping labels', 'woocommerce' ) );
|
||||
$description = sprintf( $description_base, __( 'payment setup, automated taxes, live rates and discounted shipping labels', 'woocommerce' ) );
|
||||
} else if ( $payment_enabled && $taxes_enabled ) {
|
||||
$description = sprintf( $description_base, __( 'payments and automated taxes', 'woocommerce' ) );
|
||||
$description = sprintf( $description_base, __( 'payment setup and automated taxes', 'woocommerce' ) );
|
||||
} else if ( $payment_enabled && $rates_enabled ) {
|
||||
$description = sprintf( $description_base, __( 'payments, live rates and discounted shipping labels', 'woocommerce' ) );
|
||||
$description = sprintf( $description_base, __( 'payment setup, live rates and discounted shipping labels', 'woocommerce' ) );
|
||||
} else if ( $payment_enabled ) {
|
||||
$description = sprintf( $description_base, __( 'payments', 'woocommerce' ) );
|
||||
$description = sprintf( $description_base, __( 'payment setup', 'woocommerce' ) );
|
||||
} else if ( $taxes_enabled && $rates_enabled ) {
|
||||
$description = sprintf( $description_base, __( 'automated taxes, live rates and discounted shipping labels', 'woocommerce' ) );
|
||||
} else if ( $taxes_enabled ) {
|
||||
|
@ -1687,7 +1687,7 @@ class WC_Admin_Setup_Wizard {
|
|||
if ( isset( $_GET['activate_error'] ) ) {
|
||||
$has_jetpack_error = true;
|
||||
|
||||
$title = __( "Sorry, We couldn't connect your store to Jetpack", 'woocommerce' );
|
||||
$title = __( "Sorry, we couldn't connect your store to Jetpack", 'woocommerce' );
|
||||
|
||||
$error_message = $this->get_activate_error_message( sanitize_text_field( wp_unslash( $_GET['activate_error'] ) ) );
|
||||
$description = $error_message;
|
||||
|
@ -1731,7 +1731,14 @@ class WC_Admin_Setup_Wizard {
|
|||
<input type="hidden" name="save_step" value="activate" />
|
||||
<?php wp_nonce_field( 'wc-setup' ); ?>
|
||||
</form>
|
||||
<h3 class="jetpack-reasons"><?php esc_html_e( "Bonus reasons you'll love Jetpack", 'woocommerce' ); ?></h3>
|
||||
<h3 class="jetpack-reasons">
|
||||
<?php
|
||||
echo esc_html( $description ?
|
||||
__( "Bonus reasons you'll love Jetpack", 'woocommerce' ) :
|
||||
__( "Reasons you'll love Jetpack", 'woocommerce' )
|
||||
);
|
||||
?>
|
||||
</h3>
|
||||
<ul class="wc-wizard-features">
|
||||
<li class="wc-wizard-feature-item">
|
||||
<p class="wc-wizard-feature-name">
|
||||
|
@ -1877,8 +1884,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">
|
||||
|
|
|
@ -318,7 +318,10 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -331,9 +334,7 @@ class WC_Admin_Taxonomies {
|
|||
* @return string
|
||||
*/
|
||||
public function product_cat_column( $columns, $column, $id ) {
|
||||
|
||||
if ( 'thumb' == $column ) {
|
||||
|
||||
if ( 'thumb' === $column ) {
|
||||
$thumbnail_id = get_woocommerce_term_meta( $id, 'thumbnail_id', true );
|
||||
|
||||
if ( $thumbnail_id ) {
|
||||
|
@ -342,14 +343,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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' :
|
||||
|
|
|
@ -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 <a href="%1$s" target="_blank">be added as a collaborator</a>.', 'woocommerce' ), 'https://docs.woocommerce.com/document/adding-collaborators/' ),
|
||||
/* 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',
|
||||
|
@ -1235,14 +1236,25 @@ class WC_Helper {
|
|||
|
||||
/**
|
||||
* Prompt a Helper connection if the user has WooCommerce.com extensions.
|
||||
*
|
||||
* @param string $screen_id Current screen ID.
|
||||
*/
|
||||
private static function _prompt_helper_connect( $screen_id ) {
|
||||
// Don't show the notice on the Helper screens.
|
||||
if ( 'woocommerce_page_wc-addons' == $screen_id && ! empty( $_REQUEST['section'] ) && 'helper' == $_REQUEST['section'] ) {
|
||||
$screens = wc_get_screen_ids();
|
||||
$screens[] = 'plugins';
|
||||
|
||||
if ( ! in_array( $screen_id, $screens, true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We believe have an active connection.
|
||||
// Don't show the notice on the Helper screens.
|
||||
$screen_addons = sanitize_title( __( 'WooCommerce', 'woocommerce' ) ) . '_page_wc-addons';
|
||||
|
||||
if ( $screen_addons === $screen_id && ! empty( $_REQUEST['section'] ) && 'helper' === $_REQUEST['section'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We believe we have an active connection.
|
||||
$auth = WC_Helper_Options::get( 'auth' );
|
||||
if ( ! empty( $auth['access_token'] ) ) {
|
||||
return;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -459,9 +459,11 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
|
|||
<tbody>';
|
||||
|
||||
foreach ( $line_items as $item_id => $item ) {
|
||||
$product_object = is_callable( array( $item, 'get_product' ) ) ? $item->get_product() : null;
|
||||
|
||||
$html .= '<tr class="wc-order-preview-table__item wc-order-preview-table__item--' . esc_attr( $item_id ) . '">';
|
||||
$product_object = is_callable( array( $item, 'get_product' ) ) ? $item->get_product() : null;
|
||||
$row_class = apply_filters( 'woocommerce_admin_html_order_preview_item_class', '', $item, $order );
|
||||
|
||||
$html .= '<tr class="wc-order-preview-table__item wc-order-preview-table__item--' . esc_attr( $item_id ) . ( $row_class ? ' ' . esc_attr( $row_class ) : '' ) . '">';
|
||||
|
||||
foreach ( $columns as $column => $label ) {
|
||||
$html .= '<td class="wc-order-preview-table__column--' . esc_attr( $column ) . '">';
|
||||
|
@ -710,7 +712,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…', '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
|
||||
|
|
|
@ -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">–</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">–</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,9 +403,8 @@ 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' === $vars['orderby'] ) {
|
||||
if ( 'price' === $query_vars['orderby'] ) {
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars = array_merge( $query_vars, array(
|
||||
'meta_key' => '_price',
|
||||
|
@ -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 ( isset( $query_vars['s'] ) ) {
|
||||
$data_store = WC_Data_Store::load( 'product' );
|
||||
$ids = $data_store->search_products( wc_clean( $query_vars['s'] ), '', 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.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,25 +105,32 @@ if ( wc_tax_enabled() ) {
|
|||
<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>
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
/**
|
||||
* Linked product options.
|
||||
*
|
||||
* @package WooCommerce/admin
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<div id="linked_product_data" class="panel woocommerce_options_panel hidden">
|
||||
|
||||
|
@ -10,16 +14,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<label for="grouped_products"><?php esc_html_e( 'Grouped products', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="grouped_products" name="grouped_products[]" data-sortable="true" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_children( 'edit' );
|
||||
$product_ids = $product_object->is_type( 'grouped' ) ? $product_object->get_children( 'edit' ) : array();
|
||||
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select> <?php echo wc_help_tip( __( 'This lets you choose which products are part of this group.', 'woocommerce' ) ); ?>
|
||||
</select> <?php echo wc_help_tip( __( 'This lets you choose which products are part of this group.', 'woocommerce' ) ); // WPCS: XSS ok. ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -28,32 +32,32 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<label for="upsell_ids"><?php esc_html_e( 'Upsells', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="upsell_ids" name="upsell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_upsell_ids( 'edit' );
|
||||
$product_ids = $product_object->get_upsell_ids( 'edit' );
|
||||
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select> <?php echo wc_help_tip( __( 'Upsells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce' ) ); ?>
|
||||
</select> <?php echo wc_help_tip( __( 'Upsells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce' ) ); // WPCS: XSS ok. ?>
|
||||
</p>
|
||||
|
||||
<p class="form-field hide_if_grouped hide_if_external">
|
||||
<label for="crosssell_ids"><?php esc_html_e( 'Cross-sells', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="crosssell_ids" name="crosssell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_cross_sell_ids( 'edit' );
|
||||
$product_ids = $product_object->get_cross_sell_ids( 'edit' );
|
||||
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
foreach ( $product_ids as $product_id ) {
|
||||
$product = wc_get_product( $product_id );
|
||||
if ( is_object( $product ) ) {
|
||||
echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . wp_kses_post( $product->get_formatted_name() ) . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select> <?php echo wc_help_tip( __( 'Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce' ) ); ?>
|
||||
</select> <?php echo wc_help_tip( __( 'Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce' ) ); // WPCS: XSS ok. ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -54,9 +54,43 @@ class WC_Settings_Products extends WC_Settings_Page {
|
|||
|
||||
$settings = $this->get_settings( $current_section );
|
||||
|
||||
$this->product_display_settings_moved_notice();
|
||||
|
||||
WC_Admin_Settings::output_fields( $settings );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a notice showing where some options have moved.
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @todo remove in next major release.
|
||||
*/
|
||||
private function product_display_settings_moved_notice() {
|
||||
if ( get_user_meta( get_current_user_id(), 'dismissed_product_display_settings_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', 'product_display_settings_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 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(),
|
||||
),
|
||||
) );
|
||||
?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings.
|
||||
*/
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
) );
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
|
|||
break;
|
||||
}
|
||||
|
||||
// Increments the transient version to invalidate cache
|
||||
// Increments the transient version to invalidate cache.
|
||||
WC_Cache_Helper::get_transient_version( 'shipping', true );
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,9 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
$this->save_tax_rates();
|
||||
}
|
||||
|
||||
// Invalidate caches.
|
||||
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
|
||||
WC_Cache_Helper::get_transient_version( 'shipping', true );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,7 +59,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php endif; ?>
|
||||
<div class="wc-shipping-zone-postcodes">
|
||||
<textarea name="zone_postcodes" data-attribute="zone_postcodes" id="zone_postcodes" placeholder="<?php esc_attr_e( 'List 1 postcode per line', 'woocommerce' ); ?>" class="input-text large-text" cols="25" rows="5"><?php echo esc_textarea( implode( "\n", $postcodes ) ); ?></textarea>
|
||||
<span class="description"><?php esc_html_e( 'Postcodes containing wildcards (e.g. CB23*) and fully numeric ranges (e.g. <code>90210...99000</code>) are also supported.', 'woocommerce' ) ?></span>
|
||||
<?php /* translators: WooCommerce link to setting up shipping zones */ ?>
|
||||
<span class="description"><?php sprintf( _e( 'Postcodes containing wildcards (e.g. CB23*) or fully numeric ranges (e.g. <code>90210...99000</code>) are also supported. Please see the shipping zones <a href="%s" target="_blank">documentation</a>) for more information.', 'woocommerce' ), 'https://docs.woocommerce.com/document/setting-up-shipping-zones/#section-3' ); ?></span><?php // @codingStandardsIgnoreLine. ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
<?php
|
||||
/**
|
||||
* REST API Network Orders controller
|
||||
*
|
||||
* Handles requests to the /orders/network endpoint
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 3.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* REST API Network Orders controller class.
|
||||
*
|
||||
* @package WooCommerce/API
|
||||
* @extends WC_REST_Orders_Controller
|
||||
*/
|
||||
class WC_REST_Network_Orders_Controller extends WC_REST_Orders_Controller {
|
||||
|
||||
/**
|
||||
* Register the routes for network orders.
|
||||
*/
|
||||
public function register_routes() {
|
||||
if ( is_multisite() ) {
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/network', array(
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'network_orders' ),
|
||||
'permission_callback' => array( $this, 'network_orders_permissions_check' ),
|
||||
'args' => $this->get_collection_params(),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the item's schema for display / public consumption purposes.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array Public item schema data.
|
||||
*/
|
||||
public function get_public_item_schema() {
|
||||
$schema = parent::get_public_item_schema();
|
||||
|
||||
$schema['properties']['blog'] = array(
|
||||
'description' => __( 'Blog id of the record on the multisite.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
);
|
||||
$schema['properties']['edit_url'] = array(
|
||||
'description' => __( 'URL to edit the order', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
);
|
||||
$schema['properties']['customer'][] = array(
|
||||
'description' => __( 'Name of the customer for the order', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
);
|
||||
$schema['properties']['status_name'][] = array(
|
||||
'description' => __( 'Order Status', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
);
|
||||
$schema['properties']['formatted_total'][] = array(
|
||||
'description' => __( 'Order total formatted for locale', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view' ),
|
||||
'readonly' => true,
|
||||
);
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a permissions check for the proper requested blog
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
*
|
||||
* @return bool $permission
|
||||
*/
|
||||
public function network_orders_permissions_check( $request ) {
|
||||
$blog_id = $request->get_param( 'blog_id' );
|
||||
$blog_id = ! empty( $blog_id ) ? $blog_id : get_current_blog_id();
|
||||
|
||||
switch_to_blog( $blog_id );
|
||||
|
||||
$permission = $this->get_items_permissions_check( $request );
|
||||
|
||||
restore_current_blog();
|
||||
|
||||
return $permission;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a collection of orders from the requested blog id
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
*
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function network_orders( $request ) {
|
||||
$blog_id = $request->get_param( 'blog_id' );
|
||||
$blog_id = ! empty( $blog_id ) ? $blog_id : get_current_blog_id();
|
||||
|
||||
switch_to_blog( $blog_id );
|
||||
|
||||
add_filter( 'woocommerce_rest_orders_prepare_object_query', array( $this, 'network_orders_filter_args' ) );
|
||||
$items = $this->get_items( $request );
|
||||
remove_filter( 'woocommerce_rest_orders_prepare_object_query', array( $this, 'network_orders_filter_args' ) );
|
||||
|
||||
foreach ( $items->data as &$current_order ) {
|
||||
$order = wc_get_order( $current_order['id'] );
|
||||
|
||||
$current_order['blog'] = get_blog_details( get_current_blog_id() );
|
||||
$current_order['edit_url'] = get_admin_url( $blog_id, 'post.php?post=' . absint( $order->get_id() ) . '&action=edit' );
|
||||
/* translators: 1: first name 2: last name */
|
||||
$current_order['customer'] = trim( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $order->get_billing_first_name(), $order->get_billing_last_name() ) );
|
||||
$current_order['status_name'] = wc_get_order_status_name( $order->get_status() );
|
||||
$current_order['formatted_total'] = $order->get_formatted_order_total();
|
||||
}
|
||||
|
||||
restore_current_blog();
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the post statuses to on hold and processing for the network order query.
|
||||
*
|
||||
* @param array $args Query args.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function network_orders_filter_args( $args ) {
|
||||
$args['post_status'] = array(
|
||||
'wc-on-hold',
|
||||
'wc-processing',
|
||||
);
|
||||
|
||||
return $args;
|
||||
}
|
||||
}
|
|
@ -4,8 +4,6 @@
|
|||
*
|
||||
* Handles requests to the /orders/<order_id>/refunds endpoint.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.6.0
|
||||
*/
|
||||
|
@ -45,6 +43,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
|
||||
/**
|
||||
* Stores the request.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $request = array();
|
||||
|
@ -60,61 +59,65 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
* Register the routes for order refunds.
|
||||
*/
|
||||
public function register_routes() {
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base, array(
|
||||
'args' => array(
|
||||
'order_id' => array(
|
||||
'description' => __( 'The order ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_items' ),
|
||||
'permission_callback' => array( $this, 'get_items_permissions_check' ),
|
||||
'args' => $this->get_collection_params(),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::CREATABLE,
|
||||
'callback' => array( $this, 'create_item' ),
|
||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
) );
|
||||
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
|
||||
'args' => array(
|
||||
'order_id' => array(
|
||||
'description' => __( 'The order ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::DELETABLE,
|
||||
'callback' => array( $this, 'delete_item' ),
|
||||
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'force' => array(
|
||||
'default' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Required to be true, as resource does not support trashing.', 'woocommerce' ),
|
||||
register_rest_route(
|
||||
$this->namespace, '/' . $this->rest_base, array(
|
||||
'args' => array(
|
||||
'order_id' => array(
|
||||
'description' => __( 'The order ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
) );
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_items' ),
|
||||
'permission_callback' => array( $this, 'get_items_permissions_check' ),
|
||||
'args' => $this->get_collection_params(),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::CREATABLE,
|
||||
'callback' => array( $this, 'create_item' ),
|
||||
'permission_callback' => array( $this, 'create_item_permissions_check' ),
|
||||
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
|
||||
register_rest_route(
|
||||
$this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
|
||||
'args' => array(
|
||||
'order_id' => array(
|
||||
'description' => __( 'The order ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'methods' => WP_REST_Server::DELETABLE,
|
||||
'callback' => array( $this, 'delete_item' ),
|
||||
'permission_callback' => array( $this, 'delete_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'force' => array(
|
||||
'default' => true,
|
||||
'type' => 'boolean',
|
||||
'description' => __( 'Required to be true, as resource does not support trashing.', 'woocommerce' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
'schema' => array( $this, 'get_public_item_schema' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,15 +227,15 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
* @return array Links for the given post.
|
||||
*/
|
||||
protected function prepare_links( $object, $request ) {
|
||||
$base = str_replace( '(?P<order_id>[\d]+)', $object->get_parent_id(), $this->rest_base );
|
||||
$links = array(
|
||||
'self' => array(
|
||||
$base = str_replace( '(?P<order_id>[\d]+)', $object->get_parent_id(), $this->rest_base );
|
||||
$links = array(
|
||||
'self' => array(
|
||||
'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $base, $object->get_id() ) ),
|
||||
),
|
||||
'collection' => array(
|
||||
'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $base ) ),
|
||||
),
|
||||
'up' => array(
|
||||
'up' => array(
|
||||
'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $object->get_parent_id() ) ),
|
||||
),
|
||||
);
|
||||
|
@ -276,14 +279,15 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
}
|
||||
|
||||
// Create the refund.
|
||||
$refund = wc_create_refund( array(
|
||||
'order_id' => $order->get_id(),
|
||||
'amount' => $request['amount'],
|
||||
'reason' => empty( $request['reason'] ) ? null : $request['reason'],
|
||||
'line_items' => $request['line_items'],
|
||||
'refund_payment' => is_bool( $request['api_refund'] ) ? $request['api_refund'] : true,
|
||||
'restock_items' => true,
|
||||
) );
|
||||
$refund = wc_create_refund(
|
||||
array(
|
||||
'order_id' => $order->get_id(),
|
||||
'amount' => $request['amount'],
|
||||
'reason' => empty( $request['reason'] ) ? null : $request['reason'],
|
||||
'refund_payment' => is_bool( $request['api_refund'] ) ? $request['api_refund'] : true,
|
||||
'restock_items' => true,
|
||||
)
|
||||
);
|
||||
|
||||
if ( is_wp_error( $refund ) ) {
|
||||
return new WP_Error( 'woocommerce_rest_cannot_create_order_refund', $refund->get_error_message(), 500 );
|
||||
|
@ -348,53 +352,53 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
'title' => $this->post_type,
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'date_created' => array(
|
||||
'date_created' => array(
|
||||
'description' => __( "The date the order refund was created, in the site's timezone.", 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'date_created_gmt' => array(
|
||||
'description' => __( "The date the order refund was created, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the order refund was created, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'amount' => array(
|
||||
'amount' => array(
|
||||
'description' => __( 'Refund amount.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'reason' => array(
|
||||
'reason' => array(
|
||||
'description' => __( 'Reason for refund.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'refunded_by' => array(
|
||||
'refunded_by' => array(
|
||||
'description' => __( 'User ID of user who created the refund.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'meta_data' => array(
|
||||
'meta_data' => array(
|
||||
'description' => __( 'Meta data.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Meta ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'key' => array(
|
||||
'key' => array(
|
||||
'description' => __( 'Meta key.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
@ -407,48 +411,55 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
),
|
||||
),
|
||||
),
|
||||
'line_items' => array(
|
||||
'line_items' => array(
|
||||
'description' => __( 'Line items data.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Item ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'name' => array(
|
||||
'name' => array(
|
||||
'description' => __( 'Product name.', 'woocommerce' ),
|
||||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'product_id' => array(
|
||||
'product_id' => array(
|
||||
'description' => __( 'Product ID.', 'woocommerce' ),
|
||||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'variation_id' => array(
|
||||
'description' => __( 'Variation ID, if applicable.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'quantity' => array(
|
||||
'quantity' => array(
|
||||
'description' => __( 'Quantity ordered.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'tax_class' => array(
|
||||
'tax_class' => array(
|
||||
'description' => __( 'Tax class of product.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'subtotal' => array(
|
||||
'subtotal' => array(
|
||||
'description' => __( 'Line subtotal (before discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'subtotal_tax' => array(
|
||||
'description' => __( 'Line subtotal tax (before discounts).', 'woocommerce' ),
|
||||
|
@ -456,18 +467,19 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'total' => array(
|
||||
'total' => array(
|
||||
'description' => __( 'Line total (after discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'total_tax' => array(
|
||||
'total_tax' => array(
|
||||
'description' => __( 'Line total tax (after discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'taxes' => array(
|
||||
'taxes' => array(
|
||||
'description' => __( 'Line taxes.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
@ -475,57 +487,63 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Tax rate ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'total' => array(
|
||||
'total' => array(
|
||||
'description' => __( 'Tax total.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'subtotal' => array(
|
||||
'description' => __( 'Tax subtotal.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'meta_data' => array(
|
||||
'meta_data' => array(
|
||||
'description' => __( 'Meta data.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Meta ID.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'key' => array(
|
||||
'key' => array(
|
||||
'description' => __( 'Meta key.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'value' => array(
|
||||
'description' => __( 'Meta value.', 'woocommerce' ),
|
||||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'sku' => array(
|
||||
'sku' => array(
|
||||
'description' => __( 'Product SKU.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'price' => array(
|
||||
'price' => array(
|
||||
'description' => __( 'Product price.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
@ -534,7 +552,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
),
|
||||
),
|
||||
),
|
||||
'api_refund' => array(
|
||||
'api_refund' => array(
|
||||
'description' => __( 'When true, the payment gateway API is used to generate the refund.', 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'context' => array( 'edit' ),
|
||||
|
|
|
@ -391,6 +391,16 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query arguments for a request.
|
||||
*
|
||||
* Enables adding extra arguments or setting defaults for an order collection request.
|
||||
*
|
||||
* @param array $args Key value array of query var to query value.
|
||||
* @param WP_REST_Request $request The request used.
|
||||
*/
|
||||
$args = apply_filters( 'woocommerce_rest_orders_prepare_object_query', $args, $request );
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
|
|
|
@ -674,7 +674,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to_gmt' => array(
|
||||
'description' => __( "End date of sale price, in the site's timezone.", 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -49,7 +49,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
) );
|
||||
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\w-]+)', array(
|
||||
'args' => array(
|
||||
'args' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
|
@ -117,67 +117,67 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
*/
|
||||
public function get_tools() {
|
||||
$tools = array(
|
||||
'clear_transients' => array(
|
||||
'name' => __( 'WooCommerce transients', 'woocommerce' ),
|
||||
'button' => __( 'Clear transients', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will clear the product/shop transients cache.', 'woocommerce' ),
|
||||
'clear_transients' => array(
|
||||
'name' => __( 'WooCommerce transients', 'woocommerce' ),
|
||||
'button' => __( 'Clear transients', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will clear the product/shop transients cache.', 'woocommerce' ),
|
||||
),
|
||||
'clear_expired_transients' => array(
|
||||
'name' => __( 'Expired transients', 'woocommerce' ),
|
||||
'button' => __( 'Clear transients', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will clear ALL expired transients from WordPress.', 'woocommerce' ),
|
||||
'clear_expired_transients' => array(
|
||||
'name' => __( 'Expired transients', 'woocommerce' ),
|
||||
'button' => __( 'Clear transients', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will clear ALL expired transients from WordPress.', 'woocommerce' ),
|
||||
),
|
||||
'delete_orphaned_variations' => array(
|
||||
'name' => __( 'Orphaned variations', 'woocommerce' ),
|
||||
'button' => __( 'Delete orphaned variations', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will delete all variations which have no parent.', 'woocommerce' ),
|
||||
'name' => __( 'Orphaned variations', 'woocommerce' ),
|
||||
'button' => __( 'Delete orphaned variations', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will delete all variations which have no parent.', 'woocommerce' ),
|
||||
),
|
||||
'add_order_indexes' => array(
|
||||
'name' => __( 'Order address indexes', 'woocommerce' ),
|
||||
'button' => __( 'Index orders', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will add address indexes to orders that do not have them yet. This improves order search results.', 'woocommerce' ),
|
||||
'add_order_indexes' => array(
|
||||
'name' => __( 'Order address indexes', 'woocommerce' ),
|
||||
'button' => __( 'Index orders', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will add address indexes to orders that do not have them yet. This improves order search results.', 'woocommerce' ),
|
||||
),
|
||||
'recount_terms' => array(
|
||||
'name' => __( 'Term counts', 'woocommerce' ),
|
||||
'button' => __( 'Recount terms', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.', 'woocommerce' ),
|
||||
'recount_terms' => array(
|
||||
'name' => __( 'Term counts', 'woocommerce' ),
|
||||
'button' => __( 'Recount terms', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.', 'woocommerce' ),
|
||||
),
|
||||
'reset_roles' => array(
|
||||
'name' => __( 'Capabilities', 'woocommerce' ),
|
||||
'button' => __( 'Reset capabilities', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.', 'woocommerce' ),
|
||||
'reset_roles' => array(
|
||||
'name' => __( 'Capabilities', 'woocommerce' ),
|
||||
'button' => __( 'Reset capabilities', 'woocommerce' ),
|
||||
'desc' => __( 'This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.', 'woocommerce' ),
|
||||
),
|
||||
'clear_sessions' => array(
|
||||
'name' => __( 'Clear customer sessions', 'woocommerce' ),
|
||||
'button' => __( 'Clear', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'clear_sessions' => array(
|
||||
'name' => __( 'Clear customer sessions', 'woocommerce' ),
|
||||
'button' => __( 'Clear', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'<strong class="red">%1$s</strong> %2$s',
|
||||
__( 'Note:', 'woocommerce' ),
|
||||
__( 'This tool will delete all customer session data from the database, including any current live carts.', 'woocommerce' )
|
||||
__( 'This tool will delete all customer session data from the database, including current carts and saved carts in the database.', 'woocommerce' )
|
||||
),
|
||||
),
|
||||
'install_pages' => array(
|
||||
'name' => __( 'Create default WooCommerce pages', 'woocommerce' ),
|
||||
'button' => __( 'Create pages', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'install_pages' => array(
|
||||
'name' => __( 'Create default WooCommerce pages', 'woocommerce' ),
|
||||
'button' => __( 'Create pages', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'<strong class="red">%1$s</strong> %2$s',
|
||||
__( 'Note:', 'woocommerce' ),
|
||||
__( 'This tool will install all the missing WooCommerce pages. Pages already defined and set up will not be replaced.', 'woocommerce' )
|
||||
),
|
||||
),
|
||||
'delete_taxes' => array(
|
||||
'name' => __( 'Delete WooCommerce tax rates', 'woocommerce' ),
|
||||
'button' => __( 'Delete tax rates', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'delete_taxes' => array(
|
||||
'name' => __( 'Delete WooCommerce tax rates', 'woocommerce' ),
|
||||
'button' => __( 'Delete tax rates', 'woocommerce' ),
|
||||
'desc' => sprintf(
|
||||
'<strong class="red">%1$s</strong> %2$s',
|
||||
__( 'Note:', 'woocommerce' ),
|
||||
__( 'This option will delete ALL of your tax rates, use with caution. This action cannot be reversed.', 'woocommerce' )
|
||||
),
|
||||
),
|
||||
'reset_tracking' => array(
|
||||
'name' => __( 'Reset usage tracking', 'woocommerce' ),
|
||||
'button' => __( 'Reset', 'woocommerce' ),
|
||||
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
|
||||
'reset_tracking' => array(
|
||||
'name' => __( 'Reset usage tracking', 'woocommerce' ),
|
||||
'button' => __( 'Reset', 'woocommerce' ),
|
||||
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -227,6 +227,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
|
||||
/**
|
||||
* Update (execute) a tool.
|
||||
*
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -238,14 +239,22 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
|
||||
$tool = $tools[ $request['id'] ];
|
||||
$tool = array(
|
||||
'id' => $request['id'],
|
||||
'name' => $tool['name'],
|
||||
'action' => $tool['button'],
|
||||
'description' => $tool['desc'],
|
||||
'id' => $request['id'],
|
||||
'name' => $tool['name'],
|
||||
'action' => $tool['button'],
|
||||
'description' => $tool['desc'],
|
||||
);
|
||||
|
||||
$execute_return = $this->execute_tool( $request['id'] );
|
||||
$tool = array_merge( $tool, $execute_return );
|
||||
$tool = array_merge( $tool, $execute_return );
|
||||
|
||||
/**
|
||||
* Fires after a WooCommerce REST system status tool has been executed.
|
||||
*
|
||||
* @param array $tool Details about the tool that has been executed.
|
||||
* @param WP_REST_Request $request The current WP_REST_Request object.
|
||||
*/
|
||||
do_action( 'woocommerce_rest_insert_system_status_tool', $tool, $request );
|
||||
|
||||
$request->set_param( 'context', 'edit' );
|
||||
$response = $this->prepare_item_for_response( $tool, $request );
|
||||
|
@ -255,8 +264,8 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare a tool item for serialization.
|
||||
*
|
||||
* @param array $item Object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @param array $item Object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response $response Response data.
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
|
@ -282,48 +291,48 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
'title' => 'system_status_tool',
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'A unique identifier for the tool.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'id' => array(
|
||||
'description' => __( 'A unique identifier for the tool.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_title',
|
||||
),
|
||||
),
|
||||
'name' => array(
|
||||
'description' => __( 'Tool name.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'name' => array(
|
||||
'description' => __( 'Tool name.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
'action' => array(
|
||||
'description' => __( 'What running the tool will do.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'action' => array(
|
||||
'description' => __( 'What running the tool will do.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
'description' => array(
|
||||
'description' => __( 'Tool description.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'description' => array(
|
||||
'description' => __( 'Tool description.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
'success' => array(
|
||||
'description' => __( 'Did the tool run successfully?', 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'context' => array( 'edit' ),
|
||||
'success' => array(
|
||||
'description' => __( 'Did the tool run successfully?', 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
'message' => array(
|
||||
'description' => __( 'Tool return message.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
'arg_options' => array(
|
||||
'message' => array(
|
||||
'description' => __( 'Tool return message.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
),
|
||||
),
|
||||
|
@ -372,31 +381,34 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
global $wpdb;
|
||||
$ran = true;
|
||||
switch ( $tool ) {
|
||||
case 'clear_transients' :
|
||||
case 'clear_transients':
|
||||
wc_delete_product_transients();
|
||||
wc_delete_shop_order_transients();
|
||||
WC_Cache_Helper::get_transient_version( 'shipping', true );
|
||||
$message = __( 'Product transients cleared', 'woocommerce' );
|
||||
break;
|
||||
case 'clear_expired_transients' :
|
||||
break;
|
||||
|
||||
case 'clear_expired_transients':
|
||||
$message = sprintf( __( '%d transients rows cleared', 'woocommerce' ), wc_delete_expired_transients() );
|
||||
break;
|
||||
case 'delete_orphaned_variations' :
|
||||
break;
|
||||
|
||||
case 'delete_orphaned_variations':
|
||||
/**
|
||||
* Delete orphans
|
||||
*/
|
||||
$result = absint( $wpdb->query( "DELETE products
|
||||
$result = absint( $wpdb->query( "DELETE products
|
||||
FROM {$wpdb->posts} products
|
||||
LEFT JOIN {$wpdb->posts} wp ON wp.ID = products.post_parent
|
||||
WHERE wp.ID IS NULL AND products.post_type = 'product_variation';" ) );
|
||||
$message = sprintf( __( '%d orphaned variations deleted', 'woocommerce' ), $result );
|
||||
break;
|
||||
case 'add_order_indexes' :
|
||||
break;
|
||||
|
||||
case 'add_order_indexes':
|
||||
/**
|
||||
* Add billing and shipping address indexes containing the customer name for orders
|
||||
* that don't have address indexes yet.
|
||||
*/
|
||||
$sql = "INSERT INTO {$wpdb->postmeta}( post_id, meta_key, meta_value )
|
||||
$sql = "INSERT INTO {$wpdb->postmeta}( post_id, meta_key, meta_value )
|
||||
SELECT post_id, '%s', GROUP_CONCAT( meta_value SEPARATOR ' ' )
|
||||
FROM {$wpdb->postmeta}
|
||||
WHERE meta_key IN ( '%s', '%s' )
|
||||
|
@ -404,56 +416,69 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
WHERE post_id NOT IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='%s' )
|
||||
AND post_id IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='%s' ) )
|
||||
GROUP BY post_id";
|
||||
$rows = $wpdb->query( $wpdb->prepare( $sql, '_billing_address_index', '_billing_first_name', '_billing_last_name', '_billing_address_index', '_billing_last_name' ) );
|
||||
$rows += $wpdb->query( $wpdb->prepare( $sql, '_shipping_address_index', '_shipping_first_name', '_shipping_last_name', '_shipping_address_index', '_shipping_last_name') );
|
||||
$rows = $wpdb->query( $wpdb->prepare( $sql, '_billing_address_index', '_billing_first_name', '_billing_last_name', '_billing_address_index', '_billing_last_name' ) );
|
||||
$rows += $wpdb->query( $wpdb->prepare( $sql, '_shipping_address_index', '_shipping_first_name', '_shipping_last_name', '_shipping_address_index', '_shipping_last_name' ) );
|
||||
|
||||
$message = sprintf( __( '%d indexes added', 'woocommerce' ), $rows );
|
||||
break;
|
||||
case 'reset_roles' :
|
||||
break;
|
||||
|
||||
case 'reset_roles':
|
||||
// Remove then re-add caps and roles
|
||||
WC_Install::remove_roles();
|
||||
WC_Install::create_roles();
|
||||
$message = __( 'Roles successfully reset', 'woocommerce' );
|
||||
break;
|
||||
case 'recount_terms' :
|
||||
$product_cats = get_terms( 'product_cat', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
||||
break;
|
||||
|
||||
case 'recount_terms':
|
||||
$product_cats = get_terms( 'product_cat', array(
|
||||
'hide_empty' => false,
|
||||
'fields' => 'id=>parent',
|
||||
) );
|
||||
_wc_term_recount( $product_cats, get_taxonomy( 'product_cat' ), true, false );
|
||||
$product_tags = get_terms( 'product_tag', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
||||
$product_tags = get_terms( 'product_tag', array(
|
||||
'hide_empty' => false,
|
||||
'fields' => 'id=>parent',
|
||||
) );
|
||||
_wc_term_recount( $product_tags, get_taxonomy( 'product_tag' ), true, false );
|
||||
$message = __( 'Terms successfully recounted', 'woocommerce' );
|
||||
break;
|
||||
case 'clear_sessions' :
|
||||
break;
|
||||
|
||||
case 'clear_sessions':
|
||||
$wpdb->query( "TRUNCATE {$wpdb->prefix}woocommerce_sessions" );
|
||||
$result = absint( $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key='_woocommerce_persistent_cart_" . get_current_blog_id() . "';" ) );
|
||||
wp_cache_flush();
|
||||
$message = __( 'Sessions successfully cleared', 'woocommerce' );
|
||||
break;
|
||||
case 'install_pages' :
|
||||
$message = sprintf( __( 'Deleted all active sessions, and %d saved carts.', 'woocommerce' ), absint( $result ) );
|
||||
break;
|
||||
|
||||
case 'install_pages':
|
||||
WC_Install::create_pages();
|
||||
$message = __( 'All missing WooCommerce pages successfully installed', 'woocommerce' );
|
||||
break;
|
||||
case 'delete_taxes' :
|
||||
break;
|
||||
|
||||
case 'delete_taxes':
|
||||
$wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}woocommerce_tax_rates;" );
|
||||
$wpdb->query( "TRUNCATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations;" );
|
||||
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
|
||||
$message = __( 'Tax rates successfully deleted', 'woocommerce' );
|
||||
break;
|
||||
case 'reset_tracking' :
|
||||
break;
|
||||
|
||||
case 'reset_tracking':
|
||||
delete_option( 'woocommerce_allow_tracking' );
|
||||
WC_Admin_Notices::add_notice( 'tracking' );
|
||||
$message = __( 'Usage tracking settings successfully reset.', 'woocommerce' );
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
|
||||
default:
|
||||
$tools = $this->get_tools();
|
||||
if ( isset( $tools[ $tool ]['callback'] ) ) {
|
||||
$callback = $tools[ $tool ]['callback'];
|
||||
$return = call_user_func( $callback );
|
||||
$return = call_user_func( $callback );
|
||||
if ( is_string( $return ) ) {
|
||||
$message = $return;
|
||||
} elseif ( false === $return ) {
|
||||
$callback_string = is_array( $callback ) ? get_class( $callback[0] ) . '::' . $callback[1] : $callback;
|
||||
$ran = false;
|
||||
$message = sprintf( __( 'There was an error calling %s', 'woocommerce' ), $callback_string );
|
||||
$ran = false;
|
||||
$message = sprintf( __( 'There was an error calling %s', 'woocommerce' ), $callback_string );
|
||||
} else {
|
||||
$message = __( 'Tool ran.', 'woocommerce' );
|
||||
}
|
||||
|
@ -461,9 +486,12 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
|||
$ran = false;
|
||||
$message = __( 'There was an error calling this tool. There is no callback present.', 'woocommerce' );
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return array( 'success' => $ran, 'message' => $message );
|
||||
return array(
|
||||
'success' => $ran,
|
||||
'message' => $message,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
*
|
||||
* Handles requests to the /webhooks endpoint.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.6.0
|
||||
*/
|
||||
|
@ -38,6 +36,11 @@ class WC_REST_Webhooks_Controller extends WC_REST_Webhooks_V1_Controller {
|
|||
*/
|
||||
public function prepare_item_for_response( $id, $request ) {
|
||||
$webhook = wc_get_webhook( $id );
|
||||
|
||||
if ( empty( $webhook ) || is_null( $webhook ) ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'ID is invalid.', 'woocommerce' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'id' => $webhook->get_id(),
|
||||
'name' => $webhook->get_name(),
|
||||
|
@ -148,7 +151,7 @@ class WC_REST_Webhooks_Controller extends WC_REST_Webhooks_V1_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'secret' => array(
|
||||
'description' => __( "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.", 'woocommerce' ),
|
||||
'description' => __( "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default to a MD5 hash from the current user's ID|username if not provided.", 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
|
|
|
@ -296,7 +296,6 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
|
|||
'order_id' => $order_data->ID,
|
||||
'amount' => $request['amount'],
|
||||
'reason' => empty( $request['reason'] ) ? null : $request['reason'],
|
||||
'line_items' => $request['line_items'],
|
||||
'refund_payment' => is_bool( $request['api_refund'] ) ? $request['api_refund'] : true,
|
||||
'restock_items' => true,
|
||||
) );
|
||||
|
@ -367,6 +366,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
|
|||
'description' => __( 'Line items data.', 'woocommerce' ),
|
||||
'type' => 'array',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
'items' => array(
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
|
@ -392,16 +392,19 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
|
|||
'description' => __( 'Product ID.', 'woocommerce' ),
|
||||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'variation_id' => array(
|
||||
'description' => __( 'Variation ID, if applicable.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'quantity' => array(
|
||||
'description' => __( 'Quantity ordered.', 'woocommerce' ),
|
||||
'type' => 'integer',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'tax_class' => array(
|
||||
'description' => __( 'Tax class of product.', 'woocommerce' ),
|
||||
|
@ -419,21 +422,25 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
|
|||
'description' => __( 'Line subtotal (before discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'subtotal_tax' => array(
|
||||
'description' => __( 'Line subtotal tax (before discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'total' => array(
|
||||
'description' => __( 'Line total (after discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'total_tax' => array(
|
||||
'description' => __( 'Line total tax (after discounts).', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
),
|
||||
'taxes' => array(
|
||||
'description' => __( 'Line taxes.', 'woocommerce' ),
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
*
|
||||
* Handles requests to the /webhooks endpoint.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -362,7 +360,7 @@ class WC_REST_Webhooks_V1_Controller extends WC_REST_Controller {
|
|||
$id = (int) $request['id'];
|
||||
$webhook = wc_get_webhook( $id );
|
||||
|
||||
if ( empty( $id ) || is_null( $webhook->get_id() ) ) {
|
||||
if ( empty( $webhook ) || is_null( $webhook ) ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'ID is invalid.', 'woocommerce' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
|
@ -521,12 +519,17 @@ class WC_REST_Webhooks_V1_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare a single webhook output for response.
|
||||
*
|
||||
* @param int $id Webhook ID.
|
||||
* @param int $id Webhook ID or object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response $response Response data.
|
||||
*/
|
||||
public function prepare_item_for_response( $id, $request ) {
|
||||
$webhook = wc_get_webhook( (int) $id );
|
||||
$webhook = wc_get_webhook( $id );
|
||||
|
||||
if ( empty( $webhook ) || is_null( $webhook ) ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'ID is invalid.', 'woocommerce' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'id' => $webhook->get_id(),
|
||||
'name' => $webhook->get_name(),
|
||||
|
@ -644,7 +647,7 @@ class WC_REST_Webhooks_V1_Controller extends WC_REST_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'secret' => array(
|
||||
'description' => __( "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default is a MD5 hash from the current user's ID|username if not provided.", 'woocommerce' ),
|
||||
'description' => __( "Secret key used to generate a hash of the delivered webhook and provided in the request headers. This will default to a MD5 hash from the current user's ID|username if not provided.", 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
|
|
|
@ -1455,17 +1455,19 @@ class WC_AJAX {
|
|||
wp_die();
|
||||
}
|
||||
|
||||
$ids = array();
|
||||
// Search by ID.
|
||||
if ( is_numeric( $term ) ) {
|
||||
$customer = new WC_Customer( intval( $term ) );
|
||||
|
||||
// Customer does not exists.
|
||||
if ( 0 === $customer->get_id() ) {
|
||||
wp_die();
|
||||
if ( 0 !== $customer->get_id() ) {
|
||||
$ids = array( $customer->get_id() );
|
||||
}
|
||||
}
|
||||
|
||||
$ids = array( $customer->get_id() );
|
||||
} else {
|
||||
// Usernames can be numeric so we first check that no users was found by ID before searching for numeric username, this prevents performance issues with ID lookups.
|
||||
if ( empty( $ids ) ) {
|
||||
$data_store = WC_Data_Store::load( 'customer' );
|
||||
|
||||
// If search is smaller than 3 characters, limit result set to avoid
|
||||
|
@ -2376,6 +2378,9 @@ class WC_AJAX {
|
|||
}
|
||||
}
|
||||
|
||||
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
|
||||
WC_Cache_Helper::get_transient_version( 'shipping', true );
|
||||
|
||||
wp_send_json_success( array(
|
||||
'rates' => WC_Tax::get_rates_for_tax_class( $current_class ),
|
||||
) );
|
||||
|
|
|
@ -175,6 +175,7 @@ class WC_API extends WC_Legacy_API {
|
|||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-customer-downloads-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-customers-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-orders-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-network-orders-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-order-notes-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-order-refunds-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-product-attribute-terms-controller.php' );
|
||||
|
@ -239,6 +240,7 @@ class WC_API extends WC_Legacy_API {
|
|||
'WC_REST_Coupons_Controller',
|
||||
'WC_REST_Customer_Downloads_Controller',
|
||||
'WC_REST_Customers_Controller',
|
||||
'WC_REST_Network_Orders_Controller',
|
||||
'WC_REST_Order_Notes_Controller',
|
||||
'WC_REST_Order_Refunds_Controller',
|
||||
'WC_REST_Orders_Controller',
|
||||
|
|
|
@ -2,31 +2,22 @@
|
|||
/**
|
||||
* Background Emailer
|
||||
*
|
||||
* Uses https://github.com/A5hleyRich/wp-background-processing to handle emails
|
||||
* in the background.
|
||||
*
|
||||
* @class WC_Background_Emailer
|
||||
* @version 3.0.1
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooCommerce
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_Async_Request', false ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/libraries/wp-async-request.php' );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_Background_Process', false ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/libraries/wp-background-process.php' );
|
||||
if ( ! class_exists( 'WC_Background_Process', false ) ) {
|
||||
include_once dirname( __FILE__ ) . '/abstracts/class-wc-background-process.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Background_Emailer Class.
|
||||
*/
|
||||
class WC_Background_Emailer extends WP_Background_Process {
|
||||
class WC_Background_Emailer extends WC_Background_Process {
|
||||
|
||||
/**
|
||||
* Initiate new background process.
|
||||
|
@ -59,7 +50,7 @@ class WC_Background_Emailer extends WP_Background_Process {
|
|||
* in the next pass through. Or, return false to remove the
|
||||
* item from the queue.
|
||||
*
|
||||
* @param array $callback Update callback function
|
||||
* @param array $callback Update callback function.
|
||||
* @return mixed
|
||||
*/
|
||||
protected function task( $callback ) {
|
||||
|
@ -68,7 +59,7 @@ class WC_Background_Emailer extends WP_Background_Process {
|
|||
WC_Emails::send_queued_transactional_email( $callback['filter'], $callback['args'] );
|
||||
} catch ( Exception $e ) {
|
||||
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||
trigger_error( 'Transactional email triggered fatal error for callback ' . $callback['filter'], E_USER_WARNING );
|
||||
trigger_error( 'Transactional email triggered fatal error for callback ' . esc_html( $callback['filter'] ), E_USER_WARNING );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +121,10 @@ class WC_Background_Emailer extends WP_Background_Process {
|
|||
if ( 'PHPSESSID' === $name ) {
|
||||
continue;
|
||||
}
|
||||
$cookies[] = new WP_Http_Cookie( array( 'name' => $name, 'value' => $value ) );
|
||||
$cookies[] = new WP_Http_Cookie( array(
|
||||
'name' => $name,
|
||||
'value' => $value,
|
||||
) );
|
||||
}
|
||||
|
||||
return array(
|
||||
|
|
|
@ -2,31 +2,22 @@
|
|||
/**
|
||||
* Background Updater
|
||||
*
|
||||
* Uses https://github.com/A5hleyRich/wp-background-processing to handle DB
|
||||
* updates in the background.
|
||||
*
|
||||
* @class WC_Background_Updater
|
||||
* @version 2.6.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_Async_Request', false ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/libraries/wp-async-request.php' );
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_Background_Process', false ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/libraries/wp-background-process.php' );
|
||||
if ( ! class_exists( 'WC_Background_Process', false ) ) {
|
||||
include_once dirname( __FILE__ ) . '/abstracts/class-wc-background-process.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Background_Updater Class.
|
||||
*/
|
||||
class WC_Background_Updater extends WP_Background_Process {
|
||||
class WC_Background_Updater extends WC_Background_Process {
|
||||
|
||||
/**
|
||||
* Initiate new background process.
|
||||
|
@ -88,6 +79,7 @@ class WC_Background_Updater extends WP_Background_Process {
|
|||
|
||||
/**
|
||||
* Is the updater running?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function is_updating() {
|
||||
|
@ -102,7 +94,7 @@ class WC_Background_Updater extends WP_Background_Process {
|
|||
* in the next pass through. Or, return false to remove the
|
||||
* item from the queue.
|
||||
*
|
||||
* @param string $callback Update callback function
|
||||
* @param string $callback Update callback function.
|
||||
* @return mixed
|
||||
*/
|
||||
protected function task( $callback ) {
|
||||
|
@ -110,7 +102,7 @@ class WC_Background_Updater extends WP_Background_Process {
|
|||
|
||||
$logger = wc_get_logger();
|
||||
|
||||
include_once( dirname( __FILE__ ) . '/wc-update-functions.php' );
|
||||
include_once dirname( __FILE__ ) . '/wc-update-functions.php';
|
||||
|
||||
if ( is_callable( $callback ) ) {
|
||||
$logger->info( sprintf( 'Running %s callback', $callback ), array( 'source' => 'wc_db_updates' ) );
|
||||
|
|
|
@ -118,14 +118,14 @@ class WC_Cache_Helper {
|
|||
/**
|
||||
* Get transient version.
|
||||
*
|
||||
* When using transients with unpredictable names, e.g. those containing an md5.
|
||||
* When using transients with unpredictable names, e.g. those containing an md5
|
||||
* hash in the name, we need a way to invalidate them all at once.
|
||||
*
|
||||
* When using default WP transients we're able to do this with a DB query to.
|
||||
* When using default WP transients we're able to do this with a DB query to
|
||||
* delete transients manually.
|
||||
*
|
||||
* With external cache however, this isn't possible. Instead, this function is used.
|
||||
* to append a unique string (based on time()) to each transient. When transients.
|
||||
* With external cache however, this isn't possible. Instead, this function is used
|
||||
* to append a unique string (based on time()) to each transient. When transients
|
||||
* are invalidated, the transient version will increment and data will be regenerated.
|
||||
*
|
||||
* Raised in issue https://github.com/woocommerce/woocommerce/issues/5777.
|
||||
|
|
|
@ -574,7 +574,11 @@ class WC_Discounts {
|
|||
*/
|
||||
protected function validate_coupon_user_usage_limit( $coupon, $user_id = 0 ) {
|
||||
if ( empty( $user_id ) ) {
|
||||
$user_id = get_current_user_id();
|
||||
if ( $this->object instanceof WC_Order ) {
|
||||
$user_id = $this->object->get_customer_id();
|
||||
} else {
|
||||
$user_id = get_current_user_id();
|
||||
}
|
||||
}
|
||||
|
||||
if ( $coupon && $user_id && $coupon->get_usage_limit_per_user() > 0 && $coupon->get_id() && $coupon->get_data_store() ) {
|
||||
|
|
|
@ -514,7 +514,7 @@ class WC_Form_Handler {
|
|||
$item_removed_title = apply_filters( 'woocommerce_cart_item_removed_title', $product ? sprintf( _x( '“%s”', 'Item name in quotes', 'woocommerce' ), $product->get_name() ) : __( 'Item', 'woocommerce' ), $cart_item );
|
||||
|
||||
// Don't show undo link if removed item is out of stock.
|
||||
if ( $product->is_in_stock() && $product->has_enough_stock( $cart_item['quantity'] ) ) {
|
||||
if ( $product && $product->is_in_stock() && $product->has_enough_stock( $cart_item['quantity'] ) ) {
|
||||
$removed_notice = sprintf( __( '%s removed.', 'woocommerce' ), $item_removed_title );
|
||||
$removed_notice .= ' <a href="' . esc_url( wc_get_cart_undo_url( $cart_item_key ) ) . '" class="restore-item">' . __( 'Undo?', 'woocommerce' ) . '</a>';
|
||||
} else {
|
||||
|
@ -877,17 +877,39 @@ class WC_Form_Handler {
|
|||
}
|
||||
}
|
||||
|
||||
// Gather posted attributes.
|
||||
$posted_attributes = array();
|
||||
|
||||
foreach ( $adding_to_cart->get_attributes() as $attribute ) {
|
||||
if ( ! $attribute['is_variation'] ) {
|
||||
continue;
|
||||
}
|
||||
$attribute_key = 'attribute_' . sanitize_title( $attribute['name'] );
|
||||
|
||||
if ( isset( $_REQUEST[ $attribute_key ] ) ) {
|
||||
if ( $attribute['is_taxonomy'] ) {
|
||||
// Don't use wc_clean as it destroys sanitized characters.
|
||||
$value = sanitize_title( wp_unslash( $_REQUEST[ $attribute_key ] ) );
|
||||
} else {
|
||||
$value = html_entity_decode( wc_clean( wp_unslash( $_REQUEST[ $attribute_key ] ) ), ENT_QUOTES, get_bloginfo( 'charset' ) ); // WPCS: sanitization ok.
|
||||
}
|
||||
|
||||
$posted_attributes[ $attribute_key ] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// If no variation ID is set, attempt to get a variation ID from posted attributes.
|
||||
if ( empty( $variation_id ) ) {
|
||||
$data_store = WC_Data_Store::load( 'product' );
|
||||
$variation_id = $data_store->find_matching_product_variation( $adding_to_cart, array_map( 'sanitize_title', wp_unslash( $_REQUEST ) ) );
|
||||
$variation_id = $data_store->find_matching_product_variation( $adding_to_cart, $posted_attributes );
|
||||
}
|
||||
|
||||
// Validate the attributes.
|
||||
// Do we have a variation ID?
|
||||
if ( empty( $variation_id ) ) {
|
||||
throw new Exception( __( 'Please choose product options…', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// Check the data we have is valid.
|
||||
$variation_data = wc_get_product_variation_attributes( $variation_id );
|
||||
|
||||
foreach ( $adding_to_cart->get_attributes() as $attribute ) {
|
||||
|
@ -896,28 +918,23 @@ class WC_Form_Handler {
|
|||
}
|
||||
|
||||
// Get valid value from variation data.
|
||||
$taxonomy = 'attribute_' . sanitize_title( $attribute['name'] );
|
||||
$valid_value = isset( $variation_data[ $taxonomy ] ) ? $variation_data[ $taxonomy ] : '';
|
||||
$attribute_key = 'attribute_' . sanitize_title( $attribute['name'] );
|
||||
$valid_value = isset( $variation_data[ $attribute_key ] ) ? $variation_data[ $attribute_key ]: '';
|
||||
|
||||
/**
|
||||
* If the attribute value was posted, check if it's valid.
|
||||
*
|
||||
* If no attribute was posted, only error if the variation has an 'any' attribute which requires a value.
|
||||
*/
|
||||
if ( isset( $_REQUEST[ $taxonomy ] ) ) {
|
||||
if ( $attribute['is_taxonomy'] ) {
|
||||
// Don't use wc_clean as it destroys sanitized characters.
|
||||
$value = sanitize_title( wp_unslash( $_REQUEST[ $taxonomy ] ) );
|
||||
} else {
|
||||
$value = html_entity_decode( wc_clean( wp_unslash( $_REQUEST[ $taxonomy ] ) ), ENT_QUOTES, get_bloginfo( 'charset' ) ); // WPCS: sanitization ok.
|
||||
}
|
||||
if ( isset( $posted_attributes[ $attribute_key ] ) ) {
|
||||
$value = $posted_attributes[ $attribute_key ];
|
||||
|
||||
// Allow if valid or show error.
|
||||
if ( $valid_value === $value ) {
|
||||
$variations[ $taxonomy ] = $value;
|
||||
$variations[ $attribute_key ] = $value;
|
||||
} elseif ( '' === $valid_value && in_array( $value, $attribute->get_slugs() ) ) {
|
||||
// If valid values are empty, this is an 'any' variation so get all possible values.
|
||||
$variations[ $taxonomy ] = $value;
|
||||
$variations[ $attribute_key ] = $value;
|
||||
} else {
|
||||
throw new Exception( sprintf( __( 'Invalid value posted for %s', 'woocommerce' ), wc_attribute_label( $attribute['name'] ) ) );
|
||||
}
|
||||
|
@ -933,7 +950,7 @@ class WC_Form_Handler {
|
|||
return false;
|
||||
}
|
||||
|
||||
$passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variations );
|
||||
$passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variations );
|
||||
|
||||
if ( $passed_validation && false !== WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variations ) ) {
|
||||
wc_add_to_cart_message( array( $product_id => $quantity ), true );
|
||||
|
|
|
@ -516,6 +516,7 @@ class WC_Frontend_Scripts {
|
|||
$params = array(
|
||||
'ajax_url' => WC()->ajax_url(),
|
||||
'wc_ajax_url' => WC_AJAX::get_endpoint( "%%endpoint%%" ),
|
||||
'cart_hash_key' => apply_filters( 'woocommerce_cart_hash_key', 'wc_cart_hash_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) ) ),
|
||||
'fragment_name' => apply_filters( 'woocommerce_cart_fragment_name', 'wc_fragments_' . md5( get_current_blog_id() . '_' . get_site_url( get_current_blog_id(), '/' ) ) ),
|
||||
);
|
||||
break;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
/**
|
||||
* Installation related functions and actions.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Classes
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
@ -100,6 +98,7 @@ class WC_Install {
|
|||
'wc_update_330_product_stock_status',
|
||||
'wc_update_330_set_default_product_cat',
|
||||
'wc_update_330_clear_transients',
|
||||
'wc_update_330_set_paypal_sandbox_credentials',
|
||||
'wc_update_330_db_version',
|
||||
),
|
||||
);
|
||||
|
@ -140,7 +139,7 @@ class WC_Install {
|
|||
* This check is done on all requests and runs if the versions do not match.
|
||||
*/
|
||||
public static function check_version() {
|
||||
if ( ! defined( 'IFRAME_REQUEST' ) && get_option( 'woocommerce_version' ) !== WC()->version ) {
|
||||
if ( ! defined( 'IFRAME_REQUEST' ) && version_compare( get_option( 'woocommerce_version' ), WC()->version, '<' ) ) {
|
||||
self::install();
|
||||
do_action( 'woocommerce_updated' );
|
||||
}
|
||||
|
|
|
@ -264,6 +264,11 @@ class WC_Post_types {
|
|||
$has_archive = false;
|
||||
}
|
||||
|
||||
// If theme support changes, we may need to flush permalinks since some are changed based on this flag.
|
||||
if ( update_option( 'current_theme_supports_woocommerce', current_theme_supports( 'woocommerce' ) ? 'yes' : 'no' ) ) {
|
||||
add_option( 'woocommerce_queue_flush_rewrite_rules', 'true' );
|
||||
}
|
||||
|
||||
register_post_type( 'product',
|
||||
apply_filters( 'woocommerce_register_post_type_product',
|
||||
array(
|
||||
|
@ -277,7 +282,6 @@ class WC_Post_types {
|
|||
'edit' => __( 'Edit', 'woocommerce' ),
|
||||
'edit_item' => __( 'Edit product', 'woocommerce' ),
|
||||
'new_item' => __( 'New product', 'woocommerce' ),
|
||||
'view' => __( 'View product', 'woocommerce' ),
|
||||
'view_item' => __( 'View product', 'woocommerce' ),
|
||||
'view_items' => __( 'View products', 'woocommerce' ),
|
||||
'search_items' => __( 'Search products', 'woocommerce' ),
|
||||
|
@ -337,7 +341,6 @@ class WC_Post_types {
|
|||
'edit' => __( 'Edit', 'woocommerce' ),
|
||||
'edit_item' => __( 'Edit order', 'woocommerce' ),
|
||||
'new_item' => __( 'New order', 'woocommerce' ),
|
||||
'view' => __( 'View order', 'woocommerce' ),
|
||||
'view_item' => __( 'View order', 'woocommerce' ),
|
||||
'search_items' => __( 'Search orders', 'woocommerce' ),
|
||||
'not_found' => __( 'No orders found', 'woocommerce' ),
|
||||
|
@ -400,7 +403,6 @@ class WC_Post_types {
|
|||
'edit' => __( 'Edit', 'woocommerce' ),
|
||||
'edit_item' => __( 'Edit coupon', 'woocommerce' ),
|
||||
'new_item' => __( 'New coupon', 'woocommerce' ),
|
||||
'view' => __( 'View coupons', 'woocommerce' ),
|
||||
'view_item' => __( 'View coupon', 'woocommerce' ),
|
||||
'search_items' => __( 'Search coupons', 'woocommerce' ),
|
||||
'not_found' => __( 'No coupons found', 'woocommerce' ),
|
||||
|
|
|
@ -71,7 +71,6 @@ class WC_Query {
|
|||
public function init_query_vars() {
|
||||
// Query vars to add to WP.
|
||||
$this->query_vars = array(
|
||||
'product-page' => '',
|
||||
// Checkout actions.
|
||||
'order-pay' => get_option( 'woocommerce_checkout_pay_endpoint', 'order-pay' ),
|
||||
'order-received' => get_option( 'woocommerce_checkout_order_received_endpoint', 'order-received' ),
|
||||
|
@ -277,14 +276,20 @@ class WC_Query {
|
|||
}
|
||||
}
|
||||
|
||||
// When orderby is set, WordPress shows posts. Get around that here.
|
||||
// When orderby is set, WordPress shows posts on the front-page. Get around that here.
|
||||
if ( $this->is_showing_page_on_front( $q ) && $this->page_on_front_is( wc_get_page_id( 'shop' ) ) ) {
|
||||
$_query = wp_parse_args( $q->query );
|
||||
if ( empty( $_query ) || ! array_diff( array_keys( $_query ), array( 'preview', 'page', 'paged', 'cpage', 'orderby' ) ) ) {
|
||||
$q->set( 'page_id', (int) get_option( 'page_on_front' ) );
|
||||
$q->is_page = true;
|
||||
$q->is_home = false;
|
||||
$q->set( 'page_id', (int) get_option( 'page_on_front' ) );
|
||||
$q->set( 'post_type', 'product' );
|
||||
|
||||
// WP supporting themes show post type archive.
|
||||
if ( current_theme_supports( 'woocommerce' ) ) {
|
||||
$q->set( 'post_type', 'product' );
|
||||
} else {
|
||||
$q->is_singular = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,8 +298,8 @@ class WC_Query {
|
|||
$q->is_comment_feed = false;
|
||||
}
|
||||
|
||||
// Special check for shops with the product archive on front.
|
||||
if ( $q->is_page() && 'page' === get_option( 'show_on_front' ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) {
|
||||
// Special check for shops with the PRODUCT POST TYPE ARCHIVE on front.
|
||||
if ( current_theme_supports( 'woocommerce' ) && $q->is_page() && 'page' === get_option( 'show_on_front' ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) {
|
||||
// This is a front-page shop.
|
||||
$q->set( 'post_type', 'product' );
|
||||
$q->set( 'page_id', '' );
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue