merge current master

This commit is contained in:
Ron Rennick 2020-08-13 14:33:07 -03:00
commit f0ad8a01be
822 changed files with 75420 additions and 14493 deletions

View File

@ -14,6 +14,7 @@ contributors.html
docker-compose.yaml
Dockerfile
Gruntfile.js
lerna.json
none
package-lock.json
package.json

43
.github/workflows/nightly-builds.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Nightly builds
on:
schedule:
- cron: '0 0 * * *' # Run at 12 AM UTC.
jobs:
build:
name: Nightly builds
strategy:
fail-fast: false
matrix:
build: [master]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ matrix.build }}
- name: Build
id: build
uses: woocommerce/action-build@master
with:
generate-zip: true
- name: Deploy nightly build
uses: WebFreak001/deploy-nightly@v1.0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/25945111/assets{?name,label}
release_id: 25945111
asset_path: ${{ steps.build.outputs.zip_path }}
asset_name: woocommerce-${{ matrix.build }}-nightly.zip
asset_content_type: application/zip
max_releases: 1
update:
name: Update nightly tag commit ref
runs-on: ubuntu-latest
steps:
- name: Update nightly tag
uses: richardsimko/github-tag-action@1.0.0
with:
tag_name: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -4,9 +4,8 @@ language: php
dist: xenial
cache:
directories:
- vendor
- $HOME/.composer/cache
directories:
- $HOME/.composer/cache
# Since Xenial services are not started by default, we need to instruct it below to start.
services:
@ -64,7 +63,7 @@ jobs:
- php: 7.4
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
before_script:
install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
# Remove Xdebug for a huge performance increase:
@ -80,7 +79,7 @@ before_script:
# Install WP Test suite, install PHPUnit globally:
if [[ ! -z "$WP_VERSION" ]]; then
bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=5.7.*|7.5.*"
composer global require "phpunit/phpunit=6.5.*|7.5.*"
fi
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"

View File

@ -1,5 +1,325 @@
== Changelog ==
= 4.4.0 - 2020-08-18 =
**WooCommerce**
* Accessibility: Adds alt attribute to photoswipe gallery images. #26945
* Enhancement - Remove the privacy page dropdown from the Accounts & Privacy page. #26809
* Enhancement - Added automatic language pack updates for WooCommerce.com extensions. #26750
* Enhancement - Improvements for the Hungarian address format. #26697
* Enhancement - Dropdown arrow width was made smaller. #26202
* Enhancement - Add a "No change" option to the "Stock status" selector in quick edit, preselect it when the product being edited is a variable product. #26174
* Enhancement - Don't request language packs for empty locales list. #27148
* Localization - Added 14 Namibia regions. #26894
* Localization - Change default Greek states names to English. #26719
* Localization - Improved Puerto Rico addresses and improve address formatting. #26698
* Localization - Wrapped price and currency inside a BDI tag, in order to prevent the bidirectional algorithm to produce confusing results. #26462
* Localization - Added Algerian provinces. #25687
* Tweak - Added "order_total" to the wcadmin_orders_edit_status_change tracker event. #26935
* Tweak - Fixed WooCommerce menu for users that can only manage orders on WooCommerce. #26877
* Tweak - Limit nocache headers to googleweblight by default. #26858
* Tweak - Preserve quantity input value when changing variations. #26805
* Tweak - Confirm before running any tool from the WooCommerce Status settings. #26660
* Tweak - Limit stock changes for order items to status methods for consistency. #26642
* Tweak - Custom vendor taxonomy update messages. #26634
* Tweak - Remove HTML tags from plain text email template for Customer new account. #26613
* Tweak - Conditionally change the text in My account to reflect if shipping is disabled. #26325
* Tweak - Show CSV file name in result message when product import is complete. #25240
* Tweak - Improve order details UI to highlight "Paid" and "Net Payment" sections. #27142
* Fix - Remove the dot after the generated password in new account emails. #27073
* Fix - Delayed the execution of all webhooks until after the request has completed. #27067
* Fix - [Importer/Exporter] Fixed the value display of "Published" for children of draft variable products. #27046
* Fix - Removed the extra id parameter added to CLI commands that shouldn't have one. #27017
* Fix - Added the missing instance_id to the REST CLI command so that shipping zone method commands will work. #27017
* Fix - Add rating_count to order by rating clause. #26964
* Fix - Don't show premium support forum link if the store is not connected to WooCommerce.com. #26932
* Fix - Incorrect capability used on add order note while creating an user note. #26920
* Fix - Preserve HTML entities from product names in the cart page. #26885
* Fix - Display warning hen leaving settings page without saving first. #26880
* Fix - Remove wc_round_tax_total from shipping tax because shipping prices never include tax so rounding down is not needed. #26850
* Fix - Make the "Please log in" message displayed to users with an existing account a hyperlink. #26837
* Fix - Typo in composer.json for makepot. #26829
* Fix - Layout issue on the checkout page when switching countries. #26697
* Fix - Missing closing select tag to the product exporter category select. #26680
* Fix - Possible PHP undefined index notice before WooCommerce has been configured. #26658
* Fix - A deferred product sync is now scheduled when a product having a parent (e.g. a variation product) is deleted, not only when it's saved. #26629
* Fix - Stock status of variable products that handle stock at the main product level is now appropriately updated when the product is saved. #26611
* Fix - Discounted prices are no longer underlined in Twenty Twenty. #26609
* Fix - Email link color clash. #26591
* Fix - Remove HTML from error message. #26589
* Fix - Fixed Tooltip flashing. #26558
* Fix - Correctly displays the instructional option as default in the select box for picking a Country / Region on the checkout page. #26554
* Fix - Default option "Select a country..." will now display accurately on Country select box in Cart shipping calculator. #26541
* Fix - Fixed user capability required to view the order count indicator. #26338
* Fix - The filtering widget now works as expected with variable products, displaying those products for which visible variations are available. #26260
* Fix - Added a z-index to the remove button (x) to set the z-order of the element. #26202
* Fix - Don't change the stock status of variations when bulk editing a variable product and leaving the "Stock status" selector as "No change". #26174
* Fix - Remove new WP 5.5 meta box arrows from "Order data" and "Order items" meta boxes. #27173
* Fix - After clicking to update WooCommerce, the user will stay in the same page instead of being redirected to the "Settings" page. #27172
* Fix - "Product type" dropdown missing from Product's data meta box on WP 5.5. #27170
* Fix - Removed the JETPACK_AUTOLOAD_DEV define. #27185
* Dev - Update WooCommerce Admin version to v1.4.0-beta.3. #27214
* Dev - Upgraded to the 2.x Jetpack Autoloader. #27123
* Dev - Update jest-preset-default version to ^6.2.0. #27090
* Dev - Added a second $existing_meta_keys parameter to the woocommerce_duplicate_product_exclude_meta filter. #27038
* Dev - Remove leftover note for translators in customer-completed-order.php. #26989
* Dev - Allow extend BACS accounts filter with order ID. #26961
* Dev - Add npm run build:packages to npm run build. #26906
* Dev - Add woocommerce_order_note_added action. #26846
* Dev - Add tests for template cache. #26840
* Dev - Add filter to allow disabling nocache headers. #26802
* Dev - Introduce a dependency injection framework for the code in the src directory. #26731
* Dev - Normalized parameters of woocommerce_product_importer_parsed_data filter. #26669
* Dev - Introduced new WC_Product_CSV_Importer::get_formatting_callback() fixing a typo in the method name. #26668
* Dev - Allow set "date_created" while creating orders via CRUD. #26567
* Dev - Allow set a custom as order key using wc_generate_order_key(). #26566
* Dev - Allow set order_key while creating an order via CRUD. #26565
* Dev - Introduced woocommerce_product_cross_sells_products_heading filter. #26545
* Dev - Added the removed_coupon_in_checkout event that is triggered on the Checkout page after a coupon is removed using .woocommerce-remove-coupon button. #26536
* Dev - Remove no longer used styles from TwentyTwenty. #26516
* Dev - Fix error message in wc_get_template() function. #26515
* Dev - Add npm publish script for @woocommerce/e2e-environment. #26432
* Dev - Make WC_Cart::display_prices_including_tax aware of tax display changes. #26400
* Dev - Deprecated WC_Legacy_Cart::tax_display_cart in favor of WC_Cart:: get_tax_price_display_mode(). #26400
* Dev - Add an optional $render_variations argument to in WC_Product_Variable::get_available_variation() in order to allow plugins to avoid performance bottlenecks. #26303
* Dev - Ensure wc_load_cart loads its own dependencies. #26219
* Dev - Clean up deprecated documentation. #27054
* Dev - Update WooCommerce Blocks version to 3.1.0. #27177
**REST API 1.0.11**
* Enhancement - Introduced X-WP-Total header for product attributes GET endpoint listing the number of entries in the response. woocommerce/woocommerce-rest-api#171
* Enhancement - Introduced X-WP-TotalPages header for product attributes GET endpoint listing the number of pages that can be fetched. woocommerce/woocommerce-rest-api#171
* Enhancement - Introduced the modified option for orderby fetch requests in post based resources. woocommerce/woocommerce-rest-api#226
* Fix - Ensured Action Scheduler transients are cleared by "Clear Transients" tool. woocommerce/woocommerce-rest-api#152
* Fix - Corrected the schema datatype for coupon expiry_date, date_expires, and date_expires_gmt fields. woocommerce/woocommerce-rest-api#176
* Fix - Query parameters are now passed correctly when using the batch product variation endpoints. woocommerce/woocommerce-rest-api#191
**WooCommerce Admin 1.4.0**
* Enhancement - Move the WooCommerce > Coupons dashboard menu item to Marketing > Coupons. #4786
* Fix - Installation of child theme zip files from the store setup wizard. #4852
* Fix - Center the skip link on the theme selection step. #4847
* Fix - Removed item "profiler" from the menu. #4851
* Fix - PHP notices when hosts block certain WP scripts. #4856
* Fix - Remove new WP 5.5 meta box arrows in the shipping banner. #4914
* Fix - Allow revisiting of the payments task. #4918
* Fix - Use of Jetpack autoloader. #4920
* Fix - Only show WCPay task in US based stores. #4899
* Fix - Polyfill core-data saveUser() on WP 5.3.x. #4869
* Fix - Product types step bugs in onboarding wizard. #4900
* Fix - Center all descriptive text on onboarding wizard steps. #4902
* Fix - Change account required text on biz step in onboarding wizard. #4909
* Dev - Add the experimental resolver to WCA data package. #4862
* Dev - Fix linter errors. #4904
**WooCommerce Blocks 3.0.0**
* Build - Updated the automattic/jetpack-autoloader package to the 2.0 branch. #2847
* Enhancement - Add support for the Bank Transfer (BACS) payment method in the Checkout block. #2821
* Enhancement - Several improvements to make Credit Card input fields display more consistent across different themes and viewport sizes. #2869
* Enhancement - Cart and Checkout blocks show a notification for products on backorder. #2833
* Enhancement - Chip styles of the Filter Products by Attribute and Active Filters have been updated to give a more consistent experience. #2765
* Enhancement - Add protection for rogue filters on order queries when executing cleanup draft orders logic. #2874
* Enhancement - Extend payment gateway extension API so gateways (payment methods) can dynamically disable (hide), based on checkout or order data (such as cart items or shipping method). For example, Cash on Delivery can limit availability to specific shipping methods only. #2840 [DN]
* Enhancement - Support Cash on Delivery core payment gateway in the Checkout block. #2831
* Performance - Don't load shortcode Cart and Checkout scripts when using the blocks. #2842
* Performance - Scripts only relevant to the frontend side of blocks are no longer loaded in the editor. #2788
* Performance - Lazy Loading Atomic Components. #2777
* Pefactor - Remove dashicon classes. #2848
**WooCommerce Blocks 3.1.0**
* Fix - Missing permissions_callback arg in StoreApi route definitions. #2926
* Fix - 'Product Summary' in All Products block is not pulling in the short description of the product. #2913
* Dev - Add query filter when searching for a table. #2886
= 4.3.2 - 2020-08-10 =
**WooCommerce**
* Fix - Remove new WP 5.5 meta box arrows from "Order data" and "Order items" meta boxes. #27173
* Fix - "Product type" dropdown missing from Product's data meta box on WP 5.5. #27170
**WooCommerce Blocks 2.7.3**
* Fix - Fix missing permissions_callback arg in StoreApi route definitions. #2926
**WooCommerce REST API 1.0.10-pl-1**
* Enhancement - Compatibility fixes for WordPress 5.5 #232
= 4.3.1 - 2020-07-21 =
**WooCommerce Admin 1.3.1**
* Fix - PHP Fatal errors when columns are missing from the Notes table. #4831
**WooCommerce Blocks 2.7.2**
* Enhancement - Move Draft order logic behind feature flag. #2874
= 4.3.0 - 2020-07-08 =
**WooCommerce**
* Enhancement - Show notice to update to latest PHP if version is < 7.2. #26775
* Enhancement - Add template cache clearing. #26752
* Enhancement - Add 47 Kenya counties. #26728
* Enhancement - Accessibility: add aria-disabled attribute to "Update cart" button on checkout page. #26726
* Enhancement - Update "Subtotal" translation string in wc-template-functions.php. #26706
* Enhancement - Add a new Features settings section, enabling woocommerce_homescreen_enabled for all new stores. #26625
* Enhancement - Add warning in status report if a base database table is missing. #26455
* Enhancement - Updated stock handling to prevent race conditions when orders come in at the same time. #26395
* Tweak - Allow checkout even if reserved table is not present. #26705
* Tweak - Add note to Products Importer description that TXT files are also supported. #26670
* Tweak - Allow set different notice types with WC_Admin_Notices. #26410
* Tweak - Fix redundant setting of object cache when attribute taxonomies are not being used. #26518
* Fix - Encode HTML entities for product attribute name and values. #26754
* Fix - Fix an issue with attribute value escaping in product CSV exports. #26739
* Fix - Fix comment_type value for reviews created with WordPress 5.5. #26729
* Fix - Close unbalanced <p> tag in auth "Grant Access" form template file. #26725
* Fix - Remove check for the existing term when parsing category via CSV & instead catch an existing term error when adding a new category to the database. #26720
* Fix - Domain update script now replaces woocommerce-admin domain also in Blocks package. #26690
* Fix - Correct grammar mistake in the help tip of the Connected to WooCommerce.com field of the System Status Report. #26666
* Fix - Allow float value timezone offsets to display the correct float values. #26637
* Fix - Add asterisk to star rating if 'Star ratings should be required, not optional' checkbox is enabled. #26596
* Fix - Use calculations similar to cart for orders as well (fixed regression). #26583
* Fix - Fixed data-id of notices in checkout. #26386
* Fix - Fixed password visible toggle in the checkout page. #26292
* Fix - Product description display fix when multiple products shortcodes are present on a page. #26250
* Fix - Using the add-to-cart parameter with a product variant id will now have the variation attributes populated correctly. #26237
* Fix - Better template caching support for multi-server environments. #23971
* Fix - Fix updating the wc_reserve_stock stock_quantity value after making changes to the cart in between checkouts. #26807
* Fix - Put back the remove element for multiselects on selectWoo. #26849
* Dev - Adjusted the WC tested up to check to only apply to major versions. #26685
* Dev - Make shipping calculations more flexible by providing actions. #26542
* Dev - Trigger check_variations with custom values. #26525
* Dev - Add verify_base_db method to check if all base tables are present. #26454
* Dev - Added action before the "Add payment method" save button and a filter to validate manually added fields when adding payment method. #26445
* Dev - `wc_get_shipping_method_count() has a new argument (`$enabled_only`) which allows restricting the non-legacy shipping methods to the enabled ones. #25753
* Dev - Added pre query filters for WP dashboard WooCommerce status widget. #25321
* Dev - Removed type hints from src folder. #26963
**REST API 1.0.10**
* Enhancement - Add API tool to clear template cache. woocommerce/woocommerce-rest-api#212
* Enhancement - Add API tool to verify base DB tables. woocommerce/woocommerce-rest-api#188
**WooCommerce Admin 1.3.0**
* Enhancement - Add Jetpack stats to performance indicatorts / homepage #4291
* Enhancement - New "Store Management" quick links card on WooCommerce home screen. #4350
* Enhancement - Inbox notifications layout updates #4218
* Enhancement - New Home Screen #4303
* Enhancement - Use WordPress Core colors for styling accents. #4558
* Tweak - make revenue report total sales column optional #4397
* Tweak - Adjustments to WooCommerce Payments setup task #4373
* Tweak - Handling of plugin installs in OBW #4411
* Tweak - Update design of Setup Checklist #4434
* Tweak - Add scrollable styling to left side of Table, and keep updated #4179
* Tweak - Add custom autocompleter support to Search component #4518
* Tweak - reduce asset filename length. #4535
* Tweak - Use single dash for country/state dropdown options #4553
* Tweak - Use label tag for toggleable shipping zones #4554
* Tweak - Make it easier to add submenu items to the Marketing menu #4561
* Tweak - Tag remove button style so it is properly centered. #4651
* Tweak - Tweak the embed page CSS so the top content sits better. #4622
* Tweak - Update summary number placeholder styles. #4682
* Fix - misaligned 'required' text on selects #4307
* Fix - exception when opening dashboard after selecting extensions to purchase #4357
* Fix - REST API collections schema #4377
* Fix - Monetary Advanced Filters in Customers Report with correct currency object prop. #4356
* Fix - In App purchase "back link" #4301
* Fix - Search results selectable by clicking on item text or icon #4474
* Fix - Filters' static query parameters #4458
* Fix - The WCPay method not appearing as recommended sometimes #4345
* Fix - Removed URLSearchParams method #4501
* Fix - REST API collections schema. #4484
* Fix - null issue in wpNavMenuClassChange #4513 🎉 gradosevic
* Fix - RTL stylesheet loading for split code chunks. #4542
* Fix - Don't show store location step in tax and shipping tasks if the address has already been provided #4507
* Fix - Check for enabled methods before payment task completion #4530
* Fix - Solved a problem with the method onChoose in the last onboarding step. #4583
* Fix - Only mark purchase task as complete when products exist #4574
* Fix - WCPay sometimes not appearing on the task list. #4647
* Fix - Fix inbox spacing. #4632
* Fix - Don't include sourcemaps or unminified JS for "core" builds. #4642
* Fix - Add a bottom border to the Install Jetpack CTA. #4589
* Fix - Style cleanup from components update. #4606
* Fix - Check that the possibly_add_note function exists before calling it. #4680
* Fix - Remove unnecessary rest_api_init action that caused incompatibility issues with other plugins. #4691
* Fix - Fix dashboard task list menu placement. #4664
* Fix - Added styles to the unread notes counter in the inbox panel. #4690
* Fix - Fix spacing between stats overview and store management cards. #4681
* Fix - Added default value to the note icon. #4745
* Fix - Unnecessary REST API usage leading to potential overflow of Jetpack option sizes. #4755
* Dev - Add jest-dom eslint plugin. #4327
* Dev - Migrate onboarding data store to wp.data #4433
* Dev - Remove use of `IconButton` in favor of `Button` #4415
* Dev - Fix error handling for plugins on server error #4462
* Dev - update @wordpress/components and @wordpress/base*styles #4427
* Dev - Migrate user store to wp.data #4505
* Dev - Add options data store to wp.data #4144
* Dev - Runtime feature config override #4523
* Dev - Add deprecation notice for install_plugin() #4713
* Dev - Only load non-minified js files when SCRIPT_DEBUG is on, and env is development or plugin. #4747
**WooCommerce Admin 1.2.4**
* Tweak - reduce asset filename length and remove tilde characters. #4535
* Fix - RTL stylesheet loading for split code chunks. #4542
**WooCommerce Blocks 2.7.1**
* Fix - Use IE11 friendly code for Dashicon component replacement. #2708
* Fix - Fix PHP warnings produced by StoreAPI endpoints when variations have no prices. #2722
* Fix - Fix missing scoped variable in closure and missing schema definitions. #2724
* Fix - Fix undefined index notice for query_type on the product collection data endpoint. #2723
**WooCommerce Blocks 2.7.0**
* Enhancement - Filter block font sizes have been adjusted to be in line with other blocks. #2594
* Enhancement - The All Products block and the other product grid blocks now share more styles and the markup is more similar (see release post or docs to learn how to undo this change). #2428 [DN]
* Enhancement - The Cart and Checkout blocks now use the heading styles provided by the theme. #2597
* Enhancement - The Cart block titles have been merged into one. #2615
* Enhancement - The item count badges of the Checkout block have been updated so it looks better in light & dark backgrounds. #2619
* Enhancement - Checkout step progress indicator design has been updated to match the theme headings style. #2649
* Performance - Reduce bundlesize of blocks using @wordpress/components directly. #2664
* Fix - Fix bug in Checkout block preventing a retry of credit card payment when first credit card used fails and a new one is tried. #2655
* Fix - Avoid some theme style properties leaking into the Cart and Checkout select controls. #2647
* Fix - Fixes to the product grid blocks in Twenty Twenty: discounted prices are no longer underlined and the On Sale badge is correctly positioned in the All Products block. #2573
* Fix - Improved alignment of credit card validation error messages. #2662
* Fix - Show the 'No shipping methods' placeholder in the editor with the _Checkout_ block if there are shipping methods but all of them are disabled. #2543
**WooCommerce Blocks 2.6.1**
* Fix - Updated the wc_reserved_stock table for compatibility with versions of MySql < 5.6.5. #2590
**WooCommerce Blocks 2.6.0**
* Enhancement - Add dropdown display style to Filter Products by Attribute block. #1255
* Enhancement - Add option to display a Filter button to Filter Products by Attribute block. #1332
* Enhancement - Add support for image for product categories block #1739
* Enhancement - An error notice will be shown in All Product if the customer is trying to add a product above stock or sold individually. #2278
* Performance - Improvements to REST API performance #2248
* Performance - Avoid loading Assets API during REST requests #2286
* Fix - Add placeholder to the on-sale products block when no results are found. #1519
* Fix - Added correct ellipsis character in Product Search block #1672
* Fix - If product is changed for featured product block, update the link in the button. #1894
* Fix - Import from `@woocommerce/settings` in `@woocommerce/block-settings` #2330
* Dev - Accessibility of the All Products block and filter blocks has been improved. #1656
* Dev - All Products Block: Update sorting labels to match frontend options #2462
* Dev - Change PropType validation for Icon component #1737
* Dev - Changed default rows and columns for product grid blocks to 3x3. #1613
* Dev - Check for instance of WP_Block in render_callback #2258
* Dev - Devs: `ENABLE_REVIEW_RATING` setting was renamed to `REVIEW_RATINGS_ENABLED` and now it also verifies reviews are enabled, to better match WooCommerce API. #1374
* Dev - Fix price filtering when stored prices do not match displayed prices (determined by tax settings). #1612
* Dev - HTML editing is no longer supported in several blocks. #1395
* Dev - Implement __experimentalCreateInterpolateElement for translations. #1736
* Dev - Load WooCommerce Core translations for 'Sale!' and some other strings if translations are unavailable for WooCommerce Blocks. #1694
* Dev - Prevent data hydration on REST requests #2176
* Dev - Show relationship between terms in the active filters block. #1630
* Dev - Table creation validation for install routine #2287
* Dev - Update the icons used in the blocks. #1644
= 4.2.2 - 2020-06-23 =
**WooCommerce**
* Fix - Put back the remove element for multiselects on selectWoo. #26849
= 4.2.1 - 2020-06-22 =
**WooCommerce**
* Security - Escape HTML in SelectWoo.
**WooCommerce Admin 1.2.4**
* Tweak: reduce asset filename length and remove tilde characters. #4535
* Fix: RTL stylesheet loading for split code chunks. #4542
= 4.2.0 - 2020-06-02 =
**WooCommerce**

View File

@ -1062,6 +1062,7 @@ ul.wc_coupon_list_block {
#woocommerce-order-data {
.postbox-header,
.hndle,
.handlediv {
display: none;
@ -1412,6 +1413,10 @@ ul.wc_coupon_list_block {
.refunded-total {
color: $red;
}
.label-highlight {
font-weight: bold;
}
}
.refund-actions {
@ -1466,6 +1471,7 @@ ul.wc_coupon_list_block {
display: block !important;
}
.postbox-header,
.hndle,
.handlediv {
display: none;
@ -4347,14 +4353,13 @@ img.help_tip {
span {
display: block;
vertical-align: middle;
line-height: 24px;
}
span {
display: inline;
line-height: inherit;
vertical-align: baseline;
}
.type_box {
display: inline;
line-height: inherit;
vertical-align: baseline;
}
select {
@ -6683,6 +6688,7 @@ table.bar_chart {
.select2-selection__clear {
color: #999;
margin-top: -1px;
z-index: 1;
}
.select2-search--inline .select2-search__field {
@ -6776,7 +6782,7 @@ table.bar_chart {
.select2-selection__arrow {
right: 1px;
height: 28px;
width: 28px;
width: 23px;
background: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") no-repeat right 5px top 55%;
background-size: 16px 16px;
@ -6818,6 +6824,23 @@ table.bar_chart {
}
}
.wc-wp-version-gte-55 {
#woocommerce-product-data {
.hndle {
display: block;
line-height: 24px;
.type_box {
display: inline;
line-height: inherit;
vertical-align: baseline;
}
}
}
}
/**
* Select2 colors for built-in admin color themes.
*/
@ -7267,3 +7290,8 @@ table.bar_chart {
}
}
}
.wc-quick-edit-warning {
color: darkred;
font-weight: bold;
}

View File

@ -169,25 +169,6 @@ a.button {
z-index: 1;
}
.wc-block-grid__products {
.wc-block-grid__product-onsale {
position: absolute;
top: 0;
display: inline-block;
background: $highlights-color;
color: #fff;
font-family: $headings;
font-weight: 700;
letter-spacing: -0.02em;
line-height: 1.2;
text-transform: uppercase;
z-index: 1;
font-size: 1.5rem;
padding: 1rem;
}
}
.price {
font-family: $headings;
@ -198,6 +179,7 @@ a.button {
ins {
display: inline-block;
text-decoration: none;
}
}
@ -2107,45 +2089,6 @@ a.reset_variations {
}
}
ul.wc-block-grid__products {
display: flex;
align-items: stretch;
flex-direction: row;
flex-wrap: wrap;
li.wc-block-grid__product {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
margin-bottom: 5em;
}
}
.wc-block-grid__product {
.wc-block-grid__product-title {
font-family: $headings;
color: #000;
font-size: 2.5rem;
}
.wc-block-grid__product-price {
.woocommerce-Price-amount {
font-size: 1.8rem;
}
}
.wc-block-grid__product-rating {
.star-rating {
font-size: 0.7em;
}
}
}
@media only screen and (max-width: 600px) {
.woocommerce {
@ -2435,14 +2378,6 @@ ul.wc-block-grid__products {
}
}
.wc-block-grid__products {
.wc-block-grid__product-onsale {
font-size: 1.5rem;
padding: 1rem;
}
}
/**
* Shop page
*/
@ -2596,14 +2531,6 @@ ul.wc-block-grid__products {
}
}
.wc-block-grid__products {
.wc-block-grid__product-onsale {
font-size: 1.7rem;
padding: 1.5rem;
}
}
.woocommerce-breadcrumb {
margin-bottom: 5rem;
font-size: 0.88889em;

View File

@ -123,7 +123,8 @@ jQuery( function ( $ ) {
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
'delay': 200,
'keepAlive': true
});
},

View File

@ -27,7 +27,11 @@ jQuery( function( $ ) {
});
// Type box.
$( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' );
if ( $( 'body' ).hasClass( 'wc-wp-version-gte-55' ) ) {
$( '.type_box' ).appendTo( '#woocommerce-product-data .hndle' );
} else {
$( '.type_box' ).appendTo( '#woocommerce-product-data .hndle span' );
}
$( function() {
// Prevent inputs in meta box headings opening/closing contents.

View File

@ -9,7 +9,8 @@ jQuery( function ( $ ) {
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
'delay': 200,
'keepAlive': true
});
}

View File

@ -1,135 +1,166 @@
/*global inlineEditPost, woocommerce_admin, woocommerce_quick_edit */
jQuery(function( $ ) {
$( '#the-list' ).on( 'click', '.editinline', function() {
jQuery(
function( $ ) {
$( '#the-list' ).on(
'click',
'.editinline',
function() {
inlineEditPost.revert();
inlineEditPost.revert();
var post_id = $( this ).closest( 'tr' ).attr( 'id' );
var post_id = $( this ).closest( 'tr' ).attr( 'id' );
post_id = post_id.replace( 'post-', '' );
post_id = post_id.replace( 'post-', '' );
var $wc_inline_data = $( '#woocommerce_inline_' + post_id );
var $wc_inline_data = $( '#woocommerce_inline_' + post_id );
var sku = $wc_inline_data.find( '.sku' ).text(),
regular_price = $wc_inline_data.find( '.regular_price' ).text(),
sale_price = $wc_inline_data.find( '.sale_price ').text(),
weight = $wc_inline_data.find( '.weight' ).text(),
length = $wc_inline_data.find( '.length' ).text(),
width = $wc_inline_data.find( '.width' ).text(),
height = $wc_inline_data.find( '.height' ).text(),
shipping_class = $wc_inline_data.find( '.shipping_class' ).text(),
visibility = $wc_inline_data.find( '.visibility' ).text(),
stock_status = $wc_inline_data.find( '.stock_status' ).text(),
stock = $wc_inline_data.find( '.stock' ).text(),
featured = $wc_inline_data.find( '.featured' ).text(),
manage_stock = $wc_inline_data.find( '.manage_stock' ).text(),
menu_order = $wc_inline_data.find( '.menu_order' ).text(),
tax_status = $wc_inline_data.find( '.tax_status' ).text(),
tax_class = $wc_inline_data.find( '.tax_class' ).text(),
backorders = $wc_inline_data.find( '.backorders' ).text();
var sku = $wc_inline_data.find( '.sku' ).text(),
regular_price = $wc_inline_data.find( '.regular_price' ).text(),
sale_price = $wc_inline_data.find( '.sale_price ' ).text(),
weight = $wc_inline_data.find( '.weight' ).text(),
length = $wc_inline_data.find( '.length' ).text(),
width = $wc_inline_data.find( '.width' ).text(),
height = $wc_inline_data.find( '.height' ).text(),
shipping_class = $wc_inline_data.find( '.shipping_class' ).text(),
visibility = $wc_inline_data.find( '.visibility' ).text(),
stock_status = $wc_inline_data.find( '.stock_status' ).text(),
stock = $wc_inline_data.find( '.stock' ).text(),
featured = $wc_inline_data.find( '.featured' ).text(),
manage_stock = $wc_inline_data.find( '.manage_stock' ).text(),
menu_order = $wc_inline_data.find( '.menu_order' ).text(),
tax_status = $wc_inline_data.find( '.tax_status' ).text(),
tax_class = $wc_inline_data.find( '.tax_class' ).text(),
backorders = $wc_inline_data.find( '.backorders' ).text(),
product_type = $wc_inline_data.find( '.product_type' ).text();
var formatted_regular_price = regular_price.replace('.', woocommerce_admin.mon_decimal_point ),
formatted_sale_price = sale_price.replace('.', woocommerce_admin.mon_decimal_point );
var formatted_regular_price = regular_price.replace( '.', woocommerce_admin.mon_decimal_point ),
formatted_sale_price = sale_price.replace( '.', woocommerce_admin.mon_decimal_point );
$( 'input[name="_sku"]', '.inline-edit-row' ).val( sku );
$( 'input[name="_regular_price"]', '.inline-edit-row' ).val( formatted_regular_price );
$( 'input[name="_sale_price"]', '.inline-edit-row' ).val( formatted_sale_price );
$( 'input[name="_weight"]', '.inline-edit-row' ).val( weight );
$( 'input[name="_length"]', '.inline-edit-row' ).val( length );
$( 'input[name="_width"]', '.inline-edit-row' ).val( width );
$( 'input[name="_height"]', '.inline-edit-row' ).val( height );
$( 'input[name="_sku"]', '.inline-edit-row' ).val( sku );
$( 'input[name="_regular_price"]', '.inline-edit-row' ).val( formatted_regular_price );
$( 'input[name="_sale_price"]', '.inline-edit-row' ).val( formatted_sale_price );
$( 'input[name="_weight"]', '.inline-edit-row' ).val( weight );
$( 'input[name="_length"]', '.inline-edit-row' ).val( length );
$( 'input[name="_width"]', '.inline-edit-row' ).val( width );
$( 'input[name="_height"]', '.inline-edit-row' ).val( height );
$( 'select[name="_shipping_class"] option:selected', '.inline-edit-row' ).attr( 'selected', false ).change();
$( 'select[name="_shipping_class"] option[value="' + shipping_class + '"]' ).attr( 'selected', 'selected' ).change();
$( 'select[name="_shipping_class"] option:selected', '.inline-edit-row' ).attr( 'selected', false ).change();
$( 'select[name="_shipping_class"] option[value="' + shipping_class + '"]' ).attr( 'selected', 'selected' ).change();
$( 'input[name="_stock"]', '.inline-edit-row' ).val( stock );
$( 'input[name="menu_order"]', '.inline-edit-row' ).val( menu_order );
$( 'input[name="_stock"]', '.inline-edit-row' ).val( stock );
$( 'input[name="menu_order"]', '.inline-edit-row' ).val( menu_order );
// eslint-disable-next-line max-len
$( 'select[name="_tax_status"] option, select[name="_tax_class"] option, select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option' ).removeAttr( 'selected' );
$(
'select[name="_tax_status"] option, ' +
'select[name="_tax_class"] option, ' +
'select[name="_visibility"] option, ' +
'select[name="_stock_status"] option, ' +
'select[name="_backorders"] option'
).removeAttr( 'selected' );
$( 'select[name="_tax_status"] option[value="' + tax_status + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_tax_class"] option[value="' + tax_class + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_visibility"] option[value="' + visibility + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_stock_status"] option[value="' + stock_status + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_backorders"] option[value="' + backorders + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
var is_variable_product = 'variable' === product_type;
$( 'select[name="_stock_status"] ~ .wc-quick-edit-warning', '.inline-edit-row' ).toggle( is_variable_product );
$( 'select[name="_stock_status"] option[value="' + (is_variable_product ? '' : stock_status) + '"]', '.inline-edit-row' )
.attr( 'selected', 'selected' );
if ( 'yes' === featured ) {
$( 'input[name="_featured"]', '.inline-edit-row' ).attr( 'checked', 'checked' );
} else {
$( 'input[name="_featured"]', '.inline-edit-row' ).removeAttr( 'checked' );
}
$( 'select[name="_tax_status"] option[value="' + tax_status + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_tax_class"] option[value="' + tax_class + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_visibility"] option[value="' + visibility + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
$( 'select[name="_backorders"] option[value="' + backorders + '"]', '.inline-edit-row' ).attr( 'selected', 'selected' );
// Conditional display
var product_type = $wc_inline_data.find( '.product_type' ).text(),
product_is_virtual = $wc_inline_data.find( '.product_is_virtual' ).text();
if ( 'yes' === featured ) {
$( 'input[name="_featured"]', '.inline-edit-row' ).attr( 'checked', 'checked' );
} else {
$( 'input[name="_featured"]', '.inline-edit-row' ).removeAttr( 'checked' );
}
var product_supports_stock_status = 'external' !== product_type;
var product_supports_stock_fields = 'external' !== product_type && 'grouped' !== product_type;
// Conditional display.
var product_is_virtual = $wc_inline_data.find( '.product_is_virtual' ).text();
$( '.stock_fields, .manage_stock_field, .stock_status_field, .backorder_field' ).show();
var product_supports_stock_status = 'external' !== product_type;
var product_supports_stock_fields = 'external' !== product_type && 'grouped' !== product_type;
if ( product_supports_stock_fields ) {
if ( 'yes' === manage_stock ) {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
$( '.stock_status_field' ).hide();
$( '.manage_stock_field input' ).prop( 'checked', true );
} else {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
$( '.stock_status_field' ).show().removeAttr( 'style' );
$( '.manage_stock_field input' ).prop( 'checked', false );
$( '.stock_fields, .manage_stock_field, .stock_status_field, .backorder_field' ).show();
if ( product_supports_stock_fields ) {
if ( 'yes' === manage_stock ) {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
$( '.stock_status_field' ).hide();
$( '.manage_stock_field input' ).prop( 'checked', true );
} else {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
$( '.stock_status_field' ).show().removeAttr( 'style' );
$( '.manage_stock_field input' ).prop( 'checked', false );
}
} else if ( product_supports_stock_status ) {
$( '.stock_fields, .manage_stock_field, .backorder_field' ).hide();
} else {
$( '.stock_fields, .manage_stock_field, .stock_status_field, .backorder_field' ).hide();
}
if ( 'simple' === product_type || 'external' === product_type ) {
$( '.price_fields', '.inline-edit-row' ).show().removeAttr( 'style' );
} else {
$( '.price_fields', '.inline-edit-row' ).hide();
}
if ( 'yes' === product_is_virtual ) {
$( '.dimension_fields', '.inline-edit-row' ).hide();
} else {
$( '.dimension_fields', '.inline-edit-row' ).show().removeAttr( 'style' );
}
// Rename core strings.
$( 'input[name="comment_status"]' ).parent().find( '.checkbox-title' ).text( woocommerce_quick_edit.strings.allow_reviews );
}
} else if ( product_supports_stock_status ) {
$( '.stock_fields, .manage_stock_field, .backorder_field' ).hide();
} else {
$( '.stock_fields, .manage_stock_field, .stock_status_field, .backorder_field' ).hide();
}
);
if ( 'simple' === product_type || 'external' === product_type ) {
$( '.price_fields', '.inline-edit-row' ).show().removeAttr( 'style' );
} else {
$( '.price_fields', '.inline-edit-row' ).hide();
}
$( '#the-list' ).on(
'change',
'.inline-edit-row input[name="_manage_stock"]',
function() {
if ( 'yes' === product_is_virtual ) {
$( '.dimension_fields', '.inline-edit-row' ).hide();
} else {
$( '.dimension_fields', '.inline-edit-row' ).show().removeAttr( 'style' );
}
if ( $( this ).is( ':checked' ) ) {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
$( '.stock_status_field' ).hide();
} else {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
$( '.stock_status_field' ).show().removeAttr( 'style' );
}
// Rename core strings
$( 'input[name="comment_status"]' ).parent().find( '.checkbox-title' ).text( woocommerce_quick_edit.strings.allow_reviews );
});
}
);
$( '#the-list' ).on( 'change', '.inline-edit-row input[name="_manage_stock"]', function() {
$( '#wpbody' ).on(
'click',
'#doaction, #doaction2',
function() {
$( 'input.text', '.inline-edit-row' ).val( '' );
$( '#woocommerce-fields' ).find( 'select' ).prop( 'selectedIndex', 0 );
$( '#woocommerce-fields-bulk' ).find( '.inline-edit-group .change-input' ).hide();
}
);
if ( $( this ).is( ':checked' ) ) {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
$( '.stock_status_field' ).hide();
} else {
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
$( '.stock_status_field' ).show().removeAttr( 'style' );
}
$( '#wpbody' ).on(
'change',
'#woocommerce-fields-bulk .inline-edit-group .change_to',
function() {
});
if ( 0 < $( this ).val() ) {
$( this ).closest( 'div' ).find( '.change-input' ).show();
} else {
$( this ).closest( 'div' ).find( '.change-input' ).hide();
}
$( '#wpbody' ).on( 'click', '#doaction, #doaction2', function() {
$( 'input.text', '.inline-edit-row' ).val( '' );
$( '#woocommerce-fields' ).find( 'select' ).prop( 'selectedIndex', 0 );
$( '#woocommerce-fields-bulk' ).find( '.inline-edit-group .change-input' ).hide();
});
}
);
$( '#wpbody' ).on( 'change', '#woocommerce-fields-bulk .inline-edit-group .change_to', function() {
if ( 0 < $( this ).val() ) {
$( this ).closest( 'div' ).find( '.change-input' ).show();
} else {
$( this ).closest( 'div' ).find( '.change-input' ).hide();
}
});
$( '#wpbody' ).on( 'click', '.trash-product', function() {
return window.confirm( woocommerce_admin.i18n_delete_product_notice );
});
});
$( '#wpbody' ).on(
'click',
'.trash-product',
function() {
return window.confirm( woocommerce_admin.i18n_delete_product_notice );
}
);
}
);

View File

@ -72,16 +72,11 @@
var changed = false;
$( 'input, textarea, select, checkbox' ).change( function() {
changed = true;
});
$( '.woo-nav-tab-wrapper a' ).click( function() {
if ( changed ) {
if ( ! changed ) {
window.onbeforeunload = function() {
return params.i18n_nav_warning;
};
} else {
window.onbeforeunload = '';
changed = true;
}
});

View File

@ -114,6 +114,11 @@ jQuery( function ( $ ) {
wcSystemStatus.init();
$( '.wc_status_table' ).on( 'click', '.run-tool .button', function( evt ) {
evt.stopImmediatePropagation();
return window.confirm( woocommerce_admin_system_status.run_tool_confirmation );
});
$( '#log-viewer-select' ).on( 'click', 'h2 a.page-title-action', function( evt ) {
evt.stopImmediatePropagation();
return window.confirm( woocommerce_admin_system_status.delete_log_confirmation );

View File

@ -58,6 +58,7 @@
$this.$form.find('.woocommerce-importer-progress').val( response.data.percentage );
if ( 'done' === response.data.position ) {
var file_name = wc_product_import_params.file.split( '/' ).pop();
window.location = response.data.url +
'&products-imported=' +
parseInt( $this.imported, 10 ) +
@ -66,7 +67,9 @@
'&products-updated=' +
parseInt( $this.updated, 10 ) +
'&products-skipped=' +
parseInt( $this.skipped, 10 );
parseInt( $this.skipped, 10 ) +
'&file-name=' +
file_name;
} else {
$this.run_import();
}

View File

@ -188,7 +188,8 @@
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
'delay': 200,
'keepAlive': true
} );
$( '.column-wc_actions .wc-action-button' ).tipTip( {
@ -203,7 +204,8 @@
'attribute': 'data-tip',
'fadeIn': 50,
'fadeOut': 50,
'delay': 200
'delay': 200,
'keepAlive': true
} ).css( 'cursor', 'help' );
});
});

View File

@ -293,7 +293,18 @@
$qty.find( 'input.qty' ).val( '1' ).attr( 'min', '1' ).attr( 'max', '' ).change();
$qty.hide();
} else {
$qty.find( 'input.qty' ).attr( 'min', variation.min_qty ).attr( 'max', variation.max_qty ).val( variation.min_qty ).change();
var $qty_input = $qty.find( 'input.qty' ),
qty_val = parseFloat( $qty_input.val() );
if ( isNaN( qty_val ) ) {
qty_val = variation.min_qty;
} else {
qty_val = qty_val > parseFloat( variation.max_qty ) ? variation.max_qty : qty_val;
qty_val = qty_val < parseFloat( variation.min_qty ) ? variation.min_qty : qty_val;
}
$qty_input.attr( 'min', variation.min_qty ).attr( 'max', variation.max_qty ).val( qty_val ).change();
$qty.show();
}

View File

@ -101,6 +101,10 @@ jQuery( function( $ ) {
field.show();
}
}
// Class changes.
field.removeClass( 'form-row-first form-row-last form-row-wide' );
field.addClass( fieldLocale.class.join( ' ' ) );
});
var fieldsets = $(

View File

@ -657,6 +657,7 @@ jQuery( function( $ ) {
if ( code ) {
$( 'form.woocommerce-checkout' ).before( code );
$( document.body ).trigger( 'removed_coupon_in_checkout', [ data.coupon_code ] );
$( document.body ).trigger( 'update_checkout', { update_shipping_method: false } );
// Remove coupon code from coupon field

View File

@ -273,7 +273,9 @@ jQuery( function( $ ) {
var large_image_src = img.attr( 'data-large_image' ),
large_image_w = img.attr( 'data-large_image_width' ),
large_image_h = img.attr( 'data-large_image_height' ),
alt = img.attr( 'alt' ),
item = {
alt : alt,
src : large_image_src,
w : large_image_w,
h : large_image_h,

View File

@ -66,7 +66,7 @@
org_elem.hover(function(){
active_tiptip();
}, function(){
if(!opts.keepAlive){
if(!opts.keepAlive || !tiptip_holder.is(':hover')){
deactive_tiptip();
}
});
@ -188,4 +188,4 @@
}
});
}
})(jQuery);
})(jQuery);

View File

@ -2861,6 +2861,7 @@ var _getItemAt,
};
img.src = item.src;// + '?a=' + Math.random();
img.alt = item.alt || '';
return img;
},

File diff suppressed because one or more lines are too long

View File

@ -100,6 +100,7 @@
var srcElement = source.querySelector('img');
if (srcElement) {
settings.url = srcElement.getAttribute('data-src') || srcElement.currentSrc || srcElement.src;
settings.alt = srcElement.getAttribute('data-alt') || srcElement.alt;
}
if (!settings.url) {
return;
@ -227,7 +228,7 @@
};
img.setAttribute('role', 'presentation');
img.alt = '';
img.alt = settings.alt || '';
img.src = settings.url;
});
};

View File

@ -3,4 +3,4 @@
license: MIT
http://www.jacklmoore.com/zoom
*/
(function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,a,r,m,l,s,f=o(t),h=f.css("position"),d=o(n);return t.style.position=/(absolute|fixed)/.test(h)?h:"relative",t.style.overflow="hidden",e.style.width=e.style.height="",o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){c=f.outerWidth(),u=f.outerHeight(),n===t?(r=c,a=u):(r=d.outerWidth(),a=d.outerHeight()),m=(e.width-c)/r,l=(e.height-u)/a,s=d.offset()},move:function(o){var t=o.pageX-s.left,n=o.pageY-s.top;n=Math.max(Math.min(n,a),0),t=Math.max(Math.min(t,r),0),e.style.left=t*-m+"px",e.style.top=n*-l+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e=o.extend({},t,n||{}),i=e.target&&o(e.target)[0]||this,u=this,c=o(u),a=document.createElement("img"),r=o(a),m="mousemove.zoom",l=!1,s=!1;if(!e.url){var f=u.querySelector("img");if(f&&(e.url=f.getAttribute("data-src")||f.currentSrc||f.src),!e.url)return}c.one("zoom.destroy",function(o,t){c.off(".zoom"),i.style.position=o,i.style.overflow=t,a.onload=null,r.remove()}.bind(this,i.style.position,i.style.overflow)),a.onload=function(){function t(t){f.init(),f.move(t),r.stop().fadeTo(o.support.opacity?e.duration:0,1,o.isFunction(e.onZoomIn)?e.onZoomIn.call(a):!1)}function n(){r.stop().fadeTo(e.duration,0,o.isFunction(e.onZoomOut)?e.onZoomOut.call(a):!1)}var f=o.zoom(i,u,a,e.magnify);"grab"===e.on?c.on("mousedown.zoom",function(e){1===e.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(m,f.move)}),t(e),o(document).on(m,f.move),e.preventDefault())}):"click"===e.on?c.on("click.zoom",function(e){return l?void 0:(l=!0,t(e),o(document).on(m,f.move),o(document).one("click.zoom",function(){n(),l=!1,o(document).off(m,f.move)}),!1)}):"toggle"===e.on?c.on("click.zoom",function(o){l?n():t(o),l=!l}):"mouseover"===e.on&&(f.init(),c.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(m,f.move)),e.touch&&c.on("touchstart.zoom",function(o){o.preventDefault(),s?(s=!1,n()):(s=!0,t(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),f.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}).on("touchend.zoom",function(o){o.preventDefault(),s&&(s=!1,n())}),o.isFunction(e.callback)&&e.callback.call(a)},a.setAttribute("role","presentation"),a.alt="",a.src=e.url})},o.fn.zoom.defaults=t})(window.jQuery);
!function(d){var n={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};d.zoom=function(o,t,n,e){var i,u,a,c,r,l,m,s=d(o),f=s.css("position"),h=d(t);return o.style.position=/(absolute|fixed)/.test(f)?f:"relative",o.style.overflow="hidden",n.style.width=n.style.height="",d(n).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:n.width*e,height:n.height*e,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(o),{init:function(){u=s.outerWidth(),i=s.outerHeight(),a=t===o?(c=u,i):(c=h.outerWidth(),h.outerHeight()),r=(n.width-u)/c,l=(n.height-i)/a,m=h.offset()},move:function(o){var t=o.pageX-m.left,e=o.pageY-m.top;e=Math.max(Math.min(e,a),0),t=Math.max(Math.min(t,c),0),n.style.left=t*-r+"px",n.style.top=e*-l+"px"}}},d.fn.zoom=function(e){return this.each(function(){var i=d.extend({},n,e||{}),u=i.target&&d(i.target)[0]||this,o=this,a=d(o),c=document.createElement("img"),r=d(c),l="mousemove.zoom",m=!1,s=!1;if(!i.url){var t=o.querySelector("img");if(t&&(i.url=t.getAttribute("data-src")||t.currentSrc||t.src,i.alt=t.getAttribute("data-alt")||t.alt),!i.url)return}a.one("zoom.destroy",function(o,t){a.off(".zoom"),u.style.position=o,u.style.overflow=t,c.onload=null,r.remove()}.bind(this,u.style.position,u.style.overflow)),c.onload=function(){var t=d.zoom(u,o,c,i.magnify);function e(o){t.init(),t.move(o),r.stop().fadeTo(d.support.opacity?i.duration:0,1,!!d.isFunction(i.onZoomIn)&&i.onZoomIn.call(c))}function n(){r.stop().fadeTo(i.duration,0,!!d.isFunction(i.onZoomOut)&&i.onZoomOut.call(c))}"grab"===i.on?a.on("mousedown.zoom",function(o){1===o.which&&(d(document).one("mouseup.zoom",function(){n(),d(document).off(l,t.move)}),e(o),d(document).on(l,t.move),o.preventDefault())}):"click"===i.on?a.on("click.zoom",function(o){return m?void 0:(m=!0,e(o),d(document).on(l,t.move),d(document).one("click.zoom",function(){n(),m=!1,d(document).off(l,t.move)}),!1)}):"toggle"===i.on?a.on("click.zoom",function(o){m?n():e(o),m=!m}):"mouseover"===i.on&&(t.init(),a.on("mouseenter.zoom",e).on("mouseleave.zoom",n).on(l,t.move)),i.touch&&a.on("touchstart.zoom",function(o){o.preventDefault(),s?(s=!1,n()):(s=!0,e(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),t.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}).on("touchend.zoom",function(o){o.preventDefault(),s&&(s=!1,n())}),d.isFunction(i.callback)&&i.callback.call(c)},c.setAttribute("role","presentation"),c.alt=i.alt||"",c.src=i.url})},d.fn.zoom.defaults=n}(window.jQuery);

View File

@ -4,7 +4,12 @@ PROTECTED_BRANCH="master"
REMOTE_REF=$(echo "$HUSKY_GIT_STDIN" | cut -d " " -f 3)
if [ -n "$REMOTE_REF" ]; then
if [ -z "${REMOTE_REF##*$PROTECTED_BRANCH*}" ]; then
if [ "refs/heads/${PROTECTED_BRANCH}" == "$REMOTE_REF" ]; then
if [ "$TERM" == "dumb" ]; then
>&2 echo "Sorry, you are unable to push to master using a GUI client! Please use git CLI."
exit 1
fi
printf "%sYou're about to push to master, is that what you intended? [y/N]: %s" "$(tput setaf 3)" "$(tput sgr0)"
read -r PROCEED < /dev/tty
echo

View File

@ -8,19 +8,19 @@
"minimum-stability": "dev",
"require": {
"php": ">=7.0",
"automattic/jetpack-autoloader": "^1.7.0",
"automattic/jetpack-constants": "^1.1",
"automattic/jetpack-autoloader": "2.0.2",
"automattic/jetpack-constants": "1.4.0",
"composer/installers": "1.7.0",
"league/container": "3.3.1",
"maxmind-db/reader": "1.6.0",
"pelago/emogrifier": "^3.1",
"pelago/emogrifier": "3.1.0",
"woocommerce/action-scheduler": "3.1.6",
"woocommerce/woocommerce-admin": "1.3.0-rc.1",
"woocommerce/woocommerce-blocks": "2.7.1",
"woocommerce/woocommerce-rest-api": "1.0.10"
"woocommerce/woocommerce-admin": "1.4.0-beta.3",
"woocommerce/woocommerce-blocks": "3.1.0"
},
"require-dev": {
"phpunit/phpunit": "7.5.20",
"woocommerce/woocommerce-sniffs": "0.0.10",
"woocommerce/woocommerce-sniffs": "^0.1.0",
"wp-cli/i18n-command": "^2.2"
},
"config": {
@ -39,15 +39,21 @@
"includes/legacy",
"includes/libraries"
],
"classmap": [
"includes/rest-api"
],
"psr-4": {
"Automattic\\WooCommerce\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Automattic\\WooCommerce\\Tests\\": "tests/php/src",
"Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools"
}
"Automattic\\WooCommerce\\Tests\\": "tests/php/src/",
"Automattic\\WooCommerce\\Testing\\Tools\\": "tests/Tools/"
},
"classmap": [
"tests/legacy/unit-tests/rest-api/Helpers"
]
},
"scripts": {
"post-install-cmd": [

365
composer.lock generated
View File

@ -4,24 +4,24 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c35209de8f965f88aa5121e3ba76fc65",
"content-hash": "3fedb486f9fb3c8ba2e6d4c7ef5efd1e",
"packages": [
{
"name": "automattic/jetpack-autoloader",
"version": "v1.7.0",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-autoloader.git",
"reference": "7c6736eeee0f9fc49fa691fe3e958725efb27ca0"
"reference": "4502da4b2443fc1b61389cacc94c34876aca2b3d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/7c6736eeee0f9fc49fa691fe3e958725efb27ca0",
"reference": "7c6736eeee0f9fc49fa691fe3e958725efb27ca0",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/4502da4b2443fc1b61389cacc94c34876aca2b3d",
"reference": "4502da4b2443fc1b61389cacc94c34876aca2b3d",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1"
"composer-plugin-api": "^1.1 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
@ -40,20 +40,20 @@
"GPL-2.0-or-later"
],
"description": "Creates a custom autoloader for a plugin or theme.",
"time": "2020-04-23T02:28:37+00:00"
"time": "2020-07-09T13:18:38+00:00"
},
{
"name": "automattic/jetpack-constants",
"version": "v1.2.0",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-constants.git",
"reference": "881618defb04134ddba120e7835af1a474a11edc"
"reference": "b4210d56948529b43785ce31e0055f435eac1f9f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/881618defb04134ddba120e7835af1a474a11edc",
"reference": "881618defb04134ddba120e7835af1a474a11edc",
"url": "https://api.github.com/repos/Automattic/jetpack-constants/zipball/b4210d56948529b43785ce31e0055f435eac1f9f",
"reference": "b4210d56948529b43785ce31e0055f435eac1f9f",
"shasum": ""
},
"require-dev": {
@ -71,7 +71,7 @@
"GPL-2.0-or-later"
],
"description": "A wrapper for defining constants in a more testable way.",
"time": "2020-04-15T18:58:53+00:00"
"time": "2020-07-01T15:55:35+00:00"
},
{
"name": "composer/installers",
@ -195,6 +195,78 @@
],
"time": "2019-08-12T15:00:31+00:00"
},
{
"name": "league/container",
"version": "3.3.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/container.git",
"reference": "93238f74ff5964aee27a78508cdfbdba1cd338f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/container/zipball/93238f74ff5964aee27a78508cdfbdba1cd338f6",
"reference": "93238f74ff5964aee27a78508cdfbdba1cd338f6",
"shasum": ""
},
"require": {
"php": "^7.0",
"psr/container": "^1.0"
},
"provide": {
"psr/container-implementation": "^1.0"
},
"replace": {
"orno/di": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"squizlabs/php_codesniffer": "^3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Container\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Phil Bennett",
"email": "philipobenito@gmail.com",
"homepage": "http://www.philipobenito.com",
"role": "Developer"
}
],
"description": "A fast and intuitive dependency injection container.",
"homepage": "https://github.com/thephpleague/container",
"keywords": [
"container",
"dependency",
"di",
"injection",
"league",
"provider",
"service"
],
"funding": [
{
"url": "https://github.com/philipobenito",
"type": "github"
}
],
"time": "2020-05-18T08:20:23+00:00"
},
{
"name": "maxmind-db/reader",
"version": "v1.6.0",
@ -329,9 +401,58 @@
],
"time": "2019-12-26T19:37:31+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.4.42",
"version": "v3.4.43",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@ -380,6 +501,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-16T08:31:04+00:00"
},
{
@ -419,20 +554,20 @@
},
{
"name": "woocommerce/woocommerce-admin",
"version": "v1.3.0-rc.1",
"version": "v1.4.0-beta.3",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "12bc8bf522298a099bb725990cd50bae944e667f"
"reference": "df2af46a8552cdee15df0030fccbe4cd5a6d270d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/12bc8bf522298a099bb725990cd50bae944e667f",
"reference": "12bc8bf522298a099bb725990cd50bae944e667f",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/df2af46a8552cdee15df0030fccbe4cd5a6d270d",
"reference": "df2af46a8552cdee15df0030fccbe4cd5a6d270d",
"shasum": ""
},
"require": {
"automattic/jetpack-autoloader": "^1.6.0",
"automattic/jetpack-autoloader": "^2.0.0",
"composer/installers": "1.7.0",
"php": ">=5.6|>=7.0"
},
@ -462,24 +597,24 @@
],
"description": "A modern, javascript-driven WooCommerce Admin experience.",
"homepage": "https://github.com/woocommerce/woocommerce-admin",
"time": "2020-06-23T02:57:05+00:00"
"time": "2020-08-04T02:21:47+00:00"
},
{
"name": "woocommerce/woocommerce-blocks",
"version": "v2.7.1",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "0025c5cda83892c6f566fffd05197006f230d16c"
"reference": "d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/0025c5cda83892c6f566fffd05197006f230d16c",
"reference": "0025c5cda83892c6f566fffd05197006f230d16c",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436",
"reference": "d8fdcb4fc90c392e672b0e75bb0b7fd81dac7436",
"shasum": ""
},
"require": {
"automattic/jetpack-autoloader": "^1.6.0",
"automattic/jetpack-autoloader": "^2.0.0",
"composer/installers": "1.7.0"
},
"require-dev": {
@ -509,68 +644,28 @@
"gutenberg",
"woocommerce"
],
"time": "2020-06-16T13:34:29+00:00"
},
{
"name": "woocommerce/woocommerce-rest-api",
"version": "1.0.10",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-rest-api.git",
"reference": "fdcb116b4f5b699b942c01b46fd863c7da8b4b7c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-rest-api/zipball/fdcb116b4f5b699b942c01b46fd863c7da8b4b7c",
"reference": "fdcb116b4f5b699b942c01b46fd863c7da8b4b7c",
"shasum": ""
},
"require": {
"automattic/jetpack-autoloader": "^1.2.0"
},
"require-dev": {
"phpunit/phpunit": "6.5.14",
"woocommerce/woocommerce-sniffs": "0.0.9"
},
"type": "wordpress-plugin",
"autoload": {
"classmap": [
"src/Controllers/Version1",
"src/Controllers/Version2",
"src/Controllers/Version3"
],
"psr-4": {
"Automattic\\WooCommerce\\RestApi\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0-or-later"
],
"description": "The WooCommerce core REST API.",
"homepage": "https://github.com/woocommerce/woocommerce-rest-api",
"time": "2020-06-16T09:51:51+00:00"
"time": "2020-07-29T15:45:19+00:00"
}
],
"packages-dev": [
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.6.2",
"version": "v0.7.0",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
"reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a"
"reference": "e8d808670b8f882188368faaf1144448c169c0b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/8001af8eb107fbfcedc31a8b51e20b07d85b457a",
"reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7",
"reference": "e8d808670b8f882188368faaf1144448c169c0b7",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": "^5.3|^7",
"squizlabs/php_codesniffer": "^2|^3"
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev"
},
"require-dev": {
"composer/composer": "*",
@ -617,7 +712,7 @@
"stylecheck",
"tests"
],
"time": "2020-01-29T20:22:20+00:00"
"time": "2020-06-25T14:57:39+00:00"
},
{
"name": "doctrine/instantiator",
@ -673,6 +768,20 @@
"constructor",
"instantiate"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-05-29T17:27:14+00:00"
},
{
@ -891,20 +1000,20 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.9.5",
"version": "1.10.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "b2c28789e80a97badd14145fda39b545d83ca3ef"
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef",
"reference": "b2c28789e80a97badd14145fda39b545d83ca3ef",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
"shasum": ""
},
"require": {
"php": "^7.1"
"php": "^7.1 || ^8.0"
},
"replace": {
"myclabs/deep-copy": "self.version"
@ -935,7 +1044,13 @@
"object",
"object graph"
],
"time": "2020-01-17T21:11:47+00:00"
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
"time": "2020-06-29T13:22:24+00:00"
},
{
"name": "phar-io/manifest",
@ -2414,7 +2529,7 @@
},
{
"name": "symfony/finder",
"version": "v3.4.42",
"version": "v3.4.43",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@ -2459,20 +2574,34 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-02-14T07:34:21+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.17.1",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d"
"reference": "1c302646f6efc070cd46856e600e5e0684d6b454"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d",
"reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454",
"reference": "1c302646f6efc070cd46856e600e5e0684d6b454",
"shasum": ""
},
"require": {
@ -2484,7 +2613,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.17-dev"
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -2521,7 +2650,21 @@
"polyfill",
"portable"
],
"time": "2020-06-06T08:46:27+00:00"
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "theseer/tokenizer",
@ -2565,20 +2708,20 @@
},
{
"name": "webmozart/assert",
"version": "1.9.0",
"version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "9dc4f203e36f2b486149058bade43c851dd97451"
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451",
"reference": "9dc4f203e36f2b486149058bade43c851dd97451",
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0",
"php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
@ -2610,27 +2753,27 @@
"check",
"validate"
],
"time": "2020-06-16T10:16:42+00:00"
"time": "2020-07-08T17:02:28+00:00"
},
{
"name": "woocommerce/woocommerce-sniffs",
"version": "0.0.10",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-sniffs.git",
"reference": "b0e3d69a53b3ffdbb97a0371bd1b43aa17092d65"
"reference": "b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/b0e3d69a53b3ffdbb97a0371bd1b43aa17092d65",
"reference": "b0e3d69a53b3ffdbb97a0371bd1b43aa17092d65",
"url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79",
"reference": "b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "0.6.2",
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
"php": ">=7.0",
"phpcompatibility/phpcompatibility-wp": "2.1.0",
"wp-coding-standards/wpcs": "2.2.1"
"wp-coding-standards/wpcs": "2.3.0"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
@ -2650,20 +2793,20 @@
"woocommerce",
"wordpress"
],
"time": "2020-04-07T20:25:44+00:00"
"time": "2020-08-06T18:23:45+00:00"
},
{
"name": "wp-cli/i18n-command",
"version": "v2.2.3",
"version": "v2.2.5",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/i18n-command.git",
"reference": "7a5d483d872dfec1b89d88d348666ecd59454d52"
"reference": "b02ecdc9a57f9633740c254d19749118b7411f0f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/7a5d483d872dfec1b89d88d348666ecd59454d52",
"reference": "7a5d483d872dfec1b89d88d348666ecd59454d52",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/b02ecdc9a57f9633740c254d19749118b7411f0f",
"reference": "b02ecdc9a57f9633740c254d19749118b7411f0f",
"shasum": ""
},
"require": {
@ -2707,7 +2850,7 @@
],
"description": "Provides internationalization tools for WordPress projects.",
"homepage": "https://github.com/wp-cli/i18n-command",
"time": "2020-06-04T07:07:10+00:00"
"time": "2020-07-08T15:20:38+00:00"
},
{
"name": "wp-cli/mustangostang-spyc",
@ -2871,16 +3014,16 @@
},
{
"name": "wp-coding-standards/wpcs",
"version": "2.2.1",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
"reference": "b5a453203114cc2284b1a614c4953456fbe4f546"
"reference": "7da1894633f168fe244afc6de00d141f27517b62"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b5a453203114cc2284b1a614c4953456fbe4f546",
"reference": "b5a453203114cc2284b1a614c4953456fbe4f546",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
"reference": "7da1894633f168fe244afc6de00d141f27517b62",
"shasum": ""
},
"require": {
@ -2890,6 +3033,7 @@
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
@ -2912,7 +3056,7 @@
"standards",
"wordpress"
],
"time": "2020-02-04T02:52:06+00:00"
"time": "2020-05-13T23:57:56+00:00"
}
],
"aliases": [],
@ -2926,5 +3070,6 @@
"platform-dev": [],
"platform-overrides": {
"php": "7.1"
}
},
"plugin-api-version": "1.1.0"
}

View File

@ -4,7 +4,7 @@
*
* Returns an array of continents.
*
* @package WooCommerce/i18n
* @package WooCommerce\i18n
* @version 2.5.0
*/

View File

@ -13,7 +13,7 @@ defined( 'ABSPATH' ) || exit;
return array(
'AF' => __( 'Afghanistan', 'woocommerce' ),
'AX' => __( '&#197;land Islands', 'woocommerce' ),
'AX' => __( 'Åland Islands', 'woocommerce' ),
'AL' => __( 'Albania', 'woocommerce' ),
'DZ' => __( 'Algeria', 'woocommerce' ),
'AS' => __( 'American Samoa', 'woocommerce' ),

View File

@ -2,13 +2,22 @@
/**
* Locales information
*
* @package WooCommerce/i18n
* @package WooCommerce\i18n
* @version 3.5.0
*/
defined( 'ABSPATH' ) || exit;
return array(
'AT' => array(
'currency_code' => 'EUR',
'currency_pos' => 'left',
'thousand_sep' => '.',
'decimal_sep' => ',',
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'AU' => array(
'currency_code' => 'AUD',
'currency_pos' => 'left',
@ -18,6 +27,15 @@ return array(
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'BA' => array(
'currency_code' => 'BAM',
'currency_pos' => 'right_space',
'thousand_sep' => '.',
'decimal_sep' => ',',
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'BD' => array(
'currency_code' => 'BDT',
'currency_pos' => 'left',
@ -54,6 +72,15 @@ return array(
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'CH' => array(
'currency_code' => 'CHF',
'currency_pos' => 'left_space',
'thousand_sep' => "'",
'decimal_sep' => '.',
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'DE' => array(
'currency_code' => 'EUR',
'currency_pos' => 'left',
@ -135,6 +162,15 @@ return array(
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'LI' => array(
'currency_code' => 'CHF',
'currency_pos' => 'left_space',
'thousand_sep' => "'",
'decimal_sep' => '.',
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
),
'MD' => array(
'currency_code' => 'MDL',
'currency_pos' => 'right_space',

View File

@ -4,7 +4,7 @@
*
* Returns an array of calling codes.
*
* @package WooCommerce/i18n
* @package WooCommerce\i18n
*/
defined( 'ABSPATH' ) || exit;

View File

@ -36,22 +36,22 @@ return array(
'ZAI' => __( 'Zaire', 'woocommerce' ),
),
'AR' => array( // Argentinian provinces.
'C' => __( 'Ciudad Aut&oacute;noma de Buenos Aires', 'woocommerce' ),
'C' => __( 'Ciudad Autónoma de Buenos Aires', 'woocommerce' ),
'B' => __( 'Buenos Aires', 'woocommerce' ),
'K' => __( 'Catamarca', 'woocommerce' ),
'H' => __( 'Chaco', 'woocommerce' ),
'U' => __( 'Chubut', 'woocommerce' ),
'X' => __( 'C&oacute;rdoba', 'woocommerce' ),
'X' => __( 'Córdoba', 'woocommerce' ),
'W' => __( 'Corrientes', 'woocommerce' ),
'E' => __( 'Entre R&iacute;os', 'woocommerce' ),
'E' => __( 'Entre Ríos', 'woocommerce' ),
'P' => __( 'Formosa', 'woocommerce' ),
'Y' => __( 'Jujuy', 'woocommerce' ),
'L' => __( 'La Pampa', 'woocommerce' ),
'F' => __( 'La Rioja', 'woocommerce' ),
'M' => __( 'Mendoza', 'woocommerce' ),
'N' => __( 'Misiones', 'woocommerce' ),
'Q' => __( 'Neuqu&eacute;n', 'woocommerce' ),
'R' => __( 'R&iacute;o Negro', 'woocommerce' ),
'Q' => __( 'Neuquén', 'woocommerce' ),
'R' => __( 'Río Negro', 'woocommerce' ),
'A' => __( 'Salta', 'woocommerce' ),
'J' => __( 'San Juan', 'woocommerce' ),
'D' => __( 'San Luis', 'woocommerce' ),
@ -59,7 +59,7 @@ return array(
'S' => __( 'Santa Fe', 'woocommerce' ),
'G' => __( 'Santiago del Estero', 'woocommerce' ),
'V' => __( 'Tierra del Fuego', 'woocommerce' ),
'T' => __( 'Tucum&aacute;n', 'woocommerce' ),
'T' => __( 'Tucumán', 'woocommerce' ),
),
'AT' => array(),
'AU' => array( // Australian states.
@ -186,29 +186,29 @@ return array(
'BR' => array( // Brazillian states.
'AC' => __( 'Acre', 'woocommerce' ),
'AL' => __( 'Alagoas', 'woocommerce' ),
'AP' => __( 'Amap&aacute;', 'woocommerce' ),
'AP' => __( 'Amapá', 'woocommerce' ),
'AM' => __( 'Amazonas', 'woocommerce' ),
'BA' => __( 'Bahia', 'woocommerce' ),
'CE' => __( 'Cear&aacute;', 'woocommerce' ),
'CE' => __( 'Ceará', 'woocommerce' ),
'DF' => __( 'Distrito Federal', 'woocommerce' ),
'ES' => __( 'Esp&iacute;rito Santo', 'woocommerce' ),
'GO' => __( 'Goi&aacute;s', 'woocommerce' ),
'MA' => __( 'Maranh&atilde;o', 'woocommerce' ),
'ES' => __( 'Espírito Santo', 'woocommerce' ),
'GO' => __( 'Goiás', 'woocommerce' ),
'MA' => __( 'Maranhão', 'woocommerce' ),
'MT' => __( 'Mato Grosso', 'woocommerce' ),
'MS' => __( 'Mato Grosso do Sul', 'woocommerce' ),
'MG' => __( 'Minas Gerais', 'woocommerce' ),
'PA' => __( 'Par&aacute;', 'woocommerce' ),
'PB' => __( 'Para&iacute;ba', 'woocommerce' ),
'PR' => __( 'Paran&aacute;', 'woocommerce' ),
'PA' => __( 'Pará', 'woocommerce' ),
'PB' => __( 'Paraíba', 'woocommerce' ),
'PR' => __( 'Paraná', 'woocommerce' ),
'PE' => __( 'Pernambuco', 'woocommerce' ),
'PI' => __( 'Piau&iacute;', 'woocommerce' ),
'PI' => __( 'Piauí', 'woocommerce' ),
'RJ' => __( 'Rio de Janeiro', 'woocommerce' ),
'RN' => __( 'Rio Grande do Norte', 'woocommerce' ),
'RS' => __( 'Rio Grande do Sul', 'woocommerce' ),
'RO' => __( 'Rond&ocirc;nia', 'woocommerce' ),
'RO' => __( 'Rondônia', 'woocommerce' ),
'RR' => __( 'Roraima', 'woocommerce' ),
'SC' => __( 'Santa Catarina', 'woocommerce' ),
'SP' => __( 'S&atilde;o Paulo', 'woocommerce' ),
'SP' => __( 'São Paulo', 'woocommerce' ),
'SE' => __( 'Sergipe', 'woocommerce' ),
'TO' => __( 'Tocantins', 'woocommerce' ),
),
@ -237,10 +237,10 @@ return array(
'FR' => __( 'Fribourg', 'woocommerce' ),
'GE' => __( 'Geneva', 'woocommerce' ),
'GL' => __( 'Glarus', 'woocommerce' ),
'GR' => __( 'Graub&uuml;nden', 'woocommerce' ),
'GR' => __( 'Graubünden', 'woocommerce' ),
'JU' => __( 'Jura', 'woocommerce' ),
'LU' => __( 'Luzern', 'woocommerce' ),
'NE' => __( 'Neuch&acirc;tel', 'woocommerce' ),
'NE' => __( 'Neuchâtel', 'woocommerce' ),
'NW' => __( 'Nidwalden', 'woocommerce' ),
'OW' => __( 'Obwalden', 'woocommerce' ),
'SH' => __( 'Schaffhausen', 'woocommerce' ),
@ -253,65 +253,115 @@ return array(
'VS' => __( 'Valais', 'woocommerce' ),
'VD' => __( 'Vaud', 'woocommerce' ),
'ZG' => __( 'Zug', 'woocommerce' ),
'ZH' => __( 'Z&uuml;rich', 'woocommerce' ),
'ZH' => __( 'Zürich', 'woocommerce' ),
),
'CN' => array( // Chinese states.
'CN1' => __( 'Yunnan / &#20113;&#21335;', 'woocommerce' ),
'CN2' => __( 'Beijing / &#21271;&#20140;', 'woocommerce' ),
'CN3' => __( 'Tianjin / &#22825;&#27941;', 'woocommerce' ),
'CN4' => __( 'Hebei / &#27827;&#21271;', 'woocommerce' ),
'CN5' => __( 'Shanxi / &#23665;&#35199;', 'woocommerce' ),
'CN6' => __( 'Inner Mongolia / &#20839;&#33945;&#21476;', 'woocommerce' ),
'CN7' => __( 'Liaoning / &#36797;&#23425;', 'woocommerce' ),
'CN8' => __( 'Jilin / &#21513;&#26519;', 'woocommerce' ),
'CN9' => __( 'Heilongjiang / &#40657;&#40857;&#27743;', 'woocommerce' ),
'CN10' => __( 'Shanghai / &#19978;&#28023;', 'woocommerce' ),
'CN11' => __( 'Jiangsu / &#27743;&#33487;', 'woocommerce' ),
'CN12' => __( 'Zhejiang / &#27993;&#27743;', 'woocommerce' ),
'CN13' => __( 'Anhui / &#23433;&#24509;', 'woocommerce' ),
'CN14' => __( 'Fujian / &#31119;&#24314;', 'woocommerce' ),
'CN15' => __( 'Jiangxi / &#27743;&#35199;', 'woocommerce' ),
'CN16' => __( 'Shandong / &#23665;&#19996;', 'woocommerce' ),
'CN17' => __( 'Henan / &#27827;&#21335;', 'woocommerce' ),
'CN18' => __( 'Hubei / &#28246;&#21271;', 'woocommerce' ),
'CN19' => __( 'Hunan / &#28246;&#21335;', 'woocommerce' ),
'CN20' => __( 'Guangdong / &#24191;&#19996;', 'woocommerce' ),
'CN21' => __( 'Guangxi Zhuang / &#24191;&#35199;&#22766;&#26063;', 'woocommerce' ),
'CN22' => __( 'Hainan / &#28023;&#21335;', 'woocommerce' ),
'CN23' => __( 'Chongqing / &#37325;&#24198;', 'woocommerce' ),
'CN24' => __( 'Sichuan / &#22235;&#24029;', 'woocommerce' ),
'CN25' => __( 'Guizhou / &#36149;&#24030;', 'woocommerce' ),
'CN26' => __( 'Shaanxi / &#38485;&#35199;', 'woocommerce' ),
'CN27' => __( 'Gansu / &#29976;&#32899;', 'woocommerce' ),
'CN28' => __( 'Qinghai / &#38738;&#28023;', 'woocommerce' ),
'CN29' => __( 'Ningxia Hui / &#23425;&#22799;', 'woocommerce' ),
'CN30' => __( 'Macao / &#28595;&#38376;', 'woocommerce' ),
'CN31' => __( 'Tibet / &#35199;&#34255;', 'woocommerce' ),
'CN32' => __( 'Xinjiang / &#26032;&#30086;', 'woocommerce' ),
'CN1' => __( 'Yunnan / 云南', 'woocommerce' ),
'CN2' => __( 'Beijing / 北京', 'woocommerce' ),
'CN3' => __( 'Tianjin / 天津', 'woocommerce' ),
'CN4' => __( 'Hebei / 河北', 'woocommerce' ),
'CN5' => __( 'Shanxi / 山西', 'woocommerce' ),
'CN6' => __( 'Inner Mongolia / 內蒙古', 'woocommerce' ),
'CN7' => __( 'Liaoning / 辽宁', 'woocommerce' ),
'CN8' => __( 'Jilin / 吉林', 'woocommerce' ),
'CN9' => __( 'Heilongjiang / 黑龙江', 'woocommerce' ),
'CN10' => __( 'Shanghai / 上海', 'woocommerce' ),
'CN11' => __( 'Jiangsu / 江苏', 'woocommerce' ),
'CN12' => __( 'Zhejiang / 浙江', 'woocommerce' ),
'CN13' => __( 'Anhui / 安徽', 'woocommerce' ),
'CN14' => __( 'Fujian / 福建', 'woocommerce' ),
'CN15' => __( 'Jiangxi / 江西', 'woocommerce' ),
'CN16' => __( 'Shandong / 山东', 'woocommerce' ),
'CN17' => __( 'Henan / 河南', 'woocommerce' ),
'CN18' => __( 'Hubei / 湖北', 'woocommerce' ),
'CN19' => __( 'Hunan / 湖南', 'woocommerce' ),
'CN20' => __( 'Guangdong / 广东', 'woocommerce' ),
'CN21' => __( 'Guangxi Zhuang / 广西壮族', 'woocommerce' ),
'CN22' => __( 'Hainan / 海南', 'woocommerce' ),
'CN23' => __( 'Chongqing / 重庆', 'woocommerce' ),
'CN24' => __( 'Sichuan / 四川', 'woocommerce' ),
'CN25' => __( 'Guizhou / 贵州', 'woocommerce' ),
'CN26' => __( 'Shaanxi / 陕西', 'woocommerce' ),
'CN27' => __( 'Gansu / 甘肃', 'woocommerce' ),
'CN28' => __( 'Qinghai / 青海', 'woocommerce' ),
'CN29' => __( 'Ningxia Hui / 宁夏', 'woocommerce' ),
'CN30' => __( 'Macao / 澳门', 'woocommerce' ),
'CN31' => __( 'Tibet / 西藏', 'woocommerce' ),
'CN32' => __( 'Xinjiang / 新疆', 'woocommerce' ),
),
'CZ' => array(),
'DE' => array(),
'DK' => array(),
'DZ' => array(
'DZ-01' => __( 'Adrar', 'woocommerce' ),
'DZ-02' => __( 'Chlef', 'woocommerce' ),
'DZ-03' => __( 'Laghouat', 'woocommerce' ),
'DZ-04' => __( 'Oum El Bouaghi', 'woocommerce' ),
'DZ-05' => __( 'Batna', 'woocommerce' ),
'DZ-06' => __( 'Béjaïa', 'woocommerce' ),
'DZ-07' => __( 'Biskra', 'woocommerce' ),
'DZ-08' => __( 'Béchar', 'woocommerce' ),
'DZ-09' => __( 'Blida', 'woocommerce' ),
'DZ-10' => __( 'Bouira', 'woocommerce' ),
'DZ-11' => __( 'Tamanghasset', 'woocommerce' ),
'DZ-12' => __( 'Tébessa', 'woocommerce' ),
'DZ-13' => __( 'Tlemcen', 'woocommerce' ),
'DZ-14' => __( 'Tiaret', 'woocommerce' ),
'DZ-15' => __( 'Tizi Ouzou', 'woocommerce' ),
'DZ-16' => __( 'Algiers', 'woocommerce' ),
'DZ-17' => __( 'Djelfa', 'woocommerce' ),
'DZ-18' => __( 'Jijel', 'woocommerce' ),
'DZ-19' => __( 'Sétif', 'woocommerce' ),
'DZ-20' => __( 'Saïda', 'woocommerce' ),
'DZ-21' => __( 'Skikda', 'woocommerce' ),
'DZ-22' => __( 'Sidi Bel Abbès', 'woocommerce' ),
'DZ-23' => __( 'Annaba', 'woocommerce' ),
'DZ-24' => __( 'Guelma', 'woocommerce' ),
'DZ-25' => __( 'Constantine', 'woocommerce' ),
'DZ-26' => __( 'Médéa', 'woocommerce' ),
'DZ-27' => __( 'Mostaganem', 'woocommerce' ),
'DZ-28' => __( 'MSila', 'woocommerce' ),
'DZ-29' => __( 'Mascara', 'woocommerce' ),
'DZ-30' => __( 'Ouargla', 'woocommerce' ),
'DZ-31' => __( 'Oran', 'woocommerce' ),
'DZ-32' => __( 'El Bayadh', 'woocommerce' ),
'DZ-33' => __( 'Illizi', 'woocommerce' ),
'DZ-34' => __( 'Bordj Bou Arréridj', 'woocommerce' ),
'DZ-35' => __( 'Boumerdès', 'woocommerce' ),
'DZ-36' => __( 'El Tarf', 'woocommerce' ),
'DZ-37' => __( 'Tindouf', 'woocommerce' ),
'DZ-38' => __( 'Tissemsilt', 'woocommerce' ),
'DZ-39' => __( 'El Oued', 'woocommerce' ),
'DZ-40' => __( 'Khenchela', 'woocommerce' ),
'DZ-41' => __( 'Souk Ahras', 'woocommerce' ),
'DZ-42' => __( 'Tipasa', 'woocommerce' ),
'DZ-43' => __( 'Mila', 'woocommerce' ),
'DZ-44' => __( 'Aïn Defla', 'woocommerce' ),
'DZ-45' => __( 'Naama', 'woocommerce' ),
'DZ-46' => __( 'Aïn Témouchent', 'woocommerce' ),
'DZ-47' => __( 'Ghardaïa', 'woocommerce' ),
'DZ-48' => __( 'Relizane', 'woocommerce' ),
),
'EE' => array(),
'ES' => array( // Spanish states.
'C' => __( 'A Coru&ntilde;a', 'woocommerce' ),
'VI' => __( 'Araba/&Aacute;lava', 'woocommerce' ),
'C' => __( 'A Coruña', 'woocommerce' ),
'VI' => __( 'Araba/Álava', 'woocommerce' ),
'AB' => __( 'Albacete', 'woocommerce' ),
'A' => __( 'Alicante', 'woocommerce' ),
'AL' => __( 'Almer&iacute;a', 'woocommerce' ),
'AL' => __( 'Almería', 'woocommerce' ),
'O' => __( 'Asturias', 'woocommerce' ),
'AV' => __( '&Aacute;vila', 'woocommerce' ),
'AV' => __( 'Ávila', 'woocommerce' ),
'BA' => __( 'Badajoz', 'woocommerce' ),
'PM' => __( 'Baleares', 'woocommerce' ),
'B' => __( 'Barcelona', 'woocommerce' ),
'BU' => __( 'Burgos', 'woocommerce' ),
'CC' => __( 'C&aacute;ceres', 'woocommerce' ),
'CA' => __( 'C&aacute;diz', 'woocommerce' ),
'CC' => __( 'Cáceres', 'woocommerce' ),
'CA' => __( 'Cádiz', 'woocommerce' ),
'S' => __( 'Cantabria', 'woocommerce' ),
'CS' => __( 'Castell&oacute;n', 'woocommerce' ),
'CS' => __( 'Castellón', 'woocommerce' ),
'CE' => __( 'Ceuta', 'woocommerce' ),
'CR' => __( 'Ciudad Real', 'woocommerce' ),
'CO' => __( 'C&oacute;rdoba', 'woocommerce' ),
'CO' => __( 'Córdoba', 'woocommerce' ),
'CU' => __( 'Cuenca', 'woocommerce' ),
'GI' => __( 'Girona', 'woocommerce' ),
'GR' => __( 'Granada', 'woocommerce' ),
@ -319,14 +369,14 @@ return array(
'SS' => __( 'Gipuzkoa', 'woocommerce' ),
'H' => __( 'Huelva', 'woocommerce' ),
'HU' => __( 'Huesca', 'woocommerce' ),
'J' => __( 'Ja&eacute;n', 'woocommerce' ),
'J' => __( 'Jaén', 'woocommerce' ),
'LO' => __( 'La Rioja', 'woocommerce' ),
'GC' => __( 'Las Palmas', 'woocommerce' ),
'LE' => __( 'Le&oacute;n', 'woocommerce' ),
'LE' => __( 'León', 'woocommerce' ),
'L' => __( 'Lleida', 'woocommerce' ),
'LU' => __( 'Lugo', 'woocommerce' ),
'M' => __( 'Madrid', 'woocommerce' ),
'MA' => __( 'M&aacute;laga', 'woocommerce' ),
'MA' => __( 'Málaga', 'woocommerce' ),
'ML' => __( 'Melilla', 'woocommerce' ),
'MU' => __( 'Murcia', 'woocommerce' ),
'NA' => __( 'Navarra', 'woocommerce' ),
@ -370,19 +420,19 @@ return array(
),
'GP' => array(),
'GR' => array( // Greek Regions.
'I' => __( 'Αττική', 'woocommerce' ),
'A' => __( 'Ανατολική Μακεδονία και Θράκη', 'woocommerce' ),
'B' => __( 'Κεντρική Μακεδονία', 'woocommerce' ),
'C' => __( 'Δυτική Μακεδονία', 'woocommerce' ),
'D' => __( 'Ήπειρος', 'woocommerce' ),
'E' => __( 'Θεσσαλία', 'woocommerce' ),
'F' => __( 'Ιόνιοι Νήσοι', 'woocommerce' ),
'G' => __( 'Δυτική Ελλάδα', 'woocommerce' ),
'H' => __( 'Στερεά Ελλάδα', 'woocommerce' ),
'J' => __( 'Πελοπόννησος', 'woocommerce' ),
'K' => __( 'Βόρειο Αιγαίο', 'woocommerce' ),
'L' => __( 'Νότιο Αιγαίο', 'woocommerce' ),
'M' => __( 'Κρήτη', 'woocommerce' ),
'I' => __( 'Attica', 'woocommerce' ),
'A' => __( 'East Macedonia and Thrace', 'woocommerce' ),
'B' => __( 'Central Macedonia', 'woocommerce' ),
'C' => __( 'West Macedonia', 'woocommerce' ),
'D' => __( 'Epirus', 'woocommerce' ),
'E' => __( 'Thessaly', 'woocommerce' ),
'F' => __( 'Ionian Islands', 'woocommerce' ),
'G' => __( 'West Greece', 'woocommerce' ),
'H' => __( 'Central Greece', 'woocommerce' ),
'J' => __( 'Peloponnese', 'woocommerce' ),
'K' => __( 'North Aegean', 'woocommerce' ),
'L' => __( 'South Aegean', 'woocommerce' ),
'M' => __( 'Crete', 'woocommerce' ),
),
'GF' => array(),
'HK' => array( // Hong Kong states.
@ -806,48 +856,48 @@ return array(
),
'LU' => array(),
'MD' => array( // Moldova states.
'C' => __( 'Chi&#537;in&#259;u', 'woocommerce' ),
'BL' => __( 'B&#259;l&#539;i', 'woocommerce' ),
'C' => __( 'Chișinău', 'woocommerce' ),
'BL' => __( 'Bălți', 'woocommerce' ),
'AN' => __( 'Anenii Noi', 'woocommerce' ),
'BS' => __( 'Basarabeasca', 'woocommerce' ),
'BR' => __( 'Briceni', 'woocommerce' ),
'CH' => __( 'Cahul', 'woocommerce' ),
'CT' => __( 'Cantemir', 'woocommerce' ),
'CL' => __( 'C&#259;l&#259;ra&#537;i', 'woocommerce' ),
'CS' => __( 'C&#259;u&#537;eni', 'woocommerce' ),
'CM' => __( 'Cimi&#537;lia', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'CS' => __( 'Căușeni', 'woocommerce' ),
'CM' => __( 'Cimișlia', 'woocommerce' ),
'CR' => __( 'Criuleni', 'woocommerce' ),
'DN' => __( 'Dondu&#537;eni', 'woocommerce' ),
'DN' => __( 'Dondușeni', 'woocommerce' ),
'DR' => __( 'Drochia', 'woocommerce' ),
'DB' => __( 'Dub&#259;sari', 'woocommerce' ),
'ED' => __( 'Edine&#539;', 'woocommerce' ),
'FL' => __( 'F&#259;le&#537;ti', 'woocommerce' ),
'FR' => __( 'Flore&#537;ti', 'woocommerce' ),
'GE' => __( 'UTA G&#259;g&#259;uzia', 'woocommerce' ),
'DB' => __( 'Dubăsari', 'woocommerce' ),
'ED' => __( 'Edineț', 'woocommerce' ),
'FL' => __( 'Fălești', 'woocommerce' ),
'FR' => __( 'Florești', 'woocommerce' ),
'GE' => __( 'UTA Găgăuzia', 'woocommerce' ),
'GL' => __( 'Glodeni', 'woocommerce' ),
'HN' => __( 'H&icirc;nce&#537;ti', 'woocommerce' ),
'HN' => __( 'Hîncești', 'woocommerce' ),
'IL' => __( 'Ialoveni', 'woocommerce' ),
'LV' => __( 'Leova', 'woocommerce' ),
'NS' => __( 'Nisporeni', 'woocommerce' ),
'OC' => __( 'Ocni&#539;a', 'woocommerce' ),
'OC' => __( 'Ocnița', 'woocommerce' ),
'OR' => __( 'Orhei', 'woocommerce' ),
'RZ' => __( 'Rezina', 'woocommerce' ),
'RS' => __( 'R&icirc;&#537;cani', 'woocommerce' ),
'SG' => __( 'S&icirc;ngerei', 'woocommerce' ),
'RS' => __( 'Rîșcani', 'woocommerce' ),
'SG' => __( 'Sîngerei', 'woocommerce' ),
'SR' => __( 'Soroca', 'woocommerce' ),
'ST' => __( 'Str&#259;&#537;eni', 'woocommerce' ),
'SD' => __( '&#536;old&#259;ne&#537;ti', 'woocommerce' ),
'SV' => __( '&#536;tefan Vod&#259;', 'woocommerce' ),
'ST' => __( 'Strășeni', 'woocommerce' ),
'SD' => __( 'Șoldănești', 'woocommerce' ),
'SV' => __( 'Ștefan Vodă', 'woocommerce' ),
'TR' => __( 'Taraclia', 'woocommerce' ),
'TL' => __( 'Telene&#537;ti', 'woocommerce' ),
'TL' => __( 'Telenești', 'woocommerce' ),
'UN' => __( 'Ungheni', 'woocommerce' ),
),
'MQ' => array(),
'MT' => array(),
'MX' => array( // Mexico States.
'DF' => __( 'Ciudad de M&eacute;xico', 'woocommerce' ),
'DF' => __( 'Ciudad de México', 'woocommerce' ),
'JA' => __( 'Jalisco', 'woocommerce' ),
'NL' => __( 'Nuevo Le&oacute;n', 'woocommerce' ),
'NL' => __( 'Nuevo León', 'woocommerce' ),
'AG' => __( 'Aguascalientes', 'woocommerce' ),
'BC' => __( 'Baja California', 'woocommerce' ),
'BS' => __( 'Baja California Sur', 'woocommerce' ),
@ -860,22 +910,22 @@ return array(
'GT' => __( 'Guanajuato', 'woocommerce' ),
'GR' => __( 'Guerrero', 'woocommerce' ),
'HG' => __( 'Hidalgo', 'woocommerce' ),
'MX' => __( 'Estado de M&eacute;xico', 'woocommerce' ),
'MI' => __( 'Michoac&aacute;n', 'woocommerce' ),
'MX' => __( 'Estado de México', 'woocommerce' ),
'MI' => __( 'Michoacán', 'woocommerce' ),
'MO' => __( 'Morelos', 'woocommerce' ),
'NA' => __( 'Nayarit', 'woocommerce' ),
'OA' => __( 'Oaxaca', 'woocommerce' ),
'PU' => __( 'Puebla', 'woocommerce' ),
'QT' => __( 'Quer&eacute;taro', 'woocommerce' ),
'QT' => __( 'Querétaro', 'woocommerce' ),
'QR' => __( 'Quintana Roo', 'woocommerce' ),
'SL' => __( 'San Luis Potos&iacute;', 'woocommerce' ),
'SL' => __( 'San Luis Potosí', 'woocommerce' ),
'SI' => __( 'Sinaloa', 'woocommerce' ),
'SO' => __( 'Sonora', 'woocommerce' ),
'TB' => __( 'Tabasco', 'woocommerce' ),
'TM' => __( 'Tamaulipas', 'woocommerce' ),
'TL' => __( 'Tlaxcala', 'woocommerce' ),
'VE' => __( 'Veracruz', 'woocommerce' ),
'YU' => __( 'Yucat&aacute;n', 'woocommerce' ),
'YU' => __( 'Yucatán', 'woocommerce' ),
'ZA' => __( 'Zacatecas', 'woocommerce' ),
),
'MY' => array( // Malaysian states.
@ -909,6 +959,22 @@ return array(
'MZT' => __( 'Tete', 'woocommerce' ),
'MZQ' => __( 'Zambézia', 'woocommerce' ),
),
'NA' => array( // Namibia regions.
'ER' => __( 'Erongo', 'woocommerce' ),
'HA' => __( 'Hardap', 'woocommerce' ),
'KA' => __( 'Karas', 'woocommerce' ),
'KE' => __( 'Kavango East', 'woocommerce' ),
'KW' => __( 'Kavango West', 'woocommerce' ),
'KH' => __( 'Khomas', 'woocommerce' ),
'KU' => __( 'Kunene', 'woocommerce' ),
'OW' => __( 'Ohangwena', 'woocommerce' ),
'OH' => __( 'Omaheke', 'woocommerce' ),
'OS' => __( 'Omusati', 'woocommerce' ),
'ON' => __( 'Oshana', 'woocommerce' ),
'OT' => __( 'Oshikoto', 'woocommerce' ),
'OD' => __( 'Otjozondjupa', 'woocommerce' ),
'CA' => __( 'Zambezi', 'woocommerce' ),
),
'NG' => array( // Nigerian provinces.
'AB' => __( 'Abia', 'woocommerce' ),
'FC' => __( 'Abuja', 'woocommerce' ),
@ -973,7 +1039,7 @@ return array(
'BP' => __( 'Bay of Plenty', 'woocommerce' ),
'TK' => __( 'Taranaki', 'woocommerce' ),
'GI' => __( 'Gisborne', 'woocommerce' ),
'HB' => __( 'Hawke&rsquo;s Bay', 'woocommerce' ),
'HB' => __( 'Hawkes Bay', 'woocommerce' ),
'MW' => __( 'Manawatu-Wanganui', 'woocommerce' ),
'WE' => __( 'Wellington', 'woocommerce' ),
'NS' => __( 'Nelson', 'woocommerce' ),
@ -989,15 +1055,15 @@ return array(
'LMA' => __( 'Municipalidad Metropolitana de Lima', 'woocommerce' ),
'AMA' => __( 'Amazonas', 'woocommerce' ),
'ANC' => __( 'Ancash', 'woocommerce' ),
'APU' => __( 'Apur&iacute;mac', 'woocommerce' ),
'APU' => __( 'Apurímac', 'woocommerce' ),
'ARE' => __( 'Arequipa', 'woocommerce' ),
'AYA' => __( 'Ayacucho', 'woocommerce' ),
'CAJ' => __( 'Cajamarca', 'woocommerce' ),
'CUS' => __( 'Cusco', 'woocommerce' ),
'HUV' => __( 'Huancavelica', 'woocommerce' ),
'HUC' => __( 'Hu&aacute;nuco', 'woocommerce' ),
'HUC' => __( 'Huánuco', 'woocommerce' ),
'ICA' => __( 'Ica', 'woocommerce' ),
'JUN' => __( 'Jun&iacute;n', 'woocommerce' ),
'JUN' => __( 'Junín', 'woocommerce' ),
'LAL' => __( 'La Libertad', 'woocommerce' ),
'LAM' => __( 'Lambayeque', 'woocommerce' ),
'LIM' => __( 'Lima', 'woocommerce' ),
@ -1007,7 +1073,7 @@ return array(
'PAS' => __( 'Pasco', 'woocommerce' ),
'PIU' => __( 'Piura', 'woocommerce' ),
'PUN' => __( 'Puno', 'woocommerce' ),
'SAM' => __( 'San Mart&iacute;n', 'woocommerce' ),
'SAM' => __( 'San Martín', 'woocommerce' ),
'TAC' => __( 'Tacna', 'woocommerce' ),
'TUM' => __( 'Tumbes', 'woocommerce' ),
'UCA' => __( 'Ucayali', 'woocommerce' ),
@ -1113,67 +1179,67 @@ return array(
'PL' => array(),
'PT' => array(),
'PY' => array( // Paraguay states.
'PY-ASU' => __( 'Asunci&oacute;n', 'woocommerce' ),
'PY-1' => __( 'Concepci&oacute;n', 'woocommerce' ),
'PY-ASU' => __( 'Asunción', 'woocommerce' ),
'PY-1' => __( 'Concepción', 'woocommerce' ),
'PY-2' => __( 'San Pedro', 'woocommerce' ),
'PY-3' => __( 'Cordillera', 'woocommerce' ),
'PY-4' => __( 'Guair&aacute;', 'woocommerce' ),
'PY-5' => __( 'Caaguaz&uacute;', 'woocommerce' ),
'PY-6' => __( 'Caazap&aacute;', 'woocommerce' ),
'PY-7' => __( 'Itap&uacute;a', 'woocommerce' ),
'PY-4' => __( 'Guairá', 'woocommerce' ),
'PY-5' => __( 'Caaguazú', 'woocommerce' ),
'PY-6' => __( 'Caazapá', 'woocommerce' ),
'PY-7' => __( 'Itapúa', 'woocommerce' ),
'PY-8' => __( 'Misiones', 'woocommerce' ),
'PY-9' => __( 'Paraguar&iacute;', 'woocommerce' ),
'PY-10' => __( 'Alto Paran&aacute;', 'woocommerce' ),
'PY-9' => __( 'Paraguarí', 'woocommerce' ),
'PY-10' => __( 'Alto Paraná', 'woocommerce' ),
'PY-11' => __( 'Central', 'woocommerce' ),
'PY-12' => __( '&Ntilde;eembuc&uacute;', 'woocommerce' ),
'PY-12' => __( 'Ñeembucú', 'woocommerce' ),
'PY-13' => __( 'Amambay', 'woocommerce' ),
'PY-14' => __( 'Canindey&uacute;', 'woocommerce' ),
'PY-14' => __( 'Canindeyú', 'woocommerce' ),
'PY-15' => __( 'Presidente Hayes', 'woocommerce' ),
'PY-16' => __( 'Alto Paraguay', 'woocommerce' ),
'PY-17' => __( 'Boquer&oacute;n', 'woocommerce' ),
'PY-17' => __( 'Boquerón', 'woocommerce' ),
),
'RE' => array(),
'RO' => array( // Romania states.
'AB' => __( 'Alba', 'woocommerce' ),
'AR' => __( 'Arad', 'woocommerce' ),
'AG' => __( 'Arge&#537;', 'woocommerce' ),
'BC' => __( 'Bac&#259;u', 'woocommerce' ),
'AG' => __( 'Argeș', 'woocommerce' ),
'BC' => __( 'Bacău', 'woocommerce' ),
'BH' => __( 'Bihor', 'woocommerce' ),
'BN' => __( 'Bistri&#539;a-N&#259;s&#259;ud', 'woocommerce' ),
'BT' => __( 'Boto&#537;ani', 'woocommerce' ),
'BR' => __( 'Br&#259;ila', 'woocommerce' ),
'BV' => __( 'Bra&#537;ov', 'woocommerce' ),
'B' => __( 'Bucure&#537;ti', 'woocommerce' ),
'BZ' => __( 'Buz&#259;u', 'woocommerce' ),
'CL' => __( 'C&#259;l&#259;ra&#537;i', 'woocommerce' ),
'CS' => __( 'Cara&#537;-Severin', 'woocommerce' ),
'BN' => __( 'Bistrița-Năsăud', 'woocommerce' ),
'BT' => __( 'Botoșani', 'woocommerce' ),
'BR' => __( 'Brăila', 'woocommerce' ),
'BV' => __( 'Brașov', 'woocommerce' ),
'B' => __( 'București', 'woocommerce' ),
'BZ' => __( 'Buzău', 'woocommerce' ),
'CL' => __( 'Călărași', 'woocommerce' ),
'CS' => __( 'Caraș-Severin', 'woocommerce' ),
'CJ' => __( 'Cluj', 'woocommerce' ),
'CT' => __( 'Constan&#539;a', 'woocommerce' ),
'CT' => __( 'Constanța', 'woocommerce' ),
'CV' => __( 'Covasna', 'woocommerce' ),
'DB' => __( 'D&acirc;mbovi&#539;a', 'woocommerce' ),
'DB' => __( 'Dâmbovița', 'woocommerce' ),
'DJ' => __( 'Dolj', 'woocommerce' ),
'GL' => __( 'Gala&#539;i', 'woocommerce' ),
'GL' => __( 'Galați', 'woocommerce' ),
'GR' => __( 'Giurgiu', 'woocommerce' ),
'GJ' => __( 'Gorj', 'woocommerce' ),
'HR' => __( 'Harghita', 'woocommerce' ),
'HD' => __( 'Hunedoara', 'woocommerce' ),
'IL' => __( 'Ialomi&#539;a', 'woocommerce' ),
'IS' => __( 'Ia&#537;i', 'woocommerce' ),
'IL' => __( 'Ialomița', 'woocommerce' ),
'IS' => __( 'Iași', 'woocommerce' ),
'IF' => __( 'Ilfov', 'woocommerce' ),
'MM' => __( 'Maramure&#537;', 'woocommerce' ),
'MH' => __( 'Mehedin&#539;i', 'woocommerce' ),
'MS' => __( 'Mure&#537;', 'woocommerce' ),
'NT' => __( 'Neam&#539;', 'woocommerce' ),
'MM' => __( 'Maramureș', 'woocommerce' ),
'MH' => __( 'Mehedinți', 'woocommerce' ),
'MS' => __( 'Mureș', 'woocommerce' ),
'NT' => __( 'Neamț', 'woocommerce' ),
'OT' => __( 'Olt', 'woocommerce' ),
'PH' => __( 'Prahova', 'woocommerce' ),
'SJ' => __( 'S&#259;laj', 'woocommerce' ),
'SJ' => __( 'Sălaj', 'woocommerce' ),
'SM' => __( 'Satu Mare', 'woocommerce' ),
'SB' => __( 'Sibiu', 'woocommerce' ),
'SV' => __( 'Suceava', 'woocommerce' ),
'TR' => __( 'Teleorman', 'woocommerce' ),
'TM' => __( 'Timi&#537;', 'woocommerce' ),
'TM' => __( 'Timiș', 'woocommerce' ),
'TL' => __( 'Tulcea', 'woocommerce' ),
'VL' => __( 'V&acirc;lcea', 'woocommerce' ),
'VL' => __( 'Vâlcea', 'woocommerce' ),
'VS' => __( 'Vaslui', 'woocommerce' ),
'VN' => __( 'Vrancea', 'woocommerce' ),
),
@ -1262,56 +1328,56 @@ return array(
),
'TR' => array( // Turkey States.
'TR01' => __( 'Adana', 'woocommerce' ),
'TR02' => __( 'Ad&#305;yaman', 'woocommerce' ),
'TR02' => __( 'Adıyaman', 'woocommerce' ),
'TR03' => __( 'Afyon', 'woocommerce' ),
'TR04' => __( 'A&#287;r&#305;', 'woocommerce' ),
'TR04' => __( 'Ağrı', 'woocommerce' ),
'TR05' => __( 'Amasya', 'woocommerce' ),
'TR06' => __( 'Ankara', 'woocommerce' ),
'TR07' => __( 'Antalya', 'woocommerce' ),
'TR08' => __( 'Artvin', 'woocommerce' ),
'TR09' => __( 'Ayd&#305;n', 'woocommerce' ),
'TR10' => __( 'Bal&#305;kesir', 'woocommerce' ),
'TR09' => __( 'Aydın', 'woocommerce' ),
'TR10' => __( 'Balıkesir', 'woocommerce' ),
'TR11' => __( 'Bilecik', 'woocommerce' ),
'TR12' => __( 'Bing&#246;l', 'woocommerce' ),
'TR12' => __( 'Bingöl', 'woocommerce' ),
'TR13' => __( 'Bitlis', 'woocommerce' ),
'TR14' => __( 'Bolu', 'woocommerce' ),
'TR15' => __( 'Burdur', 'woocommerce' ),
'TR16' => __( 'Bursa', 'woocommerce' ),
'TR17' => __( '&#199;anakkale', 'woocommerce' ),
'TR18' => __( '&#199;ank&#305;r&#305;', 'woocommerce' ),
'TR19' => __( '&#199;orum', 'woocommerce' ),
'TR17' => __( 'Çanakkale', 'woocommerce' ),
'TR18' => __( 'Çankırı', 'woocommerce' ),
'TR19' => __( 'Çorum', 'woocommerce' ),
'TR20' => __( 'Denizli', 'woocommerce' ),
'TR21' => __( 'Diyarbak&#305;r', 'woocommerce' ),
'TR21' => __( 'Diyarbakır', 'woocommerce' ),
'TR22' => __( 'Edirne', 'woocommerce' ),
'TR23' => __( 'Elaz&#305;&#287;', 'woocommerce' ),
'TR23' => __( 'Elazığ', 'woocommerce' ),
'TR24' => __( 'Erzincan', 'woocommerce' ),
'TR25' => __( 'Erzurum', 'woocommerce' ),
'TR26' => __( 'Eski&#351;ehir', 'woocommerce' ),
'TR26' => __( 'Eskişehir', 'woocommerce' ),
'TR27' => __( 'Gaziantep', 'woocommerce' ),
'TR28' => __( 'Giresun', 'woocommerce' ),
'TR29' => __( 'G&#252;m&#252;&#351;hane', 'woocommerce' ),
'TR29' => __( 'Gümüşhane', 'woocommerce' ),
'TR30' => __( 'Hakkari', 'woocommerce' ),
'TR31' => __( 'Hatay', 'woocommerce' ),
'TR32' => __( 'Isparta', 'woocommerce' ),
'TR33' => __( '&#304;&#231;el', 'woocommerce' ),
'TR34' => __( '&#304;stanbul', 'woocommerce' ),
'TR35' => __( '&#304;zmir', 'woocommerce' ),
'TR33' => __( 'İçel', 'woocommerce' ),
'TR34' => __( 'İstanbul', 'woocommerce' ),
'TR35' => __( 'İzmir', 'woocommerce' ),
'TR36' => __( 'Kars', 'woocommerce' ),
'TR37' => __( 'Kastamonu', 'woocommerce' ),
'TR38' => __( 'Kayseri', 'woocommerce' ),
'TR39' => __( 'K&#305;rklareli', 'woocommerce' ),
'TR40' => __( 'K&#305;r&#351;ehir', 'woocommerce' ),
'TR39' => __( 'Kırklareli', 'woocommerce' ),
'TR40' => __( 'Kıehir', 'woocommerce' ),
'TR41' => __( 'Kocaeli', 'woocommerce' ),
'TR42' => __( 'Konya', 'woocommerce' ),
'TR43' => __( 'K&#252;tahya', 'woocommerce' ),
'TR43' => __( 'Kütahya', 'woocommerce' ),
'TR44' => __( 'Malatya', 'woocommerce' ),
'TR45' => __( 'Manisa', 'woocommerce' ),
'TR46' => __( 'Kahramanmara&#351;', 'woocommerce' ),
'TR46' => __( 'Kahramanmaraş', 'woocommerce' ),
'TR47' => __( 'Mardin', 'woocommerce' ),
'TR48' => __( 'Mu&#287;la', 'woocommerce' ),
'TR49' => __( 'Mu&#351;', 'woocommerce' ),
'TR50' => __( 'Nev&#351;ehir', 'woocommerce' ),
'TR51' => __( 'Ni&#287;de', 'woocommerce' ),
'TR48' => __( 'Muğla', 'woocommerce' ),
'TR49' => __( 'Muş', 'woocommerce' ),
'TR50' => __( 'Nevşehir', 'woocommerce' ),
'TR51' => __( 'Niğde', 'woocommerce' ),
'TR52' => __( 'Ordu', 'woocommerce' ),
'TR53' => __( 'Rize', 'woocommerce' ),
'TR54' => __( 'Sakarya', 'woocommerce' ),
@ -1319,29 +1385,29 @@ return array(
'TR56' => __( 'Siirt', 'woocommerce' ),
'TR57' => __( 'Sinop', 'woocommerce' ),
'TR58' => __( 'Sivas', 'woocommerce' ),
'TR59' => __( 'Tekirda&#287;', 'woocommerce' ),
'TR59' => __( 'Tekirdağ', 'woocommerce' ),
'TR60' => __( 'Tokat', 'woocommerce' ),
'TR61' => __( 'Trabzon', 'woocommerce' ),
'TR62' => __( 'Tunceli', 'woocommerce' ),
'TR63' => __( '&#350;anl&#305;urfa', 'woocommerce' ),
'TR64' => __( 'U&#351;ak', 'woocommerce' ),
'TR63' => __( 'Şanlıurfa', 'woocommerce' ),
'TR64' => __( 'Uşak', 'woocommerce' ),
'TR65' => __( 'Van', 'woocommerce' ),
'TR66' => __( 'Yozgat', 'woocommerce' ),
'TR67' => __( 'Zonguldak', 'woocommerce' ),
'TR68' => __( 'Aksaray', 'woocommerce' ),
'TR69' => __( 'Bayburt', 'woocommerce' ),
'TR70' => __( 'Karaman', 'woocommerce' ),
'TR71' => __( 'K&#305;r&#305;kkale', 'woocommerce' ),
'TR71' => __( 'Kırıkkale', 'woocommerce' ),
'TR72' => __( 'Batman', 'woocommerce' ),
'TR73' => __( '&#350;&#305;rnak', 'woocommerce' ),
'TR74' => __( 'Bart&#305;n', 'woocommerce' ),
'TR73' => __( 'Şırnak', 'woocommerce' ),
'TR74' => __( 'Bartın', 'woocommerce' ),
'TR75' => __( 'Ardahan', 'woocommerce' ),
'TR76' => __( 'I&#287;d&#305;r', 'woocommerce' ),
'TR76' => __( 'Iğdır', 'woocommerce' ),
'TR77' => __( 'Yalova', 'woocommerce' ),
'TR78' => __( 'Karab&#252;k', 'woocommerce' ),
'TR78' => __( 'Karabük', 'woocommerce' ),
'TR79' => __( 'Kilis', 'woocommerce' ),
'TR80' => __( 'Osmaniye', 'woocommerce' ),
'TR81' => __( 'D&#252;zce', 'woocommerce' ),
'TR81' => __( 'Düzce', 'woocommerce' ),
),
'TZ' => array( // Tanzania States.
'TZ01' => __( 'Arusha', 'woocommerce' ),

34
includes/README.md Normal file
View File

@ -0,0 +1,34 @@
# WooCommerce `includes` files
This directory contains WooCommerce legacy code. Ideally, the code in this folder should only get the minimum required changes for bug fixing, and any new code should go in [the `src` directory](https://github.com/woocommerce/woocommerce/tree/master/src/README.md) instead.
## Interacting with the `src` folder
Whenever you need to get an instance of a class from the `src` directory, please don't instantiate it directly, but instead use [the container](https://github.com/woocommerce/woocommerce/tree/master/src/README.md#the-container). To get an instance of the container itself you can use the `wc_get_container` function, for example:
```php
$container = wc_get_container();
$service = $container->get( \Automattic\WooCommerce\TheNamespace\TheService::class );
$service->do_something();
```
The exception to this rule might be data-only classes that could be created the old way (using a plain `new` statement); but in general, all classes in the `src` directory are registered in the container and should be resolved using it.
## Adding new actions and filters
Please take a look at [the considerations for creation new hooks in `src` code](https://github.com/woocommerce/woocommerce/tree/master/src/README.md#defining-new-actions-and-filters), as they apply for `includes` code as well. The short version is that **new hooks should be introduced only if they provide a valuable extension point for plugins**, and not with the purpose of driving WooCommerce's internal logic.
## Writing unit tests
[As it's the case for the `src` folder](https://github.com/woocommerce/woocommerce/tree/master/src/README.md#writing-unit-tests), writing unit tests is generally mandatory if you are a WooCommerce team member or a contributor from another Automattic team, and encouraged if you are an external contributor. Tests should cover any new code (although as mentioned, adding new code in `includes` should be rare) and any modifications to existing code.
In order to make it easier to write unit tests, there are a couple of mechanisms in place that you can use:
* [The code hacker](https://github.com/woocommerce/woocommerce/blob/master/tests/Tools/CodeHacking/README.md). Pros: you don't need to do any special changes to your code to make it testable. Cons: it's a hack, the tested code is being actually modified while being loaded by the PHP engine, so not an ideal solution.
* [The legacy proxy and the related helper methods in WC_Unit_Test_case](https://github.com/woocommerce/woocommerce/tree/master/src/README.md#interacting-with-legacy-code): although these are intended in principle for writing tests for code in the `src` directory, they can be used for `includes` code as well. Pros: a clean approach, no hacks involved. Cons: you need to modify your code to use the proxy whenever you need to call a function or static method that makes the code difficult to test.
It's up to you as a contributor to decide which mechanism to use in each case. Choose wisely.

View File

@ -7,7 +7,7 @@
*
* @class WC_Data
* @version 3.0.0
* @package WooCommerce/Classes
* @package WooCommerce\Classes
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Implemented by classes using the same CRUD(s) pattern.
*
* @version 2.6.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Data {

View File

@ -7,7 +7,7 @@
*
* @class WC_Settings_API
* @version 2.6.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* @class WC_Integration
* @extends WC_Settings_API
* @version 2.6.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Integration extends WC_Settings_API {

View File

@ -3,7 +3,7 @@
* Log handling functionality.
*
* @class WC_Log_Handler
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Abstract WC Log Handler Class
*
* @version 1.0.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Log_Handler implements WC_Log_Handler_Interface {

View File

@ -2,7 +2,7 @@
/**
* Query abstraction layer functionality.
*
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Extended by classes to provide a query abstraction layer for safe object searching.
*
* @version 3.1.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Object_Query {

View File

@ -7,7 +7,7 @@
*
* @class WC_Abstract_Order
* @version 3.0.0
* @package WooCommerce/Classes
* @package WooCommerce\Classes
*/
defined( 'ABSPATH' ) || exit;
@ -87,8 +87,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
/**
* Get the order if ID is passed, otherwise the order is new and empty.
* This class should NOT be instantiated, but the get_order function or new WC_Order_Factory.
* should be used. It is possible, but the aforementioned are preferred and are the only.
* This class should NOT be instantiated, but the wc_get_order function or new WC_Order_Factory
* should be used. It is possible, but the aforementioned are preferred and are the only
* methods that will be maintained going forward.
*
* @param int|object|WC_Order $order Order to read.
@ -462,7 +462,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$tax_totals[ $code ]->is_compound = $tax->is_compound();
$tax_totals[ $code ]->label = $tax->get_label();
$tax_totals[ $code ]->amount += (float) $tax->get_tax_total() + (float) $tax->get_shipping_tax_total();
$tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ), array( 'currency' => $this->get_currency() ) );
$tax_totals[ $code ]->formatted_amount = wc_price( $tax_totals[ $code ]->amount, array( 'currency' => $this->get_currency() ) );
}
if ( apply_filters( 'woocommerce_order_hide_zero_taxes', true ) ) {
@ -672,7 +672,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*/
protected function set_total_tax( $value ) {
// We round here because this is a total entry, as opposed to line items in other setters.
$this->set_prop( 'total_tax', wc_format_decimal( wc_round_tax_total( $value ) ) );
$this->set_prop( 'total_tax', wc_format_decimal( round( $value, wc_get_price_decimals() ) ) );
}
/**

View File

@ -6,7 +6,7 @@
*
* @class WC_Payment_Gateway
* @version 2.1.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
use Automattic\Jetpack\Constants;
@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* @class WC_Payment_Gateway
* @extends WC_Settings_API
* @version 2.1.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Payment_Gateway extends WC_Settings_API {

View File

@ -5,7 +5,7 @@
* Generic payment tokens functionality which can be extended by idividual types of payment tokens.
*
* @class WC_Payment_Token
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -23,7 +23,7 @@ require_once WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-payment-token.php'
* @class WC_Payment_Token
* @version 3.0.0
* @since 2.6.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Payment_Token extends WC_Legacy_Payment_Token {

View File

@ -3,7 +3,7 @@
* WooCommerce abstract privacy class.
*
* @since 3.4.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
defined( 'ABSPATH' ) || exit;
@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* privacy data to be exported and privacy data to be deleted.
*
* @version 3.4.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Abstract_Privacy {
/**

View File

@ -2,7 +2,7 @@
/**
* WooCommerce product base class.
*
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -21,7 +21,7 @@ require_once WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-product.php';
* The WooCommerce product class handles individual product data.
*
* @version 3.0.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
class WC_Product extends WC_Abstract_Legacy_Product {
@ -1336,19 +1336,21 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$this->set_stock_quantity( '' );
$this->set_backorders( 'no' );
$this->set_low_stock_amount( '' );
// If we are stock managing and we don't have stock, force out of stock status.
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount', 0 ) && 'no' === $this->get_backorders() ) {
$this->set_stock_status( 'outofstock' );
// If we are stock managing, backorders are allowed, and we don't have stock, force on backorder status.
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount', 0 ) && 'no' !== $this->get_backorders() ) {
$this->set_stock_status( 'onbackorder' );
// If the stock level is changing and we do now have enough, force in stock status.
} elseif ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount', 0 ) ) {
$this->set_stock_status( 'instock' );
return;
}
$stock_is_above_notification_threshold = ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount', 0 ) );
$backorders_are_allowed = ( 'no' !== $this->get_backorders() );
if ( $stock_is_above_notification_threshold ) {
$new_stock_status = 'instock';
} elseif ( $backorders_are_allowed ) {
$new_stock_status = 'onbackorder';
} else {
$new_stock_status = 'outofstock';
}
$this->set_stock_status( $new_stock_status );
}
/**
@ -1378,9 +1380,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$this->data_store->create( $this );
}
if ( $this->get_parent_id() ) {
wc_deferred_product_sync( $this->get_parent_id() );
}
$this->maybe_defer_product_sync();
/**
* Trigger action after saving to the DB.
@ -1393,6 +1393,32 @@ class WC_Product extends WC_Abstract_Legacy_Product {
return $this->get_id();
}
/**
* Delete the product, set its ID to 0, and return result.
*
* @param bool $force_delete Should the product be deleted permanently.
* @return bool result
*/
public function delete( $force_delete = false ) {
$deleted = parent::delete( $force_delete );
if ( $deleted ) {
$this->maybe_defer_product_sync();
}
return $deleted;
}
/**
* If this is a child product, queue its parent for syncing at the end of the request.
*/
protected function maybe_defer_product_sync() {
$parent_id = $this->get_parent_id();
if ( $parent_id ) {
wc_deferred_product_sync( $parent_id );
}
}
/*
|--------------------------------------------------------------------------
| Conditionals
@ -1475,6 +1501,16 @@ class WC_Product extends WC_Abstract_Legacy_Product {
* @return bool
*/
public function is_visible() {
$visible = $this->is_visible_core();
return apply_filters( 'woocommerce_product_is_visible', $visible, $this->get_id() );
}
/**
* Returns whether or not the product is visible in the catalog (doesn't trigger filters).
*
* @return bool
*/
protected function is_visible_core() {
$visible = 'visible' === $this->get_catalog_visibility() || ( is_search() && 'search' === $this->get_catalog_visibility() ) || ( ! is_search() && 'catalog' === $this->get_catalog_visibility() );
if ( 'trash' === $this->get_status() ) {
@ -1495,7 +1531,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
$visible = false;
}
return apply_filters( 'woocommerce_product_is_visible', $visible, $this->get_id() );
return $visible;
}
/**
@ -1871,7 +1907,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
* @return string
*/
public function get_shipping_class() {
if ( $class_id = $this->get_shipping_class_id() ) { // @phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found, WordPress.CodeAnalysis.AssignmentInCondition.Found
$class_id = $this->get_shipping_class_id();
if ( $class_id ) {
$term = get_term_by( 'id', $class_id, 'product_shipping_class' );
if ( $term && ! is_wp_error( $term ) ) {
@ -1963,7 +2000,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
public function get_price_suffix( $price = '', $qty = 1 ) {
$html = '';
if ( ( $suffix = get_option( 'woocommerce_price_display_suffix' ) ) && wc_tax_enabled() && 'taxable' === $this->get_tax_status() ) { // @phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found, WordPress.CodeAnalysis.AssignmentInCondition.Found
$suffix = get_option( 'woocommerce_price_display_suffix' );
if ( $suffix && wc_tax_enabled() && 'taxable' === $this->get_tax_status() ) {
if ( '' === $price ) {
$price = $this->get_price();
}

View File

@ -4,7 +4,7 @@
*
* @class WC_Session
* @version 2.0.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -4,7 +4,7 @@
*
* Admin Settings API used by Integrations, Shipping Methods, and Payment Gateways.
*
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
defined( 'ABSPATH' ) || exit;

View File

@ -3,7 +3,7 @@
* Abstract shipping method
*
* @class WC_Shipping_Method
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
*
* @class WC_Shipping_Method
* @version 3.0.0
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
abstract class WC_Shipping_Method extends WC_Settings_API {

View File

@ -3,7 +3,7 @@
* Abstract widget class
*
* @class WC_Widget
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
*/
use Automattic\Jetpack\Constants;
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* WC_Widget
*
* @package WooCommerce/Abstracts
* @package WooCommerce\Abstracts
* @version 2.5.0
* @extends WP_Widget
*/

View File

@ -5,7 +5,7 @@
* Uses https://github.com/A5hleyRich/wp-background-processing to handle DB
* updates in the background.
*
* @package WooCommerce/Classes
* @package WooCommerce\Classes
*/
defined( 'ABSPATH' ) || exit;

View File

@ -2,7 +2,7 @@
/**
* Addons Page
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.5.0
*/

View File

@ -2,7 +2,7 @@
/**
* Load assets
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.7.0
*/
@ -430,6 +430,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
'woocommerce_admin_system_status',
array(
'delete_log_confirmation' => esc_js( __( 'Are you sure you want to delete this log?', 'woocommerce' ) ),
'run_tool_confirmation' => esc_js( __( 'Are you sure you want to run this tool?', 'woocommerce' ) ),
)
);
}

View File

@ -4,7 +4,7 @@
*
* The attributes section lets users add custom attributes to assign to products - they can also be used in the "Filter Products by Attribute" widget.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.3.0
*/

View File

@ -2,10 +2,8 @@
/**
* Setup customize items.
*
* @author WooCommerce
* @category Admin
* @package WooCommerce/Admin/Customize
* @version 3.1.0
* @package WooCommerce\Admin\Customize
* @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -2,7 +2,7 @@
/**
* Admin Dashboard
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.1.0
*/

View File

@ -2,7 +2,7 @@
/**
* Duplicate product functionality
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.0.0
*/
@ -129,11 +129,24 @@ class WC_Admin_Duplicate_Product {
*/
public function product_duplicate( $product ) {
/**
* Filter to allow us to unset/remove data we don't want to copy to the duplicate.
* Filter to allow us to exclude meta keys from product duplication..
*
* @param array $exclude_meta The keys to exclude from the duplicate.
* @param array $existing_meta_keys The meta keys that the product already has.
* @since 2.6
*/
$meta_to_exclude = array_filter( apply_filters( 'woocommerce_duplicate_product_exclude_meta', array() ) );
$meta_to_exclude = array_filter(
apply_filters(
'woocommerce_duplicate_product_exclude_meta',
array(),
array_map(
function ( $datum ) {
return $datum->key;
},
$product->get_meta_data()
)
)
);
$duplicate = clone $product;
$duplicate->set_id( 0 );

View File

@ -2,7 +2,7 @@
/**
* Init WooCommerce data exporters.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.1.0
*/

View File

@ -2,7 +2,7 @@
/**
* Add some content to the help tab
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.1.0
*/

View File

@ -2,7 +2,7 @@
/**
* Init WooCommerce data importers.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
use Automattic\Jetpack\Constants;

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 1.0.0
*/

View File

@ -55,11 +55,11 @@ class WC_Admin_Menus {
public function admin_menu() {
global $menu;
if ( current_user_can( 'manage_woocommerce' ) ) {
if ( current_user_can( 'edit_others_shop_orders' ) ) {
$menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' ); // WPCS: override ok.
}
add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce', null, null, '55.5' );
add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'edit_others_shop_orders', 'woocommerce', null, null, '55.5' );
add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'product_attributes', array( $this, 'attributes_page' ) );
}
@ -68,7 +68,7 @@ class WC_Admin_Menus {
* Add menu item.
*/
public function reports_menu() {
if ( current_user_can( 'manage_woocommerce' ) ) {
if ( current_user_can( 'edit_others_shop_orders' ) ) {
add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ), 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ) );
} else {
add_menu_page( __( 'Sales reports', 'woocommerce' ), __( 'Sales reports', 'woocommerce' ), 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ), null, '55.6' );
@ -183,7 +183,7 @@ class WC_Admin_Menus {
unset( $submenu['woocommerce'][0] );
// Add count if user has access.
if ( apply_filters( 'woocommerce_include_processing_order_count_in_menu', true ) && current_user_can( 'manage_woocommerce' ) ) {
if ( apply_filters( 'woocommerce_include_processing_order_count_in_menu', true ) && current_user_can( 'edit_others_shop_orders' ) ) {
$order_count = apply_filters( 'woocommerce_menu_order_count', wc_processing_order_count() );
if ( $order_count ) {
@ -239,7 +239,7 @@ class WC_Admin_Menus {
* @return bool
*/
public function custom_menu_order( $enabled ) {
return $enabled || current_user_can( 'manage_woocommerce' );
return $enabled || current_user_can( 'edit_others_shop_orders' );
}
/**

View File

@ -4,7 +4,7 @@
*
* Sets up the write panels used by products and orders (custom post types).
*
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
*/
use Automattic\Jetpack\Constants;

View File

@ -5,7 +5,7 @@
* @class WC_Admin_Permalink_Settings
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.3.0
*/

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.4.0
*/

View File

@ -2,7 +2,7 @@
/**
* Post Types Admin
*
* @package WooCommerce/admin
* @package WooCommerce\Admin
* @version 3.3.0
*/
@ -79,6 +79,8 @@ class WC_Admin_Post_Types {
public function setup_screen() {
global $wc_list_table;
$request_data = $this->request_data();
$screen_id = false;
if ( function_exists( 'get_current_screen' ) ) {
@ -86,8 +88,8 @@ class WC_Admin_Post_Types {
$screen_id = isset( $screen, $screen->id ) ? $screen->id : '';
}
if ( ! empty( $_REQUEST['screen'] ) ) { // WPCS: input var ok.
$screen_id = wc_clean( wp_unslash( $_REQUEST['screen'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['screen'] ) ) {
$screen_id = wc_clean( wp_unslash( $request_data['screen'] ) );
}
switch ( $screen_id ) {
@ -296,6 +298,8 @@ class WC_Admin_Post_Types {
* @return int
*/
public function bulk_and_quick_edit_save_post( $post_id, $post ) {
$request_data = $this->request_data();
// If this is an autosave, our form has not been submitted, so we don't want to do anything.
if ( Constants::is_true( 'DOING_AUTOSAVE' ) ) {
return $post_id;
@ -307,14 +311,15 @@ class WC_Admin_Post_Types {
}
// Check nonce.
if ( ! isset( $_REQUEST['woocommerce_quick_edit_nonce'] ) || ! wp_verify_nonce( $_REQUEST['woocommerce_quick_edit_nonce'], 'woocommerce_quick_edit_nonce' ) ) { // WPCS: input var ok, sanitization ok.
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
if ( ! isset( $request_data['woocommerce_quick_edit_nonce'] ) || ! wp_verify_nonce( $request_data['woocommerce_quick_edit_nonce'], 'woocommerce_quick_edit_nonce' ) ) {
return $post_id;
}
// Get the product and save.
$product = wc_get_product( $post );
if ( ! empty( $_REQUEST['woocommerce_quick_edit'] ) ) { // WPCS: input var ok.
if ( ! empty( $request_data['woocommerce_quick_edit'] ) ) { // WPCS: input var ok.
$this->quick_edit_save( $post_id, $product );
} else {
$this->bulk_edit_save( $post_id, $product );
@ -330,6 +335,8 @@ class WC_Admin_Post_Types {
* @param WC_Product $product Product object.
*/
private function quick_edit_save( $post_id, $product ) {
$request_data = $this->request_data();
$data_store = $product->get_data_store();
$old_regular_price = $product->get_regular_price();
$old_sale_price = $product->get_sale_price();
@ -344,14 +351,15 @@ class WC_Admin_Post_Types {
);
foreach ( $input_to_props as $input_var => $prop ) {
if ( isset( $_REQUEST[ $input_var ] ) ) { // WPCS: input var ok, sanitization ok.
$product->{"set_{$prop}"}( wc_clean( wp_unslash( $_REQUEST[ $input_var ] ) ) ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data[ $input_var ] ) ) {
$product->{"set_{$prop}"}( wc_clean( wp_unslash( $request_data[ $input_var ] ) ) );
}
}
if ( isset( $_REQUEST['_sku'] ) ) { // WPCS: input var ok, sanitization ok.
$sku = $product->get_sku();
$new_sku = (string) wc_clean( $_REQUEST['_sku'] ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data['_sku'] ) ) {
$sku = $product->get_sku();
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$new_sku = (string) wc_clean( $request_data['_sku'] );
if ( $new_sku !== $sku ) {
if ( ! empty( $new_sku ) ) {
@ -365,27 +373,30 @@ class WC_Admin_Post_Types {
}
}
if ( ! empty( $_REQUEST['_shipping_class'] ) ) { // WPCS: input var ok, sanitization ok.
if ( '_no_shipping_class' === $_REQUEST['_shipping_class'] ) { // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_shipping_class'] ) ) {
if ( '_no_shipping_class' === $request_data['_shipping_class'] ) {
$product->set_shipping_class_id( 0 );
} else {
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $_REQUEST['_shipping_class'] ) ); // WPCS: input var ok, sanitization ok.
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $request_data['_shipping_class'] ) );
$product->set_shipping_class_id( $shipping_class_id );
}
}
$product->set_featured( isset( $_REQUEST['_featured'] ) ); // WPCS: input var ok, sanitization ok.
$product->set_featured( isset( $request_data['_featured'] ) );
if ( $product->is_type( 'simple' ) || $product->is_type( 'external' ) ) {
if ( isset( $_REQUEST['_regular_price'] ) ) { // WPCS: input var ok, sanitization ok.
$new_regular_price = ( '' === $_REQUEST['_regular_price'] ) ? '' : wc_format_decimal( $_REQUEST['_regular_price'] ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data['_regular_price'] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$new_regular_price = ( '' === $request_data['_regular_price'] ) ? '' : wc_format_decimal( $request_data['_regular_price'] );
$product->set_regular_price( $new_regular_price );
} else {
$new_regular_price = null;
}
if ( isset( $_REQUEST['_sale_price'] ) ) { // WPCS: input var ok, sanitization ok.
$new_sale_price = ( '' === $_REQUEST['_sale_price'] ) ? '' : wc_format_decimal( $_REQUEST['_sale_price'] ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data['_sale_price'] ) ) {
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash
$new_sale_price = ( '' === $request_data['_sale_price'] ) ? '' : wc_format_decimal( $request_data['_sale_price'] );
$product->set_sale_price( $new_sale_price );
} else {
$new_sale_price = null;
@ -407,35 +418,25 @@ class WC_Admin_Post_Types {
}
// Handle Stock Data.
$manage_stock = ! empty( $_REQUEST['_manage_stock'] ) && 'grouped' !== $product->get_type() ? 'yes' : 'no'; // WPCS: input var ok, sanitization ok.
$backorders = ! empty( $_REQUEST['_backorders'] ) ? wc_clean( $_REQUEST['_backorders'] ) : 'no'; // WPCS: input var ok, sanitization ok.
$stock_status = ! empty( $_REQUEST['_stock_status'] ) ? wc_clean( $_REQUEST['_stock_status'] ) : 'instock'; // WPCS: input var ok, sanitization ok.
$stock_amount = 'yes' === $manage_stock && isset( $_REQUEST['_stock'] ) && is_numeric( wp_unslash( $_REQUEST['_stock'] ) ) ? wc_stock_amount( wp_unslash( $_REQUEST['_stock'] ) ) : ''; // WPCS: input var ok, sanitization ok.
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$manage_stock = ! empty( $request_data['_manage_stock'] ) && 'grouped' !== $product->get_type() ? 'yes' : 'no';
$backorders = ! empty( $request_data['_backorders'] ) ? wc_clean( $request_data['_backorders'] ) : 'no';
if ( ! empty( $request_data['_stock_status'] ) ) {
$stock_status = wc_clean( $request_data['_stock_status'] );
} else {
$stock_status = $product->is_type( 'variable' ) ? null : 'instock';
}
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$product->set_manage_stock( $manage_stock );
$product->set_backorders( $backorders );
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
$stock_amount = 'yes' === $manage_stock && isset( $request_data['_stock'] ) && is_numeric( wp_unslash( $request_data['_stock'] ) ) ? wc_stock_amount( wp_unslash( $request_data['_stock'] ) ) : '';
$product->set_stock_quantity( $stock_amount );
}
// Apply product type constraints to stock status.
if ( $product->is_type( 'external' ) ) {
// External products are always in stock.
$product->set_stock_status( 'instock' );
} elseif ( $product->is_type( 'variable' ) && ! $product->get_manage_stock() ) {
// Stock status is determined by children.
foreach ( $product->get_children() as $child_id ) {
$child = wc_get_product( $child_id );
if ( ! $product->get_manage_stock() ) {
$child->set_stock_status( $stock_status );
$child->save();
}
}
$product = WC_Product_Variable::sync( $product, false );
} else {
$product->set_stock_status( $stock_status );
}
$product = $this->maybe_update_stock_status( $product, $stock_status );
$product->save();
@ -449,58 +450,61 @@ class WC_Admin_Post_Types {
* @param WC_Product $product Product object.
*/
public function bulk_edit_save( $post_id, $product ) {
$data_store = $product->get_data_store();
$old_regular_price = $product->get_regular_price();
$old_sale_price = $product->get_sale_price();
$data = wp_unslash( $_REQUEST ); // WPCS: input var ok, CSRF ok.
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
if ( ! empty( $_REQUEST['change_weight'] ) && isset( $_REQUEST['_weight'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_weight( wc_clean( wp_unslash( $_REQUEST['_weight'] ) ) ); // WPCS: input var ok, sanitization ok.
$request_data = $this->request_data();
$data_store = $product->get_data_store();
if ( ! empty( $request_data['change_weight'] ) && isset( $request_data['_weight'] ) ) {
$product->set_weight( wc_clean( wp_unslash( $request_data['_weight'] ) ) );
}
if ( ! empty( $_REQUEST['change_dimensions'] ) ) { // WPCS: input var ok, sanitization ok.
if ( isset( $_REQUEST['_length'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_length( wc_clean( wp_unslash( $_REQUEST['_length'] ) ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['change_dimensions'] ) ) {
if ( isset( $request_data['_length'] ) ) {
$product->set_length( wc_clean( wp_unslash( $request_data['_length'] ) ) );
}
if ( isset( $_REQUEST['_width'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_width( wc_clean( wp_unslash( $_REQUEST['_width'] ) ) ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data['_width'] ) ) {
$product->set_width( wc_clean( wp_unslash( $request_data['_width'] ) ) );
}
if ( isset( $_REQUEST['_height'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_height( wc_clean( wp_unslash( $_REQUEST['_height'] ) ) ); // WPCS: input var ok, sanitization ok.
if ( isset( $request_data['_height'] ) ) {
$product->set_height( wc_clean( wp_unslash( $request_data['_height'] ) ) );
}
}
if ( ! empty( $_REQUEST['_tax_status'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_tax_status( wc_clean( $_REQUEST['_tax_status'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_tax_status'] ) ) {
$product->set_tax_status( wc_clean( $request_data['_tax_status'] ) );
}
if ( ! empty( $_REQUEST['_tax_class'] ) ) { // WPCS: input var ok, sanitization ok.
$tax_class = wc_clean( wp_unslash( $_REQUEST['_tax_class'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_tax_class'] ) ) {
$tax_class = wc_clean( wp_unslash( $request_data['_tax_class'] ) );
if ( 'standard' === $tax_class ) {
$tax_class = '';
}
$product->set_tax_class( $tax_class );
}
if ( ! empty( $_REQUEST['_shipping_class'] ) ) { // WPCS: input var ok, sanitization ok.
if ( '_no_shipping_class' === $_REQUEST['_shipping_class'] ) { // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_shipping_class'] ) ) {
if ( '_no_shipping_class' === $request_data['_shipping_class'] ) {
$product->set_shipping_class_id( 0 );
} else {
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $_REQUEST['_shipping_class'] ) ); // WPCS: input var ok, sanitization ok.
$shipping_class_id = $data_store->get_shipping_class_id_by_slug( wc_clean( $request_data['_shipping_class'] ) );
$product->set_shipping_class_id( $shipping_class_id );
}
}
if ( ! empty( $_REQUEST['_visibility'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_catalog_visibility( wc_clean( $_REQUEST['_visibility'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_visibility'] ) ) {
$product->set_catalog_visibility( wc_clean( $request_data['_visibility'] ) );
}
if ( ! empty( $_REQUEST['_featured'] ) ) { // WPCS: input var ok, sanitization ok.
$product->set_featured( wp_unslash( $_REQUEST['_featured'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_featured'] ) ) {
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$product->set_featured( wp_unslash( $request_data['_featured'] ) );
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
}
if ( ! empty( $_REQUEST['_sold_individually'] ) ) { // WPCS: input var ok, sanitization ok.
if ( 'yes' === $_REQUEST['_sold_individually'] ) { // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_sold_individually'] ) ) {
if ( 'yes' === $request_data['_sold_individually'] ) {
$product->set_sold_individually( 'yes' );
} else {
$product->set_sold_individually( '' );
@ -518,93 +522,10 @@ class WC_Admin_Post_Types {
}
if ( $can_product_type_change_price ) {
$price_changed = false;
$regular_price_changed = $this->set_new_price( $product, 'regular' );
$sale_price_changed = $this->set_new_price( $product, 'sale' );
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.
$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 ( $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 ( $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 );
}
break;
default:
break;
}
if ( isset( $new_price ) && $new_price !== $old_regular_price ) {
$price_changed = true;
$new_price = round( $new_price, wc_get_price_decimals() );
$product->set_regular_price( $new_price );
}
}
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.
$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 ( $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 ( $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 ( $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 );
}
break;
default:
break;
}
if ( isset( $new_price ) && $new_price !== $old_sale_price ) {
$price_changed = true;
$new_price = ! empty( $new_price ) || '0' === $new_price ? round( $new_price, wc_get_price_decimals() ) : '';
$product->set_sale_price( $new_price );
}
}
if ( $price_changed ) {
if ( $regular_price_changed || $sale_price_changed ) {
$product->set_date_on_sale_to( '' );
$product->set_date_on_sale_from( '' );
@ -616,24 +537,22 @@ class WC_Admin_Post_Types {
// Handle Stock Data.
$was_managing_stock = $product->get_manage_stock() ? 'yes' : 'no';
$stock_status = $product->get_stock_status();
$backorders = $product->get_backorders();
$backorders = ! empty( $_REQUEST['_backorders'] ) ? wc_clean( $_REQUEST['_backorders'] ) : $backorders; // WPCS: input var ok, sanitization ok.
$stock_status = ! empty( $_REQUEST['_stock_status'] ) ? wc_clean( $_REQUEST['_stock_status'] ) : $stock_status; // WPCS: input var ok, sanitization ok.
$backorders = ! empty( $request_data['_backorders'] ) ? wc_clean( $request_data['_backorders'] ) : $backorders;
if ( ! empty( $_REQUEST['_manage_stock'] ) ) { // WPCS: input var ok, sanitization ok.
$manage_stock = 'yes' === wc_clean( $_REQUEST['_manage_stock'] ) && 'grouped' !== $product->get_type() ? 'yes' : 'no'; // WPCS: input var ok, sanitization ok.
if ( ! empty( $request_data['_manage_stock'] ) ) {
$manage_stock = 'yes' === wc_clean( $request_data['_manage_stock'] ) && 'grouped' !== $product->get_type() ? 'yes' : 'no';
} else {
$manage_stock = $was_managing_stock;
}
$stock_amount = 'yes' === $manage_stock && ! empty( $_REQUEST['change_stock'] ) && isset( $_REQUEST['_stock'] ) ? wc_stock_amount( $_REQUEST['_stock'] ) : $product->get_stock_quantity(); // WPCS: input var ok, sanitization ok.
$stock_amount = 'yes' === $manage_stock && ! empty( $request_data['change_stock'] ) && isset( $request_data['_stock'] ) ? wc_stock_amount( $request_data['_stock'] ) : $product->get_stock_quantity();
$product->set_manage_stock( $manage_stock );
$product->set_backorders( $backorders );
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
$change_stock = absint( $_REQUEST['change_stock'] );
$change_stock = absint( $request_data['change_stock'] );
switch ( $change_stock ) {
case 2:
wc_update_product_stock( $product, $stock_amount, 'increase', true );
@ -651,27 +570,14 @@ class WC_Admin_Post_Types {
$product->set_manage_stock( 'no' );
}
// Apply product type constraints to stock status.
if ( $product->is_type( 'external' ) ) {
// External products are always in stock.
$product->set_stock_status( 'instock' );
} elseif ( $product->is_type( 'variable' ) && ! $product->get_manage_stock() ) {
// Stock status is determined by children.
foreach ( $product->get_children() as $child_id ) {
$child = wc_get_product( $child_id );
if ( ! $product->get_manage_stock() ) {
$child->set_stock_status( $stock_status );
$child->save();
}
}
$product = WC_Product_Variable::sync( $product, false );
} else {
$product->set_stock_status( $stock_status );
}
$stock_status = empty( $request_data['_stock_status'] ) ? null : wc_clean( $request_data['_stock_status'] );
$product = $this->maybe_update_stock_status( $product, $stock_status );
$product->save();
do_action( 'woocommerce_product_bulk_edit_save', $product );
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
}
/**
@ -719,11 +625,13 @@ class WC_Admin_Post_Types {
* @param WP_Post $post Current post object.
*/
public function edit_form_after_title( $post ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
if ( 'shop_coupon' === $post->post_type ) {
?>
<textarea id="woocommerce-coupon-description" name="excerpt" cols="5" rows="2" placeholder="<?php esc_attr_e( 'Description (optional)', 'woocommerce' ); ?>"><?php echo $post->post_excerpt; // WPCS: XSS ok. ?></textarea>
<textarea id="woocommerce-coupon-description" name="excerpt" cols="5" rows="2" placeholder="<?php esc_attr_e( 'Description (optional)', 'woocommerce' ); ?>"><?php echo $post->post_excerpt; ?></textarea>
<?php
}
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
@ -802,7 +710,8 @@ class WC_Admin_Post_Types {
* @return array
*/
public function upload_dir( $pathdata ) {
if ( isset( $_POST['type'] ) && 'downloadable_product' === $_POST['type'] ) { // WPCS: CSRF ok, input var ok.
// phpcs:disable WordPress.Security.NonceVerification.Missing
if ( isset( $_POST['type'] ) && 'downloadable_product' === $_POST['type'] ) {
if ( empty( $pathdata['subdir'] ) ) {
$pathdata['path'] = $pathdata['path'] . '/woocommerce_uploads';
@ -817,6 +726,7 @@ class WC_Admin_Post_Types {
}
}
return $pathdata;
// phpcs:enable WordPress.Security.NonceVerification.Missing
}
/**
@ -830,7 +740,8 @@ class WC_Admin_Post_Types {
* @since 4.0
*/
public function update_filename( $full_filename, $ext, $dir ) {
if ( ! isset( $_POST['type'] ) || ! 'downloadable_product' === $_POST['type'] ) { // WPCS: CSRF ok, input var ok.
// phpcs:disable WordPress.Security.NonceVerification.Missing
if ( ! isset( $_POST['type'] ) || ! 'downloadable_product' === $_POST['type'] ) {
return $full_filename;
}
@ -843,6 +754,7 @@ class WC_Admin_Post_Types {
}
return $this->unique_filename( $full_filename, $ext );
// phpcs:enable WordPress.Security.NonceVerification.Missing
}
/**
@ -862,11 +774,11 @@ class WC_Admin_Post_Types {
return $full_filename;
}
$suffix = strtolower( wp_generate_password( $length_to_prepend, false, false ) );
$suffix = strtolower( wp_generate_password( $length_to_prepend, false, false ) );
$filename = $full_filename;
if ( strlen( $ext ) > 0 ) {
$filename = substr( $filename, 0, strlen( $filename ) - strlen( $ext ) );
$filename = substr( $filename, 0, strlen( $filename ) - strlen( $ext ) );
}
$full_filename = str_replace(
@ -892,9 +804,10 @@ class WC_Admin_Post_Types {
* @param int $product_id product identifier.
* @param int $variation_id optional product variation identifier.
* @param array $downloadable_files newly set files.
* @deprecated and moved to post-data class.
* @deprecated 3.3.0 and moved to post-data class.
*/
public function process_product_file_download_paths( $product_id, $variation_id, $downloadable_files ) {
wc_deprecated_function( 'WC_Admin_Post_Types::process_product_file_download_paths', '3.3', '' );
WC_Post_Data::process_product_file_download_paths( $product_id, $variation_id, $downloadable_files );
}
@ -961,6 +874,118 @@ class WC_Admin_Post_Types {
return $post_states;
}
/**
* Apply product type constraints to stock status.
*
* @param WC_Product $product The product whose stock status will be adjusted.
* @param string|null $stock_status The stock status to use for adjustment, or null if no new stock status has been supplied in the request.
* @return WC_Product The supplied product, or the synced product if it was a variable product.
*/
private function maybe_update_stock_status( $product, $stock_status ) {
if ( $product->is_type( 'external' ) ) {
// External products are always in stock.
$product->set_stock_status( 'instock' );
} elseif ( isset( $stock_status ) ) {
if ( $product->is_type( 'variable' ) && ! $product->get_manage_stock() ) {
// Stock status is determined by children.
foreach ( $product->get_children() as $child_id ) {
$child = wc_get_product( $child_id );
if ( ! $product->get_manage_stock() ) {
$child->set_stock_status( $stock_status );
$child->save();
}
}
$product = WC_Product_Variable::sync( $product, false );
} else {
$product->set_stock_status( $stock_status );
}
}
return $product;
}
/**
* Set the new regular or sale price if requested.
*
* @param WC_Product $product The product to set the new price for.
* @param string $price_type 'regular' or 'sale'.
* @return bool true if a new price has been set, false otherwise.
*/
private function set_new_price( $product, $price_type ) {
// phpcs:disable WordPress.Security.NonceVerification.Recommended
$request_data = $this->request_data();
if ( empty( $request_data[ "change_{$price_type}_price" ] ) || ! isset( $request_data[ "_{$price_type}_price" ] ) ) {
return false;
}
$old_price = $product->{"get_{$price_type}_price"}();
$price_changed = false;
$change_price = absint( $request_data[ "change_{$price_type}_price" ] );
$raw_price = wc_clean( wp_unslash( $request_data[ "_{$price_type}_price" ] ) );
$is_percentage = (bool) strstr( $raw_price, '%' );
$price = wc_format_decimal( $raw_price );
switch ( $change_price ) {
case 1:
$new_price = $price;
break;
case 2:
if ( $is_percentage ) {
$percent = $price / 100;
$new_price = $old_price + ( $old_price * $percent );
} else {
$new_price = $old_price + $price;
}
break;
case 3:
if ( $is_percentage ) {
$percent = $price / 100;
$new_price = max( 0, $old_price - ( $old_price * $percent ) );
} else {
$new_price = max( 0, $old_price - $price );
}
break;
case 4:
if ( 'sale' !== $price_type ) {
break;
}
$regular_price = $product->get_regular_price();
if ( $is_percentage ) {
$percent = $price / 100;
$new_price = max( 0, $regular_price - ( round( $regular_price * $percent, wc_get_price_decimals() ) ) );
} else {
$new_price = max( 0, $regular_price - $price );
}
break;
default:
break;
}
if ( isset( $new_price ) && $new_price !== $old_price ) {
$price_changed = true;
$new_price = round( $new_price, wc_get_price_decimals() );
$product->{"set_{$price_type}_price"}( $new_price );
}
return $price_changed;
// phpcs:disable WordPress.Security.NonceVerification.Recommended
}
/**
* Get the current request data ($_REQUEST superglobal).
* This method is added to ease unit testing.
*
* @return array The $_REQUEST superglobal.
*/
protected function request_data() {
return $_REQUEST;
}
}
new WC_Admin_Post_Types();

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.4.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Reports
* @package WooCommerce\Admin\Reports
* @version 2.0.0
*/

View File

@ -2,7 +2,7 @@
/**
* WooCommerce Admin Settings Class
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.4.0
*/

View File

@ -4,7 +4,7 @@
*
* Takes new users through some basic steps to setup their store.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.6.0
* @deprecated 4.4.0
*/

View File

@ -2,7 +2,7 @@
/**
* Debug/Status page
*
* @package WooCommerce/Admin/System Status
* @package WooCommerce\Admin\System Status
* @version 2.2.0
*/

View File

@ -4,7 +4,7 @@
*
* @class WC_Admin_Taxonomies
* @version 2.3.10
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -3,7 +3,7 @@
* WooCommerce Admin
*
* @class WC_Admin
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 2.6.0
*/
@ -300,6 +300,11 @@ class WC_Admin {
$classes .= ' wc-wp-version-gte-53';
}
// Add WP 5.5+ compatibility class.
if ( $raw_version && version_compare( $version, '5.5', '>=' ) ) {
$classes .= ' wc-wp-version-gte-55';
}
return $classes;
}
}

View File

@ -3,7 +3,7 @@
* WooCommerce Admin
*
* @class WC_Helper_API
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -3,7 +3,7 @@
* The update helper for WooCommerce.com plugins.
*
* @class WC_Helper_Updater
* @package WooCommerce/Admin.
* @package WooCommerce\Admin.
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -73,6 +73,9 @@ class WC_Helper_Updater {
}
}
$translations = self::get_translations_update_data();
$transient->translations = array_merge( isset( $transient->translations ) ? $transient->translations : array(), $translations );
return $transient;
}
@ -162,6 +165,123 @@ class WC_Helper_Updater {
return self::_update_check( $payload );
}
/**
* Get translations updates informations.
*
* Scans through all subscriptions for the connected user, as well
* as all Woo extensions without a subscription, and obtains update
* data for each product.
*
* @return array Update data {product_id => data}
*/
public static function get_translations_update_data() {
$payload = array();
$installed_translations = wp_get_installed_translations( 'plugins' );
$locales = array_values( get_available_languages() );
/**
* Filters the locales requested for plugin translations.
*
* @since 3.7.0
* @since 4.5.0 The default value of the `$locales` parameter changed to include all locales.
*
* @param array $locales Plugin locales. Default is all available locales of the site.
*/
$locales = apply_filters( 'plugins_update_check_locales', $locales );
$locales = array_unique( $locales );
// No locales, the respone will be empty, we can return now.
if ( empty( $locales ) ) {
return array();
}
// Scan local plugins which may or may not have a subscription.
$plugins = WC_Helper::get_local_woo_plugins();
$active_woo_plugins = array_intersect( array_keys( $plugins ), get_option( 'active_plugins', array() ) );
/*
* Use only plugins that are subscribed to the automatic translations updates.
*/
$active_for_translations = array_filter(
$active_woo_plugins,
function( $plugin ) use ( $plugins ) {
return apply_filters( 'woocommerce_translations_updates_for_' . $plugins[ $plugin ]['slug'], false );
}
);
// Nothing to check for, exit.
if ( empty( $active_for_translations ) ) {
return array();
}
if ( wp_doing_cron() ) {
$timeout = 30;
} else {
// Three seconds, plus one extra second for every 10 plugins.
$timeout = 3 + (int) ( count( $active_for_translations ) / 10 );
}
$request_body = array(
'locales' => $locales,
'plugins' => array(),
);
foreach ( $active_for_translations as $active_plugin ) {
$plugin = $plugins[ $active_plugin ];
$request_body['plugins'][ $plugin['slug'] ] = array( 'version' => $plugin['Version'] );
}
$raw_response = wp_remote_post(
'https://translate.wordpress.com/api/translations-updates/woocommerce',
array(
'body' => json_encode( $request_body ),
'headers' => array( 'Content-Type: application/json' ),
'timeout' => $timeout,
)
);
// Something wrong happened on the translate server side.
$response_code = wp_remote_retrieve_response_code( $raw_response );
if ( 200 !== $response_code ) {
return array();
}
$response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
// API error, api returned but something was wrong.
if ( array_key_exists( 'success', $response ) && false === $response['success'] ) {
return array();
}
$translations = array();
foreach ( $response['data'] as $plugin_name => $language_packs ) {
foreach ( $language_packs as $language_pack ) {
// Maybe we have this language pack already installed so lets check revision date.
if ( array_key_exists( $plugin_name, $installed_translations ) && array_key_exists( $language_pack['wp_locale'], $installed_translations[ $plugin_name ] ) ) {
$installed_translation_revision_time = new DateTime( $installed_translations[ $plugin_name ][ $language_pack['wp_locale'] ]['PO-Revision-Date'] );
$new_translation_revision_time = new DateTime( $language_pack['last_modified'] );
// Skip if translation language pack is not newer than what is installed already.
if ( $new_translation_revision_time <= $installed_translation_revision_time ) {
continue;
}
}
$translations[] = array(
'type' => 'plugin',
'slug' => $plugin_name,
'language' => $language_pack['wp_locale'],
'version' => $language_pack['version'],
'updated' => $language_pack['last_modified'],
'package' => $language_pack['package'],
'autoupdate' => true,
);
}
}
return $translations;
}
/**
* Run an update check API call.
*

View File

@ -3,7 +3,7 @@
* WooCommerce Admin
*
* @class WC_Helper
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
use Automattic\Jetpack\Constants;

View File

@ -2,7 +2,7 @@
/**
* Helper admin navigation.
*
* @package WooCommerce/Helper
* @package WooCommerce\Helper
*/
defined( 'ABSPATH' ) || exit(); ?>

View File

@ -16,7 +16,7 @@ if ( ! class_exists( 'WP_Importer' ) ) {
/**
* Product importer controller - handles file upload and forms in admin.
*
* @package WooCommerce/Admin/Importers
* @package WooCommerce\Admin\Importers
* @version 3.1.0
*/
class WC_Product_CSV_Importer_Controller {
@ -456,11 +456,12 @@ class WC_Product_CSV_Importer_Controller {
*/
protected function done() {
check_admin_referer( 'woocommerce-csv-importer' );
$imported = isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0;
$updated = isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0;
$failed = isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0;
$skipped = isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0;
$errors = array_filter( (array) get_user_option( 'product_import_error_log' ) );
$imported = isset( $_GET['products-imported'] ) ? absint( $_GET['products-imported'] ) : 0;
$updated = isset( $_GET['products-updated'] ) ? absint( $_GET['products-updated'] ) : 0;
$failed = isset( $_GET['products-failed'] ) ? absint( $_GET['products-failed'] ) : 0;
$skipped = isset( $_GET['products-skipped'] ) ? absint( $_GET['products-skipped'] ) : 0;
$file_name = isset( $_GET['file-name'] ) ? sanitize_text_field( wp_unslash( $_GET['file-name'] ) ) : '';
$errors = array_filter( (array) get_user_option( 'product_import_error_log' ) );
include_once dirname( __FILE__ ) . '/views/html-csv-import-done.php';
}

View File

@ -3,7 +3,7 @@
* Tax importer class file
*
* @version 2.3.0
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -17,7 +17,7 @@ if ( ! class_exists( 'WP_Importer' ) ) {
/**
* Tax Rates importer - import tax rates and local tax rates into WooCommerce.
*
* @package WooCommerce/Admin/Importers
* @package WooCommerce\Admin\Importers
* @version 2.3.0
*/
class WC_Tax_Rate_Importer extends WP_Importer {

View File

@ -50,6 +50,14 @@ if ( ! defined( 'ABSPATH' ) ) {
$results[] = '<a href="#" class="woocommerce-importer-done-view-errors">' . __( 'View import log', 'woocommerce' ) . '</a>';
}
if ( ! empty( $file_name ) ) {
$results[] = sprintf(
/* translators: %s: File name */
__( 'File uploaded: %s', 'woocommerce' ),
'<strong>' . $file_name . '</strong>'
);
}
/* translators: %d: import results */
echo wp_kses_post( __( 'Import complete!', 'woocommerce' ) . ' ' . implode( '. ', $results ) );
?>

View File

@ -2,7 +2,7 @@
/**
* Admin View: Product import form
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -2,7 +2,7 @@
/**
* List tables.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.3.0
*/

View File

@ -2,7 +2,7 @@
/**
* List tables: coupons.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.3.0
*/

View File

@ -2,7 +2,7 @@
/**
* List tables: orders.
*
* @package WooCommerce\admin
* @package WooCommerce\Admin
* @version 3.3.0
*/

View File

@ -2,7 +2,7 @@
/**
* List tables: products.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @version 3.3.0
*/
@ -395,11 +395,12 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
/**
* Search by SKU or ID for products.
*
* @deprecated Logic moved to query_filters.
* @deprecated 4.4.0 Logic moved to query_filters.
* @param string $where Where clause SQL.
* @return string
*/
public function sku_search( $where ) {
wc_deprecated_function( 'WC_Admin_List_Table_Products::sku_search', '4.4.0', 'Logic moved to query_filters.' );
return $where;
}

View File

@ -2,7 +2,7 @@
/**
* Marketplace suggestions container
*
* @package WooCommerce/Templates
* @package WooCommerce\Templates
* @version 3.6.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.2.0
*/

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -2,7 +2,7 @@
/**
* Order Notes
*
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -4,7 +4,7 @@
*
* Displays the product data box, tabbed, with several panels covering price, stock etc.
*
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 3.0.0
*/

View File

@ -6,7 +6,7 @@
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -4,7 +4,7 @@
*
* Functions for displaying product reviews data meta box.
*
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
*/
defined( 'ABSPATH' ) || exit;

View File

@ -4,7 +4,7 @@
*
* Replaces the standard excerpt box.
*
* @package WooCommerce/Admin/Meta Boxes
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/

View File

@ -2,7 +2,7 @@
/**
* Shows an order item
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
* @var object $item The item being displayed
* @var int $item_id The id of the item being displayed
*/

View File

@ -2,7 +2,7 @@
/**
* Order items HTML for meta box.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
defined( 'ABSPATH' ) || exit;
@ -147,7 +147,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Items Subtotal:', 'woocommerce' ); ?></td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_subtotal(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_subtotal(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<?php if ( 0 < $order->get_total_discount() ) : ?>
@ -155,7 +155,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Coupon(s):', 'woocommerce' ); ?></td>
<td width="1%"></td>
<td class="total">-
<?php echo wc_price( $order->get_total_discount(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_total_discount(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<?php endif; ?>
@ -164,7 +164,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Fees:', 'woocommerce' ); ?></td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_total_fees(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_total_fees(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<?php endif; ?>
@ -176,7 +176,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Shipping:', 'woocommerce' ); ?></td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<?php endif; ?>
@ -189,7 +189,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php echo esc_html( $tax_total->label ); ?>:</td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $tax_total->amount, array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $tax_total->amount, array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<?php endforeach; ?>
@ -201,7 +201,7 @@ if ( wc_tax_enabled() ) {
<td class="label"><?php esc_html_e( 'Order Total', 'woocommerce' ); ?>:</td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
@ -209,16 +209,31 @@ if ( wc_tax_enabled() ) {
<div class="clear"></div>
<?php if ( in_array( $order->get_status(), array( 'processing', 'completed', 'refunded' ) ) && ! empty( $order->get_date_paid() ) ) : ?>
<?php if ( in_array( $order->get_status(), array( 'processing', 'completed', 'refunded' ), true ) && ! empty( $order->get_date_paid() ) ) : ?>
<table class="wc-order-totals" style="border-top: 1px solid #999; margin-top:12px; padding-top:12px">
<tr>
<td class="label"><?php esc_html_e( 'Paid By Customer', 'woocommerce' ); ?>:</td>
<td class="<?php echo $order->get_total_refunded() ? 'label' : 'label label-highlight'; ?>"><?php esc_html_e( 'Paid', 'woocommerce' ); ?>: <br /></td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
<tr>
<td>
<span class="description">
<?php
if ( $order->get_payment_method_title() ) {
/* translators: 1: payment date. 2: payment method */
echo esc_html( sprintf( __( '%1$s via %2$s', 'woocommerce' ), $order->get_date_paid()->date_i18n( get_option( 'date_format' ) ), $order->get_payment_method_title() ) );
} else {
echo esc_html( $order->get_date_paid()->date_i18n( get_option( 'date_format' ) ) );
}
?>
</span>
</td>
<td colspan="2"></td>
</tr>
</table>
<div class="clear"></div>
@ -230,16 +245,16 @@ if ( wc_tax_enabled() ) {
<tr>
<td class="label refunded-total"><?php esc_html_e( 'Refunded', 'woocommerce' ); ?>:</td>
<td width="1%"></td>
<td class="total refunded-total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?></td>
<td class="total refunded-total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
</tr>
<?php do_action( 'woocommerce_admin_order_totals_after_refunded', $order->get_id() ); ?>
<tr>
<td class="label"><?php esc_html_e( 'Net Total', 'woocommerce' ); ?>:</td>
<td class="label label-highlight"><?php esc_html_e( 'Net Payment', 'woocommerce' ); ?>:</td>
<td width="1%"></td>
<td class="total">
<?php echo wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?>
<?php echo wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</td>
</tr>
@ -301,11 +316,11 @@ if ( wc_tax_enabled() ) {
<?php endif; ?>
<tr>
<td class="label"><?php esc_html_e( 'Amount already refunded', 'woocommerce' ); ?>:</td>
<td class="total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?></td>
<td class="total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
</tr>
<tr>
<td class="label"><?php esc_html_e( 'Total available to refund', 'woocommerce' ); ?>:</td>
<td class="total"><?php echo wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // WPCS: XSS ok. ?></td>
<td class="total"><?php echo wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
</tr>
<tr>
<td class="label">
@ -386,7 +401,7 @@ if ( wc_tax_enabled() ) {
?>
<tbody data-row="<?php echo esc_attr( $row ); ?>">
<tr>
<?php echo $row; // WPCS: XSS ok. ?>
<?php echo $row; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</tr>
</tbody>
</table>
@ -426,18 +441,17 @@ if ( wc_tax_enabled() ) {
</tr>
</thead>
<?php
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates ORDER BY tax_rate_name LIMIT 100" );
$rates = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates ORDER BY tax_rate_name LIMIT 100" );
foreach ( $rates as $rate ) {
echo '
<tr>
<td><input type="radio" id="add_order_tax_' . absint( $rate->tax_rate_id ) . '" name="add_order_tax" value="' . absint( $rate->tax_rate_id ) . '" /></td>
<td><label for="add_order_tax_' . absint( $rate->tax_rate_id ) . '">' . WC_Tax::get_rate_label( $rate ) . '</label></td>
<td>' . ( isset( $classes_options[ $rate->tax_rate_class ] ) ? $classes_options[ $rate->tax_rate_class ] : '-' ) . '</td>
<td>' . WC_Tax::get_rate_code( $rate ) . '</td>
<td>' . WC_Tax::get_rate_percent( $rate ) . '</td>
<td><label for="add_order_tax_' . absint( $rate->tax_rate_id ) . '">' . esc_html( WC_Tax::get_rate_label( $rate ) ) . '</label></td>
<td>' . ( isset( $classes_options[ $rate->tax_rate_class ] ) ? esc_html( $classes_options[ $rate->tax_rate_class ] ) : '-' ) . '</td>
<td>' . esc_html( WC_Tax::get_rate_code( $rate ) ) . '</td>
<td>' . esc_html( WC_Tax::get_rate_percent( $rate ) ) . '</td>
</tr>
'; // WPCS: XSS ok.
';
}
?>
</table>

View File

@ -2,7 +2,7 @@
/**
* Order notes HTML for meta box.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
defined( 'ABSPATH' ) || exit;

View File

@ -2,9 +2,14 @@
/**
* Shows a shipping line
*
* @package WooCommerce\Admin
*
* @var object $item The item being displayed
* @var int $item_id The id of the item being displayed
*
* @package WooCommerce\Admin\Views
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -58,10 +63,10 @@ if ( ! defined( 'ABSPATH' ) ) {
<td class="line_cost" width="1%">
<div class="view">
<?php
echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) );
echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) );
$refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' );
if ( $refunded ) {
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
echo wp_kses_post( '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' );
}
?>
</div>
@ -74,7 +79,8 @@ if ( ! defined( 'ABSPATH' ) ) {
</td>
<?php
if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() ) {
$tax_data = $item->get_taxes();
if ( $tax_data && wc_tax_enabled() ) {
foreach ( $order_taxes as $tax_item ) {
$tax_item_id = $tax_item->get_rate_id();
$tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : '';
@ -82,10 +88,10 @@ if ( ! defined( 'ABSPATH' ) ) {
<td class="line_tax" width="1%">
<div class="view">
<?php
echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '&ndash;';
echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '&ndash;' );
$refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' );
if ( $refunded ) {
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
echo wp_kses_post( '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' );
}
?>
</div>

View File

@ -2,7 +2,7 @@
/**
* Product general data panel.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
defined( 'ABSPATH' ) || exit;

View File

@ -2,7 +2,7 @@
/**
* Linked product options.
*
* @package WooCommerce/admin
* @package WooCommerce\Admin
*/
defined( 'ABSPATH' ) || exit;

View File

@ -2,7 +2,7 @@
/**
* Product data meta box.
*
* @package WooCommerce/Admin
* @package WooCommerce\Admin
*/
if ( ! defined( 'ABSPATH' ) ) {

View File

@ -6,7 +6,7 @@
* @var int $variation_id
* @var WP_POST $variation
* @var WC_Product_Variation $variation_object
* @var array $variation_data array of variation data @deprecated.
* @var array $variation_data array of variation data @deprecated 4.4.0.
*/
defined( 'ABSPATH' ) || exit;

View File

@ -89,19 +89,15 @@ class WC_Notes_Run_Db_Update {
* - actions are set up for the first 'Update database' notice, and
* - URL for note's action is equal to the given URL (to check for potential nonce update).
*
* @param WC_Admin_Note $note Note to check.
* @param string $update_url URL to check the note against.
* @param array( string ) $current_actions List of actions to check for.
* @param WC_Admin_Note $note Note to check.
* @param string $update_url URL to check the note against.
* @param array<int, string> $current_actions List of actions to check for.
* @return bool
*/
private static function note_up_to_date( $note, $update_url, $current_actions ) {
$actions = $note->get_actions();
if ( count( $current_actions ) === count( array_intersect( wp_list_pluck( $actions, 'name' ), $current_actions ) )
&& in_array( $update_url, wp_list_pluck( $actions, 'query' ), true ) ) {
return true;
}
return false;
return count( $current_actions ) === count( array_intersect( wp_list_pluck( $actions, 'name' ), $current_actions ) )
&& in_array( $update_url, wp_list_pluck( $actions, 'query' ), true );
}
/**
@ -115,7 +111,7 @@ class WC_Notes_Run_Db_Update {
private static function update_needed_notice( $note_id = null ) {
$update_url = html_entity_decode(
wp_nonce_url(
add_query_arg( 'do_update_woocommerce', 'true', admin_url( 'admin.php?page=wc-settings' ) ),
add_query_arg( 'do_update_woocommerce', 'true', wc_get_current_admin_url() ? wc_get_current_admin_url() : admin_url( 'admin.php?page=wc-settings' ) ),
'wc_db_update',
'wc_db_update_nonce'
)
@ -214,7 +210,7 @@ class WC_Notes_Run_Db_Update {
add_query_arg(
'wc-hide-notice',
'update',
admin_url( 'admin.php?page=wc-settings' )
wc_get_current_admin_url() ? wc_get_current_admin_url() : admin_url( 'admin.php?page=wc-settings' )
),
'woocommerce_hide_notices_nonce',
'_wc_notice_nonce'

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