Merge branch 'master' into pr/16959
# Conflicts: # includes/abstracts/abstract-wc-order.php
This commit is contained in:
commit
bc7484f473
|
@ -27,7 +27,6 @@ exclude_paths:
|
|||
- "includes/gateways/simplify-commerce/"
|
||||
- "includes/shipping/legacy-*"
|
||||
- "includes/wc-deprecated-functions.php"
|
||||
- "includes/class-wc-legacy-api.php"
|
||||
- "assets/js/accounting/"
|
||||
- "assets/js/jquery-*"
|
||||
- "assets/js/prettyPhoto/"
|
||||
|
|
|
@ -37,8 +37,10 @@ If you think something could be improved and you're able to do so, make your cha
|
|||
|
||||
* Fork the repository on GitHub
|
||||
* Make the changes to your forked repository
|
||||
* **Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/php/).**
|
||||
* **Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/coding-standards/php/)**
|
||||
* Install our pre-commit hook using composer. It'll help with the Coding Standards. To install just run `composer install`
|
||||
* Ensure you use LF line endings - no crazy Windows line endings please :)
|
||||
* Optionally it's possible install [EditorConfig](http://editorconfig.org/) on your editor to auto configure with indentation, line endings and other settings
|
||||
* When committing, reference your issue number (#1234) and include a note about the fix
|
||||
* Push the changes to your fork and submit a pull request on the master branch of the WooCommerce repository. Existing maintenance branches will be maintained by WooCommerce developers
|
||||
* Please **don't** modify the changelog - this will be maintained by the WooCommerce developers.
|
||||
|
|
|
@ -27,8 +27,6 @@ filter:
|
|||
- dummy-data/
|
||||
- i18n/
|
||||
- includes/api/legacy/
|
||||
- includes/class-wc-legacy-api.php
|
||||
- includes/gateways/simplify-commerce-deprecated/
|
||||
- includes/gateways/simplify-commerce/includes/
|
||||
- includes/legacy/
|
||||
- includes/libraries/
|
||||
|
|
|
@ -27,7 +27,7 @@ before_script:
|
|||
- bash tests/bin/travis.sh before
|
||||
|
||||
script:
|
||||
- bash tests/bin/travis.sh during
|
||||
- bash tests/bin/phpunit.sh
|
||||
|
||||
after_script:
|
||||
- bash tests/bin/travis.sh after
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 106 KiB |
168
CHANGELOG.txt
168
CHANGELOG.txt
|
@ -1,5 +1,173 @@
|
|||
== Changelog ==
|
||||
|
||||
= 3.2.2 - 2017-10-31 =
|
||||
* Fix - Properly escape commas when exporting products to CSV.
|
||||
* Fix - Fixed email template padding in Outlook.
|
||||
* Fix - Flexslider support for RTL languages and fixes for zoom target in Chrome.
|
||||
* Fix - Correctly sync prices for grouped products.
|
||||
* Fix - Filter and remove invalid tax classes names.
|
||||
* Fix - Stop showing "major" update notification for minor or patch releases.
|
||||
* Fix - Allow scroll bar in untested plugins list on the bulk plugin updates screen.
|
||||
* Fix - Fixed meta data cloning when duplicating products.
|
||||
* Fix - Clean "Filter Products by Attribute" widget cache when updating attributes.
|
||||
* Fix - Fixed warning messages when reseting passwords with an invalid key.
|
||||
* Fix - Cart totals: Don't add shipping costs unless show_shipping is true.
|
||||
* Fix - Cart totals: Calculate shipping after discounts so discount amounts are available.
|
||||
* Fix - Cart totals: Fixed issue where VAT exempt users where still being charged VAT on the totals.
|
||||
* Fix - Cart totals: Fixed the coupons user limit and calculations.
|
||||
* Fix - Fixed "relevance" default sorting in search results.
|
||||
* Fix - Use item tax class rather than product tax class when recalculating order totals.
|
||||
* Tweak - Allow shortcodes and relative URLs for downloads in product CSV importer.
|
||||
* Tweak - Save unsaved items first while deleting order items.
|
||||
* Tweak - Only change `nocacheheaders` when on a cart/checkout page.
|
||||
* Tweak - Setup locale before generating settings placeholders in email templates.
|
||||
* Tweak - On checkout, improved the field locale logic to work without clearing default values.
|
||||
* Tweak - Change title of customer invoice email for clarity.
|
||||
* Tweak - Use custom event instead of blur to trigger validation.
|
||||
* Tweak - Various selectWoo usibility improvements and better support for keyboard controls on AJAX multiselect elements.
|
||||
* Tweak - Various setup Wizard improvements.
|
||||
* Dev - Fixed orders date query when querying by meta data.
|
||||
* Dev - In the CSV exporter, added a filter to process meta values before export.
|
||||
|
||||
= 3.2.1 - 2017-10-13 =
|
||||
* Fix - Made grouped products display in the saved order, vs the menu order.
|
||||
* Fix - Made variations with 'same as parent' tax class calculate taxes correctly.
|
||||
* Fix - Fixed tax rate reverting to 0 when the tax rate itself is not changed and the row is saved.
|
||||
* Fix - Made tax rates sort correctly when defining postcodes and cities.
|
||||
* Fix - Made guided tour help tab videos lazy-load to prevent performance issues.
|
||||
* Fix - Added SelectWoo dependency to admin meta box scripts.
|
||||
* Fix - Fixed cart subtotal 1p rounding error.
|
||||
* Fix - Fixed discount logic to also look at variation parent categories when validating coupons.
|
||||
* Fix - Product import filename based matching, and full URL based matching where the date part would still be present.
|
||||
* Fix - Fixed storage of cart discounts when prices include tax.
|
||||
* Fix - Added styling for screen-reader-text for themes which do not define it.
|
||||
* Fix - Fixed legacy cart `prices_include_tax` variable.
|
||||
* Fix - Hide cat-parent class when category will show no children due to the new depth setting.
|
||||
* Fix - Make sure image zoom is enable for calling initZoomForTarget.
|
||||
* Fix - {blogname} email placeholder.
|
||||
* Fix - API - Use edit context when updating prices.
|
||||
* Tweak - Clearly describe when a feature is powered by WooCommerce Services in the setup wizard.
|
||||
* Tweak - Restored discount total line in order screen when discounts are present.
|
||||
* Tweak - Add back option to send admin new order email, and include order number and customer email in order emails.
|
||||
* Tweak - Replace settings screenshot on wp.org listing.
|
||||
|
||||
= 3.2.0 - 2017-10-11 =
|
||||
* Feature - Coupons can now be applied and removed in admin when editing unpaid orders.
|
||||
* Feature - Simplified the ability to resend order details to customers with a single "Resend Order Details" action.
|
||||
* Feature - Added store street address, city and postal code to settings for use by plugins.
|
||||
* Feature - Wrapping values in quotes now let's you use commas in the product CSV importer.
|
||||
* Feature - If a fatal error occurs, WooCommerce will catch and log it to be viewed in WC > Status > Logs.
|
||||
* Feature - Drag and drop sorting on the grouped product field to control display order.
|
||||
* Feature - Integrated selectWoo; more accessible Select2 (enhanced select boxes) in admin and on the front-end.
|
||||
* Feature - Enhanced select boxes in the shipping calculator.
|
||||
* Feature - Enhanced select boxes in layered nav "or" widget.
|
||||
* Feature - Ajaxified the product category filter on the products screen.
|
||||
* Feature - `[products]` shortcode can be used in place of other product shortcodes - one shortcode to rule them all.
|
||||
* Feature - Added option to control maximum depth of product category widget, and cleaned up widget naming.
|
||||
* Feature - Show sorting options when viewing search results. This defaults to sorting by relevance.
|
||||
* Feature - Support for the `WC tested up to` plugin header to show which extensions have been tested against updates.
|
||||
* Feature - Helper - Filters on the subscription management screen, update notifications, and support for shared licenses.
|
||||
* Tweak - Importer now supports menu_order property, adds filename based titles to imported images, and correctly sets post status of variations.
|
||||
* Tweak - Made the buyer phone number clickable in the in the order back-end.
|
||||
* Tweak - Clean up user is_paying_customer after deleting an order.
|
||||
* Tweak - If stock changes between page load and editing, reject stock changes to avoid incorrect stock changes.
|
||||
* Tweak - Disable search engines indexing core, dynamic, cart/checkout pages.
|
||||
* Tweak - Added shortcodes to description output in structured data, and improved variable product data.
|
||||
* Tweak - Use AJAX when restoring an item in the cart, and removing an item from the mini-cart.
|
||||
* Tweak - On-boarding: added "next" button to pointers and allowed them to be dismissed.
|
||||
* Tweak - Display post states for WC pages e.g. shop, checkout etc.
|
||||
* Tweak - Improved order tracking page display and validation.
|
||||
* Tweak - Wizard improvements, with store-owner newsletter sign-up.
|
||||
* Tweak - Improved tax calculations on negative fees by apportioning to all items.
|
||||
* Tweak - Added logic to install the plugins and themes asynchronously without using wp-cron.
|
||||
* Tweak - Modify product API returned data by context.
|
||||
* Tweak - Move js clipboards off of zeroclipboard script.
|
||||
* Tweak - Remove spam trap field from registration form.
|
||||
* Tweak - Added screen reader text to quantity input template.
|
||||
* Fix - Improved error handling in the CSV importer when invalid files are uploaded.
|
||||
* Fix - Handle full refunds in tax report by date.
|
||||
* Fix - API - Return empty result when there is no on_sale products.
|
||||
* Fix - Fixed WC_Emails::wrap_message hooks .
|
||||
* Fix - Load up gateways on ajax order status transitions so PayPal funds capture when order is completed.
|
||||
* Fix - Replace wistia videos with youtube.
|
||||
* Fix - Handle sale dates on the fly in case of missed cron schedule.
|
||||
* Fix - If sorting by date in the REST API, fallback to ID so searches are consistant.
|
||||
* Fix - Do not apply custom sorting to product feeds.
|
||||
* Fix - Make importer columns case-insensitive.
|
||||
* Dev - Make parse_date_for_wp_query public.
|
||||
* Dev - API - Creating webhooks uses the current API version rather than the latest API version.
|
||||
* Dev - Product CRUD search helpers.
|
||||
* Dev - Refactor shipping rate to include instance IDs, and pass instance IDs through filters.
|
||||
* Dev - New attribute helper functions.
|
||||
* Dev - Order note helper functions.
|
||||
* Dev - Added the "Terms and conditions" page to the api system status report.
|
||||
* Dev - Made date inputs reusable.
|
||||
* Dev - Added option for merging when using 'Order Again' via filter `woocommerce_empty_cart_when_order_again`.
|
||||
* Dev - Added system status tool for re-populating order address search indexes.
|
||||
* Dev - Added system status tool for clearing webhook logs.
|
||||
* Dev - Added woocommerce_get_asset_url filter.
|
||||
* Dev - Show notice when internal meta props are accessed directly.
|
||||
* Dev - Improve meta data updates so data is only updated when changed.
|
||||
* Dev - Improved get_filtered_term_product_counts performance.
|
||||
* Dev - Introduced wc_get_account_orders_actions function.
|
||||
* Dev - `wc_get_account_formatted_address` can get address by customer ID.
|
||||
* Dev - Added `woocommerce_get_product_id_by_sku` filter.
|
||||
* Dev - Refactored cart to use new WC_Cart_Session/WC_Cart_Totals/WC_Cart_Fees/WC_Discounts classes.
|
||||
* Dev - New `WC_Shortcode_Products` class to handle all product based shortcodes.
|
||||
* Theming - Display downloads in their own table, universally, using a new template file.
|
||||
* Theming - Streamlined email templates content: using the new downloads table, moved billing email with the billing address, order notes into the order totals table, and removed the need for 'downloadable' subjects/headings.
|
||||
* Theming - Checkout: Order pay template
|
||||
* Localization - Added cantons of Switzerland.
|
||||
* Localization - Updated XAF and XOF currency codes.
|
||||
* Localization - Added rtl support for activation.css.
|
||||
* Localization - Updated Mexican states to use correct 2 letter codes.
|
||||
* Localization - Improved many strings by excluding HTML.
|
||||
|
||||
= 3.1.2 - 2017-08-15 =
|
||||
* Fix - Importer: Prevent multiple placeholders being created when mixing IDs and SKUs.
|
||||
* Fix - Importer: correctly set stock management props.
|
||||
* Fix - Importer: Allow "unfiltered_html" for name, description and short description fields.
|
||||
* Fix - Fix filename image handling.
|
||||
* Fix - Rest API: Allow OPTIONS requests.
|
||||
* Fix - Fixed missing reviews in product_page shortcode when querying by SKU.
|
||||
* Fix - Don't subtract negative taxes in net sales report.
|
||||
* Fix - Sort by order + zone ID as a fallback in shipping zones so the zones always match in the same order.
|
||||
* Fix - Corrected subject and heading in customer refunded email.
|
||||
* Fix - Corrected handling of custom checkbox fields in checkout get_posted_data method.
|
||||
* Fix - Fix admin help videos async property.
|
||||
* Fix - Fixed price filters by introducing precision.
|
||||
* Fix - Improved customer IP address detection.
|
||||
* Fix - Fix dark theme readability.
|
||||
* Fix - CLI tools command.
|
||||
* Fix - Adjusted shop manager role to prevent unfiltered HTML being used.
|
||||
* Fix - Various notices/warnings.
|
||||
* Dev - Correctly invalidate cache after saving order items.
|
||||
* Dev - Added `woocommerce_data_store_wp_{$this->meta_type}_read_meta` filter.
|
||||
|
||||
= 3.1.1 - 2017-07-11 =
|
||||
* Fix - Product importer: fixed handling of non UTF8 characters in descriptions.
|
||||
* Fix - Product importer: Allow times in date fields.
|
||||
* Fix - Product exporter: fixed meta data checkbox option.
|
||||
* Fix - Helper: Styling and connect button in non-english languages.
|
||||
* Fix - Tweak terms and conditions template to check for disallowed shortcodes.
|
||||
* Fix - Fixed order helper queries when before_date and after_date args are both, corrected use of "paged", and corrected use of filters.
|
||||
* Fix - Gallery; Trigger resize after main image loads to ensure correct gallery size.
|
||||
* Fix - Prevent extra slashes being added to meta values when using the CRUD.
|
||||
* Fix - Appends "where" clauses in the comment feed to prevent a notice.
|
||||
* Fix - Fixed structured data output for variable product prices.
|
||||
* Fix - 3.x issue: Changed state validation logic to work for MX states.
|
||||
* Fix - 3.x issue: 7day reports should start from midnight, not the current time.
|
||||
* Fix - 3.x issue: Status changes made by admin should be marked as a manual in the order notes.
|
||||
* Fix - 3.x issue: Allow unsetting product shipping class in REST API.
|
||||
* Fix - 3.x issue: Corrected error handling in zones shippingMethodView.
|
||||
* Tweak - Avoid CloudFlare email obfuscation in admin.
|
||||
* Tweak - Improved detection of DOING_AUTOSAVE in admin meta box code.
|
||||
* Tweak - Improved my-account redirects and fallbacks.
|
||||
* Tweak - Add `cart_subtotal` to the shipping package so prices are recalculated when needed.
|
||||
* Dev - Add search_customers() filter in customer data store.
|
||||
* Dev - Product exporter: woocommerce_product_export_skip_meta_keys filter to control what gets exported.
|
||||
* Dev - Pass correct value to woocommerce_shipping_classes_save_class when inserting a new term
|
||||
|
||||
= 3.1.0 - 2017-06-28 =
|
||||
* Feature - Built-in product CSV importer and exporter for products.
|
||||
* Feature - Display (toggle-able) terms inline on the checkout rather than showing a link.
|
||||
|
|
|
@ -271,10 +271,12 @@ module.exports = function( grunt ) {
|
|||
// PHP Code Sniffer.
|
||||
phpcs: {
|
||||
options: {
|
||||
bin: 'vendor/bin/phpcs',
|
||||
standard: './phpcs.ruleset.xml'
|
||||
bin: 'vendor/bin/phpcs'
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
standard: './phpcs.ruleset.xml'
|
||||
},
|
||||
src: [
|
||||
'**/*.php', // Include all files
|
||||
'!apigen/**', // Exclude apigen/
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
'use strict';
|
||||
$.fn.extend({
|
||||
autocomplete: function(urlOrData, options) {
|
||||
var isUrl = typeof urlOrData == "string";
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -155,6 +155,11 @@ span.mce_woocommerce_shortcodes_button {
|
|||
padding: 0 2em;
|
||||
}
|
||||
|
||||
.plugin-details-table-container {
|
||||
max-height: 40vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
table.plugin-details-table {
|
||||
margin: 20px 0;
|
||||
th, td {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
body {
|
||||
margin: 100px auto 24px;
|
||||
margin: 65px auto 24px;
|
||||
box-shadow: none;
|
||||
background: #f1f1f1;
|
||||
padding: 0;
|
||||
|
@ -10,26 +10,27 @@ body {
|
|||
padding: 0;
|
||||
text-align: center;
|
||||
img {
|
||||
max-width: 50%;
|
||||
max-width: 30%;
|
||||
}
|
||||
}
|
||||
.wc-setup-content {
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
|
||||
padding: 24px 24px 0;
|
||||
padding: 2em;
|
||||
margin: 0 0 20px;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
|
||||
h1, h2, h3, table {
|
||||
margin: 0 0 24px;
|
||||
margin: 0 0 20px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
color: #666;
|
||||
clear: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
p {
|
||||
margin: 0 0 24px;
|
||||
margin: 20px 0;
|
||||
font-size: 1em;
|
||||
line-height: 1.75em;
|
||||
color: #666;
|
||||
|
@ -312,15 +313,6 @@ body {
|
|||
p:last-child {
|
||||
margin: 0 0 24px;
|
||||
}
|
||||
form {
|
||||
input[type="email"] {
|
||||
padding: .25em .5em;
|
||||
margin: 0 1% 0 0;
|
||||
font-size: 1.05em;
|
||||
width: 49%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
.woocommerce-tracker + .woocommerce-newsletter {
|
||||
margin-top: -24px;
|
||||
|
@ -376,8 +368,8 @@ body {
|
|||
}
|
||||
.wc-setup .wc-setup-actions {
|
||||
overflow: hidden;
|
||||
margin: 20px 0 0;
|
||||
.button {
|
||||
float: right;
|
||||
font-size: 1.25em;
|
||||
padding: 0.5em 1em;
|
||||
line-height: 1em;
|
||||
|
@ -391,7 +383,6 @@ body {
|
|||
border-color: #a36597;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
|
||||
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
|
||||
float: right;
|
||||
margin: 0;
|
||||
opacity: 1;
|
||||
|
||||
|
@ -402,6 +393,15 @@ body {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wc-setup-content p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wc-setup-content p.store-setup {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.wc-return-to-dashboard {
|
||||
font-size: 0.85em;
|
||||
color: #b5b5b5;
|
||||
|
@ -466,117 +466,565 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
ul.wc-wizard-shipping-methods,
|
||||
ul.wc-wizard-payment-gateways {
|
||||
// List of services
|
||||
.wc-wizard-services {
|
||||
border: 1px solid #eee;
|
||||
border-bottom-width: 2px;
|
||||
padding: 0;
|
||||
margin: 0 0 1em;
|
||||
list-style: none outside;
|
||||
border-radius: 4px;
|
||||
|
||||
li.wc-wizard-shipping,
|
||||
li.wc-wizard-gateway {
|
||||
padding: 1.5em 1em 1em 4em;
|
||||
border-top: 1px solid #eee;
|
||||
list-style: none outside;
|
||||
p {
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
font-size: 1em;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-item, .wc-wizard-services-list-toggle {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
padding: 2em 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
color: #666;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.payment-gateway-fee {
|
||||
color: #a6a6a6;
|
||||
}
|
||||
|
||||
.wc-wizard-service-name {
|
||||
flex-basis: 0;
|
||||
min-width: 175px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
img {
|
||||
max-width: 75px;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-description {
|
||||
flex-grow: 1;
|
||||
padding: 0 1em;
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings-description {
|
||||
display: block;
|
||||
font-style: italic;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-enable {
|
||||
flex-basis: 0;
|
||||
min-width: 75px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #555;
|
||||
box-sizing: border-box;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wc-wizard-service-toggle {
|
||||
height: 16px;
|
||||
width: 32px;
|
||||
border: 2px solid #935687;
|
||||
background-color: #935687;
|
||||
display: inline-block;
|
||||
text-indent: -9999px;
|
||||
border-radius: 10em;
|
||||
position: relative;
|
||||
|
||||
input[type=checkbox] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
border-color: #999;
|
||||
background-color: #999;
|
||||
|
||||
&:before {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings {
|
||||
display: none;
|
||||
margin-bottom: 0;
|
||||
cursor: default;
|
||||
|
||||
&.hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.checked {
|
||||
.wc-wizard-service-settings {
|
||||
display: inline-block;
|
||||
|
||||
&.hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.closed {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle display a list of services
|
||||
.wc-wizard-service-enable input {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
content: "\f347"; // down chevron
|
||||
font-family: "dashicons";
|
||||
visibility: initial;
|
||||
color: #666;
|
||||
font-size: 25px;
|
||||
margin-left: -5px; // center it
|
||||
top: -6px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-enable input:checked {
|
||||
&:before {
|
||||
content: "\f343"; // up chevron
|
||||
top: -7px;
|
||||
}
|
||||
}
|
||||
.wc-wizard-services.manual .wc-wizard-service-item {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Shipping list of services
|
||||
.wc-wizard-services.shipping {
|
||||
|
||||
.wc-wizard-service-name {
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
// List header
|
||||
.wc-wizard-service-item {
|
||||
padding-left: 2em;
|
||||
|
||||
&:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
border-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
font-weight: 700;
|
||||
|
||||
&.featured {
|
||||
width: 50%;
|
||||
float: left;
|
||||
clear: none;
|
||||
border-right: 1px solid #eee;
|
||||
border-top: 0;
|
||||
.wc-wizard-service-name {
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.featured-row-last {
|
||||
border-right: 0;
|
||||
}
|
||||
.wc-wizard-shipping-method-select,
|
||||
.shipping-method-setting {
|
||||
display: flex;
|
||||
|
||||
.wc-wizard-shipping-settings,
|
||||
.wc-wizard-gateway-settings {
|
||||
&.hide {
|
||||
display: none;
|
||||
margin-bottom: 0;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
&.checked {
|
||||
background: #f7f1f6;
|
||||
.wc-wizard-shipping-method-dropdown,
|
||||
.shipping-method-setting input {
|
||||
margin-right: 2em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
.wc-wizard-shipping-settings,
|
||||
.wc-wizard-gateway-settings {
|
||||
display: table;
|
||||
}
|
||||
.select2 {
|
||||
min-width: 130px;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-shipping-description,
|
||||
.wc-wizard-gateway-description {
|
||||
font-style: italic;
|
||||
.wc-wizard-service-description {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #a6a6a6;
|
||||
font-size: 0.92em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.shipping-method-setting {
|
||||
input {
|
||||
width: 95px; // match dropdown height
|
||||
border: 1px solid #aaa;
|
||||
border-color: #ddd;
|
||||
border-radius: 4px;
|
||||
height: 28px;
|
||||
padding-left: 8px;
|
||||
padding-right: 24px;
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
background-color: #fff;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-shipping-enable,
|
||||
.wc-wizard-gateway-enable {
|
||||
margin: 0 0 0.5em;
|
||||
.shipping-method-description,
|
||||
.shipping-method-setting .description {
|
||||
color: #7e7e7e;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
vertical-align: middle;
|
||||
.shipping-method-setting input::placeholder {
|
||||
color: #e1e1e1;
|
||||
}
|
||||
}
|
||||
.wc-setup-shipping-units {
|
||||
p {
|
||||
line-height: 1.5em;
|
||||
font-size: 13px;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
|
||||
img {
|
||||
max-height: 2em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
label::before {
|
||||
content: '';
|
||||
background: #fff;
|
||||
border: 2px solid #eee;
|
||||
display: inline-block;
|
||||
float: left;
|
||||
vertical-align: middle;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
margin: 0 1em 0 -3em;
|
||||
border-radius: 4px;
|
||||
}
|
||||
input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
.wc-setup-shipping-unit {
|
||||
margin-bottom: 1.75em;
|
||||
|
||||
&:checked + label::before {
|
||||
content: '\f147';
|
||||
font-family: 'dashicons';
|
||||
color: #fff;
|
||||
border-color: #a46497;
|
||||
background: #a46497;
|
||||
}
|
||||
.select2 {
|
||||
min-width: 100%; // widen dropdowns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:focus + label {
|
||||
outline: 1px solid #ddd; /* focus style */
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wc-wizard-features {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
.wc-wizard-feature-item {
|
||||
flex-basis: calc( 50% - 4em - 3px); // two columns, account for padding and borders
|
||||
border: 1px solid #eee;
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.wc-wizard-feature-item:nth-child(1) {
|
||||
border-radius: 4px 0 0 0;
|
||||
}
|
||||
|
||||
.wc-wizard-feature-item:nth-child(2) {
|
||||
border-left: 0;
|
||||
border-radius: 0 4px 0 0;
|
||||
}
|
||||
|
||||
.wc-wizard-feature-item:nth-child(3) {
|
||||
border-top: 0;
|
||||
border-radius: 0 0 0 4px;
|
||||
}
|
||||
|
||||
.wc-wizard-feature-item:nth-child(4) {
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-radius: 0 0 4px 0;
|
||||
}
|
||||
|
||||
p.wc-wizard-feature-name,
|
||||
p.wc-wizard-feature-description {
|
||||
margin: 0;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
h3.jetpack-reasons {
|
||||
text-align: center;
|
||||
margin: 3em 0 1em 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.jetpack-logo {
|
||||
display: block;
|
||||
margin: 1.75em auto 2em auto;
|
||||
max-height: 175px;
|
||||
}
|
||||
|
||||
.step {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wc-setup .wc-setup-actions .button {
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
padding: 1em 2em;
|
||||
box-shadow: none;
|
||||
min-width: 12em;
|
||||
min-width: auto;
|
||||
margin-top:10px;
|
||||
|
||||
&:focus,
|
||||
&:hover,
|
||||
&:active {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.location-prompt {
|
||||
color: #666;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.5em;
|
||||
margin-top: 1em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.location-input {
|
||||
border: 1px solid #aaa;
|
||||
border-color: #ddd;
|
||||
border-radius: 4px;
|
||||
height: 30px;
|
||||
width: calc(100% - 8px - 24px - 2px); // account for padding, border to align with other elements
|
||||
padding-left: 8px;
|
||||
padding-right: 24px;
|
||||
font-size: 16px;
|
||||
color: #444;
|
||||
background-color: #fff;
|
||||
display: inline-block;
|
||||
|
||||
&.dropdown {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.address-step {
|
||||
.select2 {
|
||||
min-width: 100%; // widen currency, product type dropdowns
|
||||
}
|
||||
}
|
||||
|
||||
.store-address-container {
|
||||
margin-bottom: 24px; // match margin-bottom on top paragraph
|
||||
|
||||
.city-and-postcode {
|
||||
display: flex;
|
||||
|
||||
div {
|
||||
flex-basis: 50%;
|
||||
margin-right: 1em;
|
||||
|
||||
&:last-of-type {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings {
|
||||
.payment-email-input {
|
||||
border: 1px solid #aaa;
|
||||
border-color: #ddd;
|
||||
border-radius: 4px;
|
||||
height: 30px;
|
||||
padding: 0 8px;
|
||||
font-size: 14px;
|
||||
color: #444;
|
||||
background-color: #fff;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.newsletter-form-container {
|
||||
display: flex;
|
||||
|
||||
.newsletter-form-email {
|
||||
border: 1px solid #aaa;
|
||||
border-color: #ddd;
|
||||
border-radius: 4px;
|
||||
height: 42px;
|
||||
padding: 0 8px;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
background-color: #fff;
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.newsletter-form-button-container {
|
||||
flex-grow: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-setup .wc-setup-actions .button.newsletter-form-button {
|
||||
height: 42px;
|
||||
padding: 0 1em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wc-wizard-next-steps {
|
||||
border: 1px solid #eee;
|
||||
border-radius: 4px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wc-wizard-next-step-item {
|
||||
display: flex;
|
||||
border-top: 1px solid #eee;
|
||||
|
||||
&:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-next-step-description {
|
||||
flex-grow: 1;
|
||||
margin: 1.5em;
|
||||
}
|
||||
|
||||
.wc-wizard-next-step-action {
|
||||
flex-grow: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.button {
|
||||
margin: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
&.next-step-heading {
|
||||
margin: 0;
|
||||
font-size: 0.95em;
|
||||
font-weight: 400;
|
||||
font-variant: all-petite-caps;
|
||||
}
|
||||
|
||||
&.next-step-extra-info {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
&.next-step-description {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p.next-steps-help-text {
|
||||
color: #9f9f9f;
|
||||
padding: 0 2em;
|
||||
text-align: center;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
p.jetpack-terms {
|
||||
font-size: .8em;
|
||||
text-align: center;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.woocommerce-error {
|
||||
background: #ffe6e5;
|
||||
border-color: #ffc5c2;
|
||||
padding: 1em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5em;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #ff645c;
|
||||
}
|
||||
|
||||
.reconnect-reminder {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
.wc-setup-actions .button {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.allow-tracking {
|
||||
color: #9f9f9f;
|
||||
margin-top: 2em;
|
||||
text-align: center;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.wc-wizard-service-setting-stripe_create_account {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
margin-top: 0.75em;
|
||||
|
||||
.payment-checkbox-input {
|
||||
order: 1;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
width: 1.5em;
|
||||
}
|
||||
|
||||
.stripe_create_account {
|
||||
order: 2;
|
||||
margin-left: 0.3em;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-wizard-service-setting-stripe_email {
|
||||
margin-top: 0.75em;
|
||||
|
||||
label.stripe_email {
|
||||
position: absolute;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
input.payment-email-input {
|
||||
margin-left: 1.5em;
|
||||
margin-bottom: .5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wc-wizard-service-settings-description {
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -38,6 +38,15 @@ p.demo_store,
|
|||
}
|
||||
}
|
||||
|
||||
.screen-reader-text {
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
position: absolute !important;
|
||||
width: 1px;
|
||||
word-wrap: normal !important;
|
||||
}
|
||||
|
||||
.admin-bar p.demo_store {
|
||||
top: 32px;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="139px" height="141px" viewBox="0 0 139 141" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Jetpack-green-logo</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<polygon id="path-1" points="0 0.5542 0 136 135.4457 136 135.4457 0.5542"></polygon>
|
||||
<polygon id="path-3" points="77.6435 59 0.4395 59 0.4395 0.0825 77.6435 0.0825 77.6435 59"></polygon>
|
||||
<polygon id="path-5" points="7.402 0.8152 7.402 7.9552 0.2622 7.9552 0.2622 0.8152 7.402 0.8152"></polygon>
|
||||
</defs>
|
||||
<g id="Wizard---HiFi" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="05---Activate-Copy-2" transform="translate(-651.000000, -369.000000)">
|
||||
<g id="Jetpack-green-logo" transform="translate(651.000000, 369.000000)">
|
||||
<g id="Group-3" transform="translate(0.000000, 4.651000)">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<g id="Clip-2"></g>
|
||||
<path d="M67.7227,0.5542 C30.3207,0.5542 -0.0003,30.8752 -0.0003,68.2782 C-0.0003,72.2862 0.3687,76.2082 1.0367,80.0262 C4.9877,82.5422 9.9887,83.1572 14.5867,82.8632 C28.6607,81.9632 38.6187,71.3092 47.9357,61.9912 C48.1877,61.7392 52.3447,57.5822 52.3447,57.5822 L61.8337,71.9432 L19.7847,116.1112 C32.0437,128.3972 48.9947,136.0002 67.7227,136.0002 C105.1247,136.0002 135.4457,105.6802 135.4457,68.2782 C135.4457,30.8752 105.1247,0.5542 67.7227,0.5542" id="Fill-1" fill="#C2DAAA" mask="url(#mask-2)"></path>
|
||||
</g>
|
||||
<path d="M90.4863,102.4132 C90.4863,98.5002 93.6583,95.3282 97.5713,95.3282 C101.4843,95.3282 104.6563,98.5002 104.6563,102.4132 C104.6563,106.3252 101.4843,109.4982 97.5713,109.4982 C93.6583,109.4982 90.4863,106.3252 90.4863,102.4132" id="Fill-4" fill="#639B34"></path>
|
||||
<path d="M39.5879,74.8097 C42.4809,72.1547 45.2349,69.3427 47.9359,66.6417 C48.1879,66.3897 52.3449,62.2337 52.3449,62.2337 L61.8339,76.5937 L51.3319,87.6247 C51.6969,88.7267 51.8999,89.8707 51.8389,91.0427 C51.7139,93.4637 46.5109,95.6197 44.7729,97.3057 C43.0339,98.9917 44.7589,100.2087 42.3969,100.7527 C41.0769,101.0567 39.7409,101.1857 38.3979,101.2097 L24.8139,115.4787 C32.6699,108.9377 43.3129,111.9837 53.0919,112.5077 C55.5879,112.6417 58.0269,111.0507 60.3499,110.7797 C64.0429,110.3457 67.3459,109.2197 70.4699,107.2517 C72.0179,106.2777 73.8259,106.3027 75.0169,104.8977 C78.9249,100.2827 80.4739,92.7407 84.3289,88.0807 C86.7879,85.1087 89.9189,83.6027 92.9359,81.7337 C83.6429,59.3417 61.5789,43.5877 35.8279,43.5777 C34.7249,45.3707 33.8329,47.2907 33.2199,49.3107 C30.5489,58.1147 33.0919,68.2937 39.5879,74.8097" id="Fill-6" fill="#8CC258"></path>
|
||||
<path d="M19.8057,120.7394 C20.0197,120.9534 20.2227,121.1794 20.4397,121.3914 C20.9527,120.1784 21.6227,119.0434 22.4237,117.9894 L19.8057,120.7394 Z" id="Fill-8" fill="#8CC258"></path>
|
||||
<path d="M42.397,100.753 C44.759,100.209 43.034,98.991 44.772,97.306 C46.511,95.619 51.714,93.464 51.839,91.043 C51.899,89.87 51.697,88.727 51.332,87.625 L38.398,101.21 C39.741,101.186 41.077,101.057 42.397,100.753" id="Fill-10" fill="#7BAC48"></path>
|
||||
<path d="M14.5864,87.5138 C24.5824,86.8748 32.4994,81.3158 39.5874,74.8098 C33.0914,68.2938 30.5494,58.1148 33.2194,49.3108 C33.8324,47.2908 34.7244,45.3698 35.8274,43.5768 C35.8184,43.5768 35.8094,43.5758 35.8004,43.5758 C23.7404,43.5758 12.4954,47.0408 2.9824,53.0108 C1.0464,59.3088 0.0004,65.9958 0.0004,72.9288 C0.0004,76.9368 0.3614,80.8598 1.0324,84.6748 C4.9834,87.1928 9.9874,87.8088 14.5864,87.5138" id="Fill-12" fill="#7BAC48"></path>
|
||||
<g id="Group-16" transform="translate(20.000000, 81.651000)">
|
||||
<mask id="mask-4" fill="white">
|
||||
<use xlink:href="#path-3"></use>
|
||||
</mask>
|
||||
<g id="Clip-15"></g>
|
||||
<path d="M72.9355,0.0825 C69.9185,1.9515 66.7875,3.4575 64.3285,6.4305 C60.4735,11.0895 58.9255,18.6315 55.0165,23.2465 C53.8255,24.6515 52.0185,24.6265 50.4695,25.6015 C47.3455,27.5685 44.0425,28.6945 40.3505,29.1285 C38.0275,29.3995 35.5875,30.9905 33.0915,30.8565 C23.3125,30.3325 12.6695,27.2865 4.8135,33.8275 L2.4235,36.3385 C1.6225,37.3925 0.9525,38.5275 0.4395,39.7405 C12.6445,51.6505 29.3215,59.0005 47.7225,59.0005 C55.0845,59.0005 62.1645,57.8105 68.8005,55.6385 C74.4115,46.3305 77.6435,35.4285 77.6435,23.7685 C77.6435,15.3765 75.9635,7.3795 72.9355,0.0825" id="Fill-14" fill="#7BAC48" mask="url(#mask-4)"></path>
|
||||
</g>
|
||||
<path d="M22.4238,117.9894 L24.8138,115.4784 C24.6068,115.6504 24.4008,115.8254 24.1978,116.0104 C23.5328,116.6204 22.9548,117.2904 22.4238,117.9894" id="Fill-17" fill="#FFFFFF"></path>
|
||||
<g id="Group-21" transform="translate(131.000000, 59.651000)">
|
||||
<mask id="mask-6" fill="white">
|
||||
<use xlink:href="#path-5"></use>
|
||||
</mask>
|
||||
<g id="Clip-20"></g>
|
||||
<path d="M0.2622,4.3852 C0.2622,2.4132 1.8612,0.8152 3.8322,0.8152 C5.8042,0.8152 7.4022,2.4132 7.4022,4.3852 C7.4022,6.3572 5.8042,7.9552 3.8322,7.9552 C1.8612,7.9552 0.2622,6.3572 0.2622,4.3852" id="Fill-19" fill="#70B130" mask="url(#mask-6)"></path>
|
||||
</g>
|
||||
<path d="M95.4727,12.212 C95.4727,11.053 96.4117,10.113 97.5717,10.113 C98.7297,10.113 99.6697,11.053 99.6697,12.212 C99.6697,13.37 98.7297,14.311 97.5717,14.311 C96.4117,14.311 95.4727,13.37 95.4727,12.212" id="Fill-22" fill="#639B34"></path>
|
||||
<path d="M39.5874,30.5948 C39.5874,28.6048 41.2014,26.9908 43.1914,26.9908 C45.1824,26.9908 46.7954,28.6048 46.7954,30.5948 C46.7954,32.5848 45.1824,34.1988 43.1914,34.1988 C41.2014,34.1988 39.5874,32.5848 39.5874,30.5948" id="Fill-24" fill="#FFFFFF"></path>
|
||||
<polygon id="Fill-26" fill="#70B130" points="52.3047 9.7413 57.7277 7.5823 52.3047 5.4243 50.1457 0.0003 47.9867 5.4243 42.5627 7.5823 47.9867 9.7413 50.1457 15.1653"></polygon>
|
||||
<polygon id="Fill-28" fill="#FFFFFF" points="114.3955 72.3673 116.7035 67.0063 111.3415 69.3143 105.9805 67.0063 108.2885 72.3673 105.9805 77.7283 111.3415 75.4213 116.7035 77.7283"></polygon>
|
||||
<polygon id="Fill-30" fill="#FFFFFF" points="73.8223 18.297 75.5013 14.396 71.6003 16.075 67.6993 14.396 69.3793 18.297 67.6993 22.197 71.6003 20.519 75.5013 22.197"></polygon>
|
||||
<polygon id="Fill-32" fill="#FFFFFF" points="117.7373 46.9513 120.3333 45.9173 117.7373 44.8843 116.7033 42.2873 115.6703 44.8843 113.0733 45.9173 115.6703 46.9513 116.7033 49.5473"></polygon>
|
||||
<path d="M81.354,30.3155 L86.304,35.2205 L83.807,39.7905 C83.807,39.7905 76.394,40.0615 75.994,39.8935 C75.593,39.7245 73.699,35.7465 74.077,35.1765 C74.457,34.6085 80.189,30.3925 80.189,30.3925 L81.354,30.3155" id="Fill-34" fill="#FFFFFF"></path>
|
||||
<path d="M63.4233,44.8595 L45.1843,63.0975 L50.5153,68.4285 L54.6443,72.5575 L78.1593,49.0415 L74.0313,44.9135 L73.9783,44.8595 C71.0633,41.9445 66.3383,41.9445 63.4233,44.8595" id="Fill-36" fill="#498E0B"></path>
|
||||
<path d="M112.5933,18.2198 C110.5823,18.2198 108.9513,19.8498 108.9513,21.8618 L108.9513,24.1648 L100.3573,28.4748 C95.8743,30.7238 92.0683,34.0668 89.2313,38.1478 L85.5343,34.4508 L85.5313,34.4548 L82.6403,37.3458 C81.5563,38.4298 79.7983,38.4298 78.7143,37.3458 L77.5523,36.1848 C76.9903,35.6228 76.9903,34.7128 77.5513,34.1528 L81.3733,30.3308 C81.3673,30.3268 81.3623,30.3238 81.3573,30.3198 L81.3543,30.3158 L81.3533,30.3168 C79.1853,28.5698 76.0053,28.7008 73.9923,30.7148 L66.9123,37.7938 L74.0653,44.9478 C69.0473,46.1118 64.8013,49.4728 62.5313,54.1268 L55.1143,69.3468 C49.1293,71.5958 44.3483,76.4488 42.2843,82.7118 L36.3843,100.6188 L35.1673,101.2228 C28.7113,104.4248 23.4823,109.6548 20.2803,116.1098 L15.7063,125.3278 L12.2223,124.4818 C10.7843,124.1318 9.3353,125.0148 8.9863,126.4528 L5.9323,139.0218 L11.8473,133.1068 L11.8463,133.1088 L52.9223,92.0328 C53.9823,92.7448 55.1053,93.3728 56.2843,93.9068 L72.5743,101.2748 C68.2503,101.9868 64.0823,103.5528 60.3293,105.9218 L51.6963,111.3708 L49.3073,108.9828 C48.3493,108.0238 46.7943,108.0238 45.8363,108.9828 L37.0003,117.8178 L44.2853,116.0478 L44.2833,116.0498 L71.1753,109.5218 L77.5673,107.9698 C78.8683,107.6478 79.9573,107.0028 80.8023,106.1578 C83.3643,103.5958 83.6773,99.1898 80.8033,96.3168 L64.8993,80.4118 L69.8333,76.6858 L84.8743,76.6858 L85.6943,76.6858 L89.1113,76.6858 L89.2173,76.6858 C90.1763,76.6858 91.0233,76.2168 91.5503,75.4978 C91.5573,75.4878 91.5683,75.4788 91.5753,75.4678 L91.5733,75.4668 C91.9093,74.9938 92.1093,74.4178 92.1093,73.7938 L92.1093,71.0498 C92.1083,70.1668 91.3933,69.4508 90.5103,69.4508 L87.7663,69.4508 C86.1693,69.4508 84.8743,70.7458 84.8743,72.3428 L84.8743,73.2428 L79.3733,71.4168 C78.7623,71.2138 78.1453,71.0368 77.5263,70.8748 L79.6503,69.2718 C83.1563,66.6238 85.2233,62.4908 85.2423,58.0988 L85.2713,51.0108 L98.7733,37.5098 L108.9513,27.3308 L118.0633,18.2198 L112.5933,18.2198 Z" id="Fill-38" fill="#234705"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 19 KiB |
|
@ -9,7 +9,8 @@
|
|||
*/
|
||||
$.fn.WCBackboneModal = function( options ) {
|
||||
return this.each( function() {
|
||||
( new $.WCBackboneModal( $( this ), options ) );
|
||||
var WCeachBackboneModal = new $.WCBackboneModal( $( this ), options )
|
||||
( WCeachBackboneModal() );
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -24,10 +25,12 @@
|
|||
var settings = $.extend( {}, $.WCBackboneModal.defaultOptions, options );
|
||||
|
||||
if ( settings.template ) {
|
||||
new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
|
||||
var BackboneModal = new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
BackboneModal();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){new e.WCBackboneModal(e(this),t)})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
||||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){var n=new e.WCBackboneModal(e(this),t)(n())})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})()},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
|
@ -549,6 +549,10 @@ jQuery( function ( $ ) {
|
|||
action : 'woocommerce_remove_order_item',
|
||||
security : woocommerce_admin_meta_boxes.order_item_nonce
|
||||
};
|
||||
// Check if items have changed, if so pass them through so we can save them before deleting.
|
||||
if ( 'true' === $( 'button.cancel-action' ).attr( 'data-reload' ) ) {
|
||||
data.items = $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize();
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||
|
@ -556,7 +560,7 @@ jQuery( function ( $ ) {
|
|||
type: 'POST',
|
||||
success: function( response ) {
|
||||
if ( response.success ) {
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).append( response.data.html );
|
||||
wc_meta_boxes_order.init_tiptip();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
|
@ -688,8 +692,9 @@ jQuery( function ( $ ) {
|
|||
wc_meta_boxes_order_items.block();
|
||||
|
||||
if ( window.confirm( woocommerce_admin_meta_boxes.i18n_do_refund ) ) {
|
||||
var refund_amount = $( 'input#refund_amount' ).val();
|
||||
var refund_reason = $( 'input#refund_reason' ).val();
|
||||
var refund_amount = $( 'input#refund_amount' ).val();
|
||||
var refund_reason = $( 'input#refund_reason' ).val();
|
||||
var refunded_amount = $( 'input#refunded_amount' ).val();
|
||||
|
||||
// Get line item refunds
|
||||
var line_item_qtys = {};
|
||||
|
@ -723,16 +728,17 @@ jQuery( function ( $ ) {
|
|||
});
|
||||
|
||||
var data = {
|
||||
action: 'woocommerce_refund_line_items',
|
||||
order_id: woocommerce_admin_meta_boxes.post_id,
|
||||
refund_amount: refund_amount,
|
||||
refund_reason: refund_reason,
|
||||
line_item_qtys: JSON.stringify( line_item_qtys, null, '' ),
|
||||
line_item_totals: JSON.stringify( line_item_totals, null, '' ),
|
||||
line_item_tax_totals: JSON.stringify( line_item_tax_totals, null, '' ),
|
||||
api_refund: $( this ).is( '.do-api-refund' ),
|
||||
restock_refunded_items: $( '#restock_refunded_items:checked' ).length ? 'true' : 'false',
|
||||
security: woocommerce_admin_meta_boxes.order_item_nonce
|
||||
action : 'woocommerce_refund_line_items',
|
||||
order_id : woocommerce_admin_meta_boxes.post_id,
|
||||
refund_amount : refund_amount,
|
||||
refunded_amount : refunded_amount,
|
||||
refund_reason : refund_reason,
|
||||
line_item_qtys : JSON.stringify( line_item_qtys, null, '' ),
|
||||
line_item_totals : JSON.stringify( line_item_totals, null, '' ),
|
||||
line_item_tax_totals : JSON.stringify( line_item_tax_totals, null, '' ),
|
||||
api_refund : $( this ).is( '.do-api-refund' ),
|
||||
restock_refunded_items: $( '#restock_refunded_items:checked' ).length ? 'true': 'false',
|
||||
security : woocommerce_admin_meta_boxes.order_item_nonce
|
||||
};
|
||||
|
||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||
|
@ -745,6 +751,7 @@ jQuery( function ( $ ) {
|
|||
}
|
||||
} else {
|
||||
window.alert( response.data.error );
|
||||
wc_meta_boxes_order_items.reload_items();
|
||||
wc_meta_boxes_order_items.unblock();
|
||||
}
|
||||
});
|
||||
|
@ -1075,6 +1082,7 @@ jQuery( function ( $ ) {
|
|||
init: function( e, target ) {
|
||||
if ( 'wc-modal-add-products' === target ) {
|
||||
$( document.body ).trigger( 'wc-enhanced-select-init' );
|
||||
$( '#add_item_id' ).selectWoo( 'open' ).selectWoo( 'focus' );
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1107,6 +1115,11 @@ jQuery( function ( $ ) {
|
|||
data : $( '#wc-backbone-modal-dialog form' ).serialize()
|
||||
};
|
||||
|
||||
// Check if items have changed, if so pass them through so we can save them before adding a new item.
|
||||
if ( 'true' === $( 'button.cancel-action' ).attr( 'data-reload' ) ) {
|
||||
data.items = $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize();
|
||||
}
|
||||
|
||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||
if ( response.success ) {
|
||||
$( '#woocommerce-order-items' ).find( '.inside' ).empty();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
/* global wp, woocommerce_admin_meta_boxes_variations, woocommerce_admin, accounting */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
( function( $ ) {
|
||||
'use strict';
|
||||
/**
|
||||
* Variations actions
|
||||
*/
|
||||
|
@ -1043,4 +1043,4 @@ jQuery( function( $ ) {
|
|||
wc_meta_boxes_product_variations_ajax.init();
|
||||
wc_meta_boxes_product_variations_pagenav.init();
|
||||
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
jQuery(function(t){function e(e,a,n){t('<div class="chart-tooltip">'+n+"</div>").css({top:a-16,left:e+20}).appendTo("body").fadeIn(200)}var a=null,n=null;t(".chart-placeholder").bind("plothover",function(i,r,o){if(o){if((a!==o.dataIndex||n!==o.seriesIndex)&&(a=o.dataIndex,n=o.seriesIndex,t(".chart-tooltip").remove(),o.series.points.show||o.series.enable_tooltip)){var s=o.series.data[o.dataIndex][1],l="";o.series.prepend_label&&(l=l+o.series.label+": "),o.series.prepend_tooltip&&(l+=o.series.prepend_tooltip),l+=s,o.series.append_tooltip&&(l+=o.series.append_tooltip),o.series.pie.show?e(r.pageX,r.pageY,l):e(o.pageX,o.pageY,l)}}else t(".chart-tooltip").remove(),a=null}),t(".wc_sparkline.bars").each(function(){var e={grid:{show:!1}},a=[{data:t(this).data("sparkline"),color:t(this).data("color"),bars:{fillColor:t(this).data("color"),fill:!0,show:!0,lineWidth:1,barWidth:t(this).data("barwidth"),align:"center"},shadowSize:0}];t.plot(t(this),a,e)}),t(".wc_sparkline.lines").each(function(){var e={grid:{show:!1}},a=[{data:t(this).data("sparkline"),color:t(this).data("color"),lines:{fill:!1,show:!0,lineWidth:1,align:"center"},shadowSize:0}];t.plot(t(this),a,e)});var i=t(".range_datepicker").datepicker({changeMonth:!0,changeYear:!0,defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,minDate:"-20Y",maxDate:"+0D",showButtonPanel:!0,showOn:"focus",buttonImageOnly:!0,onSelect:function(){var e=t(this).is(".from")?"minDate":"maxDate",a=t(this).datepicker("getDate");i.not(this).datepicker("option",e,a)}});"undefined"==typeof document.createElement("a").download&&t(".export_csv").hide(),t(".export_csv").click(function(){var e=t(this).data("exclude_series")||"";e=e.toString(),e=e.split(",");var a,n,i,r=t(this).data("xaxes"),o=t(this).data("groupby"),s=t(this).data("index_type"),l="data:application/csv;charset=utf-8,";if("table"===t(this).data("export"))t(this).offsetParent().find("thead tr,tbody tr").each(function(){t(this).find("th, td").each(function(){var e=t(this).text();e=e.replace("[?]","").replace("#",""),l+='"'+e+'",'}),l=l.substring(0,l.length-1),l+="\n"}),t(this).offsetParent().find("tfoot tr").each(function(){t(this).find("th, td").each(function(){var e=t(this).text();if(e=e.replace("[?]","").replace("#",""),l+='"'+e+'",',t(this).attr("colspan")>0)for(p=1;p<t(this).attr("colspan");p++)l+='"",'}),l=l.substring(0,l.length-1),l+="\n"});else{if(!window.main_chart)return!1;var h=window.main_chart.getData(),d=[];for(l+='"'+r+'",',t.each(h,function(a,n){e&&-1!==t.inArray(a.toString(),e)||d.push(n)}),a=0;a<d.length;++a)l+='"'+d[a].label+'",';l=l.substring(0,l.length-1),l+="\n";var c={};for(a=0;a<d.length;++a)for(n=d[a].data,i=0;i<n.length;++i){c[n[i][0]]=[];for(var p=0;p<d.length;++p)c[n[i][0]].push(0)}for(a=0;a<d.length;++a)for(n=d[a].data,i=0;i<n.length;++i)c[n[i][0]][a]=n[i][1];t.each(c,function(t,e){var a=new Date(parseInt(t,10));l+="none"===s?'"'+t+'",':"day"===o?'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+"-"+a.getUTCDate()+'",':'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+'",';for(var n=0;n<e.length;++n){var i=e[n];Math.round(i)!==i&&(i=(i=parseFloat(i)).toFixed(2)),l+='"'+i+'",'}l=l.substring(0,l.length-1),l+="\n"})}return t(this).attr("href",encodeURI(l)),!0})});
|
||||
jQuery(function(t){function e(e,a,n){t('<div class="chart-tooltip">'+n+"</div>").css({top:a-16,left:e+20}).appendTo("body").fadeIn(200)}var a=null,n=null;t(".chart-placeholder").bind("plothover",function(i,r,o){if(o){if((a!==o.dataIndex||n!==o.seriesIndex)&&(a=o.dataIndex,n=o.seriesIndex,t(".chart-tooltip").remove(),o.series.points.show||o.series.enable_tooltip)){var s=o.series.data[o.dataIndex][1],l="";o.series.prepend_label&&(l=l+o.series.label+": "),o.series.prepend_tooltip&&(l+=o.series.prepend_tooltip),l+=s,o.series.append_tooltip&&(l+=o.series.append_tooltip),o.series.pie.show?e(r.pageX,r.pageY,l):e(o.pageX,o.pageY,l)}}else t(".chart-tooltip").remove(),a=null}),t(".wc_sparkline.bars").each(function(){var e={grid:{show:!1}},a=[{data:t(this).data("sparkline"),color:t(this).data("color"),bars:{fillColor:t(this).data("color"),fill:!0,show:!0,lineWidth:1,barWidth:t(this).data("barwidth"),align:"center"},shadowSize:0}];t.plot(t(this),a,e)}),t(".wc_sparkline.lines").each(function(){var e={grid:{show:!1}},a=[{data:t(this).data("sparkline"),color:t(this).data("color"),lines:{fill:!1,show:!0,lineWidth:1,align:"center"},shadowSize:0}];t.plot(t(this),a,e)});var i=t(".range_datepicker").datepicker({changeMonth:!0,changeYear:!0,defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,minDate:"-20Y",maxDate:"+1D",showButtonPanel:!0,showOn:"focus",buttonImageOnly:!0,onSelect:function(){var e=t(this).is(".from")?"minDate":"maxDate",a=t(this).datepicker("getDate");i.not(this).datepicker("option",e,a)}});"undefined"==typeof document.createElement("a").download&&t(".export_csv").hide(),t(".export_csv").click(function(){var e=t(this).data("exclude_series")||"";e=e.toString(),e=e.split(",");var a,n,i,r=t(this).data("xaxes"),o=t(this).data("groupby"),s=t(this).data("index_type"),l="data:application/csv;charset=utf-8,";if("table"===t(this).data("export"))t(this).offsetParent().find("thead tr,tbody tr").each(function(){t(this).find("th, td").each(function(){var e=t(this).text();e=e.replace("[?]","").replace("#",""),l+='"'+e+'",'}),l=l.substring(0,l.length-1),l+="\n"}),t(this).offsetParent().find("tfoot tr").each(function(){t(this).find("th, td").each(function(){var e=t(this).text();if(e=e.replace("[?]","").replace("#",""),l+='"'+e+'",',t(this).attr("colspan")>0)for(p=1;p<t(this).attr("colspan");p++)l+='"",'}),l=l.substring(0,l.length-1),l+="\n"});else{if(!window.main_chart)return!1;var h=window.main_chart.getData(),d=[];for(l+='"'+r+'",',t.each(h,function(a,n){e&&-1!==t.inArray(a.toString(),e)||d.push(n)}),a=0;a<d.length;++a)l+='"'+d[a].label+'",';l=l.substring(0,l.length-1),l+="\n";var c={};for(a=0;a<d.length;++a)for(n=d[a].data,i=0;i<n.length;++i){c[n[i][0]]=[];for(var p=0;p<d.length;++p)c[n[i][0]].push(0)}for(a=0;a<d.length;++a)for(n=d[a].data,i=0;i<n.length;++i)c[n[i][0]][a]=n[i][1];t.each(c,function(t,e){var a=new Date(parseInt(t,10));l+="none"===s?'"'+t+'",':"day"===o?'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+"-"+a.getUTCDate()+'",':'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+'",';for(var n=0;n<e.length;++n){var i=e[n];Math.round(i)!==i&&(i=(i=parseFloat(i)).toFixed(2)),l+='"'+i+'",'}l=l.substring(0,l.length-1),l+="\n"})}return t(this).attr("href",encodeURI(l)),!0})});
|
|
@ -1,74 +1,7 @@
|
|||
/*global wc_setup_params */
|
||||
/*global wc_setup_currencies */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
var locale_info = $.parseJSON( wc_setup_params.locale_info );
|
||||
|
||||
$( 'select[name="store_location"]' ).change( function() {
|
||||
var country_option = $(this).val().split( ':' );
|
||||
var country = country_option[0];
|
||||
var state = country_option[1] || false;
|
||||
var country_locale_info = locale_info[ country ];
|
||||
var hide_if_set = [ 'thousand_sep', 'decimal_sep', 'num_decimals', 'currency_pos' ];
|
||||
|
||||
if ( country_locale_info ) {
|
||||
$.each( country_locale_info, function( index, value ) {
|
||||
$(':input[name="' + index + '"]').val( value ).change();
|
||||
|
||||
if ( -1 !== $.inArray( index, hide_if_set ) ) {
|
||||
$(':input[name="' + index + '"]').closest('tr').hide();
|
||||
}
|
||||
} );
|
||||
|
||||
if ( ! $.isArray( country_locale_info.tax_rates ) ) {
|
||||
var tax_rates = [];
|
||||
|
||||
if ( state && country_locale_info.tax_rates[ state ] ) {
|
||||
tax_rates = tax_rates.concat( country_locale_info.tax_rates[ state ] );
|
||||
} else if ( country_locale_info.tax_rates[ '' ] ) {
|
||||
tax_rates = tax_rates.concat( country_locale_info.tax_rates[ '' ] );
|
||||
}
|
||||
|
||||
tax_rates = tax_rates.concat( country_locale_info.tax_rates[ '*' ] || [] );
|
||||
|
||||
if ( tax_rates.length ) {
|
||||
var $rate_table = $( 'table.tax-rates tbody' ).empty();
|
||||
|
||||
$.each( tax_rates, function( index, rate ) {
|
||||
$( '<tr>', {
|
||||
html: [
|
||||
$( '<td>', { 'class': 'readonly', text: rate.country || '' } ),
|
||||
$( '<td>', { 'class': 'readonly', text: rate.state || '*' } ),
|
||||
$( '<td>', { 'class': 'readonly', text: rate.rate || '' } ),
|
||||
$( '<td>', { 'class': 'readonly', text: rate.name || '' } )
|
||||
]
|
||||
} ).appendTo( $rate_table );
|
||||
} );
|
||||
|
||||
$( '.tax-rates' ).show();
|
||||
} else {
|
||||
$( '.tax-rates' ).hide();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$(':input[name="currency_pos"]').closest('tr').show();
|
||||
$(':input[name="thousand_sep"]').closest('tr').show();
|
||||
$(':input[name="decimal_sep"]').closest('tr').show();
|
||||
$(':input[name="num_decimals"]').closest('tr').show();
|
||||
$( '.tax-rates' ).hide();
|
||||
}
|
||||
} ).change();
|
||||
|
||||
$( 'input[name="woocommerce_calc_taxes"]' ).change( function() {
|
||||
if ( $(this).is( ':checked' ) ) {
|
||||
$(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest('tr').show();
|
||||
$('tr.tax-rates').show();
|
||||
} else {
|
||||
$(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest('tr').hide();
|
||||
$('tr.tax-rates').hide();
|
||||
}
|
||||
} ).change();
|
||||
|
||||
$( '.button-next' ).on( 'click', function() {
|
||||
function blockWizardUI() {
|
||||
$('.wc-setup-content').block({
|
||||
message: null,
|
||||
overlayCSS: {
|
||||
|
@ -76,24 +9,137 @@ jQuery( function( $ ) {
|
|||
opacity: 0.6
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( '.button-next' ).on( 'click', function() {
|
||||
var form = $( this ).parents( 'form' ).get( 0 );
|
||||
|
||||
if ( ( 'function' !== typeof form.checkValidity ) || form.checkValidity() ) {
|
||||
blockWizardUI();
|
||||
}
|
||||
|
||||
return true;
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-payment-gateways, .wc-wizard-shipping-methods' ).on( 'change', '.wc-wizard-gateway-enable input, .wc-wizard-shipping-enable input', function() {
|
||||
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-service-enable input', function() {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
$( this ).closest( 'li' ).addClass( 'checked' );
|
||||
$( this ).closest( '.wc-wizard-service-toggle' ).removeClass( 'disabled' );
|
||||
$( this ).closest( '.wc-wizard-service-item' ).addClass( 'checked' );
|
||||
$( this ).closest( '.wc-wizard-service-item' )
|
||||
.find( '.wc-wizard-service-settings' ).removeClass( 'hide' );
|
||||
} else {
|
||||
$( this ).closest( 'li' ).removeClass( 'checked' );
|
||||
$( this ).closest( '.wc-wizard-service-toggle' ).addClass( 'disabled' );
|
||||
$( this ).closest( '.wc-wizard-service-item' ).removeClass( 'checked' );
|
||||
$( this ).closest( '.wc-wizard-service-item' )
|
||||
.find( '.wc-wizard-service-settings' ).addClass( 'hide' );
|
||||
}
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-payment-gateways, .wc-wizard-shipping-methods' ).on( 'click', 'li.wc-wizard-gateway, li.wc-wizard-shipping', function() {
|
||||
var $enabled = $( this ).find( '.wc-wizard-gateway-enable input, .wc-wizard-shipping-enable input' );
|
||||
$( '.wc-wizard-services' ).on( 'click', '.wc-wizard-service-enable', function( e ) {
|
||||
e.stopPropagation();
|
||||
|
||||
$enabled.prop( 'checked', ! $enabled.prop( 'checked' ) ).change();
|
||||
var $checkbox = $( this ).find( '.wc-wizard-service-toggle input' );
|
||||
$checkbox.prop( 'checked', ! $checkbox.prop( 'checked' ) ).change();
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-payment-gateways li, .wc-wizard-shipping-methods li' ).on( 'click', 'table, a', function( e ) {
|
||||
e.stopPropagation();
|
||||
$( '.wc-wizard-services-list-toggle' ).on( 'change', '.wc-wizard-service-enable input', function() {
|
||||
$( this ).closest( '.wc-wizard-services-list-toggle' ).toggleClass( 'closed' );
|
||||
$( this ).closest( '.wc-wizard-services' ).find( '.wc-wizard-service-item' )
|
||||
.slideToggle()
|
||||
.css( 'display', 'flex' );
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-select .method', function( e ) {
|
||||
var zone = $( this ).closest( '.wc-wizard-service-description' );
|
||||
var selectedMethod = e.target.value;
|
||||
|
||||
var description = zone.find( '.shipping-method-descriptions' );
|
||||
description.find( '.shipping-method-description' ).addClass( 'hide' );
|
||||
description.find( '.' + selectedMethod ).removeClass( 'hide' );
|
||||
|
||||
var settings = zone.find( '.shipping-method-settings' );
|
||||
settings
|
||||
.find( '.shipping-method-setting' )
|
||||
.addClass( 'hide' )
|
||||
.find( '.shipping-method-required-field' )
|
||||
.prop( 'required', false );
|
||||
settings
|
||||
.find( '.' + selectedMethod )
|
||||
.removeClass( 'hide' )
|
||||
.find( '.shipping-method-required-field' )
|
||||
.prop( 'required', true );
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-enable', function() {
|
||||
var checked = $( this ).is( ':checked' );
|
||||
|
||||
$( this )
|
||||
.closest( '.wc-wizard-service-item' )
|
||||
.find( '.shipping-method-required-field' )
|
||||
.prop( 'required', checked );
|
||||
} );
|
||||
|
||||
function submitActivateForm() {
|
||||
$( 'form.activate-jetpack' ).submit();
|
||||
}
|
||||
|
||||
function waitForJetpackInstall() {
|
||||
wp.ajax.post( 'setup_wizard_check_jetpack' )
|
||||
.then( function( result ) {
|
||||
// If we receive success, or an unexpected result
|
||||
// let the form submit.
|
||||
if (
|
||||
! result ||
|
||||
! result.is_active ||
|
||||
'yes' === result.is_active
|
||||
) {
|
||||
return submitActivateForm();
|
||||
}
|
||||
|
||||
// Wait until checking the status again
|
||||
setTimeout( waitForJetpackInstall, 3000 );
|
||||
} )
|
||||
.fail( function() {
|
||||
// Submit the form as normal if the request fails
|
||||
submitActivateForm();
|
||||
} );
|
||||
}
|
||||
|
||||
// Wait for a pending Jetpack install to finish before triggering a "save"
|
||||
// on the activate step, which launches the Jetpack connection flow.
|
||||
$( '.activate-jetpack' ).on( 'click', '.button-primary', function( e ) {
|
||||
blockWizardUI();
|
||||
|
||||
if ( 'no' === wc_setup_params.pending_jetpack_install ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
waitForJetpackInstall();
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'change', 'input#stripe_create_account', function() {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
$( this ).closest( '.wc-wizard-service-settings' )
|
||||
.find( 'input.payment-email-input' )
|
||||
.prop( 'required', true );
|
||||
$( this ).closest( '.wc-wizard-service-settings' )
|
||||
.find( '.wc-wizard-service-setting-stripe_email' )
|
||||
.show();
|
||||
} else {
|
||||
$( this ).closest( '.wc-wizard-service-settings' )
|
||||
.find( 'input.payment-email-input' )
|
||||
.prop( 'required', false );
|
||||
$( this ).closest( '.wc-wizard-service-settings' )
|
||||
.find( '.wc-wizard-service-setting-stripe_email' )
|
||||
.hide();
|
||||
}
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services input#stripe_create_account' ).change();
|
||||
|
||||
$( 'select#store_country_state' ).on( 'change', function() {
|
||||
var countryCode = this.value.split( ':' )[ 0 ];
|
||||
$( 'select#currency_code' ).val( wc_setup_currencies[ countryCode ] ).change();
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){var t=e.parseJSON(wc_setup_params.locale_info);e('select[name="store_location"]').change(function(){var a=e(this).val().split(":"),c=a[0],n=a[1]||!1,s=t[c],i=["thousand_sep","decimal_sep","num_decimals","currency_pos"];if(s){if(e.each(s,function(t,a){e(':input[name="'+t+'"]').val(a).change(),-1!==e.inArray(t,i)&&e(':input[name="'+t+'"]').closest("tr").hide()}),!e.isArray(s.tax_rates)){var o=[];if(n&&s.tax_rates[n]?o=o.concat(s.tax_rates[n]):s.tax_rates[""]&&(o=o.concat(s.tax_rates[""])),(o=o.concat(s.tax_rates["*"]||[])).length){var r=e("table.tax-rates tbody").empty();e.each(o,function(t,a){e("<tr>",{html:[e("<td>",{"class":"readonly",text:a.country||""}),e("<td>",{"class":"readonly",text:a.state||"*"}),e("<td>",{"class":"readonly",text:a.rate||""}),e("<td>",{"class":"readonly",text:a.name||""})]}).appendTo(r)}),e(".tax-rates").show()}else e(".tax-rates").hide()}}else e(':input[name="currency_pos"]').closest("tr").show(),e(':input[name="thousand_sep"]').closest("tr").show(),e(':input[name="decimal_sep"]').closest("tr").show(),e(':input[name="num_decimals"]').closest("tr").show(),e(".tax-rates").hide()}).change(),e('input[name="woocommerce_calc_taxes"]').change(function(){e(this).is(":checked")?(e(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest("tr").show(),e("tr.tax-rates").show()):(e(':input[name="woocommerce_prices_include_tax"], :input[name="woocommerce_import_tax_rates"]').closest("tr").hide(),e("tr.tax-rates").hide())}).change(),e(".button-next").on("click",function(){return e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),!0}),e(".wc-wizard-payment-gateways, .wc-wizard-shipping-methods").on("change",".wc-wizard-gateway-enable input, .wc-wizard-shipping-enable input",function(){e(this).is(":checked")?e(this).closest("li").addClass("checked"):e(this).closest("li").removeClass("checked")}),e(".wc-wizard-payment-gateways, .wc-wizard-shipping-methods").on("click","li.wc-wizard-gateway, li.wc-wizard-shipping",function(){var t=e(this).find(".wc-wizard-gateway-enable input, .wc-wizard-shipping-enable input");t.prop("checked",!t.prop("checked")).change()}),e(".wc-wizard-payment-gateways li, .wc-wizard-shipping-methods li").on("click","table, a",function(e){e.stopPropagation()})});
|
||||
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){i.stopPropagation();var s=e(this).find(".wc-wizard-service-toggle input");s.prop("checked",!s.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").hide())}),e(".wc-wizard-services input#stripe_create_account").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
|
|
@ -291,8 +291,9 @@ jQuery( function ( $ ) {
|
|||
|
||||
// Load videos when help button is clicked.
|
||||
$( '#contextual-help-link' ).on( 'click', function() {
|
||||
var frame = $( '#tab-panel-woocommerce_guided_tour_tab iframe' );
|
||||
|
||||
frame.attr( 'src', frame.data( 'src' ) );
|
||||
$( '.wc-guided-tour-embed' ).each( function() {
|
||||
var video_id = $( this ).data( 'video_id' );
|
||||
$( this ).replaceWith( '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/' + video_id + '" frameborder="0" allowfullscreen></iframe>' );
|
||||
} );
|
||||
});
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.6.3
|
||||
* jQuery FlexSlider v2.6.1
|
||||
* Copyright 2012 WooThemes
|
||||
* Contributing Author: Tyler Smith
|
||||
*/
|
||||
|
@ -13,6 +13,11 @@
|
|||
var slider = $(el);
|
||||
|
||||
// making variables public
|
||||
|
||||
//if rtl value was not passed and html is in rtl..enable it by default.
|
||||
if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){
|
||||
options.rtl=true;
|
||||
}
|
||||
slider.vars = $.extend({}, $.flexslider.defaults, options);
|
||||
|
||||
var namespace = slider.vars.namespace,
|
||||
|
@ -49,7 +54,7 @@
|
|||
slider.syncExists = $(slider.vars.sync).length > 0;
|
||||
// SLIDE:
|
||||
if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; }
|
||||
slider.prop = (vertical) ? "top" : "marginLeft";
|
||||
slider.prop = (vertical) ? "top" : ( slider.vars.rtl ? "marginRight" : "marginLeft" );
|
||||
slider.args = {};
|
||||
// SLIDESHOW:
|
||||
slider.manualPause = false;
|
||||
|
@ -101,8 +106,14 @@
|
|||
$(document).bind('keyup', function(event) {
|
||||
var keycode = event.keyCode;
|
||||
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
||||
var target = (keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false;
|
||||
var target = (slider.vars.rtl?
|
||||
((keycode === 37) ? slider.getTarget('next') :
|
||||
(keycode === 39) ? slider.getTarget('prev') : false)
|
||||
:
|
||||
((keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false)
|
||||
)
|
||||
;
|
||||
slider.flexAnimate(target, slider.vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
|
@ -165,8 +176,15 @@
|
|||
e.preventDefault();
|
||||
var $slide = $(this),
|
||||
target = $slide.index();
|
||||
var posFromLeft = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
|
||||
if( posFromLeft <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
|
||||
var posFromX;
|
||||
if(slider.vars.rtl){
|
||||
posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container
|
||||
}
|
||||
else
|
||||
{
|
||||
posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container
|
||||
}
|
||||
if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) {
|
||||
slider.flexAnimate(slider.getTarget("prev"), true);
|
||||
} else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) {
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
|
@ -428,7 +446,6 @@
|
|||
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
||||
startX = (vertical) ? localY : localX;
|
||||
startY = (vertical) ? localX : localY;
|
||||
|
||||
el.addEventListener('touchmove', onTouchMove, false);
|
||||
el.addEventListener('touchend', onTouchEnd, false);
|
||||
}
|
||||
|
@ -440,9 +457,8 @@
|
|||
localX = e.touches[0].pageX;
|
||||
localY = e.touches[0].pageY;
|
||||
|
||||
dx = (vertical) ? startX - localY : startX - localX;
|
||||
dx = (vertical) ? startX - localY : (slider.vars.rtl?-1:1)*(startX - localX);
|
||||
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY));
|
||||
|
||||
var fxms = 500;
|
||||
|
||||
if ( ! scrolling || Number( new Date() ) - startT > fxms ) {
|
||||
|
@ -519,7 +535,7 @@
|
|||
|
||||
//Accumulate translations.
|
||||
accDx = accDx + ((vertical) ? transY : transX);
|
||||
dx = accDx;
|
||||
dx = (slider.vars.rtl?-1:1)*accDx;
|
||||
scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY));
|
||||
|
||||
if(e.detail === e.MSGESTURE_FLAG_INERTIA){
|
||||
|
@ -776,8 +792,12 @@
|
|||
}
|
||||
} else { // FADE:
|
||||
if (!touch) {
|
||||
//slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationSpeed, slider.vars.easing);
|
||||
//slider.slides.eq(target).fadeIn(slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
|
||||
|
||||
slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing);
|
||||
slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup);
|
||||
|
||||
} else {
|
||||
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
||||
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
||||
|
@ -878,7 +898,7 @@
|
|||
}());
|
||||
|
||||
if (slider.transitions) {
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + ((slider.vars.rtl?-1:1)*parseInt(target)+'px') + ",0,0)";
|
||||
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
||||
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
||||
slider.container.css("transition-duration", dur);
|
||||
|
@ -933,13 +953,23 @@
|
|||
slider.setProps(sliderOffset * slider.computedW, "init");
|
||||
setTimeout(function(){
|
||||
slider.doMath();
|
||||
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
||||
if(slider.vars.rtl){
|
||||
slider.newSlides.css({"width": slider.computedW, "marginLeft" : slider.computedM, "float": "right", "display": "block"});
|
||||
}
|
||||
else{
|
||||
slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"});
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (slider.vars.smoothHeight) { methods.smoothHeight(); }
|
||||
}, (type === "init") ? 100 : 0);
|
||||
}
|
||||
} else { // FADE:
|
||||
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
|
||||
if(slider.vars.rtl){
|
||||
slider.slides.css({"width": "100%", "float": 'right', "marginLeft": "-100%", "position": "relative"});
|
||||
}
|
||||
else{
|
||||
slider.slides.css({"width": "100%", "float": 'left', "marginRight": "-100%", "position": "relative"});
|
||||
}
|
||||
if (type === "init") {
|
||||
if (!touch) {
|
||||
//slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing);
|
||||
|
@ -1154,7 +1184,8 @@
|
|||
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
||||
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
||||
removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed
|
||||
init: function() {} //{NEW} Callback: function(slider) - Fires after the slider is initially setup
|
||||
init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup
|
||||
rtl: false //{NEW} Boolean: Whether or not to enable RTL mode
|
||||
};
|
||||
|
||||
//FlexSlider: Plugin Function
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ jQuery( function( $ ) {
|
|||
* AddToCartHandler class.
|
||||
*/
|
||||
var AddToCartHandler = function() {
|
||||
$( document )
|
||||
$( document.body )
|
||||
.on( 'click', '.add_to_cart_button', this.onAddToCart )
|
||||
.on( 'click', '.remove_from_cart_button', this.onRemoveFromCart )
|
||||
.on( 'added_to_cart', this.updateButton )
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var o=t(this);if(o.is(".ajax_add_to_cart")){if(!o.attr("data-product_id"))return!0;a.preventDefault(),o.removeClass("added"),o.addClass("loading");var r={};t.each(o.data(),function(t,a){r[t]=a}),t(document.body).trigger("adding_to_cart",[o,r]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),r,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.onRemoveFromCart=function(a){var o=t(this),r=o.closest(".woocommerce-mini-cart-item");a.preventDefault(),r.block({message:null,overlayCSS:{opacity:.6}}),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:o.data("cart_item_key")},function(a){a&&a.fragments?t(document.body).trigger("removed_from_cart",[a.fragments,a.cart_hash]):window.location=o.attr("href")}).fail(function(){window.location=o.attr("href")})},a.prototype.updateButton=function(a,o,r,e){(e=void 0!==e&&e)&&(e.removeClass("loading"),e.addClass("added"),wc_add_to_cart_params.is_cart||0!==e.parent().find(".added_to_cart").length||e.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[e]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,o){o&&(t.each(o,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(o,function(a,o){t(a).replaceWith(o),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});
|
||||
jQuery(function(t){if("undefined"==typeof wc_add_to_cart_params)return!1;var a=function(){t(document.body).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};a.prototype.onAddToCart=function(a){var o=t(this);if(o.is(".ajax_add_to_cart")){if(!o.attr("data-product_id"))return!0;a.preventDefault(),o.removeClass("added"),o.addClass("loading");var r={};t.each(o.data(),function(t,a){r[t]=a}),t(document.body).trigger("adding_to_cart",[o,r]),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),r,function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o]):window.location=wc_add_to_cart_params.cart_url)})}},a.prototype.onRemoveFromCart=function(a){var o=t(this),r=o.closest(".woocommerce-mini-cart-item");a.preventDefault(),r.block({message:null,overlayCSS:{opacity:.6}}),t.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:o.data("cart_item_key")},function(a){a&&a.fragments?t(document.body).trigger("removed_from_cart",[a.fragments,a.cart_hash]):window.location=o.attr("href")}).fail(function(){window.location=o.attr("href")})},a.prototype.updateButton=function(a,o,r,e){(e=void 0!==e&&e)&&(e.removeClass("loading"),e.addClass("added"),wc_add_to_cart_params.is_cart||0!==e.parent().find(".added_to_cart").length||e.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+"</a>"),t(document.body).trigger("wc_cart_button_updated",[e]))},a.prototype.updateCartPage=function(){var a=window.location.toString().replace("add-to-cart","added-to-cart");t(".shop_table.cart").load(a+" .shop_table.cart:eq(0) > *",function(){t(".shop_table.cart").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_page_refreshed")}),t(".cart_totals").load(a+" .cart_totals:eq(0) > *",function(){t(".cart_totals").stop(!0).css("opacity","1").unblock(),t(document.body).trigger("cart_totals_refreshed")})},a.prototype.updateFragments=function(a,o){o&&(t.each(o,function(a){t(a).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),t.each(o,function(a,o){t(a).replaceWith(o),t(a).stop(!0).css("opacity","1").unblock()}),t(document.body).trigger("wc_fragments_loaded"))},new a});
|
|
@ -11,8 +11,10 @@ jQuery( function( $ ) {
|
|||
|
||||
function field_is_required( field, is_required ) {
|
||||
if ( is_required ) {
|
||||
field.find( 'label' ).append( ' <abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
|
||||
field.addClass( 'validate-required' );
|
||||
if ( field.find( 'label abbr.required' ).length === 0 ) {
|
||||
field.find( 'label' ).append( ' <abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>' );
|
||||
field.addClass( 'validate-required' );
|
||||
}
|
||||
} else {
|
||||
field.find( 'label abbr' ).remove();
|
||||
field.removeClass( 'validate-required' );
|
||||
|
@ -46,86 +48,46 @@ jQuery( function( $ ) {
|
|||
|
||||
$.each( locale_fields, function( key, value ) {
|
||||
|
||||
var field = thisform.find( value );
|
||||
var field = thisform.find( value ),
|
||||
fieldLocale = $.extend( true, {}, locale['default'][ key ], thislocale[ key ] );
|
||||
|
||||
// Set to defaults.
|
||||
if ( locale['default'][ key ] ) {
|
||||
if ( 'state' !== key ) {
|
||||
if ( typeof locale['default'][ key ].hidden === 'undefined' || locale['default'][ key ].hidden === false ) {
|
||||
field.show();
|
||||
} else if ( locale['default'][ key ].hidden === true ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'postcode' === key || 'city' === key || 'state' === key ) {
|
||||
if ( locale['default'][ key ].label ) {
|
||||
field.find( 'label' ).html( locale['default'][ key ].label );
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].placeholder ) {
|
||||
field.find( 'input' ).attr( 'placeholder', locale['default'][ key ].placeholder );
|
||||
|
||||
// Use the label as a placeholder if there is no label element and no placeholder.
|
||||
} else if ( locale['default'][ key ].label && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', locale['default'][ key ].label );
|
||||
field.find( '.select2-selection__placeholder' ).text( locale['default'][ key ].label );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].required === true ) {
|
||||
if ( field.find( 'label abbr' ).length === 0 ) {
|
||||
field_is_required( field, true );
|
||||
}
|
||||
}
|
||||
|
||||
if ( locale['default'][ key ].priority ) {
|
||||
field.data( 'priority', locale['default'][ key ].priority );
|
||||
}
|
||||
// Labels.
|
||||
if ( typeof fieldLocale.label !== 'undefined' ) {
|
||||
field.find( 'label' ).html( fieldLocale.label );
|
||||
}
|
||||
|
||||
// Set to locale.
|
||||
if ( thislocale[ key ] ) {
|
||||
// Placeholders.
|
||||
if ( typeof fieldLocale.placeholder !== 'undefined' ) {
|
||||
field.find( 'input' ).attr( 'placeholder', fieldLocale.placeholder );
|
||||
field.find( '.select2-selection__placeholder' ).text( fieldLocale.placeholder );
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].label ) {
|
||||
field.find( 'label' ).html( thislocale[ key ].label );
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].placeholder ) {
|
||||
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].placeholder );
|
||||
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].placeholder );
|
||||
|
||||
// Use the i18n label as a placeholder if there is no label element and no i18n placeholder.
|
||||
} else if ( thislocale[ key ].label && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', thislocale[ key ].label );
|
||||
field.find( '.select2-selection__placeholder' ).text( thislocale[ key ].label );
|
||||
}
|
||||
// Use the i18n label as a placeholder if there is no label element and no i18n placeholder.
|
||||
if ( typeof fieldLocale.placeholder === 'undefined' && typeof fieldLocale.label !== 'undefined' && ! field.find( 'label' ).length ) {
|
||||
field.find( 'input' ).attr( 'placeholder', fieldLocale.label );
|
||||
field.find( '.select2-selection__placeholder' ).text( fieldLocale.label );
|
||||
}
|
||||
|
||||
// Required.
|
||||
if ( typeof fieldLocale.required !== 'undefined' ) {
|
||||
field_is_required( field, fieldLocale.required );
|
||||
} else {
|
||||
field_is_required( field, false );
|
||||
|
||||
if ( typeof thislocale[ key ].required === 'undefined' && locale['default'][ key ].required === true ) {
|
||||
field_is_required( field, true );
|
||||
} else if ( thislocale[ key ].required === true ) {
|
||||
field_is_required( field, true );
|
||||
}
|
||||
|
||||
if ( key !== 'state' ) {
|
||||
if ( thislocale[ key ].hidden === true ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
} else {
|
||||
field.show();
|
||||
}
|
||||
}
|
||||
|
||||
if ( thislocale[ key ].priority ) {
|
||||
field.data( 'priority', thislocale[ key ].priority );
|
||||
} else if ( locale['default'][ key ].priority ) {
|
||||
field.data( 'priority', locale['default'][ key ].priority );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Priority.
|
||||
if ( typeof fieldLocale.priority !== 'undefined' ) {
|
||||
field.data( 'priority', fieldLocale.priority );
|
||||
}
|
||||
|
||||
// Hidden fields.
|
||||
if ( 'state' !== key ) {
|
||||
if ( typeof fieldLocale.hidden !== 'undefined' && true === fieldLocale.hidden ) {
|
||||
field.hide().find( 'input' ).val( '' );
|
||||
} else {
|
||||
field.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var fieldsets = $('.woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields');
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){function a(e,a){a?(e.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.addClass("validate-required")):(e.find("label abbr").remove(),e.removeClass("validate-required"))}if("undefined"==typeof wc_address_i18n_params)return!1;var t=wc_address_i18n_params.locale.replace(/"/g,'"'),i=e.parseJSON(t);e(document.body).bind("country_to_state_changing",function(t,l,d){var r,n=d;r="undefined"!=typeof i[l]?i[l]:i["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),f=n.find("#billing_city_field, #shipping_city_field"),s=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),f.attr("data-o_class",f.attr("class")),s.attr("data-o_class",s.attr("class")));var p=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(p,function(e,t){var l=n.find(t);i["default"][e]&&("state"!==e&&("undefined"==typeof i["default"][e].hidden||!1===i["default"][e].hidden?l.show():!0===i["default"][e].hidden&&l.hide().find("input").val("")),"postcode"!==e&&"city"!==e&&"state"!==e||(i["default"][e].label&&l.find("label").html(i["default"][e].label),i["default"][e].placeholder?l.find("input").attr("placeholder",i["default"][e].placeholder):i["default"][e].label&&!l.find("label").length&&(l.find("input").attr("placeholder",i["default"][e].label),l.find(".select2-selection__placeholder").text(i["default"][e].label))),!0===i["default"][e].required&&0===l.find("label abbr").length&&a(l,!0),i["default"][e].priority&&l.data("priority",i["default"][e].priority)),r[e]&&(r[e].label&&l.find("label").html(r[e].label),r[e].placeholder?(l.find("input").attr("placeholder",r[e].placeholder),l.find(".select2-selection__placeholder").text(r[e].placeholder)):r[e].label&&!l.find("label").length&&(l.find("input").attr("placeholder",r[e].label),l.find(".select2-selection__placeholder").text(r[e].label)),a(l,!1),"undefined"==typeof r[e].required&&!0===i["default"][e].required?a(l,!0):!0===r[e].required&&a(l,!0),"state"!==e&&(!0===r[e].hidden?l.hide().find("input").val(""):l.show()),r[e].priority?l.data("priority",r[e].priority):i["default"][e].priority&&l.data("priority",i["default"][e].priority))}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,t){var i=e(t).find(".form-row"),l=i.first().parent(),d=0;i.each(function(){e(this).data("priority")||e(this).data("priority",d+1),d=e(this).data("priority")}),i.sort(function(a,t){var i=e(a).data("priority"),l=e(t).data("priority");return i>l?1:i<l?-1:0}),i.detach().appendTo(l)})})});
|
||||
jQuery(function(e){function a(e,a){a?0===e.find("label abbr.required").length&&(e.find("label").append(' <abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.addClass("validate-required")):(e.find("label abbr").remove(),e.removeClass("validate-required"))}if("undefined"==typeof wc_address_i18n_params)return!1;var i=wc_address_i18n_params.locale.replace(/"/g,'"'),d=e.parseJSON(i);e(document.body).bind("country_to_state_changing",function(i,t,r){var l,n=r;l="undefined"!=typeof d[t]?d[t]:d["default"];var o=n.find("#billing_postcode_field, #shipping_postcode_field"),s=n.find("#billing_city_field, #shipping_city_field"),f=n.find("#billing_state_field, #shipping_state_field");o.attr("data-o_class")||(o.attr("data-o_class",o.attr("class")),s.attr("data-o_class",s.attr("class")),f.attr("data-o_class",f.attr("class")));var p=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(p,function(i,t){var r=n.find(t),o=e.extend(!0,{},d["default"][i],l[i]);"undefined"!=typeof o.label&&r.find("label").html(o.label),"undefined"!=typeof o.placeholder&&(r.find("input").attr("placeholder",o.placeholder),r.find(".select2-selection__placeholder").text(o.placeholder)),"undefined"!=typeof o.placeholder||"undefined"==typeof o.label||r.find("label").length||(r.find("input").attr("placeholder",o.label),r.find(".select2-selection__placeholder").text(o.label)),"undefined"!=typeof o.required?a(r,o.required):a(r,!1),"undefined"!=typeof o.priority&&r.data("priority",o.priority),"state"!==i&&("undefined"!=typeof o.hidden&&!0===o.hidden?r.hide().find("input").val(""):r.show())}),e(".woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper, .woocommerce-address-fields__field-wrapper, .woocommerce-additional-fields__field-wrapper .woocommerce-account-fields").each(function(a,i){var d=e(i).find(".form-row"),t=d.first().parent(),r=0;d.each(function(){e(this).data("priority")||e(this).data("priority",r+1),r=e(this).data("priority")}),d.sort(function(a,i){var d=e(a).data("priority"),t=e(i).data("priority");return d>t?1:d<t?-1:0}),d.detach().appendTo(t)})})});
|
|
@ -32,7 +32,7 @@ jQuery( function( $ ) {
|
|||
this.$checkout_form.on( 'submit', this.submit );
|
||||
|
||||
// Inline validation
|
||||
this.$checkout_form.on( 'input blur change', '.input-text, select, input:checkbox', this.validate_field );
|
||||
this.$checkout_form.on( 'input validate change', '.input-text, select, input:checkbox', this.validate_field );
|
||||
|
||||
// Manual trigger
|
||||
this.$checkout_form.on( 'update', this.trigger_update_checkout );
|
||||
|
@ -189,7 +189,7 @@ jQuery( function( $ ) {
|
|||
$parent.removeClass( 'woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email woocommerce-validated' );
|
||||
}
|
||||
|
||||
if ( 'focusout' === event_type || 'change' === event_type ) {
|
||||
if ( 'validate' === event_type || 'change' === event_type ) {
|
||||
|
||||
if ( validate_required ) {
|
||||
if ( 'checkbox' === $this.attr( 'type' ) && ! $this.is( ':checked' ) ) {
|
||||
|
@ -382,7 +382,7 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
// Lose focus for all fields
|
||||
$form.find( '.input-text, select, input:checkbox' ).blur();
|
||||
$form.find( '.input-text, select, input:checkbox' ).trigger( 'validate' ).blur();
|
||||
|
||||
// Scroll to top
|
||||
$( 'html, body' ).animate( {
|
||||
|
@ -504,7 +504,7 @@ jQuery( function( $ ) {
|
|||
$( '.woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message' ).remove();
|
||||
wc_checkout_form.$checkout_form.prepend( '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' + error_message + '</div>' );
|
||||
wc_checkout_form.$checkout_form.removeClass( 'processing' ).unblock();
|
||||
wc_checkout_form.$checkout_form.find( '.input-text, select, input:checkbox' ).blur();
|
||||
wc_checkout_form.$checkout_form.find( '.input-text, select, input:checkbox' ).trigger( 'validate' ).blur();
|
||||
$( 'html, body' ).animate({
|
||||
scrollTop: ( $( 'form.checkout' ).offset().top - 100 )
|
||||
}, 1000 );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* global wp, pwsL10n, wc_password_strength_meter_params */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
( function( $ ) {
|
||||
'use strict';
|
||||
/**
|
||||
* Password Strength Meter class.
|
||||
*/
|
||||
|
@ -106,4 +106,4 @@ jQuery( function( $ ) {
|
|||
};
|
||||
|
||||
wc_password_strength_meter.init();
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(s){var r={init:function(){s(document.body).on("keyup change","form.register #reg_password, form.checkout #account_password, form.edit-account #password_1, form.lost_reset_password #password_1",this.strengthMeter),s("form.checkout #createaccount").change()},strengthMeter:function(){var e=s("form.register, form.checkout, form.edit-account, form.lost_reset_password"),t=s('input[type="submit"]',e),a=s("#reg_password, #account_password, #password_1",e),o=1,d=a.val();r.includeMeter(e,a),o=r.checkPasswordStrength(e,a),d.length>0&&o<wc_password_strength_meter_params.min_password_strength&&!e.is("form.checkout")?t.attr("disabled","disabled").addClass("disabled"):t.removeAttr("disabled","disabled").removeClass("disabled")},includeMeter:function(r,e){var t=r.find(".woocommerce-password-strength");""===e.val()?(t.remove(),s(document.body).trigger("wc-password-strength-removed")):0===t.length&&(e.after('<div class="woocommerce-password-strength" aria-live="polite"></div>'),s(document.body).trigger("wc-password-strength-added"))},checkPasswordStrength:function(s,r){var e=s.find(".woocommerce-password-strength"),t=s.find(".woocommerce-password-hint"),a='<small class="woocommerce-password-hint">'+wc_password_strength_meter_params.i18n_password_hint+"</small>",o=wp.passwordStrength.meter(r.val(),wp.passwordStrength.userInputBlacklist()),d="";switch(e.removeClass("short bad good strong"),t.remove(),o<wc_password_strength_meter_params.min_password_strength&&(d=" - "+wc_password_strength_meter_params.i18n_password_error),o){case 0:e.addClass("short").html(pwsL10n["short"]+d),e.after(a);break;case 1:case 2:e.addClass("bad").html(pwsL10n.bad+d),e.after(a);break;case 3:e.addClass("good").html(pwsL10n.good+d);break;case 4:e.addClass("strong").html(pwsL10n.strong+d);break;case 5:e.addClass("short").html(pwsL10n.mismatch)}return o}};r.init()});
|
||||
!function(s){"use strict";var r={init:function(){s(document.body).on("keyup change","form.register #reg_password, form.checkout #account_password, form.edit-account #password_1, form.lost_reset_password #password_1",this.strengthMeter),s("form.checkout #createaccount").change()},strengthMeter:function(){var e=s("form.register, form.checkout, form.edit-account, form.lost_reset_password"),t=s('input[type="submit"]',e),a=s("#reg_password, #account_password, #password_1",e),o=1,d=a.val();r.includeMeter(e,a),o=r.checkPasswordStrength(e,a),d.length>0&&o<wc_password_strength_meter_params.min_password_strength&&!e.is("form.checkout")?t.attr("disabled","disabled").addClass("disabled"):t.removeAttr("disabled","disabled").removeClass("disabled")},includeMeter:function(r,e){var t=r.find(".woocommerce-password-strength");""===e.val()?(t.remove(),s(document.body).trigger("wc-password-strength-removed")):0===t.length&&(e.after('<div class="woocommerce-password-strength" aria-live="polite"></div>'),s(document.body).trigger("wc-password-strength-added"))},checkPasswordStrength:function(s,r){var e=s.find(".woocommerce-password-strength"),t=s.find(".woocommerce-password-hint"),a='<small class="woocommerce-password-hint">'+wc_password_strength_meter_params.i18n_password_hint+"</small>",o=wp.passwordStrength.meter(r.val(),wp.passwordStrength.userInputBlacklist()),d="";switch(e.removeClass("short bad good strong"),t.remove(),o<wc_password_strength_meter_params.min_password_strength&&(d=" - "+wc_password_strength_meter_params.i18n_password_error),o){case 0:e.addClass("short").html(pwsL10n["short"]+d),e.after(a);break;case 1:case 2:e.addClass("bad").html(pwsL10n.bad+d),e.after(a);break;case 3:e.addClass("good").html(pwsL10n.good+d);break;case 4:e.addClass("strong").html(pwsL10n.strong+d);break;case 5:e.addClass("short").html(pwsL10n.mismatch)}return o}};r.init()}(jQuery);
|
|
@ -183,6 +183,10 @@ jQuery( function( $ ) {
|
|||
* Init zoom.
|
||||
*/
|
||||
ProductGallery.prototype.initZoomForTarget = function( zoomTarget ) {
|
||||
if ( ! this.zoom_enabled ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var galleryWidth = this.$target.width(),
|
||||
zoomEnabled = false;
|
||||
|
||||
|
@ -265,10 +269,10 @@ jQuery( function( $ ) {
|
|||
eventTarget = $( e.target ),
|
||||
clicked;
|
||||
|
||||
if ( ! eventTarget.is( '.woocommerce-product-gallery__trigger' ) ) {
|
||||
clicked = eventTarget.closest( '.woocommerce-product-gallery__image' );
|
||||
} else {
|
||||
if ( eventTarget.is( '.woocommerce-product-gallery__trigger' ) || eventTarget.is( '.woocommerce-product-gallery__trigger img' ) ) {
|
||||
clicked = this.$target.find( '.flex-active-slide' );
|
||||
} else {
|
||||
clicked = eventTarget.closest( '.woocommerce-product-gallery__image' );
|
||||
}
|
||||
|
||||
var options = $.extend( {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* SelectWoo 5.0.0
|
||||
* SelectWoo 1.0.1
|
||||
* https://github.com/woocommerce/selectWoo
|
||||
*
|
||||
* Released under the MIT license
|
||||
|
@ -1668,6 +1668,13 @@ S2.define('select2/selection/multiple',[
|
|||
});
|
||||
}
|
||||
);
|
||||
|
||||
this.$selection.on('keydown', function (evt) {
|
||||
// If user starts typing an alphanumeric key on the keyboard, open if not opened.
|
||||
if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
|
||||
container.open();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
|
@ -1694,6 +1701,7 @@ S2.define('select2/selection/multiple',[
|
|||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
var self = this;
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1719,6 +1727,14 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -3524,6 +3540,7 @@ S2.define('select2/data/ajax',[
|
|||
}
|
||||
|
||||
callback(results);
|
||||
self.container.focusOnActiveElement();
|
||||
}, function () {
|
||||
// Attempt to detect if a request was aborted
|
||||
// Only works if the transport exposes a status property
|
||||
|
@ -5416,7 +5433,7 @@ S2.define('select2/core',[
|
|||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
self.focusOnActiveElement();
|
||||
},1);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
$(document).on('keydown', function (evt) {
|
||||
|
@ -5445,16 +5462,17 @@ S2.define('select2/core',[
|
|||
evt.preventDefault();
|
||||
}
|
||||
|
||||
var $searchField = self.$dropdown.find('.select2-search__field');
|
||||
if (! $searchField.length) {
|
||||
$searchField = self.$container.find('.select2-search__field');
|
||||
}
|
||||
|
||||
// Move the focus to the selected element on keyboard navigation.
|
||||
// Required for screen readers to work properly.
|
||||
if (key === KEYS.DOWN || key === KEYS.UP) {
|
||||
self.focusOnActiveElement();
|
||||
} else {
|
||||
// Focus on the search if user starts typing.
|
||||
var $searchField = self.$dropdown.find('.select2-search__field');
|
||||
if (! $searchField.length) {
|
||||
$searchField = self.$container.find('.select2-search__field');
|
||||
}
|
||||
$searchField.focus();
|
||||
// Focus back to active selection when finished typing.
|
||||
// Small delay so typed character can be read by screen reader.
|
||||
|
@ -5463,6 +5481,14 @@ S2.define('select2/core',[
|
|||
}, 1000);
|
||||
}
|
||||
|
||||
// If focus is in the search field, select the current active element on Enter key.
|
||||
$searchField.on('keydown', function (evt) {
|
||||
if (evt.which === KEYS.ENTER) {
|
||||
self.trigger('results:select', {});
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
} else if (self.hasFocus()) {
|
||||
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
||||
(key === KEYS.DOWN && evt.altKey)) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* SelectWoo 5.0.0
|
||||
* SelectWoo 1.0.1
|
||||
* https://github.com/woocommerce/selectWoo
|
||||
*
|
||||
* Released under the MIT license
|
||||
|
@ -1668,6 +1668,13 @@ S2.define('select2/selection/multiple',[
|
|||
});
|
||||
}
|
||||
);
|
||||
|
||||
this.$selection.on('keydown', function (evt) {
|
||||
// If user starts typing an alphanumeric key on the keyboard, open if not opened.
|
||||
if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
|
||||
container.open();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
|
@ -1694,6 +1701,7 @@ S2.define('select2/selection/multiple',[
|
|||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
var self = this;
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1719,6 +1727,14 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -3524,6 +3540,7 @@ S2.define('select2/data/ajax',[
|
|||
}
|
||||
|
||||
callback(results);
|
||||
self.container.focusOnActiveElement();
|
||||
}, function () {
|
||||
// Attempt to detect if a request was aborted
|
||||
// Only works if the transport exposes a status property
|
||||
|
@ -5416,7 +5433,7 @@ S2.define('select2/core',[
|
|||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
self.focusOnActiveElement();
|
||||
},1);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
$(document).on('keydown', function (evt) {
|
||||
|
@ -5445,16 +5462,17 @@ S2.define('select2/core',[
|
|||
evt.preventDefault();
|
||||
}
|
||||
|
||||
var $searchField = self.$dropdown.find('.select2-search__field');
|
||||
if (! $searchField.length) {
|
||||
$searchField = self.$container.find('.select2-search__field');
|
||||
}
|
||||
|
||||
// Move the focus to the selected element on keyboard navigation.
|
||||
// Required for screen readers to work properly.
|
||||
if (key === KEYS.DOWN || key === KEYS.UP) {
|
||||
self.focusOnActiveElement();
|
||||
} else {
|
||||
// Focus on the search if user starts typing.
|
||||
var $searchField = self.$dropdown.find('.select2-search__field');
|
||||
if (! $searchField.length) {
|
||||
$searchField = self.$container.find('.select2-search__field');
|
||||
}
|
||||
$searchField.focus();
|
||||
// Focus back to active selection when finished typing.
|
||||
// Small delay so typed character can be read by screen reader.
|
||||
|
@ -5463,6 +5481,14 @@ S2.define('select2/core',[
|
|||
}, 1000);
|
||||
}
|
||||
|
||||
// If focus is in the search field, select the current active element on Enter key.
|
||||
$searchField.on('keydown', function (evt) {
|
||||
if (evt.which === KEYS.ENTER) {
|
||||
self.trigger('results:select', {});
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
} else if (self.hasFocus()) {
|
||||
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
||||
(key === KEYS.DOWN && evt.altKey)) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,15 +9,24 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"wp-coding-standards/wpcs": "0.10.0",
|
||||
"phpunit/phpunit": "6.2.3"
|
||||
"wp-coding-standards/wpcs": "0.13.1",
|
||||
"phpunit/phpunit": "6.2.3",
|
||||
"woocommerce/woocommerce-git-hooks": "1.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"pre-update-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::preHooks"
|
||||
],
|
||||
"pre-install-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::preHooks"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
|
||||
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs",
|
||||
"WooCommerce\\GitHooks\\Hooks::postHooks"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs"
|
||||
"\"vendor/bin/phpcs\" --config-set installed_paths vendor/wp-coding-standards/wpcs",
|
||||
"WooCommerce\\GitHooks\\Hooks::postHooks"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,20 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "4028dd750463d5e5ad5f2099196a949a",
|
||||
"content-hash": "5268174ad56d2293f14e24b931afeb63",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/installers",
|
||||
"version": "v1.3.0",
|
||||
"version": "v1.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/installers.git",
|
||||
"reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045"
|
||||
"reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045",
|
||||
"reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045",
|
||||
"url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
|
||||
"reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -63,6 +63,7 @@
|
|||
"Hurad",
|
||||
"ImageCMS",
|
||||
"Kanboard",
|
||||
"Lan Management System",
|
||||
"MODX Evo",
|
||||
"Mautic",
|
||||
"Maya",
|
||||
|
@ -86,6 +87,7 @@
|
|||
"croogo",
|
||||
"dokuwiki",
|
||||
"drupal",
|
||||
"eZ Platform",
|
||||
"elgg",
|
||||
"expressionengine",
|
||||
"fuelphp",
|
||||
|
@ -102,6 +104,7 @@
|
|||
"mediawiki",
|
||||
"modulework",
|
||||
"moodle",
|
||||
"osclass",
|
||||
"phpbb",
|
||||
"piwik",
|
||||
"ppi",
|
||||
|
@ -118,38 +121,38 @@
|
|||
"zend",
|
||||
"zikula"
|
||||
],
|
||||
"time": "2017-04-24T06:37:16+00:00"
|
||||
"time": "2017-08-09T07:53:48+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "1.0.5",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/instantiator.git",
|
||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
||||
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
||||
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
|
||||
"reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3,<8.0-DEV"
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"athletic/athletic": "~0.1.8",
|
||||
"ext-pdo": "*",
|
||||
"ext-phar": "*",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
"phpunit/phpunit": "^6.2.3",
|
||||
"squizlabs/php_codesniffer": "^3.0.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "1.2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -174,7 +177,7 @@
|
|||
"constructor",
|
||||
"instantiate"
|
||||
],
|
||||
"time": "2015-06-14T21:17:01+00:00"
|
||||
"time": "2017-07-22T11:58:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
|
@ -322,16 +325,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
"version": "1.0",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
||||
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
|
||||
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
||||
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -372,24 +375,24 @@
|
|||
"reflection",
|
||||
"static analysis"
|
||||
],
|
||||
"time": "2015-12-27T11:43:31+00:00"
|
||||
"time": "2017-09-11T18:02:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-docblock",
|
||||
"version": "3.2.0",
|
||||
"version": "4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||
"reference": "46f7e8bb075036c92695b15a1ddb6971c751e585"
|
||||
"reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/46f7e8bb075036c92695b15a1ddb6971c751e585",
|
||||
"reference": "46f7e8bb075036c92695b15a1ddb6971c751e585",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2",
|
||||
"reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5",
|
||||
"php": "^7.0",
|
||||
"phpdocumentor/reflection-common": "^1.0@dev",
|
||||
"phpdocumentor/type-resolver": "^0.4.0",
|
||||
"webmozart/assert": "^1.0"
|
||||
|
@ -417,7 +420,7 @@
|
|||
}
|
||||
],
|
||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||
"time": "2017-07-15T11:38:20+00:00"
|
||||
"time": "2017-08-30T18:51:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/type-resolver",
|
||||
|
@ -468,22 +471,22 @@
|
|||
},
|
||||
{
|
||||
"name": "phpspec/prophecy",
|
||||
"version": "v1.7.0",
|
||||
"version": "v1.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpspec/prophecy.git",
|
||||
"reference": "93d39f1f7f9326d746203c7c056f300f7f126073"
|
||||
"reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073",
|
||||
"reference": "93d39f1f7f9326d746203c7c056f300f7f126073",
|
||||
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
|
||||
"reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/instantiator": "^1.0.2",
|
||||
"php": "^5.3|^7.0",
|
||||
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
|
||||
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
|
||||
"sebastian/comparator": "^1.1|^2.0",
|
||||
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
|
||||
},
|
||||
|
@ -494,7 +497,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.6.x-dev"
|
||||
"dev-master": "1.7.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -527,32 +530,32 @@
|
|||
"spy",
|
||||
"stub"
|
||||
],
|
||||
"time": "2017-03-02T20:05:34+00:00"
|
||||
"time": "2017-09-04T11:05:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b"
|
||||
"reference": "8ed1902a57849e117b5651fc1a5c48110946c06b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/dc421f9ca5082a0c0cb04afb171c765f79add85b",
|
||||
"reference": "dc421f9ca5082a0c0cb04afb171c765f79add85b",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b",
|
||||
"reference": "8ed1902a57849e117b5651fc1a5c48110946c06b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": "^7.0",
|
||||
"phpunit/php-file-iterator": "^1.3",
|
||||
"phpunit/php-text-template": "^1.2",
|
||||
"phpunit/php-file-iterator": "^1.4.2",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-token-stream": "^1.4.11 || ^2.0",
|
||||
"sebastian/code-unit-reverse-lookup": "^1.0",
|
||||
"sebastian/code-unit-reverse-lookup": "^1.0.1",
|
||||
"sebastian/environment": "^3.0",
|
||||
"sebastian/version": "^2.0",
|
||||
"sebastian/version": "^2.0.1",
|
||||
"theseer/tokenizer": "^1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@ -560,7 +563,7 @@
|
|||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-xdebug": "^2.5.3"
|
||||
"ext-xdebug": "^2.5.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
|
@ -591,7 +594,7 @@
|
|||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2017-04-21T08:03:57+00:00"
|
||||
"time": "2017-08-03T12:40:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
|
@ -732,29 +735,29 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/php-token-stream",
|
||||
"version": "1.4.11",
|
||||
"version": "2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
||||
"reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7"
|
||||
"reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7",
|
||||
"reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0",
|
||||
"reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-tokenizer": "*",
|
||||
"php": ">=5.3.3"
|
||||
"php": "^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.2"
|
||||
"phpunit/phpunit": "^6.2.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.4-dev"
|
||||
"dev-master": "2.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -777,7 +780,7 @@
|
|||
"keywords": [
|
||||
"tokenizer"
|
||||
],
|
||||
"time": "2017-02-27T10:12:30+00:00"
|
||||
"time": "2017-08-20T05:47:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
|
@ -865,22 +868,22 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
"version": "4.0.2",
|
||||
"version": "4.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
||||
"reference": "d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4"
|
||||
"reference": "2f789b59ab89669015ad984afa350c4ec577ade0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4",
|
||||
"reference": "d8833b396dce9162bb2eb5d59aee5a3ab3cfa5b4",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0",
|
||||
"reference": "2f789b59ab89669015ad984afa350c4ec577ade0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/instantiator": "^1.0.2",
|
||||
"doctrine/instantiator": "^1.0.5",
|
||||
"php": "^7.0",
|
||||
"phpunit/php-text-template": "^1.2",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"sebastian/exporter": "^3.0"
|
||||
},
|
||||
"conflict": {
|
||||
|
@ -920,7 +923,7 @@
|
|||
"mock",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2017-06-30T08:15:21+00:00"
|
||||
"time": "2017-08-03T14:08:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/code-unit-reverse-lookup",
|
||||
|
@ -969,21 +972,21 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
||||
"reference": "20f84f468cb67efee293246e6a09619b891f55f0"
|
||||
"reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/20f84f468cb67efee293246e6a09619b891f55f0",
|
||||
"reference": "20f84f468cb67efee293246e6a09619b891f55f0",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a",
|
||||
"reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"sebastian/diff": "^1.2",
|
||||
"sebastian/diff": "^2.0",
|
||||
"sebastian/exporter": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@ -1029,32 +1032,32 @@
|
|||
"compare",
|
||||
"equality"
|
||||
],
|
||||
"time": "2017-03-03T06:26:08+00:00"
|
||||
"time": "2017-08-03T07:14:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
"version": "1.4.3",
|
||||
"version": "2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
|
||||
"reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
|
||||
"reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
|
||||
"reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.3.3 || ^7.0"
|
||||
"php": "^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
|
||||
"phpunit/phpunit": "^6.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.4-dev"
|
||||
"dev-master": "2.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
@ -1081,7 +1084,7 @@
|
|||
"keywords": [
|
||||
"diff"
|
||||
],
|
||||
"time": "2017-05-22T07:24:03+00:00"
|
||||
"time": "2017-08-03T08:09:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
|
@ -1253,21 +1256,21 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastian/object-enumerator",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
|
||||
"reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8"
|
||||
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/31dd3379d16446c5d86dec32ab1ad1f378581ad8",
|
||||
"reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5",
|
||||
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"sebastian/object-reflector": "^1.0",
|
||||
"sebastian/object-reflector": "^1.1.1",
|
||||
"sebastian/recursion-context": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@ -1296,7 +1299,7 @@
|
|||
],
|
||||
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
||||
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
||||
"time": "2017-03-12T15:17:29+00:00"
|
||||
"time": "2017-08-03T12:35:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/object-reflector",
|
||||
|
@ -1483,64 +1486,37 @@
|
|||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "2.9.1",
|
||||
"version": "3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62"
|
||||
"reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62",
|
||||
"reference": "dcbed1074f8244661eecddfc2a675430d8d33f62",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d667e245d5dcd4d7bf80f26f2c947d476b66213e",
|
||||
"reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.1.2"
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0"
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
|
||||
},
|
||||
"bin": [
|
||||
"scripts/phpcs",
|
||||
"scripts/phpcbf"
|
||||
"bin/phpcs",
|
||||
"bin/phpcbf"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"CodeSniffer.php",
|
||||
"CodeSniffer/CLI.php",
|
||||
"CodeSniffer/Exception.php",
|
||||
"CodeSniffer/File.php",
|
||||
"CodeSniffer/Fixer.php",
|
||||
"CodeSniffer/Report.php",
|
||||
"CodeSniffer/Reporting.php",
|
||||
"CodeSniffer/Sniff.php",
|
||||
"CodeSniffer/Tokens.php",
|
||||
"CodeSniffer/Reports/",
|
||||
"CodeSniffer/Tokenizers/",
|
||||
"CodeSniffer/DocGenerators/",
|
||||
"CodeSniffer/Standards/AbstractPatternSniff.php",
|
||||
"CodeSniffer/Standards/AbstractScopeSniff.php",
|
||||
"CodeSniffer/Standards/AbstractVariableSniff.php",
|
||||
"CodeSniffer/Standards/IncorrectPatternException.php",
|
||||
"CodeSniffer/Standards/Generic/Sniffs/",
|
||||
"CodeSniffer/Standards/MySource/Sniffs/",
|
||||
"CodeSniffer/Standards/PEAR/Sniffs/",
|
||||
"CodeSniffer/Standards/PSR1/Sniffs/",
|
||||
"CodeSniffer/Standards/PSR2/Sniffs/",
|
||||
"CodeSniffer/Standards/Squiz/Sniffs/",
|
||||
"CodeSniffer/Standards/Zend/Sniffs/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
|
@ -1557,7 +1533,7 @@
|
|||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"time": "2017-05-22T02:43:20+00:00"
|
||||
"time": "2017-10-16T22:40:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
|
@ -1650,23 +1626,60 @@
|
|||
"time": "2016-11-23T20:04:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wp-coding-standards/wpcs",
|
||||
"version": "0.10.0",
|
||||
"name": "woocommerce/woocommerce-git-hooks",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
|
||||
"reference": "b39490465f6fd7375743a395019cd597e12119c9"
|
||||
"url": "https://github.com/woocommerce/woocommerce-git-hooks.git",
|
||||
"reference": "f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/b39490465f6fd7375743a395019cd597e12119c9",
|
||||
"reference": "b39490465f6fd7375743a395019cd597e12119c9",
|
||||
"url": "https://api.github.com/repos/woocommerce/woocommerce-git-hooks/zipball/f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c",
|
||||
"reference": "f0eea8aa392c822f0f3b9cd0b31f92bfa4de6a0c",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "scripts",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WooCommerce\\GitHooks\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Claudio Sanches",
|
||||
"email": "claudio@automattic.com"
|
||||
}
|
||||
],
|
||||
"description": "WooCommerce Git Hooks",
|
||||
"time": "2017-09-27T16:03:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wp-coding-standards/wpcs",
|
||||
"version": "0.13.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"squizlabs/php_codesniffer": "^2.6"
|
||||
"php": ">=5.3",
|
||||
"squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
|
||||
},
|
||||
"type": "library",
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1"
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
|
@ -1683,7 +1696,7 @@
|
|||
"standards",
|
||||
"wordpress"
|
||||
],
|
||||
"time": "2016-08-29T20:04:47+00:00"
|
||||
"time": "2017-08-05T16:08:58+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
Type,SKU,Name,Published,Is featured?,Visibility in catalog,Short description,Description,Date sale price starts,Date sale price ends,Tax class,In stock?,Stock,Backorders allowed?,Sold individually?,Weight (kg),Length (cm),Width (cm),Height (cm),Allow customer reviews?,Purchase note,Sale price,Regular price,Categories,Tags,Shipping class,Images,Download limit,Download expiry days,Parent,Grouped products,Upsells,Cross-sells,External URL,Button text,Download 1 name,Download 1 URL,Attribute 1 name,Attribute 1 value(s),Attribute 1 visible,Attribute 1 global,Attribute 2 name,Attribute 2 value(s),Attribute 2 visible,Attribute 2 global,Attribute 1 default,Attribute 2 default
|
||||
"simple, downloadable, virtual",WOO-SINGLE-2,Woo Single #2,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,2,3,"Music, Music > Singles",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_flat.jpg",10,90,,,,,,,Song #2,https://woocommerce.files.wordpress.com/2017/06/woo-single-2.ogg,,,,,,,,,,
|
||||
"simple, downloadable, virtual",WOO-SINGLE-1,Woo Single #1,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,3,"Music, Music > Singles",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_4_flat.jpg",-1,-1,,,,,,,Song #1,https://woocommerce.files.wordpress.com/2017/06/woo-single-1.ogg,,,,,,,,,,
|
||||
grouped,WOO-SINGLES,Woo Singles,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,,"Music, Music > Singles",,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_6_flat.jpg,,,,"WOO-SINGLE-1,WOO-SINGLE-2","WOO-ALBUM-1,WOO-ALBUM-2",WOO-ALBUM-3,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-4,Woo Album #4,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_5_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_5_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-3,Woo Album #3,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_3_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_3_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-2,Woo Album #2,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_2_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_2_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
"simple, virtual",WOO-ALBUM-1,Woo Album #1,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,9,"Music > Albums, Music",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_1_angle.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/cd_1_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,POSTER-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_5_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_5_flat.jpg",,,,,,"T-SHIRT-WOO-LOGO,HOODIE-WOO-LOGO",,,,,,,,,,,,,,
|
||||
simple,POSTER-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_4_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_4_flat.jpg",,,,,,"T-SHIRT-WOO-NINJA,HOODIE-WOO-NINJA",,,,,,,,,,,,,,
|
||||
simple,POSTER-PREMIUM-QUALITY,Premium Quality,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,12,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_3_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_3_flat.jpg",,,,,T-SHIRT-PREMIUM-QUALITY,,,,,,,,,,,,,,,
|
||||
simple,POSTER-FLYING-NINJA,Flying Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,12,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_2_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_2_flat.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,POSTER-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,15,Posters,,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/poster_1_up.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/Poster_1_flat.jpg",,,,,"T-SHIRT-SHIP-YOUR-IDEA,HOODIE-SHIP-YOUR-IDEA","T-SHIRT-SHIP-YOUR-IDEA,HOODIE-SHIP-YOUR-IDEA",,,,,,,,,,,,,,
|
||||
simple,HOODIE-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_6_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_6_back.jpg",,,,,,T-SHIRT-WOO-LOGO,,,,,,,,,,,,,,
|
||||
external,HOODIE-NINJA-SILHOUETTE,Ninja Silhouette,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,0,,,30,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_5_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_5_back.jpg",,,,,,T-SHIRT-NINJA-SILHOUETTE,https://mercantile.wordpress.org/product/wordpress-logo-black-zip-hoodie/,Buy on WordPress Swag Store,,,,,,,,,,,,
|
||||
simple,HOODIE-HAPPY-NINJA,Happy Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_4_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_4_back.jpg",,,,,,T-SHIRT-HAPPY-NINJA,,,,,,,,,,,,,,
|
||||
simple,HOODIE-PATIENT-NINJA,Patient Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_3_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_3_back.jpg",,,,,,HOODIE-HAPPY-NINJA,,,,,,,,,,,,,,
|
||||
simple,HOODIE-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,35,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_2_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_2_back.jpg",,,,,,T-SHIRT-WOO-NINJA,,,,,,,,,,,,,,
|
||||
variable,HOODIE-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,30,"Clothing, Clothing > Hoodies",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_front.jpg",,,,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,"Black, Blue",0,1,Size,"L, XL",1,0,Black,L
|
||||
variation,HOODIE-SHIP-YOUR-IDEA-BLUE-XL,"Ship Your Idea - Blue, XL",1,0,visible,,,,,taxable,1,,0,0,,,,,1,,30,35,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_1_front.jpg,,,HOODIE-SHIP-YOUR-IDEA,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,Blue,,1,Size,XL,,0,,
|
||||
variation,HOODIE-SHIP-YOUR-IDEA-BLACK-L,"Ship Your Idea - Black, L",1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,35,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/hoodie_7_front.jpg,,,HOODIE-SHIP-YOUR-IDEA,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,Color,Black,,1,Size,L,,0,,
|
||||
simple,T-SHIRT-HAPPY-NINJA,Happy Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,18,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_7_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_7_back.jpg",,,,,HOODIE-HAPPY-NINJA,"T-SHIRT-WOO-NINJA,T-SHIRT-NINJA-SILHOUETTE",,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-WOO-NINJA,Woo Ninja,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_6_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_6_back.jpg",,,,,HOODIE-WOO-NINJA,"T-SHIRT-HAPPY-NINJA,T-SHIRT-NINJA-SILHOUETTE",,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-NINJA-SILHOUETTE,Ninja Silhouette,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_5_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_5_back.jpg",,,,,HOODIE-NINJA-SILHOUETTE,"T-SHIRT-WOO-NINJA,T-SHIRT-HAPPY-NINJA",,,,,,,,,,,,,,
|
||||
variable,T-SHIRT-SHIP-YOUR-IDEA,Ship Your Idea,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_back.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front1.jpg",,,,,HOODIE-SHIP-YOUR-IDEA,,,,,,Color,"Black, Green",0,1,,,,,,
|
||||
variation,T-SHIRT-SHIP-YOUR-IDEA-GREEN,Ship Your Idea - Green,1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,20,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_3_front.jpg,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,,,,Color,Green,,1,,,,,,
|
||||
variation,T-SHIRT-SHIP-YOUR-IDEA-BLACK,Ship Your Idea - Black,1,0,visible,,,,,taxable,1,,0,0,,,,,1,,,20,,,,http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_4_front1.jpg,,,T-SHIRT-SHIP-YOUR-IDEA,,,,,,,,Color,Black,,1,,,,,,
|
||||
simple,T-SHIRT-PREMIUM-QUALITY,Premium Quality,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,,0,0,,,,,1,,,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",,,,,,,,,,,,,,,,,,,,
|
||||
simple,T-SHIRT-WOO-LOGO,Woo Logo,1,0,visible,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.","Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,1,5,0,0,,,,,1,,18,20,"Clothing, Clothing > T-shirts",,,"http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_1_front.jpg, http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_1_back.jpg",,,,,HOODIE-WOO-LOGO,,,,,,,,,,,,,,,
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,21 @@
|
|||
ID,Type,SKU,Name,Published,Is featured?,Visibility in catalog,Short description,Description,Date sale price starts,Date sale price ends,Tax status,Tax class,In stock?,Stock,Backorders allowed?,Sold individually?,Weight (kg),Length (cm),Width (cm),Height (cm),Allow customer reviews?,Purchase note,Sale price,Regular price,Categories,Tags,Shipping class,Images,Download limit,Download expiry days,Parent,Grouped products,Upsells,Cross-sells,External URL,Button text,Attribute 1 name,Attribute 1 value(s),Attribute 1 visible,Attribute 1 global
|
||||
,simple,woo-beanie,Beanie,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,18,20,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/beanie.jpg,,,,,,,,,Color,Red,1,1
|
||||
,simple,woo-belt,Belt,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,55,65,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/belt.jpg,,,,,,,,,,,,
|
||||
,simple,woo-cap,Cap,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,16,18,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/cap.jpg,,,,,,,,,Color,Yellow,1,1
|
||||
,simple,woo-sunglasses,Sunglasses,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,90,Accessories,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/sunglasses.jpg,,,,,,,,,,,,
|
||||
,simple,woo-hoodie-with-logo,Hoodie with Logo,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-logo.jpg,,,,,,,,,Color,Blue,1,1
|
||||
,simple,woo-hoodie-with-pocket,Hoodie with Pocket,1,1,hidden,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,35,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-pocket.jpg,,,,,,,,,Color,Gray,1,1
|
||||
,simple,woo-hoodie-with-zipper,Hoodie with Zipper,1,1,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,45,Hoodies,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie-with-zipper.jpg,,,,,,,,,,,,
|
||||
,variable,woo-hoodie,Hoodie,1,0,visible,This is a variable product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,42,45,Hoodies,,,"https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-blue.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-green.jpg",,,,,,,,,Color,"Blue, Green, Red",1,1
|
||||
,simple,woo-long-sleeve-tee,Long Sleeve Tee,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,25,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/long-sleeve-tee.jpg,,,,,,,,,Color,Green,1,1
|
||||
,simple,woo-polo,Polo,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,20,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/polo.jpg,,,,,,,,,Color,Blue,1,1
|
||||
,simple,woo-tshirt,T-Shirt,1,0,visible,This is a simple product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,18,T-Shirts,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/tshirt.jpg,,,,,,,,,Color,Gray,1,1
|
||||
,variable,woo-vneck-tee,V-Neck T-Shirt,1,1,visible,This is a variable product.,"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",,,taxable,,1,,0,0,,,,,1,,,18,T-Shirts,,,"https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vneck-tee.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-green.jpg, https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-blue.jpg",,,,,,,,,Color,"Blue, Green, Red",1,1
|
||||
,"simple, downloadable, virtual",woo-album,Album,1,0,visible,"This is a simple, virtual product.","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,1,,,15,Music,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/album.jpg,-1,-1,,,,,,,,,,
|
||||
,"simple, downloadable, virtual",woo-single,Single,1,0,visible,"This is a simple, virtual product.","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,1,,2,3,Music,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/single.jpg,-1,-1,,,,,,,,,,
|
||||
,variation,woo-vneck-tee-red,V-Neck T-Shirt - Red,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,20,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vneck-tee.jpg,,,woo-vneck-tee,,,,,,Color,Red,,1
|
||||
,variation,woo-vneck-tee-green,V-Neck T-Shirt - Green,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,20,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-green.jpg,,,woo-vneck-tee,,,,,,Color,Green,,1
|
||||
,variation,woo-vneck-tee-blue,V-Neck T-Shirt - Blue,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,15,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/vnech-tee-blue.jpg,,,woo-vneck-tee,,,,,,Color,Blue,,1
|
||||
,variation,woo-hoodie-red,Hoodie - Red,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,42,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/hoodie.jpg,,,woo-hoodie,,,,,,Color,Red,,1
|
||||
,variation,woo-hoodie-green,Hoodie - Green,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-green.jpg,,,woo-hoodie,,,,,,Color,Green,,1
|
||||
,variation,woo-hoodie-blue,Hoodie - Blue,1,0,visible,This is a product variation.,"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sagittis orci ac odio dictum tincidunt. Donec ut metus leo. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed luctus, dui eu sagittis sodales, nulla nibh sagittis augue, vel porttitor diam enim non metus. Vestibulum aliquam augue neque. Phasellus tincidunt odio eget ullamcorper efficitur. Cras placerat ut turpis pellentesque vulputate. Nam sed consequat tortor. Curabitur finibus sapien dolor. Ut eleifend tellus nec erat pulvinar dignissim. Nam non arcu purus. Vivamus et massa massa.",,,taxable,,1,,0,0,,,,,0,,,45,,,,https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/05/hoodie-blue.jpg,,,woo-hoodie,,,,,,Color,Blue,,1
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -524,7 +524,7 @@ return array(
|
|||
'thousand_sep' => ',',
|
||||
'decimal_sep' => '.',
|
||||
'num_decimals' => 2,
|
||||
'weight_unit' => 'lbs',
|
||||
'weight_unit' => 'oz',
|
||||
'dimension_unit' => 'in',
|
||||
'tax_rates' => array(
|
||||
'AL' => array(
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
/**
|
||||
* Tanzania States
|
||||
*
|
||||
* @author Lev and Mohsin @ Extreme Web Technologies Ltd
|
||||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.0.0
|
||||
* @notes Based on English names published at https://en.wikipedia.org/wiki/ISO_3166-2:TZ
|
||||
*/
|
||||
global $states;
|
||||
|
||||
$states['TZ'] = array(
|
||||
'TZ01' => __( 'Arusha', 'woocommerce' ),
|
||||
'TZ02' => __( 'Dar es Salaam', 'woocommerce' ),
|
||||
'TZ03' => __( 'Dodoma', 'woocommerce' ),
|
||||
'TZ04' => __( 'Iringa', 'woocommerce' ),
|
||||
'TZ05' => __( 'Kagera', 'woocommerce' ),
|
||||
'TZ06' => __( 'Pemba North', 'woocommerce' ),
|
||||
'TZ07' => __( 'Zanzibar North', 'woocommerce' ),
|
||||
'TZ08' => __( 'Kigoma', 'woocommerce' ),
|
||||
'TZ09' => __( 'Kilimanjaro', 'woocommerce' ),
|
||||
'TZ10' => __( 'Pemba South', 'woocommerce' ),
|
||||
'TZ11' => __( 'Zanzibar South', 'woocommerce' ),
|
||||
'TZ12' => __( 'Lindi', 'woocommerce' ),
|
||||
'TZ13' => __( 'Mara', 'woocommerce' ),
|
||||
'TZ14' => __( 'Mbeya', 'woocommerce' ),
|
||||
'TZ15' => __( 'Zanzibar West', 'woocommerce' ),
|
||||
'TZ16' => __( 'Morogoro', 'woocommerce' ),
|
||||
'TZ17' => __( 'Mtwara', 'woocommerce' ),
|
||||
'TZ18' => __( 'Mwanza', 'woocommerce' ),
|
||||
'TZ19' => __( 'Coast', 'woocommerce' ),
|
||||
'TZ20' => __( 'Rukwa', 'woocommerce' ),
|
||||
'TZ21' => __( 'Ruvuma', 'woocommerce' ),
|
||||
'TZ22' => __( 'Shinyanga', 'woocommerce' ),
|
||||
'TZ23' => __( 'Singida', 'woocommerce' ),
|
||||
'TZ24' => __( 'Tabora', 'woocommerce' ),
|
||||
'TZ25' => __( 'Tanga', 'woocommerce' ),
|
||||
'TZ26' => __( 'Manyara', 'woocommerce' ),
|
||||
'TZ27' => __( 'Geita', 'woocommerce' ),
|
||||
'TZ28' => __( 'Katavi', 'woocommerce' ),
|
||||
'TZ29' => __( 'Njombe', 'woocommerce' ),
|
||||
'TZ30' => __( 'Simiyu', 'woocommerce' )
|
||||
);
|
|
@ -142,7 +142,7 @@ abstract class WC_Data {
|
|||
foreach ( $this->meta_data as $array_key => $meta ) {
|
||||
$this->meta_data[ $array_key ] = clone $meta;
|
||||
if ( ! empty( $meta->id ) ) {
|
||||
unset( $this->meta_data[ $array_key ]->id );
|
||||
$this->meta_data[ $array_key ]->id = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,9 +248,7 @@ abstract class WC_Data {
|
|||
* Filter null meta values from array.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param mixed $meta
|
||||
*
|
||||
* @param mixed $meta Meta value to check.
|
||||
* @return bool
|
||||
*/
|
||||
protected function filter_null_meta( $meta ) {
|
||||
|
@ -261,7 +259,7 @@ abstract class WC_Data {
|
|||
* Get All Meta Data.
|
||||
*
|
||||
* @since 2.6.0
|
||||
* @return array
|
||||
* @return array of objects.
|
||||
*/
|
||||
public function get_meta_data() {
|
||||
$this->maybe_read_meta_data();
|
||||
|
@ -272,17 +270,25 @@ abstract class WC_Data {
|
|||
* Check if the key is an internal one.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param string $key
|
||||
* @param string $key Key to check.
|
||||
* @return bool true if it's an internal key, false otherwise
|
||||
*/
|
||||
protected function is_internal_meta_key( $key ) {
|
||||
if ( $this->data_store && ! empty( $key ) && in_array( $key, $this->data_store->get_internal_meta_keys() ) ) {
|
||||
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'Generic add/update/get meta methods should not be used for internal meta data, including "%s". Use getters and setters.', 'woocommerce' ), $key ), '3.2.0' );
|
||||
$internal_meta_key = ! empty( $key ) && $this->data_store && in_array( $key, $this->data_store->get_internal_meta_keys() );
|
||||
|
||||
return true;
|
||||
if ( ! $internal_meta_key ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
$has_setter_or_getter = is_callable( array( $this, 'set_' . $key ) ) || is_callable( array( $this, 'get_' . $key ) );
|
||||
|
||||
if ( ! $has_setter_or_getter ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'Generic add/update/get meta methods should not be used for internal meta data, including "%s". Use getters and setters.', 'woocommerce' ), $key ), '3.2.0' );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -992,7 +992,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
foreach ( $this->get_items( 'coupon' ) as $coupon_item ) {
|
||||
$coupon_code = $coupon_item->get_code();
|
||||
$coupon_id = wc_get_coupon_id_by_code( $coupon_code );
|
||||
$coupon_object = false;
|
||||
|
||||
// If we have a coupon ID (loaded via wc_get_coupon_id_by_code) we can simply load the new coupon object using the ID.
|
||||
if ( $coupon_id ) {
|
||||
|
@ -1237,8 +1236,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
$found_tax_classes = array();
|
||||
|
||||
foreach ( $this->get_items() as $item ) {
|
||||
if ( ( $product = $item->get_product() ) && ( $product->is_taxable() || $product->is_shipping_taxable() ) ) {
|
||||
$found_tax_classes[] = $product->get_tax_class();
|
||||
if ( is_callable( array( $item, 'get_tax_status' ) ) && in_array( $item->get_tax_status(), array( 'taxable', 'shipping' ), true ) ) {
|
||||
$found_tax_classes[] = $item->get_tax_class();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1294,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
$shipping_tax_class = get_option( 'woocommerce_shipping_tax_class' );
|
||||
|
||||
if ( 'inherit' === $shipping_tax_class ) {
|
||||
$shipping_tax_class = current( array_intersect( array_merge( array( '' ), WC_Tax::get_tax_class_slugs() ), $this->get_items_tax_classes() ) );
|
||||
$found_classes = array_intersect( array_merge( array( '' ), WC_Tax :: get_tax_class_slugs() ), $this->get_items_tax_classes() );
|
||||
$shipping_tax_class = count( $found_classes ) ? current( $found_classes ): false;
|
||||
}
|
||||
|
||||
$is_vat_exempt = apply_filters( 'woocommerce_order_is_vat_exempt', 'yes' === $this->get_meta( 'is_vat_exempt' ) );
|
||||
|
@ -1306,7 +1306,11 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
}
|
||||
|
||||
foreach ( $this->get_shipping_methods() as $item_id => $item ) {
|
||||
$item->calculate_taxes( array_merge( $calculate_tax_for, array( 'tax_class' => $shipping_tax_class ) ), $is_vat_exempt );
|
||||
if ( false !== $shipping_tax_class ) {
|
||||
$item->calculate_taxes( array_merge( $calculate_tax_for, array( 'tax_class' => $shipping_tax_class ) ) );
|
||||
} else {
|
||||
$item->set_taxes( false );
|
||||
}
|
||||
}
|
||||
|
||||
$this->update_taxes();
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* WooCommerce product base class.
|
||||
*
|
||||
* @package WooCommerce/Classes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
@ -23,18 +29,21 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* This is the name of this object type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $object_type = 'product';
|
||||
|
||||
/**
|
||||
* Post type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $post_type = 'product';
|
||||
|
||||
/**
|
||||
* Cache group.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $cache_group = 'products';
|
||||
|
@ -151,7 +160,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product name.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_name( $context = 'view' ) {
|
||||
|
@ -162,7 +171,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product slug.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_slug( $context = 'view' ) {
|
||||
|
@ -173,7 +182,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product created date.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
public function get_date_created( $context = 'view' ) {
|
||||
|
@ -184,7 +193,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product modified date.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
public function get_date_modified( $context = 'view' ) {
|
||||
|
@ -195,7 +204,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product status.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_status( $context = 'view' ) {
|
||||
|
@ -206,7 +215,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* If the product is featured.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return boolean
|
||||
*/
|
||||
public function get_featured( $context = 'view' ) {
|
||||
|
@ -217,7 +226,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get catalog visibility.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_catalog_visibility( $context = 'view' ) {
|
||||
|
@ -228,7 +237,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product description.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_description( $context = 'view' ) {
|
||||
|
@ -239,7 +248,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get product short description.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_short_description( $context = 'view' ) {
|
||||
|
@ -249,7 +258,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get SKU (Stock-keeping unit) - product unique ID.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_sku( $context = 'view' ) {
|
||||
|
@ -259,7 +268,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product's active price.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string price
|
||||
*/
|
||||
public function get_price( $context = 'view' ) {
|
||||
|
@ -269,7 +278,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product's regular price.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string price
|
||||
*/
|
||||
public function get_regular_price( $context = 'view' ) {
|
||||
|
@ -279,7 +288,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product's sale price.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string price
|
||||
*/
|
||||
public function get_sale_price( $context = 'view' ) {
|
||||
|
@ -290,7 +299,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get date on sale from.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
public function get_date_on_sale_from( $context = 'view' ) {
|
||||
|
@ -301,7 +310,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get date on sale to.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
public function get_date_on_sale_to( $context = 'view' ) {
|
||||
|
@ -312,7 +321,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get number total of sales.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_total_sales( $context = 'view' ) {
|
||||
|
@ -322,7 +331,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the tax status.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_tax_status( $context = 'view' ) {
|
||||
|
@ -332,7 +341,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the tax class.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_tax_class( $context = 'view' ) {
|
||||
|
@ -343,7 +352,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Return if product manage stock.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return boolean
|
||||
*/
|
||||
public function get_manage_stock( $context = 'view' ) {
|
||||
|
@ -353,7 +362,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns number of items available for sale.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int|null
|
||||
*/
|
||||
public function get_stock_quantity( $context = 'view' ) {
|
||||
|
@ -363,7 +372,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Return the stock status.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
|
@ -374,7 +383,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get backorders.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @since 3.0.0
|
||||
* @return string yes no or notify
|
||||
*/
|
||||
|
@ -385,7 +394,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Return if should be sold individually.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -396,7 +405,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product's weight.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_weight( $context = 'view' ) {
|
||||
|
@ -406,7 +415,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product length.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_length( $context = 'view' ) {
|
||||
|
@ -416,7 +425,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product width.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_width( $context = 'view' ) {
|
||||
|
@ -426,7 +435,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the product height.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_height( $context = 'view' ) {
|
||||
|
@ -436,7 +445,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns formatted dimensions.
|
||||
*
|
||||
* @param $formatted bool True by default for legacy support - will be false/not set in future versions to return the array only. Use wc_format_dimensions for formatted versions instead.
|
||||
* @param bool $formatted True by default for legacy support - will be false/not set in future versions to return the array only. Use wc_format_dimensions for formatted versions instead.
|
||||
* @return string|array
|
||||
*/
|
||||
public function get_dimensions( $formatted = true ) {
|
||||
|
@ -455,7 +464,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get upsell IDs.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_upsell_ids( $context = 'view' ) {
|
||||
|
@ -466,7 +475,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get cross sell IDs.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_cross_sell_ids( $context = 'view' ) {
|
||||
|
@ -477,7 +486,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get parent ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_parent_id( $context = 'view' ) {
|
||||
|
@ -488,7 +497,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Return if reviews is allowed.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return bool
|
||||
*/
|
||||
public function get_reviews_allowed( $context = 'view' ) {
|
||||
|
@ -499,7 +508,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get purchase note.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_purchase_note( $context = 'view' ) {
|
||||
|
@ -509,7 +518,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns product attributes.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_attributes( $context = 'view' ) {
|
||||
|
@ -520,7 +529,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get default attributes.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_default_attributes( $context = 'view' ) {
|
||||
|
@ -531,7 +540,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get menu order.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_menu_order( $context = 'view' ) {
|
||||
|
@ -542,7 +551,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get category ids.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_category_ids( $context = 'view' ) {
|
||||
|
@ -553,7 +562,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get tag ids.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_tag_ids( $context = 'view' ) {
|
||||
|
@ -564,7 +573,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get virtual.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return bool
|
||||
*/
|
||||
public function get_virtual( $context = 'view' ) {
|
||||
|
@ -574,7 +583,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the gallery attachment ids.
|
||||
*
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_gallery_image_ids( $context = 'view' ) {
|
||||
|
@ -585,7 +594,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get shipping class ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_shipping_class_id( $context = 'view' ) {
|
||||
|
@ -596,7 +605,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get downloads.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array
|
||||
*/
|
||||
public function get_downloads( $context = 'view' ) {
|
||||
|
@ -607,7 +616,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get download expiry.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_download_expiry( $context = 'view' ) {
|
||||
|
@ -618,7 +627,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get downloadable.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return bool
|
||||
*/
|
||||
public function get_downloadable( $context = 'view' ) {
|
||||
|
@ -629,7 +638,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get download limit.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_download_limit( $context = 'view' ) {
|
||||
|
@ -640,7 +649,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get main image ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return string
|
||||
*/
|
||||
public function get_image_id( $context = 'view' ) {
|
||||
|
@ -649,7 +658,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Get rating count.
|
||||
* @param string $context
|
||||
*
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return array of counts
|
||||
*/
|
||||
public function get_rating_counts( $context = 'view' ) {
|
||||
|
@ -658,7 +668,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Get average rating.
|
||||
* @param string $context
|
||||
*
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return float
|
||||
*/
|
||||
public function get_average_rating( $context = 'view' ) {
|
||||
|
@ -667,7 +678,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Get review count.
|
||||
* @param string $context
|
||||
*
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return int
|
||||
*/
|
||||
public function get_review_count( $context = 'view' ) {
|
||||
|
@ -738,7 +750,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set if the product is featured.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
* @param bool|string $featured Whether the product is featured or not.
|
||||
*/
|
||||
public function set_featured( $featured ) {
|
||||
$this->set_prop( 'featured', wc_string_to_bool( $featured ) );
|
||||
|
@ -748,7 +760,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set catalog visibility.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @throws WC_Data_Exception Throws exception when invalid data is found.
|
||||
* @param string $visibility Options: 'hidden', 'visible', 'search' and 'catalog'.
|
||||
*/
|
||||
public function set_catalog_visibility( $visibility ) {
|
||||
|
@ -783,7 +795,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set SKU.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @throws WC_Data_Exception Throws exception when invalid data is found.
|
||||
* @param string $sku Product SKU.
|
||||
*/
|
||||
public function set_sku( $sku ) {
|
||||
|
@ -859,7 +871,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set the tax status.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @throws WC_Data_Exception Throws exception when invalid data is found.
|
||||
* @param string $status Tax status.
|
||||
*/
|
||||
public function set_tax_status( $status ) {
|
||||
|
@ -890,7 +902,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
public function set_tax_class( $class ) {
|
||||
$class = sanitize_title( $class );
|
||||
$class = 'standard' === $class ? '' : $class;
|
||||
$valid_classes = WC_Tax::get_tax_class_slugs();
|
||||
$valid_classes = $this->get_valid_tax_classes();
|
||||
|
||||
if ( ! in_array( $class, $valid_classes ) ) {
|
||||
$class = '';
|
||||
|
@ -899,11 +911,20 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$this->set_prop( 'tax_class', $class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of valid tax classes
|
||||
*
|
||||
* @return array valid tax classes
|
||||
*/
|
||||
protected function get_valid_tax_classes() {
|
||||
return WC_Tax::get_tax_class_slugs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if product manage stock.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
* @param bool $manage_stock Whether or not manage stock is enabled.
|
||||
*/
|
||||
public function set_manage_stock( $manage_stock ) {
|
||||
$this->set_prop( 'manage_stock', wc_string_to_bool( $manage_stock ) );
|
||||
|
@ -942,7 +963,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set if should be sold individually.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
* @param bool $sold_individually Whether or not product is sold individually.
|
||||
*/
|
||||
public function set_sold_individually( $sold_individually ) {
|
||||
$this->set_prop( 'sold_individually', wc_string_to_bool( $sold_individually ) );
|
||||
|
@ -1073,7 +1094,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*/
|
||||
public function set_default_attributes( $default_attributes ) {
|
||||
$this->set_prop( 'default_attributes',
|
||||
array_filter( (array) $default_attributes, 'wc_array_filter_default_attributes' ) );
|
||||
array_filter( (array) $default_attributes, 'wc_array_filter_default_attributes' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1110,7 +1131,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set if the product is virtual.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
* @param bool|string $virtual Whether product is virtual or not.
|
||||
*/
|
||||
public function set_virtual( $virtual ) {
|
||||
$this->set_prop( 'virtual', wc_string_to_bool( $virtual ) );
|
||||
|
@ -1120,7 +1141,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set shipping class ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param int
|
||||
* @param int $id Product shipping class id.
|
||||
*/
|
||||
public function set_shipping_class_id( $id ) {
|
||||
$this->set_prop( 'shipping_class_id', absint( $id ) );
|
||||
|
@ -1130,7 +1151,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set if the product is downloadable.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
* @param bool|string $downloadable Whether product is downloadable or not.
|
||||
*/
|
||||
public function set_downloadable( $downloadable ) {
|
||||
$this->set_prop( 'downloadable', wc_string_to_bool( $downloadable ) );
|
||||
|
@ -1140,7 +1161,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set downloads.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param $downloads_array array of WC_Product_Download objects or arrays.
|
||||
* @param array $downloads_array Array of WC_Product_Download objects or arrays.
|
||||
*/
|
||||
public function set_downloads( $downloads_array ) {
|
||||
$downloads = array();
|
||||
|
@ -1160,7 +1181,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$download_object->set_previous_hash( $download['previous_hash'] );
|
||||
}
|
||||
|
||||
// Validate the file extension
|
||||
// Validate the file extension.
|
||||
if ( ! $download_object->is_allowed_filetype() ) {
|
||||
if ( $this->get_object_read() ) {
|
||||
$errors[] = sprintf( __( 'The downloadable file %1$s cannot be used as it does not have an allowed file type. Allowed types include: %2$s', 'woocommerce' ), '<code>' . basename( $download_object->get_file() ) . '</code>', '<code>' . implode( ', ', array_keys( $download_object->get_allowed_mime_types() ) ) . '</code>' );
|
||||
|
@ -1190,7 +1211,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set download limit.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param int|string $download_limit
|
||||
* @param int|string $download_limit Product download limit.
|
||||
*/
|
||||
public function set_download_limit( $download_limit ) {
|
||||
$this->set_prop( 'download_limit', -1 === (int) $download_limit || '' === $download_limit ? -1 : absint( $download_limit ) );
|
||||
|
@ -1200,7 +1221,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set download expiry.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param int|string $download_limit
|
||||
* @param int|string $download_expiry Product download expiry.
|
||||
*/
|
||||
public function set_download_expiry( $download_expiry ) {
|
||||
$this->set_prop( 'download_expiry', -1 === (int) $download_expiry || '' === $download_expiry ? -1 : absint( $download_expiry ) );
|
||||
|
@ -1210,7 +1231,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set gallery attachment ids.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param array $image_ids
|
||||
* @param array $image_ids List of image ids.
|
||||
*/
|
||||
public function set_gallery_image_ids( $image_ids ) {
|
||||
$image_ids = wp_parse_id_list( $image_ids );
|
||||
|
@ -1226,7 +1247,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Set main image ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param int $image_id
|
||||
* @param int|string $image_id Product image id.
|
||||
*/
|
||||
public function set_image_id( $image_id = '' ) {
|
||||
$this->set_prop( 'image_id', $image_id );
|
||||
|
@ -1234,7 +1255,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Set rating counts. Read only.
|
||||
* @param array $counts
|
||||
*
|
||||
* @param array $counts Product rating counts.
|
||||
*/
|
||||
public function set_rating_counts( $counts ) {
|
||||
$this->set_prop( 'rating_counts', array_filter( array_map( 'absint', (array) $counts ) ) );
|
||||
|
@ -1242,7 +1264,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Set average rating. Read only.
|
||||
* @param float $average
|
||||
*
|
||||
* @param float $average Product average rating.
|
||||
*/
|
||||
public function set_average_rating( $average ) {
|
||||
$this->set_prop( 'average_rating', wc_format_decimal( $average ) );
|
||||
|
@ -1250,7 +1273,8 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Set review count. Read only.
|
||||
* @param int $count
|
||||
*
|
||||
* @param int $count Product review count.
|
||||
*/
|
||||
public function set_review_count( $count ) {
|
||||
$this->set_prop( 'review_count', absint( $count ) );
|
||||
|
@ -1264,6 +1288,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Ensure properties are set correctly before save.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function validate_props() {
|
||||
|
@ -1272,11 +1297,11 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$this->set_stock_quantity( '' );
|
||||
$this->set_backorders( 'no' );
|
||||
|
||||
// If we are stock managing and we don't have stock, force out of stock status.
|
||||
// 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' ) && 'no' === $this->get_backorders() ) {
|
||||
$this->set_stock_status( 'outofstock' );
|
||||
|
||||
// If the stock level is changing and we do now have enough, force in stock status.
|
||||
// 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' ) && array_key_exists( 'stock_quantity', $this->get_changes() ) ) {
|
||||
$this->set_stock_status( 'instock' );
|
||||
}
|
||||
|
@ -1340,7 +1365,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*
|
||||
* Backwards compatibility with downloadable/virtual.
|
||||
*
|
||||
* @param string|array $type Array or string of types
|
||||
* @param string|array $type Array or string of types.
|
||||
* @return bool
|
||||
*/
|
||||
public function is_type( $type ) {
|
||||
|
@ -1521,7 +1546,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Check if a product is on backorder.
|
||||
*
|
||||
* @param int $qty_in_cart (default: 0)
|
||||
* @param int $qty_in_cart (default: 0).
|
||||
* @return bool
|
||||
*/
|
||||
public function is_on_backorder( $qty_in_cart = 0 ) {
|
||||
|
@ -1531,7 +1556,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns whether or not the product has enough stock for the order.
|
||||
*
|
||||
* @param mixed $quantity
|
||||
* @param mixed $quantity Quantity of a product added to an order.
|
||||
* @return bool
|
||||
*/
|
||||
public function has_enough_stock( $quantity ) {
|
||||
|
@ -1586,7 +1611,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*
|
||||
* @since 1.6.2
|
||||
*
|
||||
* @param string $download_id file identifier
|
||||
* @param string $download_id file identifier.
|
||||
* @return bool Whether downloadable product has a file attached.
|
||||
*/
|
||||
public function has_file( $download_id = '' ) {
|
||||
|
@ -1621,6 +1646,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Product permalink.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_permalink() {
|
||||
|
@ -1638,6 +1664,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* If the stock level comes from another product ID, this should be modified.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
|
@ -1648,7 +1675,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the price in html format.
|
||||
*
|
||||
* @param string $deprecated
|
||||
* @param string $deprecated Deprecated param.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
@ -1728,9 +1755,9 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Returns the main product image.
|
||||
*
|
||||
* @param string $size (default: 'shop_thumbnail')
|
||||
* @param array $attr
|
||||
* @param bool $placeholder True to return $placeholder if no image is found, or false to return an empty string.
|
||||
* @param string $size (default: 'shop_thumbnail').
|
||||
* @param array $attr Image attributes.
|
||||
* @param bool $placeholder True to return $placeholder if no image is found, or false to return an empty string.
|
||||
* @return string
|
||||
*/
|
||||
public function get_image( $size = 'shop_thumbnail', $attr = array(), $placeholder = true ) {
|
||||
|
@ -1764,6 +1791,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Returns a single product attribute as a string.
|
||||
*
|
||||
* @param string $attribute to get.
|
||||
* @return string
|
||||
*/
|
||||
|
@ -1783,6 +1811,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Get the total amount (COUNT) of ratings, or just the count for one rating e.g. number of 5 star ratings.
|
||||
*
|
||||
* @param int $value Optional. Rating value to get the count for. By default returns the count of all rating values.
|
||||
* @return int
|
||||
*/
|
||||
|
@ -1801,14 +1830,14 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get a file by $download_id.
|
||||
*
|
||||
* @param string $download_id file identifier
|
||||
* @param string $download_id file identifier.
|
||||
* @return array|false if not found
|
||||
*/
|
||||
public function get_file( $download_id = '' ) {
|
||||
$files = $this->get_downloads();
|
||||
|
||||
if ( '' === $download_id ) {
|
||||
$file = sizeof( $files ) ? current( $files ) : false;
|
||||
$file = count( $files ) ? current( $files ) : false;
|
||||
} elseif ( isset( $files[ $download_id ] ) ) {
|
||||
$file = $files[ $download_id ];
|
||||
} else {
|
||||
|
@ -1821,22 +1850,22 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get file download path identified by $download_id.
|
||||
*
|
||||
* @param string $download_id file identifier
|
||||
* @param string $download_id file identifier.
|
||||
* @return string
|
||||
*/
|
||||
public function get_file_download_path( $download_id ) {
|
||||
$files = $this->get_downloads();
|
||||
$file_path = isset( $files[ $download_id ] ) ? $files[ $download_id ]->get_file() : '';
|
||||
|
||||
// allow overriding based on the particular file being requested
|
||||
// allow overriding based on the particular file being requested.
|
||||
return apply_filters( 'woocommerce_product_file_download_path', $file_path, $this, $download_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the suffix to display after prices > 0.
|
||||
*
|
||||
* @param string $price to calculate, left blank to just use get_price()
|
||||
* @param integer $qty passed on to get_price_including_tax() or get_price_excluding_tax()
|
||||
* @param string $price to calculate, left blank to just use get_price().
|
||||
* @param integer $qty passed on to get_price_including_tax() or get_price_excluding_tax().
|
||||
* @return string
|
||||
*/
|
||||
public function get_price_suffix( $price = '', $qty = 1 ) {
|
||||
|
|
|
@ -378,7 +378,8 @@ abstract class WC_REST_Terms_Controller extends WC_REST_Controller {
|
|||
|
||||
$parent = get_term( (int) $request['parent'], $taxonomy );
|
||||
|
||||
if ( ! $parent ) {
|
||||
// If is null or WP_Error is invalid parent term.
|
||||
if ( ! $parent || is_wp_error( $parent ) ) {
|
||||
return new WP_Error( 'woocommerce_rest_term_invalid', __( 'Parent resource does not exist.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ class WC_Admin_Assets {
|
|||
wp_register_script( 'wc-shipping-classes', WC()->plugin_url() . '/assets/js/admin/wc-shipping-classes' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone' ), WC_VERSION );
|
||||
wp_register_script( 'wc-clipboard', WC()->plugin_url() . '/assets/js/admin/wc-clipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
|
||||
wp_register_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.0' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.1' );
|
||||
wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
|
||||
wp_localize_script( 'wc-enhanced-select', 'wc_enhanced_select_params', array(
|
||||
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
|
||||
|
@ -232,7 +232,7 @@ class WC_Admin_Assets {
|
|||
if ( in_array( str_replace( 'edit-', '', $screen_id ), wc_get_order_types( 'order-meta-boxes' ) ) ) {
|
||||
$default_location = wc_get_customer_default_location();
|
||||
|
||||
wp_enqueue_script( 'wc-admin-order-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes-order' . $suffix . '.js', array( 'wc-admin-meta-boxes', 'wc-backbone-modal' ), WC_VERSION );
|
||||
wp_enqueue_script( 'wc-admin-order-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes-order' . $suffix . '.js', array( 'wc-admin-meta-boxes', 'wc-backbone-modal', 'selectWoo' ), WC_VERSION );
|
||||
wp_localize_script( 'wc-admin-order-meta-boxes', 'woocommerce_admin_meta_boxes_order', array(
|
||||
'countries' => json_encode( array_merge( WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states() ) ),
|
||||
'i18n_select_state_text' => esc_attr__( 'Select an option…', 'woocommerce' ),
|
||||
|
@ -374,7 +374,7 @@ class WC_Admin_Assets {
|
|||
}
|
||||
|
||||
if ( in_array( $screen_id, array( 'user-edit', 'profile' ) ) ) {
|
||||
wp_register_script( 'wc-users', WC()->plugin_url() . '/assets/js/admin/users' . $suffix . '.js', array( 'jquery', 'wc-enhanced-select' ), WC_VERSION, true );
|
||||
wp_register_script( 'wc-users', WC()->plugin_url() . '/assets/js/admin/users' . $suffix . '.js', array( 'jquery', 'wc-enhanced-select', 'selectWoo' ), WC_VERSION, true );
|
||||
wp_enqueue_script( 'wc-users' );
|
||||
wp_localize_script(
|
||||
'wc-users',
|
||||
|
|
|
@ -177,7 +177,10 @@ class WC_Admin_Help {
|
|||
}
|
||||
|
||||
if ( isset( $video_map[ $video_key ] ) ) {
|
||||
$embed_code = str_replace( '?feature=oembed', '?feature=oembed&modestbranding=1&scolor=white', wp_oembed_get( 'https://www.youtube.com/watch?v=' . $video_map[ $video_key ]['id'], array( 'width' => '420px' ) ) );
|
||||
$embed_code = '
|
||||
<a href="https://www.youtube.com/watch?v=' . esc_attr( $video_map[ $video_key ]['id'] ) . '" target="_blank" class="wc-guided-tour-embed" data-video_id="' . esc_attr( $video_map[ $video_key ]['id'] ) . '">
|
||||
<img src="https://img.youtube.com/vi/' . esc_attr( $video_map[ $video_key ]['id'] ) . '/maxresdefault.jpg" width="560" height="315" />
|
||||
</a>';
|
||||
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'woocommerce_guided_tour_tab',
|
||||
|
|
|
@ -235,12 +235,12 @@ class WC_Admin_Notices {
|
|||
$theme_file = false;
|
||||
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/woocommerce/' . $file;
|
||||
} elseif ( file_exists( get_template_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_template_directory() . '/' . WC()->template_path() . $file;
|
||||
}
|
||||
|
||||
if ( false !== $theme_file ) {
|
||||
|
|
|
@ -194,7 +194,7 @@ class WC_Admin_Permalink_Settings {
|
|||
$product_base = '/' . _x( 'product', 'slug', 'woocommerce' ) . $product_base;
|
||||
}
|
||||
} elseif ( empty( $product_base ) ) {
|
||||
$product_base = false;
|
||||
$product_base = _x( 'product', 'slug', 'woocommerce' );
|
||||
}
|
||||
|
||||
$permalinks['product_base'] = wc_sanitize_permalink( $product_base );
|
||||
|
|
|
@ -176,7 +176,7 @@ class WC_Admin_Post_Types {
|
|||
'<strong>' . date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) . '</strong>'
|
||||
),
|
||||
10 => __( 'Order draft updated.', 'woocommerce' ),
|
||||
11 => __( 'Order updated and sent to the customer.', 'woocommerce' ),
|
||||
11 => __( 'Order updated and sent.', 'woocommerce' ),
|
||||
);
|
||||
|
||||
$messages['shop_coupon'] = array(
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,7 @@ class WC_Admin {
|
|||
add_action( 'admin_init', array( $this, 'admin_redirects' ) );
|
||||
add_action( 'admin_footer', 'wc_print_js', 25 );
|
||||
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
|
||||
add_action( 'wp_ajax_setup_wizard_check_jetpack', array( $this, 'setup_wizard_check_jetpack' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,7 +238,7 @@ class WC_Admin {
|
|||
$footer_text = sprintf(
|
||||
/* translators: 1: WooCommerce 2:: five stars */
|
||||
__( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'woocommerce' ),
|
||||
sprintf( '<strong>%s<strong>', esc_html__( 'WooCommerce', 'woocommerce' ) ),
|
||||
sprintf( '<strong>%s</strong>', esc_html__( 'WooCommerce', 'woocommerce' ) ),
|
||||
'<a href="https://wordpress.org/support/plugin/woocommerce/reviews?rate=5#new-post" target="_blank" class="wc-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'woocommerce' ) . '">★★★★★</a>'
|
||||
);
|
||||
wc_enqueue_js( "
|
||||
|
@ -253,6 +254,19 @@ class WC_Admin {
|
|||
|
||||
return $footer_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check on a Jetpack install queued by the Setup Wizard.
|
||||
*
|
||||
* See: WC_Admin_Setup_Wizard::install_jetpack()
|
||||
*/
|
||||
public function setup_wizard_check_jetpack() {
|
||||
$jetpack_active = class_exists( 'Jetpack' );
|
||||
|
||||
wp_send_json_success( array(
|
||||
'is_active' => $jetpack_active ? 'yes' : 'no',
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
return new WC_Admin();
|
||||
|
|
|
@ -330,6 +330,7 @@ class WC_Helper {
|
|||
'all' => __( 'All', 'woocommerce' ),
|
||||
'active' => __( 'Active', 'woocommerce' ),
|
||||
'inactive' => __( 'Inactive', 'woocommerce' ),
|
||||
'installed' => __( 'Installed', 'woocommerce' ),
|
||||
'update-available' => __( 'Update Available', 'woocommerce' ),
|
||||
'expiring' => __( 'Expiring Soon', 'woocommerce' ),
|
||||
'expired' => __( 'Expired', 'woocommerce' ),
|
||||
|
@ -399,6 +400,14 @@ class WC_Helper {
|
|||
$subscriptions = wp_list_filter( $subscriptions, array( 'active' => false ) );
|
||||
break;
|
||||
|
||||
case 'installed':
|
||||
foreach ( $subscriptions as $key => $subscription ) {
|
||||
if ( empty( $subscription['local']['installed'] ) ) {
|
||||
unset( $subscriptions[ $key ] );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update-available':
|
||||
$subscriptions = wp_list_filter( $subscriptions, array( 'has_update' => true ) );
|
||||
break;
|
||||
|
@ -1104,7 +1113,7 @@ class WC_Helper {
|
|||
}
|
||||
|
||||
// No more sites available in this subscription.
|
||||
if ( $_sub['sites_active'] >= $_sub['sites_max'] ) {
|
||||
if ( $_sub['sites_max'] && $_sub['sites_active'] >= $_sub['sites_max'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -379,6 +379,22 @@ class WC_Product_CSV_Importer_Controller {
|
|||
include_once( dirname( __FILE__ ) . '/views/html-csv-import-done.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Columns to normalize.
|
||||
*
|
||||
* @param array $columns List of columns names and keys.
|
||||
* @return array
|
||||
*/
|
||||
protected function normalize_columns_names( $columns ) {
|
||||
$normalized = array();
|
||||
|
||||
foreach ( $columns as $key => $value ) {
|
||||
$normalized[ strtolower( $key ) ] = $value;
|
||||
}
|
||||
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto map column names.
|
||||
*
|
||||
|
@ -395,8 +411,9 @@ class WC_Product_CSV_Importer_Controller {
|
|||
/**
|
||||
* @hooked wc_importer_generic_mappings - 10
|
||||
* @hooked wc_importer_wordpress_mappings - 10
|
||||
* @hooked wc_importer_default_english_mappings - 100
|
||||
*/
|
||||
$default_columns = apply_filters( 'woocommerce_csv_product_import_mapping_default_columns', array(
|
||||
$default_columns = $this->normalize_columns_names( apply_filters( 'woocommerce_csv_product_import_mapping_default_columns', array(
|
||||
__( 'ID', 'woocommerce' ) => 'id',
|
||||
__( 'Type', 'woocommerce' ) => 'type',
|
||||
__( 'SKU', 'woocommerce' ) => 'sku',
|
||||
|
@ -435,26 +452,20 @@ class WC_Product_CSV_Importer_Controller {
|
|||
__( 'External URL', 'woocommerce' ) => 'product_url',
|
||||
__( 'Button text', 'woocommerce' ) => 'button_text',
|
||||
__( 'Position', 'woocommerce' ) => 'menu_order',
|
||||
) );
|
||||
) ) );
|
||||
|
||||
// Normalize the columns so they are case-insensitive.
|
||||
$normalized_default_columns = array();
|
||||
foreach ( $default_columns as $key => $val ) {
|
||||
$normalized_default_columns[ strtolower( $key ) ] = $val;
|
||||
}
|
||||
|
||||
$special_columns = $this->get_special_columns( apply_filters( 'woocommerce_csv_product_import_mapping_special_columns',
|
||||
$special_columns = $this->get_special_columns( $this->normalize_columns_names( apply_filters( 'woocommerce_csv_product_import_mapping_special_columns',
|
||||
array(
|
||||
strtolower( __( 'Attribute %d name', 'woocommerce' ) ) => 'attributes:name',
|
||||
strtolower( __( 'Attribute %d value(s)', 'woocommerce' ) ) => 'attributes:value',
|
||||
strtolower( __( 'Attribute %d visible', 'woocommerce' ) ) => 'attributes:visible',
|
||||
strtolower( __( 'Attribute %d global', 'woocommerce' ) ) => 'attributes:taxonomy',
|
||||
strtolower( __( 'Attribute %d default', 'woocommerce' ) ) => 'attributes:default',
|
||||
strtolower( __( 'Download %d name', 'woocommerce' ) ) => 'downloads:name',
|
||||
strtolower( __( 'Download %d URL', 'woocommerce' ) ) => 'downloads:url',
|
||||
strtolower( __( 'Meta: %s', 'woocommerce' ) ) => 'meta:',
|
||||
__( 'Attribute %d name', 'woocommerce' ) => 'attributes:name',
|
||||
__( 'Attribute %d value(s)', 'woocommerce' ) => 'attributes:value',
|
||||
__( 'Attribute %d visible', 'woocommerce' ) => 'attributes:visible',
|
||||
__( 'Attribute %d global', 'woocommerce' ) => 'attributes:taxonomy',
|
||||
__( 'Attribute %d default', 'woocommerce' ) => 'attributes:default',
|
||||
__( 'Download %d name', 'woocommerce' ) => 'downloads:name',
|
||||
__( 'Download %d URL', 'woocommerce' ) => 'downloads:url',
|
||||
__( 'Meta: %s', 'woocommerce' ) => 'meta:',
|
||||
)
|
||||
) );
|
||||
) ) );
|
||||
|
||||
$headers = array();
|
||||
foreach ( $raw_headers as $key => $field ) {
|
||||
|
@ -462,8 +473,8 @@ class WC_Product_CSV_Importer_Controller {
|
|||
$index = $num_indexes ? $key : $field;
|
||||
$headers[ $index ] = $field;
|
||||
|
||||
if ( isset( $normalized_default_columns[ $field ] ) ) {
|
||||
$headers[ $index ] = $normalized_default_columns[ $field ];
|
||||
if ( isset( $default_columns[ $field ] ) ) {
|
||||
$headers[ $index ] = $default_columns[ $field ];
|
||||
} else {
|
||||
foreach ( $special_columns as $regex => $special_key ) {
|
||||
if ( preg_match( $regex, $field, $matches ) ) {
|
||||
|
|
|
@ -33,7 +33,8 @@ class WC_Meta_Box_Order_Actions {
|
|||
}
|
||||
|
||||
$order_actions = apply_filters( 'woocommerce_order_actions', array(
|
||||
'send_order_details' => __( 'Email order details to customer', 'woocommerce' ),
|
||||
'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ),
|
||||
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
|
||||
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
|
||||
) );
|
||||
?>
|
||||
|
@ -81,7 +82,7 @@ class WC_Meta_Box_Order_Actions {
|
|||
* @param WP_Post $post
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
// Order data saved, now get it so we can manipulate status
|
||||
// Order data saved, now get it so we can manipulate status.
|
||||
$order = wc_get_order( $post_id );
|
||||
|
||||
// Handle button actions
|
||||
|
@ -105,6 +106,19 @@ class WC_Meta_Box_Order_Actions {
|
|||
// Change the post saved message.
|
||||
add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) );
|
||||
|
||||
} elseif ( 'send_order_details_admin' === $action ) {
|
||||
|
||||
do_action( 'woocommerce_before_resend_order_emails', $order, 'new_order' );
|
||||
|
||||
WC()->payment_gateways();
|
||||
WC()->shipping();
|
||||
WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order );
|
||||
|
||||
do_action( 'woocommerce_after_resend_order_email', $order, 'new_order' );
|
||||
|
||||
// Change the post saved message.
|
||||
add_filter( 'redirect_post_location', array( __CLASS__, 'set_email_sent_message' ) );
|
||||
|
||||
} elseif ( 'regenerate_download_permissions' === $action ) {
|
||||
|
||||
$data_store = WC_Data_Store::load( 'customer-download' );
|
||||
|
|
|
@ -124,7 +124,32 @@ if ( wc_tax_enabled() ) {
|
|||
}
|
||||
?>
|
||||
<table class="wc-order-totals">
|
||||
<?php if ( 0 < $order->get_total_discount() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Discount:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo wc_price( $order->get_total_discount(), array( 'currency' => $order->get_currency() ) ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_totals_after_discount', $order->get_id() ); ?>
|
||||
|
||||
<?php if ( $order->get_shipping_methods() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Shipping:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total"><?php
|
||||
if ( ( $refunded = $order->get_total_shipping_refunded() ) > 0 ) {
|
||||
echo '<del>' . strip_tags( wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) ) ) . '</del> <ins>' . wc_price( $order->get_shipping_total() - $refunded, array( 'currency' => $order->get_currency() ) ) . '</ins>';
|
||||
} else {
|
||||
echo wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) );
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_totals_after_shipping', $order->get_id() ); ?>
|
||||
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
|
@ -146,7 +171,7 @@ if ( wc_tax_enabled() ) {
|
|||
<?php do_action( 'woocommerce_admin_order_totals_after_tax', $order->get_id() ); ?>
|
||||
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Order total', 'woocommerce' ); ?>:</td>
|
||||
<td class="label"><?php _e( 'Total', 'woocommerce' ); ?>:</td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo $order->get_formatted_order_total(); ?>
|
||||
|
@ -244,6 +269,7 @@ if ( wc_tax_enabled() ) {
|
|||
<button type="button" class="button <?php echo $gateway_supports_refunds ? 'button-primary do-api-refund' : 'tips disabled'; ?>" <?php echo $gateway_supports_refunds ? '' : 'data-tip="' . esc_attr__( 'The payment gateway used to place this order does not support automatic refunds.', 'woocommerce' ) . '"'; ?>><?php printf( __( 'Refund %1$s via %2$s', 'woocommerce' ), $refund_amount, $gateway_name ); ?></button>
|
||||
<button type="button" class="button button-primary do-manual-refund tips" data-tip="<?php esc_attr_e( 'You will need to manually issue a refund through your payment gateway after using this.', 'woocommerce' ); ?>"><?php printf( __( 'Refund %s manually', 'woocommerce' ), $refund_amount ); ?></button>
|
||||
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<input type="hidden" id="refunded_amount" name="refunded_amount" value="<?php echo esc_attr( $order->get_total_refunded() ); ?>" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -169,18 +169,27 @@ class WC_Plugin_Updates {
|
|||
/**
|
||||
* Get active plugins that have a tested version lower than the input version.
|
||||
*
|
||||
* @param string $version
|
||||
* @param string $new_version
|
||||
* @param string $release 'major' or 'minor'.
|
||||
* @return array of plugin info arrays
|
||||
*/
|
||||
public function get_untested_plugins( $version, $release ) {
|
||||
$extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() );
|
||||
$untested = array();
|
||||
$version_parts = explode( '.', $version );
|
||||
$version = $version_parts[0];
|
||||
public function get_untested_plugins( $new_version, $release ) {
|
||||
$extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() );
|
||||
$untested = array();
|
||||
$new_version_parts = explode( '.', $new_version );
|
||||
$version = $new_version_parts[0];
|
||||
|
||||
if ( 'minor' === $release ) {
|
||||
$version .= '.' . $version_parts[1];
|
||||
$version .= '.' . $new_version_parts[1];
|
||||
}
|
||||
|
||||
if ( 'major' === $release ) {
|
||||
$current_version_parts = explode( '.', WC_VERSION );
|
||||
|
||||
// If user has already moved to the major version, we don't need to flag up anything.
|
||||
if ( version_compare( $current_version_parts[0] . '.' . $current_version_parts[1], $new_version_parts[0] . '.0', '>=' ) ) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $extensions as $file => $plugin ) {
|
||||
|
|
|
@ -46,15 +46,10 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates {
|
|||
$new_version_parts = explode( '.', $this->new_version );
|
||||
|
||||
// If user has already moved to the minor version, we don't need to flag up anything.
|
||||
if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . $new_version_parts[1], '=' ) ) {
|
||||
if ( version_compare( $current_version_parts[0] . '.' . $current_version_parts[1], $new_version_parts[0] . '.' . $new_version_parts[1], '=' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If user has already moved to the major version, we should only shown minor notices and assume everything is "ok" for major.
|
||||
if ( version_compare( $current_version_parts[0] . $current_version_parts[1], $new_version_parts[0] . '0', '>=' ) ) {
|
||||
$this->major_untested_plugins = array();
|
||||
}
|
||||
|
||||
if ( ! empty( $this->major_untested_plugins ) ) {
|
||||
$this->upgrade_notice .= $this->get_extensions_inline_warning_major();
|
||||
}
|
||||
|
|
|
@ -35,14 +35,13 @@ class WC_Updates_Screen_Updates extends WC_Plugin_Updates {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
||||
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
||||
$this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, 'major' );
|
||||
if ( empty( $this->major_untested_plugins ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo $this->get_extensions_modal_warning();
|
||||
$this->update_screen_modal_js();
|
||||
if ( ! empty( $this->major_untested_plugins ) ) {
|
||||
echo $this->get_extensions_modal_warning();
|
||||
$this->update_screen_modal_js();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,22 +18,24 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
);
|
||||
?></p>
|
||||
|
||||
<table class="plugin-details-table" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Plugin', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Tested up to WooCommerce version', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ( $plugins as $plugin ) : ?>
|
||||
<div class="plugin-details-table-container">
|
||||
<table class="plugin-details-table" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $plugin['Name'] ); ?></td>
|
||||
<td><?php echo esc_html( $plugin['WC tested up to'] ); ?></td>
|
||||
<th><?php esc_html_e( 'Plugin', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Tested up to WooCommerce version', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ( $plugins as $plugin ) : ?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $plugin['Name'] ); ?></td>
|
||||
<td><?php echo esc_html( $plugin['WC tested up to'] ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p><?php esc_html_e( 'As this is a major update, we strongly recommend creating a backup of your site before updating.', 'woocommerce' ); ?> <a href="https://woocommerce.com/2017/05/create-use-backups-woocommerce/" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
|
|||
'placeholder' => __( 'N/A', 'woocommerce' ),
|
||||
'type' => 'textarea',
|
||||
/* translators: %s: site name */
|
||||
'default' => sprintf( __( '%s - Powered by WooCommerce', 'woocommerce' ), get_bloginfo( 'name', 'display' ) ),
|
||||
'default' => get_bloginfo( 'name', 'display' ),
|
||||
'autoload' => false,
|
||||
'desc_tip' => true,
|
||||
),
|
||||
|
|
|
@ -12,7 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Settings_Tax', false ) ) :
|
||||
if ( class_exists( 'WC_Settings_Tax', false ) ) {
|
||||
return new WC_Settings_Tax();
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Settings_Tax.
|
||||
|
@ -23,17 +25,22 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->id = 'tax';
|
||||
$this->id = 'tax';
|
||||
$this->label = __( 'Tax', 'woocommerce' );
|
||||
|
||||
parent::__construct();
|
||||
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
|
||||
|
||||
if ( wc_tax_enabled() ) {
|
||||
add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) );
|
||||
add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) );
|
||||
add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add this page to settings.
|
||||
*
|
||||
* @param array $pages
|
||||
*
|
||||
* @param array $pages Existing pages.
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function add_settings_page( $pages ) {
|
||||
|
@ -55,7 +62,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
'standard' => __( 'Standard rates', 'woocommerce' ),
|
||||
);
|
||||
|
||||
// Get tax classes and display as links
|
||||
// Get tax classes and display as links.
|
||||
$tax_classes = WC_Tax::get_tax_classes();
|
||||
|
||||
foreach ( $tax_classes as $class ) {
|
||||
|
@ -68,15 +75,15 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
/**
|
||||
* Get settings array.
|
||||
*
|
||||
* @param string $current_section
|
||||
* @param string $current_section Current section being shown.
|
||||
* @return array
|
||||
*/
|
||||
public function get_settings( $current_section = '' ) {
|
||||
$settings = array();
|
||||
|
||||
if ( '' === $current_section ) {
|
||||
$settings = include( 'views/settings-tax.php' );
|
||||
}
|
||||
$settings = include( 'views/settings-tax.php' );
|
||||
}
|
||||
return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings, $current_section );
|
||||
}
|
||||
|
||||
|
@ -88,7 +95,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
|
||||
$tax_classes = WC_Tax::get_tax_class_slugs();
|
||||
|
||||
if ( 'standard' === $current_section || in_array( $current_section, $tax_classes ) ) {
|
||||
if ( 'standard' === $current_section || in_array( $current_section, $tax_classes, true ) ) {
|
||||
$this->output_tax_rates();
|
||||
} else {
|
||||
$settings = $this->get_settings();
|
||||
|
@ -192,6 +199,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
|
||||
/**
|
||||
* Get tax class being edited.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function get_current_tax_class() {
|
||||
|
@ -201,7 +209,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
$current_class = '';
|
||||
|
||||
foreach ( $tax_classes as $class ) {
|
||||
if ( sanitize_title( $class ) == $current_section ) {
|
||||
if ( sanitize_title( $class ) === $current_section ) {
|
||||
$current_class = $class;
|
||||
}
|
||||
}
|
||||
|
@ -211,9 +219,10 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
|
||||
/**
|
||||
* Get a posted tax rate.
|
||||
* @param string $key Key of tax rate in the post data array
|
||||
* @param int $order Position/order of rate
|
||||
* @param string $class Tax class for rate
|
||||
*
|
||||
* @param string $key Key of tax rate in the post data array.
|
||||
* @param int $order Position/order of rate.
|
||||
* @param string $class Tax class for rate.
|
||||
* @return array
|
||||
*/
|
||||
private function get_posted_tax_rate( $key, $order, $class ) {
|
||||
|
@ -227,8 +236,8 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
);
|
||||
|
||||
foreach ( $tax_rate_keys as $tax_rate_key ) {
|
||||
if ( isset( $_POST[ $tax_rate_key ] ) && isset( $_POST[ $tax_rate_key ][ $key ] ) ) {
|
||||
$tax_rate[ $tax_rate_key ] = wc_clean( $_POST[ $tax_rate_key ][ $key ] );
|
||||
if ( isset( $_POST[ $tax_rate_key ], $_POST[ $tax_rate_key ][ $key ] ) ) {
|
||||
$tax_rate[ $tax_rate_key ] = wc_clean( wp_unslash( $_POST[ $tax_rate_key ][ $key ] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,24 +255,25 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
public function save_tax_rates() {
|
||||
global $wpdb;
|
||||
|
||||
$current_class = sanitize_title( $this->get_current_tax_class() );
|
||||
$current_class = sanitize_title( $this->get_current_tax_class() );
|
||||
$posted_countries = wc_clean( wp_unslash( $_POST['tax_rate_country'] ) );
|
||||
|
||||
// get the tax rate id of the first submited row
|
||||
$first_tax_rate_id = key( $_POST['tax_rate_country'] );
|
||||
// get the tax rate id of the first submited row.
|
||||
$first_tax_rate_id = key( $posted_countries );
|
||||
|
||||
// get the order position of the first tax rate id
|
||||
// get the order position of the first tax rate id.
|
||||
$tax_rate_order = absint( $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate_order FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %s", $first_tax_rate_id ) ) );
|
||||
|
||||
$index = isset( $tax_rate_order ) ? $tax_rate_order : 0;
|
||||
|
||||
// Loop posted fields
|
||||
foreach ( $_POST['tax_rate_country'] as $key => $value ) {
|
||||
// Loop posted fields.
|
||||
foreach ( $posted_countries as $key => $value ) {
|
||||
$mode = ( 0 === strpos( $key, 'new-' ) ) ? 'insert' : 'update';
|
||||
$tax_rate = $this->get_posted_tax_rate( $key, $index ++, $current_class );
|
||||
|
||||
if ( 'insert' === $mode ) {
|
||||
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
|
||||
} elseif ( 1 == $_POST['remove_tax_rate'][ $key ] ) {
|
||||
} elseif ( 1 === absint( $_POST['remove_tax_rate'][ $key ] ) ) {
|
||||
$tax_rate_id = absint( $key );
|
||||
WC_Tax::_delete_tax_rate( $tax_rate_id );
|
||||
continue;
|
||||
|
@ -273,15 +283,13 @@ class WC_Settings_Tax extends WC_Settings_Page {
|
|||
}
|
||||
|
||||
if ( isset( $_POST['tax_rate_postcode'][ $key ] ) ) {
|
||||
WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, wc_clean( $_POST['tax_rate_postcode'][ $key ] ) );
|
||||
WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, wc_clean( wp_unslash( $_POST['tax_rate_postcode'][ $key ] ) ) );
|
||||
}
|
||||
if ( isset( $_POST['tax_rate_city'][ $key ] ) ) {
|
||||
WC_Tax::_update_tax_rate_cities( $tax_rate_id, wc_clean( $_POST['tax_rate_city'][ $key ] ) );
|
||||
WC_Tax::_update_tax_rate_cities( $tax_rate_id, wc_clean( wp_unslash( $_POST['tax_rate_city'][ $key ] ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
return new WC_Settings_Tax();
|
||||
|
|
|
@ -1,23 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Admin View: Settings
|
||||
*
|
||||
* @package WooCommerce
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$tab_exists = isset( $tabs[ $current_tab ] ) || has_action( 'woocommerce_sections_' . $current_tab ) || has_action( 'woocommerce_settings_' . $current_tab ) || has_action( 'woocommerce_settings_tabs_' . $current_tab );
|
||||
$current_tab_label = isset( $tabs[ $current_tab ] ) ? $tabs[ $current_tab ] : '';
|
||||
|
||||
if ( ! $tab_exists ) {
|
||||
wp_safe_redirect( admin_url( 'admin.php?page=wc-settings' ) );
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="wrap woocommerce">
|
||||
<form method="<?php echo esc_attr( apply_filters( 'woocommerce_settings_form_method_tab_' . $current_tab, 'post' ) ); ?>" id="mainform" action="" enctype="multipart/form-data">
|
||||
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||
<?php
|
||||
foreach ( $tabs as $name => $label ) {
|
||||
echo '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
|
||||
}
|
||||
do_action( 'woocommerce_settings_tabs' );
|
||||
|
||||
foreach ( $tabs as $slug => $label ) {
|
||||
echo '<a href="' . esc_html( admin_url( 'admin.php?page=wc-settings&tab=' . esc_attr( $slug ) ) ) . '" class="nav-tab ' . ( $current_tab === $slug ? 'nav-tab-active' : '' ) . '">' . esc_html( $label ) . '</a>';
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_settings_tabs' );
|
||||
|
||||
?>
|
||||
</nav>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
|
||||
<h1 class="screen-reader-text"><?php echo esc_html( $current_tab_label ); ?></h1>
|
||||
<?php
|
||||
do_action( 'woocommerce_sections_' . $current_tab );
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ class WC_REST_Product_Categories_Controller extends WC_REST_Product_Categories_V
|
|||
/**
|
||||
* Prepare a single product category output for response.
|
||||
*
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_REST_Response $response
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
// Get category display type.
|
||||
|
@ -50,13 +50,14 @@ class WC_REST_Product_Categories_Controller extends WC_REST_Product_Categories_V
|
|||
'parent' => (int) $item->parent,
|
||||
'description' => $item->description,
|
||||
'display' => $display_type ? $display_type : 'default',
|
||||
'image' => array(),
|
||||
'image' => null,
|
||||
'menu_order' => (int) $menu_order,
|
||||
'count' => (int) $item->count,
|
||||
);
|
||||
|
||||
// Get category image.
|
||||
if ( $image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' ) ) {
|
||||
$image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' );
|
||||
if ( $image_id ) {
|
||||
$attachment = get_post( $image_id );
|
||||
|
||||
$data['image'] = array(
|
||||
|
|
|
@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller {
|
||||
|
||||
/**
|
||||
* Endpoint namespace.
|
||||
* Endpoint namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
@ -92,7 +92,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
'context' => $this->get_context_param( array(
|
||||
'default' => 'view',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
@ -396,7 +398,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( $parent_attributes[ $attribute_name ]->is_taxonomy() ) {
|
||||
// If dealing with a taxonomy, we need to get the slug from the name posted to the API.
|
||||
// @codingStandardsIgnoreStart
|
||||
$term = get_term_by( 'name', $attribute_value, $attribute_name );
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
if ( $term && ! is_wp_error( $term ) ) {
|
||||
$attribute_value = $term->slug;
|
||||
|
@ -449,7 +453,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Delete a variation.
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
*
|
||||
* @return bool|WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -459,7 +463,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
$result = false;
|
||||
|
||||
if ( ! $object || 0 === $object->get_id() ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
$supports_trash = EMPTY_TRASH_DAYS > 0 && is_callable( array( $object, 'get_status' ) );
|
||||
|
@ -476,7 +482,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( ! wc_rest_check_post_permissions( $this->post_type, 'delete', $object->get_id() ) ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => rest_authorization_required_code(),
|
||||
) );
|
||||
}
|
||||
|
||||
$request->set_param( 'context', 'edit' );
|
||||
|
@ -490,14 +498,18 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
// If we don't support trashing for this type, error out.
|
||||
if ( ! $supports_trash ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array( 'status' => 501 ) );
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 501,
|
||||
) );
|
||||
}
|
||||
|
||||
// Otherwise, only trash if we haven't already.
|
||||
if ( is_callable( array( $object, 'get_status' ) ) ) {
|
||||
if ( 'trash' === $object->get_status() ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 410 ) );
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 410,
|
||||
) );
|
||||
}
|
||||
|
||||
$object->delete();
|
||||
|
@ -507,7 +519,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
|
||||
if ( ! $result ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 500 ) );
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 500,
|
||||
) );
|
||||
}
|
||||
|
||||
// Delete parent product transients.
|
||||
|
@ -544,7 +558,9 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
if ( ! empty( $items[ $batch_type ] ) ) {
|
||||
$injected_items = array();
|
||||
foreach ( $items[ $batch_type ] as $item ) {
|
||||
$injected_items[] = is_array( $item ) ? array_merge( array( 'product_id' => $product_id ), $item ) : $item;
|
||||
$injected_items[] = is_array( $item ) ? array_merge( array(
|
||||
'product_id' => $product_id,
|
||||
), $item ) : $item;
|
||||
}
|
||||
$body_params[ $batch_type ] = $injected_items;
|
||||
}
|
||||
|
@ -671,7 +687,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
'readonly' => true,
|
||||
),
|
||||
'visible' => array(
|
||||
'description' => __( "Define if the attribute is visible on the \"Additional information\" tab in the product's page.", 'woocommerce' ),
|
||||
'description' => __( "Define if the variation is visible on the product's page.", 'woocommerce' ),
|
||||
'type' => 'boolean',
|
||||
'default' => true,
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
|
|
@ -89,7 +89,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'callback' => array( $this, 'get_item' ),
|
||||
'permission_callback' => array( $this, 'get_item_permissions_check' ),
|
||||
'args' => array(
|
||||
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
|
||||
'context' => $this->get_context_param( array(
|
||||
'default' => 'view',
|
||||
) ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
@ -231,7 +233,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( ! empty( $tax_query ) ) {
|
||||
$args['tax_query'] = $tax_query;
|
||||
$args['tax_query'] = $tax_query; // WPCS: slow query ok.
|
||||
}
|
||||
|
||||
// Filter featured.
|
||||
|
@ -251,7 +253,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
$skus[] = $request['sku'];
|
||||
}
|
||||
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_sku',
|
||||
'value' => $skus,
|
||||
'compare' => 'IN',
|
||||
|
@ -260,7 +262,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Filter by tax class.
|
||||
if ( ! empty( $request['tax_class'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_tax_class',
|
||||
'value' => 'standard' !== $request['tax_class'] ? $request['tax_class'] : '',
|
||||
) );
|
||||
|
@ -268,12 +270,12 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Price filter.
|
||||
if ( ! empty( $request['min_price'] ) || ! empty( $request['max_price'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) );
|
||||
$args['meta_query'] = $this->add_meta_query( $args, wc_get_min_max_price_meta_query( $request ) ); // WPCS: slow query ok.
|
||||
}
|
||||
|
||||
// Filter product in stock or out of stock.
|
||||
if ( is_bool( $request['in_stock'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array(
|
||||
$args['meta_query'] = $this->add_meta_query( $args, array( // WPCS: slow query ok.
|
||||
'key' => '_stock_status',
|
||||
'value' => true === $request['in_stock'] ? 'instock' : 'outofstock',
|
||||
) );
|
||||
|
@ -485,7 +487,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
*/
|
||||
protected function get_attribute_options( $product_id, $attribute ) {
|
||||
if ( isset( $attribute['is_taxonomy'] ) && $attribute['is_taxonomy'] ) {
|
||||
return wc_get_product_terms( $product_id, $attribute['name'], array( 'fields' => 'names' ) );
|
||||
return wc_get_product_terms( $product_id, $attribute['name'], array(
|
||||
'fields' => 'names',
|
||||
) );
|
||||
} elseif ( isset( $attribute['value'] ) ) {
|
||||
return array_map( 'trim', explode( '|', $attribute['value'] ) );
|
||||
}
|
||||
|
@ -547,7 +551,8 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
* Get product data.
|
||||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param string $context 'view' or 'edit'
|
||||
* @param string $context Request context.
|
||||
* Options: 'view' and 'edit'.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_product_data( $product, $context = 'view' ) {
|
||||
|
@ -678,7 +683,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( 'variation' === $product->get_type() ) {
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
// Post title.
|
||||
|
@ -1060,6 +1067,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
}
|
||||
|
||||
if ( ! wp_attachment_is_image( $attachment_id ) ) {
|
||||
/* translators: %s: attachment id */
|
||||
throw new WC_REST_Exception( 'woocommerce_product_invalid_image_id', sprintf( __( '#%s is an invalid image ID.', 'woocommerce' ), $attachment_id ), 400 );
|
||||
}
|
||||
|
||||
|
@ -1076,7 +1084,15 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
// Set the image name if present.
|
||||
if ( ! empty( $image['name'] ) ) {
|
||||
wp_update_post( array( 'ID' => $attachment_id, 'post_title' => $image['name'] ) );
|
||||
wp_update_post( array(
|
||||
'ID' => $attachment_id,
|
||||
'post_title' => $image['name'],
|
||||
) );
|
||||
}
|
||||
|
||||
// Set the image source if present, for future reference.
|
||||
if ( ! empty( $image['src'] ) ) {
|
||||
update_post_meta( $attachment_id, '_wc_attachment_source', esc_url_raw( $image['src'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1268,11 +1284,15 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
$result = false;
|
||||
|
||||
if ( ! $object || 0 === $object->get_id() ) {
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'Invalid ID.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
if ( 'variation' === $object->get_type() ) {
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array( 'status' => 404 ) );
|
||||
return new WP_Error( "woocommerce_rest_invalid_{$this->post_type}_id", __( 'To manipulate product variations you should use the /products/<product_id>/variations/<id> endpoint.', 'woocommerce' ), array(
|
||||
'status' => 404,
|
||||
) );
|
||||
}
|
||||
|
||||
$supports_trash = EMPTY_TRASH_DAYS > 0 && is_callable( array( $object, 'get_status' ) );
|
||||
|
@ -1289,7 +1309,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
if ( ! wc_rest_check_post_permissions( $this->post_type, 'delete', $object->get_id() ) ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => rest_authorization_required_code(),
|
||||
) );
|
||||
}
|
||||
|
||||
$request->set_param( 'context', 'edit' );
|
||||
|
@ -1316,14 +1338,18 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
// If we don't support trashing for this type, error out.
|
||||
if ( ! $supports_trash ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array( 'status' => 501 ) );
|
||||
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 501,
|
||||
) );
|
||||
}
|
||||
|
||||
// Otherwise, only trash if we haven't already.
|
||||
if ( is_callable( array( $object, 'get_status' ) ) ) {
|
||||
if ( 'trash' === $object->get_status() ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 410 ) );
|
||||
return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 410,
|
||||
) );
|
||||
}
|
||||
|
||||
$object->delete();
|
||||
|
@ -1333,7 +1359,9 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
|
||||
if ( ! $result ) {
|
||||
/* translators: %s: post type */
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 500 ) );
|
||||
return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array(
|
||||
'status' => 500,
|
||||
) );
|
||||
}
|
||||
|
||||
// Delete parent product transients.
|
||||
|
@ -1396,7 +1424,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_created_gmt' => array(
|
||||
'description' => __( "The date the product was created, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the product was created, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1408,7 +1436,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_modified_gmt' => array(
|
||||
'description' => __( "The date the product was last modified, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the product was last modified, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1487,7 +1515,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to_gmt' => array(
|
||||
'description' => __( "End date of sale price, in the site's timezone.", 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
@ -1810,7 +1838,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_created_gmt' => array(
|
||||
'description' => __( "The date the image was created, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the image was created, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
@ -1822,7 +1850,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
'readonly' => true,
|
||||
),
|
||||
'date_modified_gmt' => array(
|
||||
'description' => __( "The date the image was last modified, as GMT.", 'woocommerce' ),
|
||||
'description' => __( 'The date the image was last modified, as GMT.', 'woocommerce' ),
|
||||
'type' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'readonly' => true,
|
||||
|
|
|
@ -836,7 +836,11 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
|
|||
$outdated_templates = false;
|
||||
$scan_files = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates/' );
|
||||
foreach ( $scan_files as $file ) {
|
||||
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$located = apply_filters( 'wc_get_template', $file, $file, array(), WC()->template_path(), WC()->plugin_path() . '/templates/' );
|
||||
|
||||
if ( file_exists( $located ) ) {
|
||||
$theme_file = $located;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . $file;
|
||||
} elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
|
||||
$theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
|
||||
|
|
|
@ -1076,10 +1076,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1566,10 +1566,11 @@ class WC_API_Products extends WC_API_Resource {
|
|||
|
||||
$product->set_date_on_sale_to( $date_to );
|
||||
$product->set_date_on_sale_from( $date_from );
|
||||
|
||||
if ( $product->is_on_sale() ) {
|
||||
$product->set_price( $product->get_sale_price() );
|
||||
$product->set_price( $product->get_sale_price( 'edit' ) );
|
||||
} else {
|
||||
$product->set_price( $product->get_regular_price() );
|
||||
$product->set_price( $product->get_regular_price( 'edit' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
/**
|
||||
* Prepare a single product category output for response.
|
||||
*
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_REST_Response $response
|
||||
* @param WP_Term $item Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return WP_REST_Response
|
||||
*/
|
||||
public function prepare_item_for_response( $item, $request ) {
|
||||
// Get category display type.
|
||||
|
@ -64,13 +64,14 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
'parent' => (int) $item->parent,
|
||||
'description' => $item->description,
|
||||
'display' => $display_type ? $display_type : 'default',
|
||||
'image' => array(),
|
||||
'image' => null,
|
||||
'menu_order' => (int) $menu_order,
|
||||
'count' => (int) $item->count,
|
||||
);
|
||||
|
||||
// Get category image.
|
||||
if ( $image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' ) ) {
|
||||
$image_id = get_woocommerce_term_meta( $item->term_id, 'thumbnail_id' );
|
||||
if ( $image_id ) {
|
||||
$attachment = get_post( $image_id );
|
||||
|
||||
$data['image'] = array(
|
||||
|
@ -106,8 +107,8 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
/**
|
||||
* Update term meta fields.
|
||||
*
|
||||
* @param WP_Term $term
|
||||
* @param WP_REST_Request $request
|
||||
* @param WP_Term $term Term object.
|
||||
* @param WP_REST_Request $request Request instance.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
protected function update_term_meta_fields( $term, $request ) {
|
||||
|
@ -145,7 +146,10 @@ class WC_REST_Product_Categories_V1_Controller extends WC_REST_Terms_Controller
|
|||
|
||||
// Set the image title.
|
||||
if ( ! empty( $request['image']['title'] ) ) {
|
||||
wp_update_post( array( 'ID' => $image_id, 'post_title' => wc_clean( $request['image']['title'] ) ) );
|
||||
wp_update_post( array(
|
||||
'ID' => $image_id,
|
||||
'post_title' => wc_clean( $request['image']['title'] ),
|
||||
) );
|
||||
}
|
||||
} else {
|
||||
delete_woocommerce_term_meta( $id, 'thumbnail_id' );
|
||||
|
|
|
@ -1829,7 +1829,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to' => array(
|
||||
'description' => __( 'End data of sale price.', 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
@ -2314,7 +2314,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'date_on_sale_to' => array(
|
||||
'description' => __( 'End data of sale price.', 'woocommerce' ),
|
||||
'description' => __( 'End date of sale price.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
|
|
|
@ -32,7 +32,7 @@ class WC_AJAX {
|
|||
* @return string
|
||||
*/
|
||||
public static function get_endpoint( $request = '' ) {
|
||||
return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ) ) ), $request ) );
|
||||
return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), home_url( '/' ) ) ), $request ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -773,11 +773,20 @@ class WC_AJAX {
|
|||
$order_id = absint( $_POST['order_id'] );
|
||||
$order = wc_get_order( $order_id );
|
||||
$items_to_add = wp_parse_id_list( is_array( $_POST['item_to_add'] ) ? $_POST['item_to_add'] : array( $_POST['item_to_add'] ) );
|
||||
$items = ( ! empty( $_POST['items'] ) ) ? $_POST['items'] : '';
|
||||
|
||||
if ( ! $order ) {
|
||||
throw new Exception( __( 'Invalid order', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// If we passed through items it means we need to save first before adding a new one.
|
||||
if ( ! empty( $items ) ) {
|
||||
$save_items = array();
|
||||
parse_str( $items, $save_items );
|
||||
// Save order items.
|
||||
wc_save_order_items( $order->get_id(), $save_items );
|
||||
}
|
||||
|
||||
foreach ( $items_to_add as $item_to_add ) {
|
||||
if ( ! in_array( get_post_type( $item_to_add ), array( 'product', 'product_variation' ) ) ) {
|
||||
continue;
|
||||
|
@ -985,11 +994,20 @@ class WC_AJAX {
|
|||
try {
|
||||
$order_id = absint( $_POST['order_id'] );
|
||||
$order_item_ids = $_POST['order_item_ids'];
|
||||
$items = ( ! empty( $_POST['items'] ) ) ? $_POST['items'] : '';
|
||||
|
||||
if ( ! is_array( $order_item_ids ) && is_numeric( $order_item_ids ) ) {
|
||||
$order_item_ids = array( $order_item_ids );
|
||||
}
|
||||
|
||||
// If we passed through items it means we need to save first before deleting.
|
||||
if ( ! empty( $items ) ) {
|
||||
$save_items = array();
|
||||
parse_str( $items, $save_items );
|
||||
// Save order items
|
||||
wc_save_order_items( $order_id, $save_items );
|
||||
}
|
||||
|
||||
if ( sizeof( $order_item_ids ) > 0 ) {
|
||||
foreach ( $order_item_ids as $id ) {
|
||||
wc_delete_order_item( absint( $id ) );
|
||||
|
@ -1521,6 +1539,8 @@ class WC_AJAX {
|
|||
|
||||
/**
|
||||
* Handle a refund via the edit order screen.
|
||||
*
|
||||
* @throws Exception To return errors.
|
||||
*/
|
||||
public static function refund_line_items() {
|
||||
ob_start();
|
||||
|
@ -1533,6 +1553,7 @@ class WC_AJAX {
|
|||
|
||||
$order_id = absint( $_POST['order_id'] );
|
||||
$refund_amount = wc_format_decimal( sanitize_text_field( $_POST['refund_amount'] ), wc_get_price_decimals() );
|
||||
$refunded_amount = wc_format_decimal( sanitize_text_field( $_POST['refunded_amount'] ), wc_get_price_decimals() );
|
||||
$refund_reason = sanitize_text_field( $_POST['refund_reason'] );
|
||||
$line_item_qtys = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_qtys'] ) ), true );
|
||||
$line_item_totals = json_decode( sanitize_text_field( stripslashes( $_POST['line_item_totals'] ) ), true );
|
||||
|
@ -1551,7 +1572,11 @@ class WC_AJAX {
|
|||
throw new exception( __( 'Invalid refund amount', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// Prepare line items which we are refunding
|
||||
if ( $refunded_amount !== wc_format_decimal( $order->get_total_refunded(), wc_get_price_decimals() ) ) {
|
||||
throw new exception( __( 'Error processing refund. Please try again.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
// Prepare line items which we are refunding.
|
||||
$line_items = array();
|
||||
$item_ids = array_unique( array_merge( array_keys( $line_item_qtys, $line_item_totals ) ) );
|
||||
|
||||
|
@ -2234,18 +2259,15 @@ class WC_AJAX {
|
|||
'tax_rate_order' => 1,
|
||||
) );
|
||||
|
||||
// Format the rate.
|
||||
$tax_rate['tax_rate'] = wc_format_decimal( $tax_rate['tax_rate'] );
|
||||
if ( isset( $tax_rate['tax_rate'] ) ) {
|
||||
$tax_rate['tax_rate'] = wc_format_decimal( $tax_rate['tax_rate'] );
|
||||
}
|
||||
|
||||
if ( isset( $data['newRow'] ) ) {
|
||||
// Hurrah, shiny and new!
|
||||
$tax_rate['tax_rate_class'] = $current_class;
|
||||
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
|
||||
} else {
|
||||
// Updating an existing rate ...
|
||||
if ( ! empty( $tax_rate ) ) {
|
||||
WC_Tax::_update_tax_rate( $tax_rate_id, $tax_rate );
|
||||
}
|
||||
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
|
||||
} elseif ( ! empty( $tax_rate ) ) {
|
||||
WC_Tax::_update_tax_rate( $tax_rate_id, $tax_rate );
|
||||
}
|
||||
|
||||
if ( isset( $data['postcode'] ) ) {
|
||||
|
|
|
@ -14,10 +14,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* API class.
|
||||
*/
|
||||
class WC_API extends WC_Legacy_API {
|
||||
|
||||
/**
|
||||
* Setup class.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
@ -43,7 +47,7 @@ class WC_API extends WC_Legacy_API {
|
|||
* Add new query vars.
|
||||
*
|
||||
* @since 2.0
|
||||
* @param array $vars
|
||||
* @param array $vars Query vars.
|
||||
* @return string[]
|
||||
*/
|
||||
public function add_query_vars( $vars ) {
|
||||
|
@ -54,6 +58,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* WC API for payment gateway IPNs, etc.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
public static function add_endpoint() {
|
||||
|
@ -70,8 +75,8 @@ class WC_API extends WC_Legacy_API {
|
|||
public function handle_api_requests() {
|
||||
global $wp;
|
||||
|
||||
if ( ! empty( $_GET['wc-api'] ) ) {
|
||||
$wp->query_vars['wc-api'] = $_GET['wc-api'];
|
||||
if ( ! empty( $_GET['wc-api'] ) ) { // WPCS: input var okay, CSRF ok.
|
||||
$wp->query_vars['wc-api'] = sanitize_key( wp_unslash( $_GET['wc-api'] ) ); // WPCS: input var okay, CSRF ok.
|
||||
}
|
||||
|
||||
// wc-api endpoint requests.
|
||||
|
@ -84,7 +89,7 @@ class WC_API extends WC_Legacy_API {
|
|||
nocache_headers();
|
||||
|
||||
// Clean the API request.
|
||||
$api_request = strtolower( wc_clean( $wp->query_vars['wc-api'] ) );
|
||||
$api_request = $wp->query_vars['wc-api'];
|
||||
|
||||
// Trigger generic action before request hook.
|
||||
do_action( 'woocommerce_api_request', $api_request );
|
||||
|
@ -103,6 +108,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Init WP REST API.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
private function rest_api_init() {
|
||||
|
@ -129,12 +135,6 @@ class WC_API extends WC_Legacy_API {
|
|||
// Authentication.
|
||||
include_once( dirname( __FILE__ ) . '/api/class-wc-rest-authentication.php' );
|
||||
|
||||
// WP-API classes and functions.
|
||||
include_once( dirname( __FILE__ ) . '/vendor/wp-rest-functions.php' );
|
||||
if ( ! class_exists( 'WP_REST_Controller' ) ) {
|
||||
include_once( dirname( __FILE__ ) . '/vendor/abstract-wp-rest-controller.php' );
|
||||
}
|
||||
|
||||
// Abstract controllers.
|
||||
include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-controller.php' );
|
||||
include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-posts-controller.php' );
|
||||
|
@ -205,6 +205,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Register REST API routes.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
public function register_rest_routes() {
|
||||
|
@ -275,6 +276,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Register WC settings from WP-API to the REST API.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function register_wp_admin_settings() {
|
||||
|
|
|
@ -21,7 +21,6 @@ class WC_Cache_Helper {
|
|||
public static function init() {
|
||||
add_action( 'template_redirect', array( __CLASS__, 'geolocation_ajax_redirect' ) );
|
||||
add_action( 'wp', array( __CLASS__, 'prevent_caching' ) );
|
||||
add_filter( 'nocache_headers', array( __CLASS__, 'set_nocache_constants' ) );
|
||||
add_action( 'admin_notices', array( __CLASS__, 'notices' ) );
|
||||
add_action( 'delete_version_transients', array( __CLASS__, 'delete_version_transients' ) );
|
||||
}
|
||||
|
@ -159,6 +158,7 @@ class WC_Cache_Helper {
|
|||
$page_ids = array_filter( array( wc_get_page_id( 'cart' ), wc_get_page_id( 'checkout' ), wc_get_page_id( 'myaccount' ) ) );
|
||||
|
||||
if ( isset( $_GET['download_file'] ) || isset( $_GET['add-to-cart'] ) || is_page( $page_ids ) ) {
|
||||
add_filter( 'nocache_headers', array( __CLASS__, 'set_nocache_constants' ) );
|
||||
nocache_headers();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ final class WC_Cart_Fees {
|
|||
* Reference to cart object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @var array
|
||||
* @var WC_Cart
|
||||
*/
|
||||
private $cart;
|
||||
|
||||
|
@ -54,9 +54,14 @@ final class WC_Cart_Fees {
|
|||
* Constructor. Reference to the cart.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param object $cart Cart object.
|
||||
* @throws Exception If missing WC_Cart object.
|
||||
* @param WC_Cart $cart Cart object.
|
||||
*/
|
||||
public function __construct( &$cart = null ) {
|
||||
public function __construct( &$cart ) {
|
||||
if ( ! is_a( $cart, 'WC_Cart' ) ) {
|
||||
throw new Exception( 'A valid WC_Cart object is required' );
|
||||
}
|
||||
|
||||
$this->cart = $cart;
|
||||
add_action( 'woocommerce_cart_emptied', array( $this, 'remove_all_fees' ) );
|
||||
add_action( 'woocommerce_cart_reset', array( $this, 'remove_all_fees' ) );
|
||||
|
@ -72,7 +77,7 @@ final class WC_Cart_Fees {
|
|||
public function add_fee( $args = array() ) {
|
||||
$fee_props = (object) wp_parse_args( $args, $this->default_fee_props );
|
||||
$fee_props->name = $fee_props->name ? $fee_props->name : __( 'Fee', 'woocommerce' );
|
||||
$fee_props->tax_class = in_array( $fee_props->tax_class, WC_Tax::get_tax_classes(), true ) ? $fee_props->tax_class: '';
|
||||
$fee_props->tax_class = in_array( $fee_props->tax_class, array_merge( WC_Tax::get_tax_classes(), WC_Tax::get_tax_class_slugs() ), true ) ? $fee_props->tax_class: '';
|
||||
$fee_props->taxable = wc_string_to_bool( $fee_props->taxable );
|
||||
$fee_props->amount = wc_format_decimal( $fee_props->amount );
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ final class WC_Cart_Session {
|
|||
* Reference to cart object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @var array
|
||||
* @var WC_Cart
|
||||
*/
|
||||
protected $cart;
|
||||
|
||||
|
@ -29,9 +29,14 @@ final class WC_Cart_Session {
|
|||
* Sets up the items provided, and calculate totals.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param object $cart Cart object to calculate totals for.
|
||||
* @throws Exception If missing WC_Cart object.
|
||||
* @param WC_Cart $cart Cart object to calculate totals for.
|
||||
*/
|
||||
public function __construct( &$cart = null ) {
|
||||
public function __construct( &$cart ) {
|
||||
if ( ! is_a( $cart, 'WC_Cart' ) ) {
|
||||
throw new Exception( 'A valid WC_Cart object is required' );
|
||||
}
|
||||
|
||||
$this->cart = $cart;
|
||||
|
||||
add_action( 'wp_loaded', array( $this, 'get_cart_from_session' ) );
|
||||
|
|
|
@ -24,7 +24,7 @@ final class WC_Cart_Totals {
|
|||
* Reference to cart object.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @var array
|
||||
* @var WC_Cart
|
||||
*/
|
||||
protected $cart;
|
||||
|
||||
|
@ -114,14 +114,17 @@ final class WC_Cart_Totals {
|
|||
* Sets up the items provided, and calculate totals.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param object $cart Cart object to calculate totals for.
|
||||
* @throws Exception If missing WC_Cart object.
|
||||
* @param WC_Cart $cart Cart object to calculate totals for.
|
||||
*/
|
||||
public function __construct( &$cart = null ) {
|
||||
if ( is_a( $cart, 'WC_Cart' ) ) {
|
||||
$this->cart = $cart;
|
||||
$this->calculate_tax = wc_tax_enabled() && ! $cart->get_customer()->get_is_vat_exempt();
|
||||
$this->calculate();
|
||||
if ( ! is_a( $cart, 'WC_Cart' ) ) {
|
||||
throw new Exception( 'A valid WC_Cart object is required' );
|
||||
}
|
||||
|
||||
$this->cart = $cart;
|
||||
$this->calculate_tax = wc_tax_enabled() && ! $cart->get_customer()->get_is_vat_exempt();
|
||||
$this->calculate();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -310,6 +313,8 @@ final class WC_Cart_Totals {
|
|||
}
|
||||
}
|
||||
|
||||
$fee->taxes = apply_filters( 'woocommerce_cart_totals_get_fees_from_cart_taxes', $fee->taxes, $fee, $this );
|
||||
|
||||
$fee->total_tax = array_sum( $fee->taxes );
|
||||
|
||||
if ( ! $this->round_at_subtotal() ) {
|
||||
|
@ -333,6 +338,10 @@ final class WC_Cart_Totals {
|
|||
protected function get_shipping_from_cart() {
|
||||
$this->shipping = array();
|
||||
|
||||
if ( ! $this->cart->show_shipping() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->cart->calculate_shipping() as $key => $shipping_object ) {
|
||||
$shipping_line = $this->get_default_shipping_props();
|
||||
$shipping_line->object = $shipping_object;
|
||||
|
@ -405,6 +414,27 @@ final class WC_Cart_Totals {
|
|||
return ( $a->sort < $b->sort ) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ran to remove all base taxes from an item. Used when prices include tax, and the customer is tax exempt.
|
||||
*
|
||||
* @since 3.2.2
|
||||
* @param object $item Item to adjust the prices of.
|
||||
* @return object
|
||||
*/
|
||||
protected function remove_item_base_taxes( $item ) {
|
||||
if ( $item->price_includes_tax ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
|
||||
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only ran if woocommerce_adjust_non_base_location_prices is true.
|
||||
*
|
||||
|
@ -418,15 +448,17 @@ final class WC_Cart_Totals {
|
|||
* @return object
|
||||
*/
|
||||
protected function adjust_non_base_location_price( $item ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'edit' ) );
|
||||
if ( $item->price_includes_tax ) {
|
||||
$base_tax_rates = WC_Tax::get_base_tax_rates( $item->product->get_tax_class( 'unfiltered' ) );
|
||||
|
||||
if ( $item->tax_rates !== $base_tax_rates ) {
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
if ( $item->tax_rates !== $base_tax_rates ) {
|
||||
// Work out a new base price without the shop's base tax.
|
||||
$taxes = WC_Tax::calc_tax( $item->subtotal, $base_tax_rates, true, true );
|
||||
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
// Now we have a new item price (excluding TAX).
|
||||
$item->subtotal = $item->subtotal - array_sum( $taxes );
|
||||
$item->price_includes_tax = false;
|
||||
}
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
@ -650,8 +682,12 @@ final class WC_Cart_Totals {
|
|||
*/
|
||||
protected function calculate_item_subtotals() {
|
||||
foreach ( $this->items as $item_key => $item ) {
|
||||
if ( $item->price_includes_tax && apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||
$item = $this->adjust_non_base_location_price( $item );
|
||||
if ( $item->price_includes_tax ) {
|
||||
if ( $this->cart->get_customer()->get_is_vat_exempt() ) {
|
||||
$item = $this->remove_item_base_taxes( $item );
|
||||
} elseif ( apply_filters( 'woocommerce_adjust_non_base_location_prices', true ) ) {
|
||||
$item = $this->adjust_non_base_location_price( $item );
|
||||
}
|
||||
}
|
||||
|
||||
$subtotal_taxes = array();
|
||||
|
@ -721,11 +757,20 @@ final class WC_Cart_Totals {
|
|||
$this->coupon_discount_totals = (array) $discounts->get_discounts_by_item( true );
|
||||
$this->coupon_discount_tax_totals = $coupon_discount_tax_amounts;
|
||||
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
if ( wc_prices_include_tax() ) {
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) - array_sum( $this->coupon_discount_tax_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
} else {
|
||||
$this->set_total( 'discounts_total', array_sum( $this->coupon_discount_totals ) );
|
||||
$this->set_total( 'discounts_tax_total', array_sum( $this->coupon_discount_tax_totals ) );
|
||||
}
|
||||
|
||||
$this->cart->set_coupon_discount_totals( wc_remove_number_precision_deep( $coupon_discount_amounts ) );
|
||||
$this->cart->set_coupon_discount_tax_totals( wc_remove_number_precision_deep( $coupon_discount_tax_amounts ) );
|
||||
|
||||
// Add totals to cart object. Note: Discount total for cart is excl tax.
|
||||
$this->cart->set_discount_total( $this->get_total( 'discounts_total' ) );
|
||||
$this->cart->set_discount_tax( $this->get_total( 'discounts_tax_total' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -769,10 +814,6 @@ final class WC_Cart_Totals {
|
|||
*/
|
||||
protected function calculate_totals() {
|
||||
$this->set_total( 'total', round( $this->get_total( 'items_total', true ) + $this->get_total( 'fees_total', true ) + $this->get_total( 'shipping_total', true ) + array_sum( $this->get_merged_taxes( true ) ) ) );
|
||||
|
||||
// Add totals to cart object.
|
||||
$this->cart->set_discount_total( $this->get_total( 'discounts_total' ) );
|
||||
$this->cart->set_discount_tax( $this->get_total( 'discounts_tax_total' ) );
|
||||
$this->cart->set_total_tax( array_sum( $this->get_merged_taxes( false ) ) );
|
||||
|
||||
// Allow plugins to hook and alter totals before final total is calculated.
|
||||
|
|
|
@ -1495,9 +1495,11 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
$users_query = new WP_User_Query( array(
|
||||
'fields' => 'ID',
|
||||
'meta_query' => array(
|
||||
'key' => '_billing_email',
|
||||
'value' => $check_emails,
|
||||
'compare' => 'IN',
|
||||
array(
|
||||
'key' => '_billing_email',
|
||||
'value' => $check_emails,
|
||||
'compare' => 'IN',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
|
@ -1754,9 +1756,8 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
public function get_fees() {
|
||||
$fees = $this->fees_api()->get_fees();
|
||||
|
||||
if ( ! empty( $this->fees ) ) {
|
||||
wc_deprecated_function( 'WC_Cart->fees', '3.2', sprintf( 'Fees should only be added through the Fees API (%s)', 'WC_Cart::add_fee()' ) );
|
||||
$fees = $fees + $this->fees;
|
||||
if ( property_exists( $this, 'fees' ) ) {
|
||||
$fees = $fees + (array) $this->fees;
|
||||
}
|
||||
return $fees;
|
||||
}
|
||||
|
|
|
@ -1149,7 +1149,7 @@ class WC_Countries {
|
|||
'label' => __( 'Phone', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'type' => 'tel',
|
||||
'class' => array( 'form-row-first' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
'validate' => array( 'phone' ),
|
||||
'autocomplete' => 'tel',
|
||||
'priority' => 100,
|
||||
|
@ -1158,7 +1158,7 @@ class WC_Countries {
|
|||
'label' => __( 'Email address', 'woocommerce' ),
|
||||
'required' => true,
|
||||
'type' => 'email',
|
||||
'class' => array( 'form-row-last' ),
|
||||
'class' => array( 'form-row-wide' ),
|
||||
'validate' => array( 'email' ),
|
||||
'autocomplete' => 'no' === get_option( 'woocommerce_registration_generate_username' ) ? 'email' : 'email username',
|
||||
'priority' => 110,
|
||||
|
|
|
@ -11,12 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
class WC_Deprecated_Action_Hooks extends WC_Deprecated_Hooks {
|
||||
|
||||
/**
|
||||
* Array of deprecated hooks we need to handle.
|
||||
* Array of deprecated hooks we need to handle. Format of 'new' => 'old'.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $deprecated_hooks = array(
|
||||
'woocommerce_new_order_item' => array(
|
||||
'woocommerce_new_order_item' => array(
|
||||
'woocommerce_order_add_shipping',
|
||||
'woocommerce_order_add_coupon',
|
||||
'woocommerce_order_add_tax',
|
||||
|
@ -25,15 +25,16 @@ class WC_Deprecated_Action_Hooks extends WC_Deprecated_Hooks {
|
|||
'woocommerce_add_order_item_meta',
|
||||
'woocommerce_add_order_fee_meta',
|
||||
),
|
||||
'woocommerce_update_order_item' => array(
|
||||
'woocommerce_update_order_item' => array(
|
||||
'woocommerce_order_edit_product',
|
||||
'woocommerce_order_update_coupon',
|
||||
'woocommerce_order_update_shipping',
|
||||
'woocommerce_order_update_fee',
|
||||
'woocommerce_order_update_tax',
|
||||
),
|
||||
'woocommerce_new_payment_token' => 'woocommerce_payment_token_created',
|
||||
'woocommerce_new_product_variation' => 'woocommerce_create_product_variation',
|
||||
'woocommerce_new_payment_token' => 'woocommerce_payment_token_created',
|
||||
'woocommerce_new_product_variation' => 'woocommerce_create_product_variation',
|
||||
'woocommerce_order_details_after_order_table_items' => 'woocommerce_order_items_table'
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,12 +45,10 @@ class WC_Discounts {
|
|||
* @param array $object Cart or order object.
|
||||
*/
|
||||
public function __construct( $object = array() ) {
|
||||
$this->object = $object;
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) ) {
|
||||
$this->set_items_from_cart( $this->object );
|
||||
} elseif ( is_a( $this->object, 'WC_Order' ) ) {
|
||||
$this->set_items_from_order( $this->object );
|
||||
if ( is_a( $object, 'WC_Cart' ) ) {
|
||||
$this->set_items_from_cart( $object );
|
||||
} elseif ( is_a( $object, 'WC_Order' ) ) {
|
||||
$this->set_items_from_order( $object );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +56,7 @@ class WC_Discounts {
|
|||
* Normalise cart items which will be discounted.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param array $cart Cart object.
|
||||
* @param WC_Cart $cart Cart object.
|
||||
*/
|
||||
public function set_items_from_cart( $cart ) {
|
||||
$this->items = $this->discounts = array();
|
||||
|
@ -67,6 +65,8 @@ class WC_Discounts {
|
|||
return;
|
||||
}
|
||||
|
||||
$this->object = $cart;
|
||||
|
||||
foreach ( $cart->get_cart() as $key => $cart_item ) {
|
||||
$item = new stdClass();
|
||||
$item->key = $key;
|
||||
|
@ -87,12 +87,14 @@ class WC_Discounts {
|
|||
* @param array $order Cart object.
|
||||
*/
|
||||
public function set_items_from_order( $order ) {
|
||||
$this->items = $this->discounts = array();
|
||||
$this->items = $this->discounts = array();
|
||||
|
||||
if ( ! is_a( $order, 'WC_Order' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->object = $order;
|
||||
|
||||
foreach ( $order->get_items() as $order_item ) {
|
||||
$item = new stdClass();
|
||||
$item->key = $order_item->get_id();
|
||||
|
@ -242,7 +244,7 @@ class WC_Discounts {
|
|||
foreach ( $items_to_apply as $item ) {
|
||||
$discounted_price = $this->get_discounted_price_in_cents( $item );
|
||||
$price_to_discount = wc_remove_number_precision( ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price );
|
||||
$discount = wc_add_number_precision( $coupon->get_discount_amount( $price_to_discount, $item->object ) ) * $item->quantity;
|
||||
$discount = wc_add_number_precision( $coupon->get_discount_amount( $price_to_discount / $item->quantity, $item->object, true ) ) * $item->quantity;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
|
||||
// Store code and discount amount per item.
|
||||
|
@ -292,39 +294,19 @@ class WC_Discounts {
|
|||
*/
|
||||
protected function get_items_to_apply_coupon( $coupon ) {
|
||||
$items_to_apply = array();
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
foreach ( $this->items as $item ) {
|
||||
$item_to_apply = clone $item; // Clone the item so changes to this item do not affect the originals.
|
||||
|
||||
if ( 0 === $this->get_discounted_price_in_cents( $item_to_apply ) ) {
|
||||
if ( 0 === $this->get_discounted_price_in_cents( $item_to_apply ) || 0 >= $item_to_apply->quantity ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $coupon->is_valid_for_product( $item_to_apply->product, $item_to_apply->object ) && ! $coupon->is_valid_for_cart() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $limit_usage_qty && $applied_count >= $limit_usage_qty ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $limit_usage_qty && $item_to_apply->quantity > ( $limit_usage_qty - $applied_count ) ) {
|
||||
$limit_to_qty = absint( $limit_usage_qty - $applied_count );
|
||||
|
||||
// Lower the qty and cost so the discount is applied less.
|
||||
$item_to_apply->price = ( $item_to_apply->price / $item_to_apply->quantity ) * $limit_to_qty;
|
||||
$item_to_apply->quantity = $limit_to_qty;
|
||||
}
|
||||
if ( 0 >= $item_to_apply->quantity ) {
|
||||
continue;
|
||||
}
|
||||
$items_to_apply[] = $item_to_apply;
|
||||
$applied_count += $item_to_apply->quantity;
|
||||
}
|
||||
return $items_to_apply;
|
||||
}
|
||||
|
@ -338,8 +320,15 @@ class WC_Discounts {
|
|||
* @return int Total discounted.
|
||||
*/
|
||||
protected function apply_coupon_percent( $coupon, $items_to_apply ) {
|
||||
$total_discount = 0;
|
||||
$cart_total = 0;
|
||||
$total_discount = 0;
|
||||
$cart_total = 0;
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
$adjust_final_discount = true;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
// Because get_amount() could return an empty string, let's be sure to set our local variable to a known good value.
|
||||
$coupon_amount = ( '' === $coupon->get_amount() ) ? 0 : $coupon->get_amount();
|
||||
|
@ -351,20 +340,27 @@ class WC_Discounts {
|
|||
// Get the price we actually want to discount, based on settings.
|
||||
$price_to_discount = ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price;
|
||||
|
||||
// Total up.
|
||||
$cart_total += $price_to_discount;
|
||||
// See how many and what price to apply to.
|
||||
$apply_quantity = max( 0, ( $limit_usage_qty && ( $limit_usage_qty - $applied_count ) < $item->quantity ? $limit_usage_qty - $applied_count : $item->quantity ) );
|
||||
$price_to_discount = ( $price_to_discount / $item->quantity ) * $apply_quantity;
|
||||
|
||||
// Run coupon calculations.
|
||||
$discount = floor( $price_to_discount * ( $coupon_amount / 100 ) );
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) && has_filter( 'woocommerce_coupon_get_discount_amount' ) ) {
|
||||
// Send through the legacy filter, but not as cents.
|
||||
$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
$filtered_discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
|
||||
if ( $filtered_discount !== $discount ) {
|
||||
$discount = $filtered_discount;
|
||||
$adjust_final_discount = false;
|
||||
}
|
||||
}
|
||||
|
||||
$discount = min( $discounted_price, $discount );
|
||||
|
||||
$total_discount += $discount;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$cart_total = $cart_total + $price_to_discount;
|
||||
$total_discount = $total_discount + $discount;
|
||||
$applied_count = $applied_count + $apply_quantity;
|
||||
|
||||
// Store code and discount amount per item.
|
||||
$this->discounts[ $coupon->get_code() ][ $item->key ] += $discount;
|
||||
|
@ -373,7 +369,7 @@ class WC_Discounts {
|
|||
// Work out how much discount would have been given to the cart as a whole and compare to what was discounted on all line items.
|
||||
$cart_total_discount = wc_cart_round_discount( $cart_total * ( $coupon_amount / 100 ), 0 );
|
||||
|
||||
if ( $total_discount < $cart_total_discount ) {
|
||||
if ( $total_discount < $cart_total_discount && $adjust_final_discount ) {
|
||||
$total_discount += $this->apply_coupon_remainder( $coupon, $items_to_apply, $cart_total_discount - $total_discount );
|
||||
}
|
||||
|
||||
|
@ -390,8 +386,14 @@ class WC_Discounts {
|
|||
* @return int Total discounted.
|
||||
*/
|
||||
protected function apply_coupon_fixed_product( $coupon, $items_to_apply, $amount = null ) {
|
||||
$total_discount = 0;
|
||||
$amount = $amount ? $amount : wc_add_number_precision( $coupon->get_amount() );
|
||||
$total_discount = 0;
|
||||
$amount = $amount ? $amount: wc_add_number_precision( $coupon->get_amount() );
|
||||
$limit_usage_qty = 0;
|
||||
$applied_count = 0;
|
||||
|
||||
if ( null !== $coupon->get_limit_usage_to_x_items() ) {
|
||||
$limit_usage_qty = $coupon->get_limit_usage_to_x_items();
|
||||
}
|
||||
|
||||
foreach ( $items_to_apply as $item ) {
|
||||
// Find out how much price is available to discount for the item.
|
||||
|
@ -401,15 +403,22 @@ class WC_Discounts {
|
|||
$price_to_discount = ( 'yes' === get_option( 'woocommerce_calc_discounts_sequentially', 'no' ) ) ? $discounted_price : $item->price;
|
||||
|
||||
// Run coupon calculations.
|
||||
$discount = $amount * $item->quantity;
|
||||
if ( $limit_usage_qty ) {
|
||||
$apply_quantity = max( 0, ( $limit_usage_qty - $applied_count < $item->quantity ? $limit_usage_qty - $applied_count: $item->quantity ) );
|
||||
$discount = min( $amount, $item->price / $item->quantity ) * $apply_quantity;
|
||||
} else {
|
||||
$apply_quantity = $item->quantity;
|
||||
$discount = $amount * $apply_quantity;
|
||||
}
|
||||
|
||||
if ( is_a( $this->object, 'WC_Cart' ) && has_filter( 'woocommerce_coupon_get_discount_amount' ) ) {
|
||||
// Send through the legacy filter, but not as cents.
|
||||
$discount = wc_add_number_precision( apply_filters( 'woocommerce_coupon_get_discount_amount', wc_remove_number_precision( $discount ), wc_remove_number_precision( $price_to_discount ), $item->object, false, $coupon ) );
|
||||
}
|
||||
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$total_discount += $discount;
|
||||
$discount = min( $discounted_price, $discount );
|
||||
$total_discount = $total_discount + $discount;
|
||||
$applied_count = $applied_count + $apply_quantity;
|
||||
|
||||
// Store code and discount amount per item.
|
||||
$this->discounts[ $coupon->get_code() ][ $item->key ] += $discount;
|
||||
|
@ -665,6 +674,10 @@ class WC_Discounts {
|
|||
|
||||
$product_cats = wc_get_product_cat_ids( $item->product->get_id() );
|
||||
|
||||
if ( $item->product->get_parent_id() ) {
|
||||
$product_cats = array_merge( $product_cats, wc_get_product_cat_ids( $item->product->get_parent_id() ) );
|
||||
}
|
||||
|
||||
// If we find an item with a cat in our allowed cat list, the coupon is valid.
|
||||
if ( count( array_intersect( $product_cats, $coupon->get_product_categories() ) ) > 0 ) {
|
||||
$valid = true;
|
||||
|
@ -797,6 +810,11 @@ class WC_Discounts {
|
|||
}
|
||||
|
||||
$product_cats = wc_get_product_cat_ids( $item->product->get_id() );
|
||||
|
||||
if ( $item->product->get_parent_id() ) {
|
||||
$product_cats = array_merge( $product_cats, wc_get_product_cat_ids( $item->product->get_parent_id() ) );
|
||||
}
|
||||
|
||||
$cat_id_list = array_intersect( $product_cats, $coupon->get_excluded_product_categories() );
|
||||
if ( count( $cat_id_list ) > 0 ) {
|
||||
foreach ( $cat_id_list as $cat_id ) {
|
||||
|
|
|
@ -928,11 +928,11 @@ class WC_Form_Handler {
|
|||
|
||||
try {
|
||||
$creds = array(
|
||||
'user_login' => trim( $_POST['username'] ),
|
||||
'user_password' => $_POST['password'],
|
||||
'remember' => isset( $_POST['rememberme'] ),
|
||||
);
|
||||
|
||||
$username = trim( $_POST['username'] );
|
||||
$validation_error = new WP_Error();
|
||||
$validation_error = apply_filters( 'woocommerce_process_login_errors', $validation_error, $_POST['username'], $_POST['password'] );
|
||||
|
||||
|
@ -940,29 +940,13 @@ class WC_Form_Handler {
|
|||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . $validation_error->get_error_message() );
|
||||
}
|
||||
|
||||
if ( empty( $username ) ) {
|
||||
if ( empty( $creds['user_login'] ) ) {
|
||||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . __( 'Username is required.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
if ( is_email( $username ) && apply_filters( 'woocommerce_get_username_from_email', true ) ) {
|
||||
$user = get_user_by( 'email', $username );
|
||||
|
||||
if ( ! $user ) {
|
||||
$user = get_user_by( 'login', $username );
|
||||
}
|
||||
|
||||
if ( isset( $user->user_login ) ) {
|
||||
$creds['user_login'] = $user->user_login;
|
||||
} else {
|
||||
throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . __( 'A user could not be found with this email address.', 'woocommerce' ) );
|
||||
}
|
||||
} else {
|
||||
$creds['user_login'] = $username;
|
||||
}
|
||||
|
||||
// On multisite, ensure user exists on current site, if not add them before allowing login.
|
||||
if ( is_multisite() ) {
|
||||
$user_data = get_user_by( 'login', $username );
|
||||
$user_data = get_user_by( is_email( $creds['user_login'] ) ? 'email' : 'login', $creds['user_login'] );
|
||||
|
||||
if ( $user_data && ! is_user_member_of_blog( $user_data->ID, get_current_blog_id() ) ) {
|
||||
add_user_to_blog( get_current_blog_id(), $user_data->ID, 'customer' );
|
||||
|
@ -974,7 +958,7 @@ class WC_Form_Handler {
|
|||
|
||||
if ( is_wp_error( $user ) ) {
|
||||
$message = $user->get_error_message();
|
||||
$message = str_replace( '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', '<strong>' . esc_html( $username ) . '</strong>', $message );
|
||||
$message = str_replace( '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', '<strong>' . esc_html( $creds['user_login'] ) . '</strong>', $message );
|
||||
throw new Exception( $message );
|
||||
} else {
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ class WC_Frontend_Scripts {
|
|||
'flexslider' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/flexslider/jquery.flexslider' . $suffix . '.js' ),
|
||||
'deps' => array( 'jquery' ),
|
||||
'version' => '2.6.3',
|
||||
'version' => '2.6.1',
|
||||
),
|
||||
'js-cookie' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/js-cookie/js.cookie' . $suffix . '.js' ),
|
||||
|
@ -234,7 +234,7 @@ class WC_Frontend_Scripts {
|
|||
'selectWoo' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/selectWoo/selectWoo.full' . $suffix . '.js' ),
|
||||
'deps' => array( 'jquery' ),
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.0.1',
|
||||
),
|
||||
'wc-address-i18n' => array(
|
||||
'src' => self::get_asset_url( 'assets/js/frontend/address-i18n' . $suffix . '.js' ),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue