Fix merge conflict

This commit is contained in:
roykho 2021-01-20 07:10:47 -08:00
commit 21f872e766
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
201 changed files with 10359 additions and 13522 deletions

View File

@ -51,4 +51,4 @@ Feature requests can be [submitted to our issue tracker](https://github.com/wooc
Feature request issues will remain closed until we see sufficient interest via comments and [👍 reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/) from the community.
You can see a [list of current feature requests which require votes here](https://github.com/woocommerce/woocommerce/issues?q=label%3A%22votes+needed%22+label%3Aenhancement+sort%3Areactions-%2B1-desc+is%3Aclosed).
You can see a [list of current feature requests which require votes here](https://github.com/woocommerce/woocommerce/issues?q=is%3Aclosed+label%3A%22type%3A+enhancement%22+label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).

4
.gitignore vendored
View File

@ -24,8 +24,7 @@ none
/assets/css/photoswipe/**/*.min.css
# Minified JS
/assets/js/admin/*.min.js
/assets/js/frontend/*.min.js
/assets/js/**/*.min.js
# OS X metadata
.DS_Store
@ -76,3 +75,4 @@ i18n/languages/woocommerce.pot
# Build
build/
woocommerce.zip

View File

@ -1,24 +1,25 @@
version: ~> 1.0
# Specifies that Travis should create builds for master and release branches and also tags.
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^release\//
language: php
os:
- linux
dist: xenial
cache:
directories:
- $HOME/.composer/cache
# Since Xenial services are not started by default, we need to instruct it below to start.
services:
- mysql
- docker
# Test main supported versions of PHP against latest WP.
php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
env:
- WP_VERSION=latest WP_MULTISITE=0
@ -33,32 +34,50 @@ jobs:
install:
- nvm install
- npm install
- composer install
- composer install --no-dev
script:
- npm run build:assets
- npm run docker:up
- npm run test:e2e
- travis_retry npm run build:assets
- travis_retry npm run docker:up
- travis_retry npm run test:e2e
after_script:
- npm run docker:down
- name: "WP Nightly"
php: 7.4
php: "7.4"
env: WP_VERSION=nightly WP_MULTISITE=0
- name: "WP Latest - 1"
php: 7.2
env: WP_VERSION=5.4 WP_MULTISITE=0
php: "7.2"
env: WP_VERSION=5.5 WP_MULTISITE=0
- name: "WP Latest - 2"
php: 7.2
env: WP_VERSION=5.3 WP_MULTISITE=0
php: "7.2"
env: WP_VERSION=5.4 WP_MULTISITE=0
- name: "Code Standards"
php: 7.4
php: "7.4"
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
- name: "Code Coverage"
php: 7.4
php: "7.4"
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
allow_failures:
- php: 7.4
- php: "7.4"
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
# Git clone depth
# By default Travis CI clones repositories to a depth of 50 commits. Using a depth of 1 makes this step a bit faster.
git:
depth: 1
# Since Xenial services are not started by default, we need to instruct it below to start.
services:
- mysql
- docker
cache:
directories:
- $HOME/.composer/cache
# Composer 2.0.7 introduced a change that broke the jetpack autoloader in PHP 7.0 - 7.3.
before_install:
- composer self-update 2.0.6
install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
@ -69,6 +88,14 @@ install:
echo "xdebug.ini does not exist"
fi
- composer install
- |
if [ "$(php -r "echo version_compare(PHP_VERSION,'8.0','>=');")" ]; then
curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip
unzip -d /tmp/phpunit-7.5-fork /tmp/phpunit-7.5-fork.zip
composer bin phpunit config --unset platform
composer bin phpunit config repositories.0 '{"type": "path", "url": "/tmp/phpunit-7.5-fork/phpunit-add-compatibility-with-php8-to-phpunit-7", "options": {"symlink": false}}'
composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
fi
- |
# Install WP Test suite:
if [[ ! -z "$WP_VERSION" ]]; then
@ -81,20 +108,3 @@ script:
after_script:
- bash tests/bin/travis.sh after
# Specifies that Travis should create builds for master and release branches and also tags.
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^release\//
# Composer 2.0.7 introduced a change that broke the jetpack autoloader in PHP 7.0 - 7.3.
before_install:
- composer self-update 2.0.6
# Git clone depth
# By default Travis CI clones repositories to a depth of 50 commits. Using a depth of 1 makes this step a bit faster.
git:
depth: 1

View File

@ -45,67 +45,18 @@ module.exports = function( grunt ) {
comments : /@license|@preserve|^!/
}
},
admin: {
js_assets: {
files: [{
expand: true,
cwd: '<%= dirs.js %>/admin/',
cwd: '<%= dirs.js %>/',
src: [
'*.js',
'!*.min.js'
'**/*.js',
'!**/*.min.js'
],
dest: '<%= dirs.js %>/admin/',
extDot: 'last',
dest: '<%= dirs.js %>',
ext: '.min.js'
}]
},
vendor: {
files: {
'<%= dirs.js %>/accounting/accounting.min.js': ['<%= dirs.js %>/accounting/accounting.js'],
'<%= dirs.js %>/jquery-blockui/jquery.blockUI.min.js': ['<%= dirs.js %>/jquery-blockui/jquery.blockUI.js'],
'<%= dirs.js %>/jquery-cookie/jquery.cookie.min.js': ['<%= dirs.js %>/jquery-cookie/jquery.cookie.js'],
'<%= dirs.js %>/js-cookie/js.cookie.min.js': ['<%= dirs.js %>/js-cookie/js.cookie.js'],
'<%= dirs.js %>/jquery-flot/jquery.flot.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.js'],
'<%= dirs.js %>/jquery-flot/jquery.flot.pie.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.pie.js'],
'<%= dirs.js %>/jquery-flot/jquery.flot.resize.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.resize.js'],
'<%= dirs.js %>/jquery-flot/jquery.flot.stack.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.stack.js'],
'<%= dirs.js %>/jquery-flot/jquery.flot.time.min.js': ['<%= dirs.js %>/jquery-flot/jquery.flot.time.js'],
'<%= dirs.js %>/jquery-payment/jquery.payment.min.js': ['<%= dirs.js %>/jquery-payment/jquery.payment.js'],
'<%= dirs.js %>/jquery-qrcode/jquery.qrcode.min.js': ['<%= dirs.js %>/jquery-qrcode/jquery.qrcode.js'],
'<%= dirs.js %>/jquery-serializejson/jquery.serializejson.min.js': [
'<%= dirs.js %>/jquery-serializejson/jquery.serializejson.js'
],
'<%= dirs.js %>/jquery-tiptip/jquery.tipTip.min.js': ['<%= dirs.js %>/jquery-tiptip/jquery.tipTip.js'],
'<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.min.js': [
'<%= dirs.js %>/jquery-ui-touch-punch/jquery-ui-touch-punch.js'
],
'<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.init.min.js': ['<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.init.js'],
'<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.min.js': ['<%= dirs.js %>/prettyPhoto/jquery.prettyPhoto.js'],
'<%= dirs.js %>/flexslider/jquery.flexslider.min.js': ['<%= dirs.js %>/flexslider/jquery.flexslider.js'],
'<%= dirs.js %>/zoom/jquery.zoom.min.js': ['<%= dirs.js %>/zoom/jquery.zoom.js'],
'<%= dirs.js %>/photoswipe/photoswipe.min.js': ['<%= dirs.js %>/photoswipe/photoswipe.js'],
'<%= dirs.js %>/photoswipe/photoswipe-ui-default.min.js': ['<%= dirs.js %>/photoswipe/photoswipe-ui-default.js'],
'<%= dirs.js %>/round/round.min.js': ['<%= dirs.js %>/round/round.js'],
'<%= dirs.js %>/selectWoo/selectWoo.full.min.js': ['<%= dirs.js %>/selectWoo/selectWoo.full.js'],
'<%= dirs.js %>/selectWoo/selectWoo.min.js': ['<%= dirs.js %>/selectWoo/selectWoo.js'],
'<%= dirs.js %>/stupidtable/stupidtable.min.js': ['<%= dirs.js %>/stupidtable/stupidtable.js'],
'<%= dirs.js %>/zeroclipboard/jquery.zeroclipboard.min.js': ['<%= dirs.js %>/zeroclipboard/jquery.zeroclipboard.js']
}
},
frontend: {
files: [{
expand: true,
cwd: '<%= dirs.js %>/frontend/',
src: [
'*.js',
'!*.min.js'
],
dest: '<%= dirs.js %>/frontend/',
ext: '.min.js'
}]
},
flexslider: {
files: [{
'<%= dirs.js %>/flexslider/jquery.flexslider.min.js': ['<%= dirs.js %>/flexslider/jquery.flexslider.js']
}]
}
},
@ -189,12 +140,10 @@ module.exports = function( grunt ) {
js: {
files: [
'GruntFile.js',
'<%= dirs.js %>/admin/*js',
'<%= dirs.js %>/frontend/*js',
'!<%= dirs.js %>/admin/*.min.js',
'!<%= dirs.js %>/frontend/*.min.js'
'<%= dirs.js %>/**/*.js',
'!<%= dirs.js %>/**/*.min.js'
],
tasks: ['eslint','uglify']
tasks: ['eslint','newer:uglify']
}
},
@ -244,6 +193,7 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-newer' );
// Register tasks.
grunt.registerTask( 'default', [
@ -253,8 +203,7 @@ module.exports = function( grunt ) {
grunt.registerTask( 'js', [
'eslint',
'uglify:admin',
'uglify:frontend'
'uglify:js_assets'
]);
grunt.registerTask( 'css', [
@ -271,9 +220,7 @@ module.exports = function( grunt ) {
]);
grunt.registerTask( 'e2e-build', [
'uglify:admin',
'uglify:frontend',
'uglify:flexslider',
'uglify:js_assets',
'css'
]);

View File

@ -7,7 +7,7 @@
&::before,
&::after {
content: ' ';
content: " ";
display: table;
}
@ -127,10 +127,14 @@
}
@mixin darkorlighttextshadow($a, $opacity: 0.8) {
@if lightness($a) >= 65% {
@include text_shadow(0, -1px, 0, rgba(0, 0, 0, $opacity));
}
@else {
@include text_shadow(0, 1px, 0, rgba(255, 255, 255, $opacity));
}
}
@ -139,6 +143,7 @@
* Objects
*/
@mixin menu() {
@include clearfix();
li {
@ -147,6 +152,7 @@
}
@mixin mediaright() {
@include clearfix();
img {
@ -156,6 +162,7 @@
}
@mixin medialeft() {
@include clearfix();
img {
@ -172,9 +179,9 @@
width: 1em;
}
@mixin icon( $glyph: '\e001' ) {
font-family: 'WooCommerce';
speak: none;
@mixin icon( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -190,9 +197,9 @@
content: $glyph;
}
@mixin icon_dashicons( $glyph: '\f333' ) {
font-family: 'Dashicons';
speak: none;
@mixin icon_dashicons( $glyph: "\f333" ) {
font-family: "Dashicons";
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -209,9 +216,9 @@
content: $glyph;
}
@mixin iconbefore( $glyph: '\e001' ) {
font-family: 'WooCommerce';
speak: none;
@mixin iconbefore( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -222,9 +229,9 @@
text-decoration: none;
}
@mixin iconbeforedashicons( $glyph: '\f333' ) {
font-family: 'Dashicons';
speak: none;
@mixin iconbeforedashicons( $glyph: "\f333" ) {
font-family: "Dashicons";
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -234,9 +241,9 @@
text-decoration: none;
}
@mixin iconafter( $glyph: '\e001' ) {
font-family: 'WooCommerce';
speak: none;
@mixin iconafter( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -248,6 +255,7 @@
}
@mixin loader() {
&::before {
height: 1em;
width: 1em;
@ -257,9 +265,9 @@
left: 50%;
margin-left: -0.5em;
margin-top: -0.5em;
content: '';
content: "";
animation: spin 1s ease-in-out infinite;
background: url('../images/icons/loader.svg') center center;
background: url("../images/icons/loader.svg") center center;
background-size: cover;
line-height: 1;
text-align: center;
@ -267,3 +275,14 @@
color: rgba(#000, 0.75);
}
}
@mixin inversebuttoncolors {
background-color: transparent !important;
color: var(--button--color-text-hover) !important;
&:hover {
background-color: var(--button--color-background) !important;
color: var(--button--color-text) !important;
text-decoration: none !important;
}
}

View File

@ -8,7 +8,7 @@ $red: #a00 !default;
$orange: #ffba00 !default;
$blue: #2ea2cc !default;
$primary: #a46497 !default; // Primary color for buttons (alt)
$primary: #a46497 !default; // Primary color for buttons (alt)
$primarytext: desaturate(lighten($primary, 50%), 18%) !default; // Text on primary color bg
$secondary: desaturate(lighten($primary, 40%), 21%) !default; // Secondary buttons
@ -17,5 +17,22 @@ $secondarytext: desaturate(darken($secondary, 60%), 21%) !default; // Text
$highlight: adjust-hue($primary, 150deg) !default; // Prices, In stock labels, sales flash
$highlightext: desaturate(lighten($highlight, 50%), 18%) !default; // Text on highlight color bg
$contentbg: #fff !default; // Content BG - Tabs (active state)
$subtext: #767676 !default; // small, breadcrumbs etc
$contentbg: #fff !default; // Content BG - Tabs (active state)
$subtext: #767676 !default; // small, breadcrumbs etc
// export vars as CSS vars
:root {
--woocommerce: $woocommerce;
--wc-green: $green;
--wc-red: $red;
--wc-orange: $orange;
--wc-blue: $blue;
--wc-primary: $primary;
--wc-primary-text: $primarytext;
--wc-secondary: $secondary;
--wc-secondary-text: $secondarytext;
--wc-highlight: $highlight;
--wc-highligh-text: $highlightext;
--wc-content-bg: $contentbg;
--wc-subtext: $subtext;
}

View File

@ -360,7 +360,7 @@
}
.addons-button-solid {
background-color:#674399;
background-color: #674399;
color: #fff;
}
@ -2128,7 +2128,7 @@ ul.wc_coupon_list_block {
&::after {
font-family: "Dashicons";
speak: none;
speak: never;
font-weight: normal;
font-variant: normal;
text-transform: none;
@ -3169,6 +3169,13 @@ table.wc_input_table {
}
}
table.wc_tax_rates {
td.country {
position: relative;
}
}
table.wc_gateways,
table.wc_emails,
table.wc_shipping {

View File

@ -63,7 +63,7 @@ span.mce_woocommerce_shortcodes_button {
content: '\f348';
display: inline-block;
font: 400 18px/1 dashicons;
speak: none;
speak: never;
margin: 0 8px 0 -2px;
vertical-align: top;
}

View File

@ -103,13 +103,13 @@ a.button {
border: 0;
tbody {
border-bottom: 1px solid #ddd;
border-bottom: 1px solid $body-color;
}
tfoot {
tr:last-of-type {
border-top: 1px solid #ddd;
border-top: 1px solid $body-color;
.woocommerce-Price-amount {
font-weight: 700;
@ -174,12 +174,21 @@ a.button {
justify-content: center;
&::before {
content: '';
content: "";
float: left;
padding-top: 100%;
}
}
.onsale + .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
top: 2.2em;
right: 2.2em;
}
.single-product .type-product.sale > .onsale {
right: calc(52% - 0.7rem);
}
.price {
font-family: $headings;
font-size: 1rem;
@ -211,7 +220,6 @@ a.button {
.woocommerce-error li,
.woocommerce-info {
padding: 1.5rem 3rem;
display: flex;
justify-content: space-between;
align-items: center;
@ -242,6 +250,7 @@ a.button {
}
#main {
.woocommerce-error,
.woocommerce-info {
font-family: $headings;
@ -286,11 +295,11 @@ a.button {
.woocommerce-store-notice__dismiss-link {
float: right;
color: #fff;
color: #000;
&:hover {
text-decoration: underline;
color: #fff;
text-decoration: none;
color: #000;
}
}
@ -347,11 +356,6 @@ a.button {
/**
* Shop page
*/
.woocommerce-products-header__title.page-title {
font-size: 3rem;
text-align: center;
}
.woocommerce-result-count,
.woocommerce-ordering {
margin: 0 0 1rem;
@ -376,7 +380,7 @@ ul.products {
.woocommerce-loop-product__title {
margin: 0.5rem 0 0.5rem;
font-size: 1.5rem;
font-weight: 700;
font-weight: 400;
&::before {
content: none;
@ -408,10 +412,18 @@ ul.products {
.button {
vertical-align: middle;
background-color: transparent;
color: var(--button--color-text-hover);
text-decoration: none !important;
&.loading {
opacity: 0.5;
}
&:hover {
background-color: var(--button--color-background);
color: var(--button--color-text);
}
}
.added_to_cart {
@ -783,6 +795,7 @@ a.reset_variations {
li {
display: inline-flex !important;
a {
color: $body-color;
text-decoration: none;
@ -1215,6 +1228,72 @@ a.reset_variations {
margin-top: 0;
}
}
.woocommerce-Addresses {
margin-top: -1rem;
.woocommerce-Address-title {
h3 {
display: inline-block;
margin-right: 1rem;
font-size: 1.8rem;
margin-top: 2rem;
}
}
address {
line-height: 1.8rem;
}
}
.woocommerce-address-fields {
label {
font-size: 1.5rem;
margin-bottom: 0.1rem;
}
input,
.selection {
font-size: 1.5rem;
padding-top: 0.3rem;
padding-bottom: 0.3rem;
}
input {
border: 3px solid black;
}
.form-row {
margin-top: 1.5rem !important;
margin-bottom: 0 !important;
}
#billing_company_field {
padding-top: 1.5rem !important;
}
.select2-selection {
border: 2px solid black;
height: 3rem;
padding-top: 0.5rem;
margin-top: -1rem;
}
.select2-selection__arrow {
position: absolute;
top: -0.2rem;
}
.select2-dropdown {
border: 2px solid black !important;
}
.woocommerce-address-fields__field-wrapper {
margin-bottom: 2rem;
}
}
}
table.account-orders-table {
@ -1245,17 +1324,15 @@ a.reset_variations {
tbody {
tr:nth-child(2n) {
td {
background: #eee;
}
}
tr:nth-child(2n+1) {
td {
background: #fff;
background: var(--global--color-background);
filter: brightness(88%);
.is-dark-theme & {
filter: brightness(112%);
}
}
}
}
@ -1263,16 +1340,50 @@ a.reset_variations {
.woocommerce-EditAccountForm {
label {
font-size: 1.5rem;
}
input {
border: 1px solid #ddd;
border: var(--form--border-width) solid var(--form--border-color);
font-size: 1.5rem;
}
fieldset {
border: 0.2rem solid #ddd;
border: none;
padding-left: 0;
padding-right: 0;
margin-top: 30px;
legend {
display: contents;
font-size: 2rem;
}
p {
margin-top: 20px;
margin-bottom: 0 !important;
}
.show-password-input {
display: inherit;
}
}
button {
margin-top: 3rem;
margin-top: 0;
}
#account_display_name + span {
font-size: 1.5rem;
}
p {
margin-top: 20px;
&:nth-of-type(4) {
margin-top: 30px;
}
}
}
}
@ -1335,7 +1446,8 @@ a.reset_variations {
border-radius: var(--form--border-radius);
}
.select2-container--focus .select2-selection,.select2-container--open .select2-selection {
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
outline-offset: 2px;
outline: 2px dotted var(--form--border-color);
}
@ -1368,6 +1480,7 @@ a.reset_variations {
margin-bottom: 2rem;
padding: 1rem;
}
.woocommerce-form-coupon {
background: #eee;
padding: 1rem;
@ -1670,7 +1783,8 @@ a.reset_variations {
height: 46px;
}
.select2-container--focus .select2-selection,.select2-container--open .select2-selection {
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
outline-offset: 2px;
outline: 2px dotted var(--form--border-color);
}
@ -1702,7 +1816,7 @@ a.reset_variations {
&::before {
content: "";
display: inline-block;
width: 14px;
width: 14px !important;
height: 14px;
border: var(--form--border-width) solid var(--form--border-color);
background: var(--global--color-white);
@ -1846,6 +1960,18 @@ a.reset_variations {
input[type=checkbox] {
width: 25px !important;
}
input[type=radio] {
& + label::before {
background: #fff !important;
border: var(--form--border-width) solid #000 !important;
}
&:checked + label::before {
background: #000 !important;
}
}
}
> label:first-of-type {
@ -1863,7 +1989,7 @@ a.reset_variations {
cursor: pointer;
}
input.input-radio[name="payment_method"] {
input[type="radio"] {
display: none;
& + label {
@ -1881,6 +2007,7 @@ a.reset_variations {
border-radius: 100%;
transform: translateY(2px);
}
}
&:checked + label {
@ -1906,6 +2033,57 @@ a.reset_variations {
}
}
.account-payment-methods-table {
padding-top: 0 !important;
margin-bottom: 1rem;
table,
tr {
border-style: hidden;
}
tr:nth-child(2n) {
td {
background: transparent !important;
}
}
tr:nth-child(2n+1) {
td {
background: var(--global--color-background);
filter: brightness(88%);
.is-dark-theme & {
filter: brightness(112%);
}
}
}
td.payment-method-actions {
padding-right: 0.5rem;
padding-left: 0.5rem;
padding-top: 0.3rem;
padding-bottom: 0.3rem;
display: grid;
border: none;
font-size: 0;
a {
width: 100%;
padding-top: 0.3rem !important;
padding-bottom: 0.3rem !important;
margin-top: 0.5rem !important;
margin-bottom: 0.5rem !important;
@include inversebuttoncolors();
}
}
}
.woocommerce-terms-and-conditions-wrapper {
margin-bottom: 5rem;
@ -2012,7 +2190,7 @@ a.reset_variations {
h2.woocommerce-loop-category__title {
margin-top: 0.4rem;
font-family: $headings;
font-size: 1rem;
font-size: 1.5rem;
.count {
background-color: transparent;
@ -2020,6 +2198,10 @@ a.reset_variations {
}
}
}
mark {
background-color: initial;
}
}
}
}
@ -2031,6 +2213,12 @@ a.reset_variations {
.woocommerce-ordering {
float: left;
clear: both;
margin-top: 0;
}
.woocommerce-result-count {
margin-top: 0;
margin-bottom: 20px;
}
}
}
@ -2078,8 +2266,14 @@ a.reset_variations {
}
.onsale {
font-size: 1.2rem;
font-size: 1rem;
}
.onsale + .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
top: 1.8em;
right: 1.8em;
}
}
}
@ -2124,8 +2318,31 @@ a.reset_variations {
.woocommerce,
.woocommerce-page {
.onsale {
right: -0.7rem !important;
}
.woocommerce-tabs {
ul {
li {
font-size: 1rem;
a {
padding: calc(0.75 * var(--button--padding-vertical)) calc(0.75 * var(--button--padding-horizontal));
}
}
}
}
table.shop_table_responsive {
.button {
@include inversebuttoncolors();
}
tr {
margin: 0 0 1.5rem;
@ -2140,7 +2357,19 @@ a.reset_variations {
&:nth-child(2n) {
td {
background: #fff;
background: transparent;
}
}
&:nth-child(2n+1) {
td {
background: var(--global--color-background);
filter: brightness(88%);
.is-dark-theme & {
filter: brightness(112%);
}
}
}
@ -2326,12 +2555,14 @@ a.reset_variations {
.onsale {
font-size: 1rem;
}
}
/**
* Home page
*/
.home #main {
[class*="woocommerce columns-"] {
word-break: break-word;
max-width: var(--responsive--aligndefault-width);
@ -2343,10 +2574,6 @@ a.reset_variations {
/**
* Shop page
*/
.woocommerce-products-header__title.page-title {
font-size: 4.2rem;
font-weight: 800;
}
.woocommerce-pagination {
@ -2388,6 +2615,7 @@ a.reset_variations {
table.account-orders-table {
margin-top: 0;
border: 0;
margin-bottom: 1rem;
tr,
td,
@ -2399,12 +2627,24 @@ a.reset_variations {
th,
td,
td.woocommerce-orders-table__cell-order-actions {
width: 1%;
padding-right: 0.5rem;
padding-left: 0.5rem;
a {
padding-top: 0.3rem !important;
padding-bottom: 0.3rem !important;
margin-top: 0.5rem !important;
margin-bottom: 0.5rem !important;
}
}
td.woocommerce-orders-table__cell-order-date {
padding-right: 0;
}
thead {
border-bottom: 1px solid #ddd;
border-bottom: 1px solid $body-color;
}
.button {
@ -2412,6 +2652,8 @@ a.reset_variations {
padding-right: 0.5em;
width: 100%;
margin: 1.5rem 0;
@include inversebuttoncolors();
}
}
}
@ -2516,6 +2758,34 @@ a.reset_variations {
}
}
@media only screen and (max-width: 768px) {
.woocommerce-products-header {
border-bottom: none !important;
padding-bottom: 0;
margin-bottom: 0 !important;
}
}
@media only screen and (min-width: 600px) {
.woocommerce-products-header {
padding-bottom: 1.5vw;
}
.woocommerce-ordering,
.woocommerce-result-count {
margin-top: 0 !important;
}
}
@media only screen and (min-width: 690px) {
.woocommerce-products-header {
border-bottom: 3px solid var(--global--color-border);
}
}
.woocommerce-account {
.entry-header {
@ -2528,6 +2798,62 @@ a.reset_variations {
p:first-of-type {
margin-bottom: 2rem;
}
#add_payment_method {
ul {
list-style-type: none !important;
}
.woocommerce-PaymentMethod {
margin-bottom: 1.5rem;
}
}
input[type=radio] {
float: left;
margin-top: 0.5rem;
margin-right: 0.5rem;
}
label {
font-size: 1.5rem;
display: flex;
justify-content: flex-end;
img {
margin-left: 10px !important;
}
img:first-child {
margin-left: auto !important;
}
img:last-child {
margin-right: 5px !important;
}
}
.woocommerce-PaymentBox {
p,
label {
font-size: 1.3rem;
}
p {
margin-bottom: 1.5rem;
}
br {
display: none;
}
.woocommerce_error {
margin-top: 1rem;
margin-bottom: 0;
}
}
}
.woocommerce-MyAccount-navigation-link {
@ -2561,7 +2887,6 @@ a.reset_variations {
.woocommerce-notices-wrapper {
& > * {
background: var(--global--color-light-gray);
padding: 15px;
list-style: none;
}
@ -2593,7 +2918,8 @@ a.reset_variations {
}
}
button[name="update_cart"],button[name="apply_coupon"] {
button[name="update_cart"],
button[name="apply_coupon"] {
padding: 0.5rem;
color: var(--global--color-primary);
background: var(--global--color-background);
@ -2603,7 +2929,13 @@ a.reset_variations {
&:active {
color: var(--global--color-background);
background: var(--global--color-primary);
}
}
.product-thumbnail {
.attachment-woocommerce_thumbnail {
height: auto !important;
}
}
}
@ -2658,3 +2990,57 @@ a.reset_variations {
}
}
}
/**
* Downloads
*/
.woocommerce-order-downloads {
padding-top: 0 !important;
table,
tr {
border-style: hidden;
td.download-remaining {
text-align: center !important;
}
}
tr:nth-child(2n) {
td {
background: transparent !important;
}
}
tr:nth-child(2n+1) {
td {
background: var(--global--color-background);
filter: brightness(88%);
.is-dark-theme & {
filter: brightness(112%);
}
}
}
td.download-file {
padding-right: 0.5rem;
padding-left: 0.5rem;
padding-top: 0.3rem;
padding-bottom: 0.3rem;
a {
width: 100%;
padding-top: 0.3rem !important;
padding-bottom: 0.3rem !important;
margin-top: 0.5rem !important;
margin-bottom: 0.5rem !important;
@include inversebuttoncolors();
}
}
}

View File

@ -279,11 +279,11 @@ a.button {
.woocommerce-store-notice__dismiss-link {
float: right;
color: #fff;
color: #000;
&:hover {
text-decoration: underline;
color: #fff;
text-decoration: none;
color: #000;
}
}

View File

@ -374,7 +374,7 @@ body {
li a::before {
color: #82878c;
font: 400 20px/1 dashicons; /* stylelint-disable-line font-family-no-missing-generic-family-keyword */
speak: none;
speak: never;
display: inline-block;
padding: 0 10px 0 0;
top: 1px;

View File

@ -1,21 +0,0 @@
/*!
* accounting.js v0.4.2
* Copyright 2014 Open Exchange Rates
*
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
*
* Full details and documentation:
* http://openexchangerates.github.io/accounting.js/
*/
!function(n,r){function e(n){return!!(""===n||n&&n.charCodeAt&&n.substr)}function t(n){return p?p(n):"[object Array]"===l.call(n)}function o(n){return n&&"[object Object]"===l.call(n)}function a(n,r){var e;n=n||{},r=r||{};for(e in r)r.hasOwnProperty(e)&&null==n[e]&&(n[e]=r[e]);return n}function i(n,r,e){var t,o,a=[];if(!n)return a;if(f&&n.map===f)return n.map(r,e);for(t=0,o=n.length;t<o;t++)a[t]=r.call(e,n[t],t,n);return a}function u(n,r){return n=Math.round(Math.abs(n)),isNaN(n)?r:n}function c(n){var r=s.settings.currency.format;return"function"==typeof n&&(n=n()),e(n)&&n.match("%v")?{pos:n,neg:n.replace("-","").replace("%v","-%v"),zero:n}:n&&n.pos&&n.pos.match("%v")?n:e(r)?s.settings.currency.format={pos:r,neg:r.replace("%v","-%v"),zero:r}:r}var s={};s.version="0.4.1",s.settings={currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}};var f=Array.prototype.map,p=Array.isArray,l=Object.prototype.toString,m=s.unformat=s.parse=function(n,r){if(t(n))return i(n,function(n){return m(n,r)});if("number"==typeof(n=n||0))return n;r=r||s.settings.number.decimal;var e=new RegExp("[^0-9-"+r+"]",["g"]),o=parseFloat((""+n).replace(/\((.*)\)/,"-$1").replace(e,"").replace(r,"."));return isNaN(o)?0:o},d=s.toFixed=function(n,r){r=u(r,s.settings.number.precision);var e=Math.pow(10,r);return(Math.round(s.unformat(n)*e)/e).toFixed(r)},g=s.formatNumber=s.format=function(n,r,e,c){if(t(n))return i(n,function(n){return g(n,r,e,c)});n=m(n);var f=a(o(r)?r:{precision:r,thousand:e,decimal:c},s.settings.number),p=u(f.precision),l=n<0?"-":"",h=parseInt(d(Math.abs(n||0),p),10)+"",y=h.length>3?h.length%3:0;return l+(y?h.substr(0,y)+f.thousand:"")+h.substr(y).replace(/(\d{3})(?=\d)/g,"$1"+f.thousand)+(p?f.decimal+d(Math.abs(n),p).split(".")[1]:"")},h=s.formatMoney=function(n,r,e,f,p,l){if(t(n))return i(n,function(n){return h(n,r,e,f,p,l)});n=m(n);var d=a(o(r)?r:{symbol:r,precision:e,thousand:f,decimal:p,format:l},s.settings.currency),y=c(d.format);return(n>0?y.pos:n<0?y.neg:y.zero).replace("%s",d.symbol).replace("%v",g(Math.abs(n),u(d.precision),d.thousand,d.decimal))};s.formatColumn=function(n,r,f,p,l,d){if(!n)return[];var h=a(o(r)?r:{symbol:r,precision:f,thousand:p,decimal:l,format:d},s.settings.currency),y=c(h.format),b=y.pos.indexOf("%s")<y.pos.indexOf("%v"),v=0;return i(i(n,function(n,r){if(t(n))return s.formatColumn(n,h);var e=((n=m(n))>0?y.pos:n<0?y.neg:y.zero).replace("%s",h.symbol).replace("%v",g(Math.abs(n),u(h.precision),h.thousand,h.decimal));return e.length>v&&(v=e.length),e}),function(n,r){return e(n)&&n.length<v?b?n.replace(h.symbol,h.symbol+new Array(v-n.length+1).join(" ")):new Array(v-n.length+1).join(" ")+n:n})},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=s),exports.accounting=s):"function"==typeof define&&define.amd?define([],function(){return s}):(s.noConflict=function(r){return function(){/*!
* accounting.js v0.4.2
* Copyright 2014 Open Exchange Rates
*
* Freely distributable under the MIT license.
* Portions of accounting.js are inspired or borrowed from underscore.js
*
* Full details and documentation:
* http://openexchangerates.github.io/accounting.js/
*/
return n.accounting=r,s.noConflict=void 0,s}}(n.accounting),n.accounting=s)}(this);

View File

@ -405,7 +405,7 @@
}
// Track when suggestions are displayed (and not already visible).
$( 'ul.product_data_tabs li.marketplace-suggestions_options a' ).click( function( e ) {
$( 'ul.product_data_tabs li.marketplace-suggestions_options a' ).on( 'click', function( e ) {
e.preventDefault();
if ( '#marketplace_suggestions' === currentTab ) {

View File

@ -25,10 +25,10 @@ jQuery( function ( $ ) {
$( '.js_field-country' ).selectWoo().change( this.change_country );
$( '.js_field-country' ).trigger( 'change', [ true ] );
$( document.body ).on( 'change', 'select.js_field-state', this.change_state );
$( '#woocommerce-order-actions input, #woocommerce-order-actions a' ).click(function() {
$( '#woocommerce-order-actions input, #woocommerce-order-actions a' ).on( 'click', function() {
window.onbeforeunload = '';
});
$( 'a.edit_address' ).click( this.edit_address );
$( 'a.edit_address' ).on( 'click', this.edit_address );
$( 'a.billing-same-as-shipping' ).on( 'click', this.copy_billing_to_shipping );
$( 'a.load_customer_billing' ).on( 'click', this.load_billing );
$( 'a.load_customer_shipping' ).on( 'click', this.load_shipping );

View File

@ -49,14 +49,14 @@ jQuery( function( $ ) {
});
// Catalog Visibility.
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).click( function() {
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).on( 'click', function() {
if ( $( '#catalog-visibility-select' ).is( ':hidden' ) ) {
$( '#catalog-visibility-select' ).slideDown( 'fast' );
$( this ).hide();
}
return false;
});
$( '#catalog-visibility' ).find( '.save-post-visibility' ).click( function() {
$( '#catalog-visibility' ).find( '.save-post-visibility' ).on( 'click', function() {
$( '#catalog-visibility-select' ).slideUp( 'fast' );
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show();
@ -70,7 +70,7 @@ jQuery( function( $ ) {
$( '#catalog-visibility-display' ).text( label );
return false;
});
$( '#catalog-visibility' ).find( '.cancel-post-visibility' ).click( function() {
$( '#catalog-visibility' ).find( '.cancel-post-visibility' ).on( 'click', function() {
$( '#catalog-visibility-select' ).slideUp( 'fast' );
$( '#catalog-visibility' ).find( '.edit-catalog-visibility' ).show();
@ -355,7 +355,7 @@ jQuery( function( $ ) {
});
$( '.product_attributes' ).on( 'click', 'button.select_all_attributes', function() {
$( this ).closest( 'td' ).find( 'select option' ).attr( 'selected', 'selected' );
$( this ).closest( 'td' ).find( 'select option' ).prop( 'selected', 'selected' );
$( this ).closest( 'td' ).find( 'select' ).change();
return false;
});

View File

@ -23,7 +23,7 @@ jQuery( function ( $ ) {
// Tabbed Panels
$( document.body ).on( 'wc-init-tabbed-panels', function() {
$( 'ul.wc-tabs' ).show();
$( 'ul.wc-tabs a' ).click( function( e ) {
$( 'ul.wc-tabs a' ).on( 'click', function( e ) {
e.preventDefault();
var panel_wrap = $( this ).closest( 'div.panel-wrap' );
$( 'ul.wc-tabs li', panel_wrap ).removeClass( 'active' );

View File

@ -130,7 +130,7 @@ jQuery(function( $ ) {
}
// Export
$( '.export_csv' ).click( function() {
$( '.export_csv' ).on( 'click', function() {
var exclude_series = $( this ).data( 'exclude_series' ) || '';
exclude_series = exclude_series.toString();
exclude_series = exclude_series.split( ',' );

View File

@ -80,7 +80,7 @@
}
});
$( '.submit :input' ).click( function() {
$( '.submit :input' ).on( 'click', function() {
window.onbeforeunload = '';
});
});

View File

@ -235,7 +235,7 @@
$( this ).focus();
} );
$( '.wc_input_table .remove_rows' ).click( function() {
$( '.wc_input_table .remove_rows' ).on( 'click', function() {
var $tbody = $( this ).closest( '.wc_input_table' ).find( 'tbody' );
if ( $tbody.find( 'tr.current' ).length > 0 ) {
var $current = $tbody.find( 'tr.current' );

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@ jQuery( function( $ ) {
return false;
}
$( document.body ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) {
$( document.body ).on( 'price_slider_create price_slider_slide', function( event, min, max ) {
$( '.price_slider_amount span.from' ).html( accounting.formatMoney( min, {
symbol: woocommerce_price_slider_params.currency_format_symbol,
@ -66,6 +66,7 @@ jQuery( function( $ ) {
}
init_price_filter();
$( document.body ).on( 'init_price_filter', init_price_filter );
var hasSelectiveRefresh = (
'undefined' !== typeof wp &&
@ -75,7 +76,7 @@ jQuery( function( $ ) {
wp.customize.widgetsPreview.WidgetPartial
);
if ( hasSelectiveRefresh ) {
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
wp.customize.selectiveRefresh.on( 'partial-content-rendered', function() {
init_price_filter();
} );
}

View File

@ -25,7 +25,7 @@ jQuery( function( $ ) {
}
// Set a cookie and hide the store notice when the dismiss button is clicked
$( '.woocommerce-store-notice__dismiss-link' ).click( function( event ) {
$( '.woocommerce-store-notice__dismiss-link' ).on( 'click', function( event ) {
Cookies.set( cookieName, 'hidden', { path: '/' } );
$( '.woocommerce-store-notice' ).hide();
event.preventDefault();
@ -85,7 +85,7 @@ jQuery( function( $ ) {
$( '.woocommerce form input' ).filter(':password').parent('span').addClass('password-input');
$( '.password-input' ).append( '<span class="show-password-input"></span>' );
$( '.show-password-input' ).click(
$( '.show-password-input' ).on( 'click',
function() {
$( this ).toggleClass( 'display-password' );
if ( $( this ).hasClass( 'display-password' ) ) {

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return c.raw?e:encodeURIComponent(e)}function i(e){return c.raw?e:decodeURIComponent(e)}function o(e){return n(c.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(u," ")),c.json?JSON.parse(e):e}catch(n){}}function t(n,i){var o=c.raw?n:r(n);return e.isFunction(i)?i(o):o}var u=/\+/g,c=e.cookie=function(r,u,f){if(u!==undefined&&!e.isFunction(u)){if("number"==typeof(f=e.extend({},c.defaults,f)).expires){var d=f.expires,a=f.expires=new Date;a.setTime(+a+864e5*d)}return document.cookie=[n(r),"=",o(u),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?undefined:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;m<x;m++){var k=s[m].split("="),l=i(k.shift()),j=k.join("=");if(r&&r===l){p=t(j,u);break}r||(j=t(j))===undefined||(p[l]=j)}return p};c.defaults={},e.removeCookie=function(n,i){return e.cookie(n)!==undefined&&(e.cookie(n,"",e.extend({},i,{expires:-1})),!e.cookie(n))}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(t,e,i){function n(){h=e[o](function(){r.each(function(){var e=t(this),i=e.width(),n=e.height(),h=t.data(this,u);i===h.w&&n===h.h||e.trigger(a,[h.w=i,h.h=n])}),n()},s[d])}var h,r=t([]),s=t.resize=t.extend(t.resize,{}),o="setTimeout",a="resize",u=a+"-special-event",d="delay",c="throttleWindow";s[d]=250,s[c]=!0,t.event.special[a]={setup:function(){if(!s[c]&&this[o])return!1;var e=t(this);r=r.add(e),t.data(this,u,{w:e.width(),h:e.height()}),1===r.length&&n()},teardown:function(){if(!s[c]&&this[o])return!1;var e=t(this);r=r.not(e),e.removeData(u),r.length||clearTimeout(h)},add:function(e){function n(e,n,r){var s=t(this),o=t.data(this,u);o.w=n!==i?n:s.width(),o.h=r!==i?r:s.height(),h.apply(this,arguments)}if(!s[c]&&this[o])return!1;var h;if(t.isFunction(e))return h=e,n;h=e.handler,e.handler=n}}}(jQuery,this),function(t){var e={};jQuery.plot.plugins.push({init:function(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}t.hooks.bindEvents.push(function(t,i){t.getPlaceholder().resize(e)}),t.hooks.shutdown.push(function(t,i){t.getPlaceholder().unbind("resize",e)})},options:e,name:"resize",version:"1.0"})}();

View File

@ -1 +0,0 @@
!function(s){var n={series:{stack:null}};jQuery.plot.plugins.push({init:function(s){function n(s,n){for(var t=null,i=0;i<n.length&&s!=n[i];++i)n[i].stack==s.stack&&(t=n[i]);return t}s.hooks.processDatapoints.push(function(s,t,i){if(null!=t.stack&&!1!==t.stack){var l=n(t,s.getData());if(l){for(var o,e,u,f,a,p,r,h,c=i.pointsize,g=i.points,k=l.datapoints.pointsize,v=l.datapoints.points,m=[],z=t.lines.show,d=t.bars.horizontal,y=c>2&&(d?i.format[2].x:i.format[2].y),D=z&&t.lines.steps,b=!0,j=d?1:0,w=d?0:1,x=0,Q=0;!(x>=g.length);){if(r=m.length,null==g[x]){for(h=0;h<c;++h)m.push(g[x+h]);x+=c}else if(Q>=v.length){if(!z)for(h=0;h<c;++h)m.push(g[x+h]);x+=c}else if(null==v[Q]){for(h=0;h<c;++h)m.push(null);b=!0,Q+=k}else{if(o=g[x+j],e=g[x+w],f=v[Q+j],a=v[Q+w],p=0,o==f){for(h=0;h<c;++h)m.push(g[x+h]);m[r+w]+=a,p=a,x+=c,Q+=k}else if(o>f){if(z&&x>0&&null!=g[x-c]){for(u=e+(g[x-c+w]-e)*(f-o)/(g[x-c+j]-o),m.push(f),m.push(u+a),h=2;h<c;++h)m.push(g[x+h]);p=a}Q+=k}else{if(b&&z){x+=c;continue}for(h=0;h<c;++h)m.push(g[x+h]);z&&Q>0&&null!=v[Q-k]&&(p=a+(v[Q-k+w]-a)*(o-f)/(v[Q-k+j]-f)),m[r+w]+=p,x+=c}b=!1,r!=m.length&&y&&(m[r+2]+=p)}if(D&&r!=m.length&&r>0&&null!=m[r]&&m[r]!=m[r-c]&&m[r+1]!=m[r-c+1]){for(h=0;h<c;++h)m[r+c+h]=m[r+h];m[r+1]=m[r-c+1]}}i.points=m}}})},options:n,name:"stack",version:"1.2"})}();

View File

@ -1 +0,0 @@
!function(e){function t(e,t){return t*Math.floor(e/t)}function n(e,t,n,r){if("function"==typeof e.strftime)return e.strftime(t);var i=function(e,t){return e=""+e,t=""+(null==t?"0":t),1==e.length?t+e:e},a=[],o=!1,s=e.getHours(),u=s<12;null==n&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==r&&(r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var c;c=s>12?s-12:0==s?12:s;for(var m=0;m<t.length;++m){var l=t.charAt(m);if(o){switch(l){case"a":l=""+r[e.getDay()];break;case"b":l=""+n[e.getMonth()];break;case"d":l=i(e.getDate());break;case"e":l=i(e.getDate()," ");break;case"h":case"H":l=i(s);break;case"I":l=i(c);break;case"l":l=i(c," ");break;case"m":l=i(e.getMonth()+1);break;case"M":l=i(e.getMinutes());break;case"q":l=""+(Math.floor(e.getMonth()/3)+1);break;case"S":l=i(e.getSeconds());break;case"y":l=i(e.getFullYear()%100);break;case"Y":l=""+e.getFullYear();break;case"p":l=u?"am":"pm";break;case"P":l=u?"AM":"PM";break;case"w":l=""+e.getDay()}a.push(l),o=!1}else"%"==l?o=!0:a.push(l)}return a.join("")}function r(e){function t(e,t,n,r){e[t]=function(){return n[r].apply(n,arguments)}}var n={date:e};e.strftime!=undefined&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");for(var r=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],i=0;i<r.length;i++)t(n,"get"+r[i],e,"getUTC"+r[i]),t(n,"set"+r[i],e,"setUTC"+r[i]);return n}function i(e,t){if("browser"==t.timezone)return new Date(e);if(t.timezone&&"utc"!=t.timezone){if("undefined"!=typeof timezoneJS&&"undefined"!=typeof timezoneJS.Date){var n=new timezoneJS.Date;return n.setTimezone(t.timezone),n.setTime(e),n}return r(new Date(e))}return r(new Date(e))}var a={xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},o={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},s=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],u=s.concat([[3,"month"],[6,"month"],[1,"year"]]),c=s.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);e.plot.plugins.push({init:function(r){r.hooks.processOptions.push(function(r,a){e.each(r.getAxes(),function(e,r){var a=r.options;"time"==a.mode&&(r.tickGenerator=function(e){var n=[],r=i(e.min,a),s=0,m=a.tickSize&&"quarter"===a.tickSize[1]||a.minTickSize&&"quarter"===a.minTickSize[1]?c:u;null!=a.minTickSize&&(s="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*o[a.minTickSize[1]]);for(var l=0;l<m.length-1&&!(e.delta<(m[l][0]*o[m[l][1]]+m[l+1][0]*o[m[l+1][1]])/2&&m[l][0]*o[m[l][1]]>=s);++l);var h=m[l][0],f=m[l][1];if("year"==f){if(null!=a.minTickSize&&"year"==a.minTickSize[1])h=Math.floor(a.minTickSize[0]);else{var k=Math.pow(10,Math.floor(Math.log(e.delta/o.year)/Math.LN10)),d=e.delta/o.year/k;h=d<1.5?1:d<3?2:d<7.5?5:10,h*=k}h<1&&(h=1)}e.tickSize=a.tickSize||[h,f];var M=e.tickSize[0];f=e.tickSize[1];var g=M*o[f];"second"==f?r.setSeconds(t(r.getSeconds(),M)):"minute"==f?r.setMinutes(t(r.getMinutes(),M)):"hour"==f?r.setHours(t(r.getHours(),M)):"month"==f?r.setMonth(t(r.getMonth(),M)):"quarter"==f?r.setMonth(3*t(r.getMonth()/3,M)):"year"==f&&r.setFullYear(t(r.getFullYear(),M)),r.setMilliseconds(0),g>=o.minute&&r.setSeconds(0),g>=o.hour&&r.setMinutes(0),g>=o.day&&r.setHours(0),g>=4*o.day&&r.setDate(1),g>=2*o.month&&r.setMonth(t(r.getMonth(),3)),g>=2*o.quarter&&r.setMonth(t(r.getMonth(),6)),g>=o.year&&r.setMonth(0);var y,S=0,z=Number.NaN;do{if(y=z,z=r.getTime(),n.push(z),"month"==f||"quarter"==f)if(M<1){r.setDate(1);var p=r.getTime();r.setMonth(r.getMonth()+("quarter"==f?3:1));var v=r.getTime();r.setTime(z+S*o.hour+(v-p)*M),S=r.getHours(),r.setHours(0)}else r.setMonth(r.getMonth()+M*("quarter"==f?3:1));else"year"==f?r.setFullYear(r.getFullYear()+M):r.setTime(z+g)}while(z<e.max&&z!=y);return n},r.tickFormatter=function(e,t){var r=i(e,t.options);if(null!=a.timeformat)return n(r,a.timeformat,a.monthNames,a.dayNames);var s=t.options.tickSize&&"quarter"==t.options.tickSize[1]||t.options.minTickSize&&"quarter"==t.options.minTickSize[1],u=t.tickSize[0]*o[t.tickSize[1]],c=t.max-t.min,m=a.twelveHourClock?" %p":"",l=a.twelveHourClock?"%I":"%H";return n(r,u<o.minute?l+":%M:%S"+m:u<o.day?c<2*o.day?l+":%M"+m:"%b %d "+l+":%M"+m:u<o.month?"%b %d":s&&u<o.quarter||!s&&u<o.year?c<o.year?"%b":"%b %Y":s&&u<o.year?c<o.year?"Q%q":"Q%q %Y":"%Y",a.monthNames,a.dayNames)})})})},options:a,name:"time",version:"1.0"}),e.plot.formatDate=n}(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(O){O.fn.tipTip=function(t){var g,b,M,w=O.extend({activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},t);return O("#tiptip_holder").length<=0?(g=O('<div id="tiptip_holder" style="max-width:'+w.maxWidth+';"></div>'),b=O('<div id="tiptip_content"></div>'),M=O('<div id="tiptip_arrow"></div>'),O("body").append(g.html(b).prepend(M.html('<div id="tiptip_arrow_inner"></div>')))):(g=O("#tiptip_holder"),b=O("#tiptip_content"),M=O("#tiptip_arrow")),this.each(function(){var _,v,m=O(this);function t(){w.enter.call(this),b.html(_),g.hide().removeAttr("class").css("margin","0"),M.removeAttr("style");var t=parseInt(m.offset().top),e=parseInt(m.offset().left),o=parseInt(m.outerWidth()),i=parseInt(m.outerHeight()),n=g.outerWidth(),r=g.outerHeight(),a=Math.round((o-n)/2),f=Math.round((i-r)/2),d=Math.round(e+a),u=Math.round(t+i+w.edgeOffset),p="",h="",l=Math.round(n-12)/2;"bottom"==w.defaultPosition?p="_bottom":"top"==w.defaultPosition?p="_top":"left"==w.defaultPosition?p="_left":"right"==w.defaultPosition&&(p="_right");var c=a+e<parseInt(O(window).scrollLeft()),s=n+e>parseInt(O(window).width());c&&a<0||"_right"==p&&!s||"_left"==p&&e<n+w.edgeOffset+5?(p="_right",h=Math.round(r-13)/2,l=-12,d=Math.round(e+o+w.edgeOffset),u=Math.round(t+f)):(s&&a<0||"_left"==p&&!c)&&(p="_left",h=Math.round(r-13)/2,l=Math.round(n),d=Math.round(e-(n+w.edgeOffset+5)),u=Math.round(t+f));n=t+i+w.edgeOffset+r+8>parseInt(O(window).height()+O(window).scrollTop()),f=t+i-(w.edgeOffset+r+8)<0;n||"_bottom"==p&&n||"_top"==p&&!f?("_top"==p||"_bottom"==p?p="_top":p+="_top",h=r,u=Math.round(t-(r+5+w.edgeOffset))):(f|("_top"==p&&f)||"_bottom"==p&&!n)&&("_top"==p||"_bottom"==p?p="_bottom":p+="_bottom",h=-12,u=Math.round(t+i+w.edgeOffset)),"_right_top"==p||"_left_top"==p?u+=5:"_right_bottom"!=p&&"_left_bottom"!=p||(u-=5),"_left_top"!=p&&"_left_bottom"!=p||(d+=5),M.css({"margin-left":l+"px","margin-top":h+"px"}),g.css({"margin-left":d+"px","margin-top":u+"px"}).attr("class","tip"+p),v&&clearTimeout(v),v=setTimeout(function(){g.stop(!0,!0).fadeIn(w.fadeIn)},w.delay)}function e(){w.exit.call(this),v&&clearTimeout(v),g.fadeOut(w.fadeOut)}""!=(_=w.content?w.content:m.attr(w.attribute))&&(w.content||m.removeAttr(w.attribute),v=!1,"hover"==w.activation?(m.hover(function(){t()},function(){w.keepAlive&&g.is(":hover")||e()}),w.keepAlive&&g.hover(function(){},function(){e()})):"focus"==w.activation?m.focus(function(){t()}).blur(function(){e()}):"click"==w.activation&&(m.click(function(){return t(),!1}).hover(function(){},function(){w.keepAlive||e()}),w.keepAlive&&g.hover(function(){},function(){e()})))})}}(jQuery);

View File

@ -1,11 +0,0 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 20112014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(o){function t(o,t){if(!(o.originalEvent.touches.length>1)){o.preventDefault();var e=o.originalEvent.changedTouches[0],u=document.createEvent("MouseEvents");u.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),o.target.dispatchEvent(u)}}if(o.support.touch="ontouchend"in document,o.support.touch){var e,u=o.ui.mouse.prototype,n=u._mouseInit,c=u._mouseDestroy;u._touchStart=function(o){var u=this;!e&&u._mouseCapture(o.originalEvent.changedTouches[0])&&(e=!0,u._touchMoved=!1,t(o,"mouseover"),t(o,"mousemove"),t(o,"mousedown"))},u._touchMove=function(o){e&&(this._touchMoved=!0,t(o,"mousemove"))},u._touchEnd=function(o){e&&(t(o,"mouseup"),t(o,"mouseout"),this._touchMoved||t(o,"click"),e=!1)},u._mouseInit=function(){var t=this;t.element.bind({touchstart:o.proxy(t,"_touchStart"),touchmove:o.proxy(t,"_touchMove"),touchend:o.proxy(t,"_touchEnd")}),n.call(t)},u._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:o.proxy(t,"_touchStart"),touchmove:o.proxy(t,"_touchMove"),touchend:o.proxy(t,"_touchEnd")}),c.call(t)}}}(jQuery);

View File

@ -1,8 +0,0 @@
/*!
* JavaScript Cookie v2.1.4
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(m){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,!0!==i[s]&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u<p.length;u++){var l=p[u].split("="),C=l.slice(1).join("=");'"'===C.charAt(0)&&(C=C.slice(1,-1));try{var g=l[0].replace(d,decodeURIComponent);if(C=o.read?o.read(C,g):o(C,g)||C.replace(d,decodeURIComponent),this.json)try{C=JSON.parse(C)}catch(m){}if(n===g){c=C;break}n||(c[g]=C)}catch(m){}}return c}}return t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(n,o){t(n,"",e(o,{expires:-1}))},t.withConverter=n,t}return n(function(){})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(o){o(function(){o("a.zoom").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1}),o("a[data-rel^='prettyPhoto']").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1})})}(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
function round(a,e,r){var _,c,s,t;if(e|=0,_=Math.pow(10,e),a*=_,t=a>0|-(a<0),s=a%1==.5*t,c=Math.floor(a),s)switch(r){case"2":case"PHP_ROUND_HALF_DOWN":a=c+(t<0);break;case"3":case"PHP_ROUND_HALF_EVEN":a=c+c%2*t;break;case"4":case"PHP_ROUND_HALF_ODD":a=c+!(c%2);break;default:a=c+(t>0)}return(s?a:Math.round(a))/_}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(t){t.fn.stupidtable=function(r){return this.each(function(){var n=t(this);r=r||{},r=t.extend({},t.fn.stupidtable.default_sort_fns,r),n.on("click.stupidtable","thead th",function(){var a=t(this),e=0,i=t.fn.stupidtable.dir;a.parents("tr").find("th").slice(0,a.index()+1).each(function(){var r=t(this).attr("colspan")||1;e+=parseInt(r,10)}),e-=1;var s=a.data("sort-default")||i.ASC;a.data("sort-dir")&&(s=a.data("sort-dir")===i.ASC?i.DESC:i.ASC);var o=a.data("sort")||null;null!==o&&(n.trigger("beforetablesort",{column:a.index(),direction:s}),n.css("display"),setTimeout(function(){var d=r[o];n.children("tbody").each(function(r,n){var a=[],o=t(n),c=o.children("tr").not("[data-sort-ignore]");c.each(function(r,n){var i=t(n).children().eq(e),s=i.data("sort-value"),o=void 0!==s?s:i.text();a.push([o,n])}),a.sort(function(t,r){return d(t[0],r[0])}),s!=i.ASC&&a.reverse(),c=t.map(a,function(t){return t[1]}),o.append(c)}),n.find("th").data("sort-dir",null).removeClass("sorting-desc sorting-asc"),a.data("sort-dir",s).addClass("sorting-"+s),n.trigger("aftertablesort",{column:a.index(),direction:s}),n.css("display")},10))})})},t.fn.stupidtable.dir={ASC:"asc",DESC:"desc"},t.fn.stupidtable.default_sort_fns={"int":function(t,r){return parseInt(t,10)-parseInt(r,10)},"float":function(t,r){return parseFloat(t)-parseFloat(r)},string:function(t,r){return t.localeCompare(r)},"string-ins":function(t,r){return t=t.toLocaleLowerCase(),r=r.toLocaleLowerCase(),t.localeCompare(r)}}}(jQuery);

File diff suppressed because one or more lines are too long

View File

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

View File

@ -214,16 +214,16 @@
},
{
"name": "symfony/console",
"version": "v4.4.16",
"version": "v4.4.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5"
"reference": "12e071278e396cc3e1c149857337e9e192deca0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5",
"reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5",
"url": "https://api.github.com/repos/symfony/console/zipball/12e071278e396cc3e1c149857337e9e192deca0b",
"reference": "12e071278e396cc3e1c149857337e9e192deca0b",
"shasum": ""
},
"require": {
@ -283,7 +283,7 @@
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/console/tree/v4.4.16"
"source": "https://github.com/symfony/console/tree/v4.4.18"
},
"funding": [
{
@ -299,20 +299,20 @@
"type": "tidelift"
}
],
"time": "2020-10-24T11:50:19+00:00"
"time": "2020-12-18T07:41:31+00:00"
},
{
"name": "symfony/finder",
"version": "v4.4.16",
"version": "v4.4.18",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31"
"reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/26f63b8d4e92f2eecd90f6791a563ebb001abe31",
"reference": "26f63b8d4e92f2eecd90f6791a563ebb001abe31",
"url": "https://api.github.com/repos/symfony/finder/zipball/ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b",
"reference": "ebd0965f2dc2d4e0f11487c16fbb041e50b5c09b",
"shasum": ""
},
"require": {
@ -344,7 +344,7 @@
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v4.4.16"
"source": "https://github.com/symfony/finder/tree/v4.4.18"
},
"funding": [
{
@ -360,7 +360,7 @@
"type": "tidelift"
}
],
"time": "2020-10-24T11:50:19+00:00"
"time": "2020-12-08T16:59:59+00:00"
},
{
"name": "symfony/polyfill-mbstring",

View File

@ -879,23 +879,23 @@
},
{
"name": "sebastian/code-unit-reverse-lookup",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
"reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
"reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
"reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619",
"reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0"
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.0"
"phpunit/phpunit": "^8.5"
},
"type": "library",
"extra": {
@ -922,9 +922,15 @@
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
"source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master"
"source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2"
},
"time": "2017-03-04T06:30:41+00:00"
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-11-30T08:15:22+00:00"
},
{
"name": "sebastian/comparator",
@ -1106,20 +1112,20 @@
},
{
"name": "sebastian/exporter",
"version": "3.1.2",
"version": "3.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e"
"reference": "6b853149eab67d4da22291d36f5b0631c0fd856e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e",
"reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e",
"reference": "6b853149eab67d4da22291d36f5b0631c0fd856e",
"shasum": ""
},
"require": {
"php": "^7.0",
"php": ">=7.0",
"sebastian/recursion-context": "^3.0"
},
"require-dev": {
@ -1171,9 +1177,15 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/master"
"source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3"
},
"time": "2019-09-14T09:02:43+00:00"
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-11-30T07:47:53+00:00"
},
{
"name": "sebastian/global-state",
@ -1232,20 +1244,20 @@
},
{
"name": "sebastian/object-enumerator",
"version": "3.0.3",
"version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5"
"reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5",
"reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5",
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2",
"reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2",
"shasum": ""
},
"require": {
"php": "^7.0",
"php": ">=7.0",
"sebastian/object-reflector": "^1.1.1",
"sebastian/recursion-context": "^3.0"
},
@ -1277,26 +1289,32 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
"source": "https://github.com/sebastianbergmann/object-enumerator/tree/master"
"source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4"
},
"time": "2017-08-03T12:35:26+00:00"
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-11-30T07:40:27+00:00"
},
{
"name": "sebastian/object-reflector",
"version": "1.1.1",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
"reference": "773f97c67f28de00d397be301821b06708fca0be"
"reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be",
"reference": "773f97c67f28de00d397be301821b06708fca0be",
"url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d",
"reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d",
"shasum": ""
},
"require": {
"php": "^7.0"
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
@ -1326,26 +1344,32 @@
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
"source": "https://github.com/sebastianbergmann/object-reflector/tree/master"
"source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2"
},
"time": "2017-03-29T09:07:27+00:00"
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-11-30T07:37:18+00:00"
},
{
"name": "sebastian/recursion-context",
"version": "3.0.0",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8"
"reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
"reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb",
"reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb",
"shasum": ""
},
"require": {
"php": "^7.0"
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
@ -1366,14 +1390,14 @@
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
@ -1383,9 +1407,15 @@
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"source": "https://github.com/sebastianbergmann/recursion-context/tree/master"
"source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1"
},
"time": "2017-03-03T06:23:57+00:00"
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-11-30T07:34:24+00:00"
},
{
"name": "sebastian/resource-operations",

View File

@ -345,16 +345,16 @@
},
{
"name": "wp-cli/i18n-command",
"version": "v2.2.5",
"version": "v2.2.6",
"source": {
"type": "git",
"url": "https://github.com/wp-cli/i18n-command.git",
"reference": "b02ecdc9a57f9633740c254d19749118b7411f0f"
"reference": "a66da3f09f6a728832381012848c3074bf1635c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/b02ecdc9a57f9633740c254d19749118b7411f0f",
"reference": "b02ecdc9a57f9633740c254d19749118b7411f0f",
"url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/a66da3f09f6a728832381012848c3074bf1635c8",
"reference": "a66da3f09f6a728832381012848c3074bf1635c8",
"shasum": ""
},
"require": {
@ -400,9 +400,9 @@
"homepage": "https://github.com/wp-cli/i18n-command",
"support": {
"issues": "https://github.com/wp-cli/i18n-command/issues",
"source": "https://github.com/wp-cli/i18n-command/tree/master"
"source": "https://github.com/wp-cli/i18n-command/tree/v2.2.6"
},
"time": "2020-07-08T15:20:38+00:00"
"time": "2020-12-07T19:28:27+00:00"
},
{
"name": "wp-cli/mustangostang-spyc",

View File

@ -1,5 +1,227 @@
== Changelog ==
= 4.9.0 =
**WooCommerce**
* Localization - Add 'Ladakh' to the list of Indian states. #28458
* Localization - Revert change and make city and postcode required again for Serbia. #28415
* Performance - Added cache and filter for wc-customer get operations. #27352
* Performance - Hydrate caches for wc_get_order to improve performance. #27734
* Performance - Fetch only required data from DB when possible in API calls. #27735
* Enhancement - add product and variation before_set_stock action hooks to allow 3rd party plugins to snapshot a products stock quantity before it is updated. #27558
* Enhancement - Add the ability to avoid unsupported updates based on the PHP version. #28151
* Fix - Format tax class before insertion to prevent conflicts with default classes. #27451
* Fix - Change href of premium support link. #27675
* Fix - `get_next` will now return null if the same action is currently executing to help with missed webhooks issue. #27850
* Fix - Return default date/time formats from wc_date_format and wc_time_format if WP core formats are empty. #28322
* Fix - Use WC function to get low stock amount instead of accessing option directly. #28440
* Fix - Use single quotes inside MySQL query to avoid issues when ANSI_QUOTES is enabled. #28468
* Fix - Remove deprecated PayPal Standard "Page Style" setting. #28499
* Fix - Remove GB and IM from EU VAT countries. #28538
* Fix - Fix issue where customer could checkout although mandatory field "Country" was not given. #28543
* Fix - Switch to general tab when enabling virtual on a product setting. #28414
* Fix - Unwanted HTML is showing up on the product search fields when searching for a product variation. #28416
* Fix - Add `postbox` class to `woocommerce_attribute wc-metabox` for proper targeting. #28351
* Fix - Error tooltip misaligned on tax country field. #28565
* Fix - Prevent meta_data from overwriting column data in customer's read. #28102
* Fix - Also count comment types with '' and 'comment' in the review count query. #28624
* Fix - Better error messages when usage limit are reached. #28592
* Fix - Adjust stock items only for statuses which reduces the stock. #28620
* Fix - Named parameter to fix DB update routine on PHP8. #28537
* Dev - Hook for intializing price slider in frontend. #28014
* Dev - Add support for running a custom initialization script for tests. #28041
* Dev - Use the coenjacobs/mozart package to renamespace vendor packages. #28147
* Dev - Documentation for `wc_get_container`. #28269
* Dev - Removed unused dockerfile. #28270
* Dev - replaces deprecated jQuery.fn.click( handler ) with jQuery.fn.on( 'click', handler ). #28332
* Dev - removed jQuery code that didn't work that was supposed to interact with the coupon page. #28287
* Dev - Documentation return type fixes for WC_Payment_Gateway class. #28358
* Dev - Remove function existence check for determine_locale. #28386
* Dev - add a missing second parameter to our copy of the WP action lostpassword_post. #28467
* Dev - Added argument on wc_get_template() to pass email object to email header and footer templates. #28204
* Dev - Add is_numeric checks on sales reports by date to prevent notices with PHP 7.4. #28403
**WooCommerce - Admin 1.8.0 & 1.8.1**
* Enhancement - Add “filter by variations in reports” inbox note. #5208
* Enhancement - Tasks extensibility in Home Screen. #5794
* Enhancement - Add page parameter to override default wc-admin page in Navigation API. #5821
* Enhancement - Introduce the customer effort score (CES) feature.
* Enhancement - Rework task extensibility in the homescreen. #5794
* Enhancement - Migrate the reviews panel to the homescreen. #5706
* Enhancement - Migrate reviews panel to home screen. #5706
* Enhancement - Add Razorpay to payment task for stores in India #5775
* Enhancement - Migrate Stock Panel to Homescreen. #5729
* Enhancement - Add enhanced placeholders for Marketing components. #5611
* Enhancement - Allow switching on/off the navigation feature in plugin and core builds. #5697
* Fix - Product exclusion filter on Orders Report.
* Fix - Typo in Variation Stats DataStore context filter value. #5784
* Fix - Move collapsible config to panels object, to allow for more control. #5855
* Fix - Invalidate product count if the last product was updated in the list. #5790
* Fix - Add Customer Type column to the Orders report table. #5820
* Fix - Product exclusion filter on Orders Report. #5822
* Fix - Show the customer type column in Orders report table. #5820
* Fix - make sure Customers page updates after order update. #5776
* Fix - Fix fatal errors when child themes are installed in a subdirectory. #5783
* Fix - Allow actionable statuses in orders endpoint(s) filters. #5733
* Fix - snackbar dismissal bug. #5696
* Fix - Only import the Gridicons we need, to reduce package size. #5668
* Fix - Stop order panels flickering on load. #5655
* Fix - Load wc-tracks to avoid fatal errors. #5645 #5638
* Fix - Preventing desktop-sized navigation placeholder from appearing on mobile during load. #5616
* Fix - Completed tasks tracking causing infinite loop #5941
* Fix - Remove Navigation access #5940
* Tweak - Fix inconsistent REST API parameter name for customer type filtering. #5823
* Tweak - Improve styles of the tax task. #5709
* Tweak - Do not show store setup link on the homescreen. #5801
* Tweak - Revert the #5001 work to order tasks by completion. #5721
* Tweak - Revert the smart tax defaults work. #5720
* Tweak - Do not show store setup activity panel on the homescreen. #5801
* Tweak - Dont show the Orders panel on the homescreen with the Task List. #5552
* Tweak - Continue showing tasklist even if list is complete, only hide if set to hidden. #5673
* Tweak - Remove check for Jetpack and WCS from Stripe onboarding task. #4933
**WooCommerce Blocks 3.9.0 & 4.0.0**
* Enhancements - Expose `discount_type` in Store API coupon endpoints. ([3399](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3399))
* Enhancements - Exclude checkout-draft orders from WC Admin reports and My Account > Orders. ([3379](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3379))
* Fix - Hide spinner on cart block's "Proceed to Checkout" link when page unloads. ([3436](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3436))
* Fix - Fixed express payment methods processing not completing when Stripe payment method active. ([3432](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3432))
* Fix - Refresh PaymentRequest after cancelling payment to prevent addresses remaining populated on repeat attempts. ([3430](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3430))
* Fix - Ensure "Add a note to your order" section is styled correctly when disabled. ([3427](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3427))
* Fix - Prevent checkout step heading text overlapping actual heading on small viewports. ([3425](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3425))
* Fix - Improve Stripe payment request API payment method availability. ([3424](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3424))
* Fix - Stop hidden products from being linked in cart and checkout blocks. ([3415](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3415))
* Fix - Show Express Payment Method Error Notices after Payment Failure. ([3410](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3410))
* Fix - Fix cart block `isLarge` console error in the editor when running WordPress 5.6 beta. ([3408](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3408))
* Fix - Orders not being placed when paying with an Express payment method from the Cart block. ([3403](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3403))
* Fix - Fix incorrect usage of static method in Stripe payment method integration. ([3400](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3400))
* Fix - Cart and checkout should respect the global "Hide shipping costs until an address is entered" setting. ([3383](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3383))
* Fix - Sync shipping address with billing address when shipping address fields are disabled. This fixes a bug where taxes would not reflect changes in billing address when they are set to be calculated from billing address ([3358](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3358))
* Fix - Checkout block: Prevent `Create an account` from creating up a user account if the order fails coupon validation. ([3423](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3423))
* Fix - Make sure cart is initialized before the CartItems route is used in the Store API. ([3488](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3488))
* Fix - Fix notice close button color in Twenty Twenty One dark mode. ([3472](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3472))
* Fix - Remove held stock for a draft order if an item is removed from the cart. ([3468](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3468))
* Fix - Ensure correct alignment of checkout notice's dismiss button. ([3455](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3455))
* Fix - Fixed a bug in Checkout block (Store API) causing checkout to fail when using an invalid coupon and creating an account.
* Fix - Checkout block: Correctly handle cases where the order fails with an error (e.g. invalid coupon) and a new user account is created. ([3429](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3429))
* Dev - Refactored and reordered Store API checkout processing to handle various edge cases and better support future extensibility. ([3454](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3454))
* Dev - Support a plain js configuration argument to payment method registration APIs. ([3404](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404))
* Dev - Change register_endpoint_data to use an array of params instead of individual params. ([3478](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3478))
* Dev - Expose store/cart via ExtendRestApi to extensions. ([3445](https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3445))
* Dev - Added formatting classes to the Store API for extensions to consume.
= 4.8.0 - 2020-12-08 =
**WooCommerce**
* Enhancement - Limited the system status report's "not tested with version" warning to major versions. #28114
* Enhancement - Add shipping, tax, and fee lines to refund REST API response. #28241
* Enhancement - Added support for Twenty Twenty-One theme. #28134
* Tweak - Reduced the memory usage of AJAX product searches. #28177
* Tweak - Replaced deprecated jQuery functionality. #28005, #28058
* Tweak - Hid "Add to cart" button for out of stock grouped products. #28169
* Tweak - Made product date deserialization more explicit. #28052
* Fix - Stock adjustment when deleting a refunded order item. #28069
* Fix - Avatar display for recent reviews widget in admin area. #28067
* Fix - Incorrect product sorting user capability. #28062
* Fix - PayPal response emptying uninitialized cart. #28027
* Fix - Display of visual feedback after pressing "Place Order" in `Twenty Twenty` and `Twenty Nineteen` themes #27997
* Fix - Category and tag bulk deletion message. #27856
* Fix - Corrected Puerto Rico address validation. #28465
* Dev - Filter: `woocommerce_product_has_options` to products. #27514
* Dev - Added error message to `checkout_error` JS event. #28101
* Dev - Replaced usage of deprecated `woocommerce_reset_loop()` in product category shortcodes. #28242
* Dev - Set "Tested up to" header to WordPress 5.6. #28388
* Localization - Jamaican currency, states, and address structure. #27723
* Localization - Better display of inclusive taxes during checkout. #28064
* Localization - Validation for Belgium postcodes. #28145
**WooCommerce Admin - 1.7.0 & 1.7.1 & 1.7.2 & 1.7.3**
* Enhancement - Variations report. #5167
* Enhancement - Add ability to toggle homescreen layouts. #5429
* Enhancement - Accordion component #5474
* Enhancement - Badge component #5520
* Tweak - Remove customer analytics data upon order deletion #5171
* Tweak - Updating Stripe key field validation to support test keys #5201
* Tweak - Wrap search control selected items in list #5231
* Tweak - Update store setup link to redirect to setup wizard #5200
* Tweak - Removing breadcrumbs from wc-admin header #5232
* Tweak - Use consistent markdown headers in navigation readme #5417
* Tweak - Remove Store Setup Alert #5499
* Tweak - Customers: Update column heading for date registered #5542
* Tweak - alter homescreen layout. #5465
* Fix - Added support for custom actionable statuses. #5550
* Fix - wrong casing used on the PayPal brand name #5514 🎉 @rtpHarry
* Fix - Import @wordpress/base-styles/default-custom-properties #5491
* Fix - downloads report #5441
* Fix - missing custom autocompleter attribute in Search component of Advanced Filter #5448
* Fix - empty no posts state on Marketing page. #5411
* Fix - visual issues in the Search component. #5199
* Fix - Inconsistent line endings in readme.txt. #5281
* Fix - popover menu to expand menu item width to 100% #5519
* Fix - Wrong class name for querying Categories Report #5522 🎉 @zzap
* Fix - Remove label printing mention for non us countries #5527
* Fix - First product script navigation dependency #5584
* Fix - Added support for custom actionable statuses #5550
* Fix - Display the store management links last on the homescreen #5579
* Fix - Ensure the "Set up additional payment providers" inbox notification is shown when relevant after completing the OBW. #5547
* Fix - Load wc-tracks in the homepage notice admin script. #5638
* Fix - Link component prop caused a React warning. #5653
* Fix - Flickering of order panel while loading. #5655
* Fix - Tax code duplicated when clicking the button to remove. #5638
* Fix - Restore Autoloading of WooCommerce Classes in PHP Tests. #5650
* Fix - Skip WC Payment plugin note if plugin not added through the onboarding process. #5619
* Fix - Use error_log() to log the deprecated class calls instead of `_deprecated_function()`. #5802
* Fix - Don't show the Orders panel on the homescreen with the Task List. #5552
* Fix - Home Screen: Do not show store setup activity panel. #5801
* Dev - Home Screen - migrate orders panel. #5455
* Dev - Store Profiler - include Creative Mail as a free extension #5543
* Dev - Add undefined check in intervals data util #5546
* Dev - Fix wakeup visibility for PHP 8 compatibility #5211
* Dev - Fix header height and positioning for wc nav #5173
* Dev - Add remote inbox notification rule processors for country and state #5203
* Dev - Rename admin notes classes and file names to fit conventions #514
* Dev - remove checks of store registration that are no longer needed. #5170
* Dev - Fix version update script for composer.json #5165
* Dev - Remove getAdminLink from data package #5158
* Dev - Bump @woocommerce/components dependencies. #5153
* Dev - Add note status remote inbox notifications rule processor #5207
* Dev - Make code chunk filenames more stable. #5229
* Dev - Inbox Panel component moved #5252
* Dev - Added animation to Inbox note deletion #5263
* Dev - Update starter pack dependencies #5254
* Dev - Ensure test zips have latest packages from npm and composer. #5313
* Dev - Add remote inbox notifications rule allowing access to any option #5206
* Dev - Add manage orders on the go admin note #5159
* Dev - Add WooCommerceDependencyExtractionWebpackPlugin package #5198
* Dev - Migrate devdocs examples to Storybook stories #5271
* Dev - Remove Enzyme in favor of React Testing Library #5299
* Dev - Add exclusion rule to PHPCS config for TODO comments #5388
* Dev - Remove no longer used isPanelEmpty logic. #5423
* Dev - Use new @wordpress/components Card on Marketing page. #5428
* Dev - Add PSR-4 naming checks to PHP linting. #5512
* Dev - Rearrange the store management links under categories add filter woocommerce_admin_homescreen_quicklinks. #5476
* Dev - Restyle the setup task list header to display incomplete tasks #5520
**WooCommerce Blocks - 3.7.0 & 3.7.1 & 3.8.0 & 3.8.1**
* Enhancement - Allow shoppers to sign-up for an account from the Checkout block. #3331
* Enhancement - Standardise & refactor colors scss to align with Gutenberg colors and WooCommerce brand. #3300
* Tweak - Show the phone number field in the billing section when shipping is disabled in settings. #3376
* Tweak - Add new doc referencing feature flags and experimental interfaces. #3348
* Tweak - Add __experimental_woocommerce_blocks_checkout_order_processed action. #3238
* Fix - Fix PHP 8 error when argument is not invocable in AssetsDataRegistry::Add_data. #3315
* Fix - Improve layout of Cart block line item quantity selector & price on smaller screens. #3299
* Fix - Correctly process orders with $0 total (e.g. via coupon) in Checkout block. #3298
* Fix - Respect Enable Taxes setting for checkout block taxes display. #3291
* Fix - Fix 3D secure payment errors. #3272
* Fix - Show current selected attributes when re-edit Products by Attribute block. #3185
* Fix - Ensure that accounts are not created via checkout block request if account registration is disabled for WooCommerce. #3371
* Fix - radio controls and checkboxes in Twenty Twenty One dark theme. #3446
* Fix - Twenty Twenty One Price filter, Active filters and radio control styling. #3444
* Fix - Twenty Twenty One Button and Placeholder Styling. #3443
* Fix - checkbox and textarea styles in Twenty Twenty One when it has dark controls active. #3450
= 4.7.1 - 2020-11-24 =
**WooCommerce**

View File

@ -14,20 +14,21 @@
],
"require": {
"php": ">=7.0",
"automattic/jetpack-autoloader": "2.6.0",
"automattic/jetpack-autoloader": "2.7.1",
"automattic/jetpack-constants": "1.5.1",
"composer/installers": "~1.7",
"maxmind-db/reader": "1.6.0",
"pelago/emogrifier": "3.1.0",
"psr/container": "1.0.0",
"woocommerce/action-scheduler": "3.1.6",
"woocommerce/woocommerce-admin": "1.7.2",
"woocommerce/woocommerce-blocks": "3.8.1"
"woocommerce/woocommerce-admin": "1.8.3",
"woocommerce/woocommerce-blocks": "4.0.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.0"
},

40
composer.lock generated
View File

@ -4,27 +4,27 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "486f7eb6eda8b5a537d5a6e72c4cbdad",
"content-hash": "758b097c13e89200b28bf3a3b5fc2752",
"packages": [
{
"name": "automattic/jetpack-autoloader",
"version": "v2.6.0",
"version": "v2.7.1",
"source": {
"type": "git",
"url": "https://github.com/Automattic/jetpack-autoloader.git",
"reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58"
"reference": "5437697a56aefbdf707849b9833e1b36093d7a73"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/47dde8dbca6b1e30f176725f2f748a9abefcaf58",
"reference": "47dde8dbca6b1e30f176725f2f748a9abefcaf58",
"url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/5437697a56aefbdf707849b9833e1b36093d7a73",
"reference": "5437697a56aefbdf707849b9833e1b36093d7a73",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5"
"yoast/phpunit-polyfills": "0.2.0"
},
"type": "composer-plugin",
"extra": {
@ -44,9 +44,9 @@
],
"description": "Creates a custom autoloader for a plugin or theme.",
"support": {
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.6.0"
"source": "https://github.com/Automattic/jetpack-autoloader/tree/v2.7.1"
},
"time": "2020-11-19T21:20:12+00:00"
"time": "2020-12-18T22:33:59+00:00"
},
{
"name": "automattic/jetpack-constants",
@ -515,16 +515,16 @@
},
{
"name": "woocommerce/woocommerce-admin",
"version": "1.7.2",
"version": "1.8.3",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "efd94d917504fe71bae650233de47344c8d5c005"
"reference": "534442980c34369f711efdb8e85fdcb1363be712"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/efd94d917504fe71bae650233de47344c8d5c005",
"reference": "efd94d917504fe71bae650233de47344c8d5c005",
"url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/534442980c34369f711efdb8e85fdcb1363be712",
"reference": "534442980c34369f711efdb8e85fdcb1363be712",
"shasum": ""
},
"require": {
@ -558,22 +558,22 @@
"homepage": "https://github.com/woocommerce/woocommerce-admin",
"support": {
"issues": "https://github.com/woocommerce/woocommerce-admin/issues",
"source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.7.2"
"source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.8.3"
},
"time": "2020-11-19T17:48:33+00:00"
"time": "2021-01-06T00:00:42+00:00"
},
{
"name": "woocommerce/woocommerce-blocks",
"version": "v3.8.1",
"version": "v4.0.0",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-gutenberg-products-block.git",
"reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c"
"reference": "f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/e5aef9eddd13c5511ba673eb70ed8cb3e80d828c",
"reference": "e5aef9eddd13c5511ba673eb70ed8cb3e80d828c",
"url": "https://api.github.com/repos/woocommerce/woocommerce-gutenberg-products-block/zipball/f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e",
"reference": "f5b2485254f36f0b85fd0f30c28e17bdf44a8d1e",
"shasum": ""
},
"require": {
@ -609,9 +609,9 @@
],
"support": {
"issues": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues",
"source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v3.8.1"
"source": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/v4.0.0"
},
"time": "2020-11-23T20:48:39+00:00"
"time": "2020-12-08T13:17:01+00:00"
}
],
"packages-dev": [

View File

@ -306,6 +306,40 @@ return array(
'CZ' => array(),
'DE' => array(),
'DK' => array(),
'DO' => array( // Dominican Republic.
'DO-01' => __( 'Distrito Nacional', 'woocommerce' ),
'DO-02' => __( 'Azua', 'woocommerce' ),
'DO-03' => __( 'Baoruco', 'woocommerce' ),
'DO-04' => __( 'Barahona', 'woocommerce' ),
'DO-05' => __( 'Dajabón', 'woocommerce' ),
'DO-06' => __( 'Duarte', 'woocommerce' ),
'DO-07' => __( 'Elías Piña', 'woocommerce' ),
'DO-08' => __( 'El Seibo', 'woocommerce' ),
'DO-09' => __( 'Espaillat', 'woocommerce' ),
'DO-10' => __( 'Independencia', 'woocommerce' ),
'DO-11' => __( 'La Altagracia', 'woocommerce' ),
'DO-12' => __( 'La Romana', 'woocommerce' ),
'DO-13' => __( 'La Vega', 'woocommerce' ),
'DO-14' => __( 'María Trinidad Sánchez', 'woocommerce' ),
'DO-15' => __( 'Monte Cristi', 'woocommerce' ),
'DO-16' => __( 'Pedernales', 'woocommerce' ),
'DO-17' => __( 'Peravia', 'woocommerce' ),
'DO-18' => __( 'Puerto Plata', 'woocommerce' ),
'DO-19' => __( 'Hermanas Mirabal', 'woocommerce' ),
'DO-20' => __( 'Samaná', 'woocommerce' ),
'DO-21' => __( 'San Cristóbal', 'woocommerce' ),
'DO-22' => __( 'San Juan', 'woocommerce' ),
'DO-23' => __( 'San Pedro de Macorís', 'woocommerce' ),
'DO-24' => __( 'Sánchez Ramírez', 'woocommerce' ),
'DO-25' => __( 'Santiago', 'woocommerce' ),
'DO-26' => __( 'Santiago Rodríguez', 'woocommerce' ),
'DO-27' => __( 'Valverde', 'woocommerce' ),
'DO-28' => __( 'Monseñor Nouel', 'woocommerce' ),
'DO-29' => __( 'Monte Plata', 'woocommerce' ),
'DO-30' => __( 'Hato Mayor', 'woocommerce' ),
'DO-31' => __( 'San José de Ocoa', 'woocommerce' ),
'DO-32' => __( 'Santo Domingo', 'woocommerce' ),
),
'DZ' => array(
'DZ-01' => __( 'Adrar', 'woocommerce' ),
'DZ-02' => __( 'Chlef', 'woocommerce' ),
@ -442,6 +476,7 @@ return array(
),
'FI' => array(),
'FR' => array(),
'GF' => array(),
'GH' => array( // Ghanaian Regions.
'AF' => __( 'Ahafo', 'woocommerce' ),
'AH' => __( 'Ashanti', 'woocommerce' ),
@ -477,7 +512,30 @@ return array(
'L' => __( 'South Aegean', 'woocommerce' ),
'M' => __( 'Crete', 'woocommerce' ),
),
'GF' => array(),
'GT' => array( // Guatemalan states.
'AV' => __( 'Alta Verapaz', 'woocommerce' ),
'BV' => __( 'Baja Verapaz', 'woocommerce' ),
'CM' => __( 'Chimaltenango', 'woocommerce' ),
'CQ' => __( 'Chiquimula', 'woocommerce' ),
'PR' => __( 'El Progreso', 'woocommerce' ),
'ES' => __( 'Escuintla', 'woocommerce' ),
'GU' => __( 'Guatemala', 'woocommerce' ),
'HU' => __( 'Huehuetenango', 'woocommerce' ),
'IZ' => __( 'Izabal', 'woocommerce' ),
'JA' => __( 'Jalapa', 'woocommerce' ),
'JU' => __( 'Jutiapa', 'woocommerce' ),
'PE' => __( 'Petén', 'woocommerce' ),
'QZ' => __( 'Quetzaltenango', 'woocommerce' ),
'QC' => __( 'Quiché', 'woocommerce' ),
'RE' => __( 'Retalhuleu', 'woocommerce' ),
'SA' => __( 'Sacatepéquez', 'woocommerce' ),
'SM' => __( 'San Marcos', 'woocommerce' ),
'SR' => __( 'Santa Rosa', 'woocommerce' ),
'SO' => __( 'Sololá', 'woocommerce' ),
'SU' => __( 'Suchitepéquez', 'woocommerce' ),
'TO' => __( 'Totonicapán', 'woocommerce' ),
'ZA' => __( 'Zacapa', 'woocommerce' )
),
'HK' => array( // Hong Kong states.
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),
@ -590,7 +648,7 @@ return array(
'ML' => __( 'Meghalaya', 'woocommerce' ),
'MZ' => __( 'Mizoram', 'woocommerce' ),
'NL' => __( 'Nagaland', 'woocommerce' ),
'OR' => __( 'Orissa', 'woocommerce' ),
'OR' => __( 'Odisha', 'woocommerce' ),
'PB' => __( 'Punjab', 'woocommerce' ),
'RJ' => __( 'Rajasthan', 'woocommerce' ),
'SK' => __( 'Sikkim', 'woocommerce' ),
@ -1237,6 +1295,7 @@ return array(
'SD' => __( 'Sindh', 'woocommerce' ),
),
'PL' => array(),
'PR' => array(),
'PT' => array(),
'PY' => array( // Paraguay states.
'PY-ASU' => __( 'Asunción', 'woocommerce' ),
@ -1303,7 +1362,6 @@ return array(
'VS' => __( 'Vaslui', 'woocommerce' ),
'VN' => __( 'Vrancea', 'woocommerce' ),
),
'RS' => array(),
'SG' => array(),
'SK' => array(),
'SI' => array(),

View File

@ -1349,7 +1349,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @param int $qty Quantity to add.
* @param array $args Args for the added product.
* @return int
* @throws WC_Data_Exception Exception thrown if the item cannot be added to the cart.
*/
public function add_product( $product, $qty = 1, $args = array() ) {
if ( $product ) {

View File

@ -218,7 +218,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
/**
* Get the return url (thank you page).
*
* @param WC_Order $order Order object.
* @param WC_Order|null $order Order object.
* @return string
*/
public function get_return_url( $order = null ) {
@ -369,9 +369,9 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
* If the gateway declares 'refunds' support, this will allow it to refund.
* a passed in amount.
*
* @param int $order_id Order ID.
* @param float $amount Refund amount.
* @param string $reason Refund reason.
* @param int $order_id Order ID.
* @param float|null $amount Refund amount.
* @param string $reason Refund reason.
* @return boolean True or false based on success, or a WP_Error object.
*/
public function process_refund( $order_id, $amount = null, $reason = '' ) {

View File

@ -25,11 +25,25 @@ class WC_Admin_Addons {
public static function get_featured() {
$featured = get_transient( 'wc_addons_featured' );
if ( false === $featured ) {
$raw_featured = wp_safe_remote_get( 'https://d3t0oesq8995hv.cloudfront.net/add-ons/featured-v2.json', array( 'user-agent' => 'WooCommerce Addons Page' ) );
$headers = array();
$auth = WC_Helper_Options::get( 'auth' );
if ( ! empty( $auth['access_token'] ) ) {
$headers['Authorization'] = 'Bearer ' . $auth['access_token'];
}
$raw_featured = wp_safe_remote_get(
'https://woocommerce.com/wp-json/wccom-extensions/1.0/featured',
array(
'headers' => $headers,
'user-agent' => 'WooCommerce Addons Page',
)
);
if ( ! is_wp_error( $raw_featured ) ) {
$featured = json_decode( wp_remote_retrieve_body( $raw_featured ) );
if ( $featured ) {
set_transient( 'wc_addons_featured', $featured, WEEK_IN_SECONDS );
set_transient( 'wc_addons_featured', $featured, DAY_IN_SECONDS );
}
}
}
@ -71,9 +85,19 @@ class WC_Admin_Addons {
*/
public static function get_extension_data( $category, $term, $country ) {
$parameters = self::build_parameter_string( $category, $term, $country );
$raw_extensions = wp_remote_get(
'https://woocommerce.com/wp-json/wccom-extensions/1.0/search' . $parameters
$headers = array();
$auth = WC_Helper_Options::get( 'auth' );
if ( ! empty( $auth['access_token'] ) ) {
$headers['Authorization'] = 'Bearer ' . $auth['access_token'];
}
$raw_extensions = wp_safe_remote_get(
'https://woocommerce.com/wp-json/wccom-extensions/1.0/search' . $parameters,
array( 'headers' => $headers )
);
if ( ! is_wp_error( $raw_extensions ) ) {
$addons = json_decode( wp_remote_retrieve_body( $raw_extensions ) )->products;
}

View File

@ -462,7 +462,7 @@ class WC_Admin_Attributes {
<script type="text/javascript">
/* <![CDATA[ */
jQuery( 'a.delete' ).click( function() {
jQuery( 'a.delete' ).on( 'click', function() {
if ( window.confirm( '<?php esc_html_e( 'Are you sure you want to delete this attribute?', 'woocommerce' ); ?>' ) ) {
return true;
}

View File

@ -377,7 +377,7 @@ class WC_Admin_Status {
private static function output_plugins_info( $plugins, $untested_plugins ) {
$wc_version = Constants::get_constant( 'WC_VERSION' );
if ( 'major' === WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE ) {
if ( 'major' === Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Since we're only testing against major, we don't need to show minor and patch version.
$wc_version = $wc_version[0] . '.0';
}

View File

@ -236,7 +236,7 @@ class WC_Admin {
'<a href="https://wordpress.org/support/plugin/woocommerce/reviews?rate=5#new-post" target="_blank" class="wc-rating-link" aria-label="' . esc_attr__( 'five star', 'woocommerce' ) . '" data-rated="' . esc_attr__( 'Thanks :)', 'woocommerce' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
);
wc_enqueue_js(
"jQuery( 'a.wc-rating-link' ).click( function() {
"jQuery( 'a.wc-rating-link' ).on( 'click', function() {
jQuery.post( '" . WC()->ajax_url() . "', { action: 'woocommerce_rated' } );
jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
});"

View File

@ -118,7 +118,9 @@ class WC_Meta_Box_Order_Actions {
WC()->payment_gateways();
WC()->shipping();
WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order );
add_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' );
WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order, true );
remove_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' );
do_action( 'woocommerce_after_resend_order_email', $order, 'new_order' );

View File

@ -116,7 +116,7 @@ class WC_Meta_Box_Product_Data {
'variations' => array(
'label' => __( 'Variations', 'woocommerce' ),
'target' => 'variable_product_options',
'class' => array( 'variations_tab', 'show_if_variable' ),
'class' => array( 'show_if_variable' ),
'priority' => 60,
),
'advanced' => array(
@ -177,7 +177,7 @@ class WC_Meta_Box_Product_Data {
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) );
$variations_total_pages = ceil( $variations_count / $variations_per_page );
include __DIR__ . '/views/html-product-data-variations.php';
include __DIR__ . '/views/html-product-data-variations.php';
}
/**
@ -349,7 +349,7 @@ class WC_Meta_Box_Product_Data {
$date_on_sale_from = wc_clean( wp_unslash( $_POST['_sale_price_dates_from'] ) );
if ( ! empty( $date_on_sale_from ) ) {
$date_on_sale_from = date( 'Y-m-d 00:00:00', strtotime( $date_on_sale_from ) );
$date_on_sale_from = date( 'Y-m-d 00:00:00', strtotime( $date_on_sale_from ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}
}
@ -358,7 +358,7 @@ class WC_Meta_Box_Product_Data {
$date_on_sale_to = wc_clean( wp_unslash( $_POST['_sale_price_dates_to'] ) );
if ( ! empty( $date_on_sale_to ) ) {
$date_on_sale_to = date( 'Y-m-d 23:59:59', strtotime( $date_on_sale_to ) );
$date_on_sale_to = date( 'Y-m-d 23:59:59', strtotime( $date_on_sale_to ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}
}
@ -475,7 +475,7 @@ class WC_Meta_Box_Product_Data {
$date_on_sale_from = wc_clean( wp_unslash( $_POST['variable_sale_price_dates_from'][ $i ] ) );
if ( ! empty( $date_on_sale_from ) ) {
$date_on_sale_from = date( 'Y-m-d 00:00:00', strtotime( $date_on_sale_from ) );
$date_on_sale_from = date( 'Y-m-d 00:00:00', strtotime( $date_on_sale_from ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}
}
@ -484,7 +484,7 @@ class WC_Meta_Box_Product_Data {
$date_on_sale_to = wc_clean( wp_unslash( $_POST['variable_sale_price_dates_to'][ $i ] ) );
if ( ! empty( $date_on_sale_to ) ) {
$date_on_sale_to = date( 'Y-m-d 23:59:59', strtotime( $date_on_sale_to ) );
$date_on_sale_to = date( 'Y-m-d 23:59:59', strtotime( $date_on_sale_to ) ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}
}

View File

@ -150,10 +150,15 @@ class WC_Plugin_Updates {
* with the $new_version.
*
* @param string $new_version WooCommerce version to test against.
* @param string $release 'major' or 'minor'.
* @param string $release 'major', 'minor', or 'none'.
* @return array of plugin info arrays
*/
public function get_untested_plugins( $new_version, $release ) {
// Since 5.0 all versions are backwards compatible.
if ( 'none' === $release ) {
return array();
}
$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 );

View File

@ -42,9 +42,14 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates {
* @param stdClass $response Plugin update response.
*/
public function in_plugin_update_message( $args, $response ) {
$version_type = Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' );
if ( ! is_string( $version_type ) ) {
$version_type = 'none';
}
$this->new_version = $response->new_version;
$this->upgrade_notice = $this->get_upgrade_notice( $response->new_version );
$this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, 'major' );
$this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, $version_type );
$current_version_parts = explode( '.', Constants::get_constant( 'WC_VERSION' ) );
$new_version_parts = explode( '.', $this->new_version );

View File

@ -18,7 +18,7 @@ $untested_plugins_msg = sprintf(
?>
<div id="wc_untested_extensions_modal">
<div class="wc_untested_extensions_modal--content">
<h1><?php esc_html_e( "This is a major update, are you sure you're ready?", 'woocommerce' ); ?></h1>
<h1><?php esc_html_e( "Are you sure you're ready?", 'woocommerce' ); ?></h1>
<div class="wc_plugin_upgrade_notice extensions_warning">
<p><?php echo esc_html( $untested_plugins_msg ); ?></p>
@ -41,7 +41,7 @@ $untested_plugins_msg = sprintf(
</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 esc_html_e( 'Learn more', 'woocommerce' ); ?></a></p>
<p><?php esc_html_e( '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 esc_html_e( 'Learn more', 'woocommerce' ); ?></a></p>
<?php if ( current_user_can( 'update_plugins' ) ) : ?>
<div class="actions">

View File

@ -12,8 +12,6 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* WC_Report_Coupon_Usage
*
* @author WooThemes
* @category Admin
* @package WooCommerce\Admin\Reports
* @version 2.1.0
*/
@ -330,25 +328,26 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
</table>
</div>
<script type="text/javascript">
jQuery('.section_title').click(function(){
var next_section = jQuery(this).next('.section');
jQuery( '.section_title' ).on( 'click', function() {
var next_section = jQuery( this ).next( '.section' );
if ( jQuery(next_section).is(':visible') )
if ( jQuery( next_section ).is( ':visible' ) ) {
return false;
}
jQuery('.section:visible').slideUp();
jQuery('.section_title').removeClass('open');
jQuery(this).addClass('open').next('.section').slideDown();
jQuery( '.section:visible' ).slideUp();
jQuery( '.section_title' ).removeClass( 'open' );
jQuery( this ).addClass( 'open' ).next( '.section' ).slideDown();
return false;
});
jQuery('.section').slideUp( 100, function() {
} );
jQuery( '.section' ).slideUp( 100, function() {
<?php if ( empty( $this->coupon_codes ) ) : ?>
jQuery('.section_title:eq(1)').click();
jQuery( '.section_title:eq(1)' ).click();
<?php else : ?>
jQuery('.section_title:eq(0)').click();
jQuery( '.section_title:eq(0)' ).click();
<?php endif; ?>
});
} );
</script>
<?php
}

View File

@ -62,6 +62,7 @@ class WC_Report_Customer_List extends WP_List_Table {
delete_user_meta( $user_id, '_money_spent' );
delete_user_meta( $user_id, '_order_count' );
delete_user_meta( $user_id, '_last_order' );
/* translators: User display name */
echo '<div class="updated"><p>' . sprintf( esc_html__( 'Refreshed stats for %s', 'woocommerce' ), esc_html( $user->display_name ) ) . '</p></div>';
}

View File

@ -374,23 +374,24 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
</table>
</div>
<script type="text/javascript">
jQuery('.section_title').click(function(){
var next_section = jQuery(this).next('.section');
jQuery( '.section_title' ).on( 'click', function() {
var next_section = jQuery( this ).next( '.section' );
if ( jQuery(next_section).is(':visible') )
if ( jQuery( next_section ).is( ':visible' ) ) {
return false;
}
jQuery('.section:visible').slideUp();
jQuery('.section_title').removeClass('open');
jQuery(this).addClass('open').next('.section').slideDown();
jQuery( '.section:visible' ).slideUp();
jQuery( '.section_title' ).removeClass( 'open' );
jQuery( this ).addClass( 'open' ).next( '.section' ).slideDown();
return false;
});
jQuery('.section').slideUp( 100, function() {
} );
jQuery( '.section' ).slideUp( 100, function() {
<?php if ( empty( $this->product_ids ) ) : ?>
jQuery('.section_title:eq(1)').click();
jQuery( '.section_title:eq(1)' ).click();
<?php endif; ?>
});
} );
</script>
<?php
}

View File

@ -191,6 +191,22 @@ class WC_Settings_Emails extends WC_Settings_Page {
'id' => 'email_template_options',
),
array(
'title' => __( 'Store management insights', 'woocommerce' ),
'type' => 'title',
'id' => 'email_merchant_notes',
),
array(
'title' => __( 'Enable email insights', 'woocommerce' ),
'desc' => __( 'Receive email notifications with additional guidance to complete the basic store setup and helpful insights', 'woocommerce' ),
'id' => 'woocommerce_merchant_email_notifications',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'default' => 'yes',
'autoload' => false,
),
)
);

View File

@ -9,6 +9,16 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<div class="wrap woocommerce">
<div id="message" class="error inline" style="margin-top:30px">
<p>
<strong>
<?php
/* translators: 1: Link URL */
echo wp_kses_post( sprintf( __( 'With the release of WooCommerce 4.0, these reports are being replaced. There is a new and better Analytics section available for users running WordPress 5.3+. Head on over to the <a href="%1$s">WooCommerce Analytics</a> or learn more about the new experience in the <a href="https://docs.woocommerce.com/document/woocommerce-analytics/" target="_blank">WooCommerce Analytics documentation</a>.', 'woocommerce' ), esc_url( wc_admin_url( '&path=/analytics/overview' ) ) ) );
?>
</strong>
</p>
</div>
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
foreach ( $reports as $key => $report_group ) {

View File

@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
</form>
<?php
wc_enqueue_js(
"jQuery( '#flush-logs' ).click( function() {
"jQuery( '#flush-logs' ).on( 'click', function() {
if ( window.confirm('" . esc_js( __( 'Are you sure you want to clear all logs from the database?', 'woocommerce' ) ) . "') ) {
return true;
}

View File

@ -11,7 +11,8 @@ global $wpdb;
if ( ! defined( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Define if we're checking against major or minor versions.
define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'major' );
// Since 5.0 all versions are backwards compatible, so there's no more check.
define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'none' );
}
$report = wc()->api->get_endpoint_data( '/wc/v3/system_status' );
@ -844,10 +845,11 @@ if ( 0 < count( $dropins_mu_plugins['mu_plugins'] ) ) :
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . wp_kses_post( sprintf( __( 'Page visibility should be <a href="%s" target="_blank">public</a>', 'woocommerce' ), 'https://wordpress.org/support/article/content-visibility/' ) ) . '</mark>';
$found_error = true;
} else {
// Shortcode check.
if ( $_page['shortcode_required'] ) {
if ( ! $_page['shortcode_present'] ) {
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( esc_html__( 'Page does not contain the shortcode.', 'woocommerce' ), esc_html( $_page['shortcode'] ) ) . '</mark>';
// Shortcode and block check.
if ( $_page['shortcode_required'] || $_page['block_required'] ) {
if ( ! $_page['shortcode_present'] && ! $_page['block_present'] ) {
/* Translators: %1$s: shortcode text, %2$s: block slug. */
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . ( $_page['block_required'] ? sprintf( esc_html__( 'Page does not contain the %1$s shortcode or the %2$s block.', 'woocommerce' ), esc_html( $_page['shortcode'] ), esc_html( $_page['block'] ) ) : sprintf( esc_html__( 'Page does not contain the %s shortcode.', 'woocommerce' ), esc_html( $_page['shortcode'] ) ) ) . '</mark>'; /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */
$found_error = true;
}
}

View File

@ -8,9 +8,7 @@
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
<div id="poststuff" class="woocommerce-reports-wide">
<div class="postbox">

View File

@ -220,10 +220,10 @@ function wc_maybe_adjust_line_item_product_stock( $item, $item_quantity = -1 ) {
/*
* 0 as $item_quantity usually indicates we're deleting the order item.
* We need to perform different calculations for this case.
* Let's restore back the reduced count.
*/
if ( 0 === $item_quantity ) {
$diff = min( absint( $refunded_item_quantity ), $already_reduced_stock ) * -1;
$diff = $already_reduced_stock * -1;
}
if ( $diff < 0 ) {
@ -241,6 +241,14 @@ function wc_maybe_adjust_line_item_product_stock( $item, $item_quantity = -1 ) {
$item->update_meta_data( '_reduced_stock', $item_quantity + $refunded_item_quantity );
$item->save();
if ( $item_quantity > 0 ) {
// If stock was reduced, then we need to mark this on parent order object as well so that cancel logic works properly.
$order_data_store = WC_Data_Store::load( 'order' );
if ( $item->get_order_id() && ! $order_data_store->get_stock_reduced( $item->get_order_id() ) ) {
$order_data_store->set_stock_reduced( $item->get_order_id(), true );
}
}
return array(
'from' => $new_stock + $diff,
'to' => $new_stock,
@ -259,6 +267,7 @@ function wc_save_order_items( $order_id, $items ) {
do_action( 'woocommerce_before_save_order_items', $order_id, $items );
$qty_change_order_notes = array();
$order = wc_get_order( $order_id );
// Line items and fees.
if ( isset( $items['order_item_id'] ) ) {
@ -333,9 +342,11 @@ function wc_save_order_items( $order_id, $items ) {
$item->save();
$changed_stock = wc_maybe_adjust_line_item_product_stock( $item );
if ( $changed_stock && ! is_wp_error( $changed_stock ) ) {
$qty_change_order_notes[] = $item->get_name() . ' (' . $changed_stock['from'] . '&rarr;' . $changed_stock['to'] . ')';
if ( in_array( $order->get_status(), array( 'processing', 'completed', 'on-hold' ) ) ) {
$changed_stock = wc_maybe_adjust_line_item_product_stock( $item );
if ( $changed_stock && ! is_wp_error( $changed_stock ) ) {
$qty_change_order_notes[] = $item->get_name() . ' (' . $changed_stock['from'] . '&rarr;' . $changed_stock['to'] . ')';
}
}
}
}

View File

@ -0,0 +1,84 @@
<?php
/**
* Blocks Utils
*
* Used by core components that need to work with blocks.
*
* @package WooCommerce\Blocks\Utils
* @version 5.0.0
*/
defined( 'ABSPATH' ) || exit;
/**
* Blocks Utility class.
*/
class WC_Blocks_Utils {
/**
* Get blocks from a woocommerce page.
*
* @param string $woo_page_name A woocommerce page e.g. `checkout` or `cart`.
* @return array Array of blocks as returned by parse_blocks().
*/
private static function get_all_blocks_from_page( $woo_page_name ) {
$page_id = wc_get_page_id( $woo_page_name );
$page = get_post( $page_id );
if ( ! $page ) {
return array();
}
$blocks = parse_blocks( $page->post_content );
if ( ! $blocks ) {
return array();
}
return $blocks;
}
/**
* Get all instances of the specified block on a specific woo page
* (e.g. `cart` or `checkout` page).
*
* @param string $block_name The name (id) of a block, e.g. `woocommerce/cart`.
* @param string $woo_page_name The woo page to search, e.g. `cart`.
* @return array Array of blocks as returned by parse_blocks().
*/
public static function get_blocks_from_page( $block_name, $woo_page_name ) {
$page_blocks = self::get_all_blocks_from_page( $woo_page_name );
// Get any instances of the specified block.
return array_values(
array_filter(
$page_blocks,
function ( $block ) use ( $block_name ) {
return ( $block_name === $block['blockName'] );
}
)
);
}
/**
* Check if a given page contains a particular block.
*
* @param int|WP_Post $page Page post ID or post object.
* @param string $block_name The name (id) of a block, e.g. `woocommerce/cart`.
* @return bool Boolean value if the page contains the block or not. Null in case the page does not exist.
*/
public static function has_block_in_page( $page, $block_name ) {
$page_to_check = get_post( $page );
if ( null === $page_to_check ) {
return false;
}
$blocks = parse_blocks( $page_to_check->post_content );
foreach ( $blocks as $block ) {
if ( $block_name === $block['blockName'] ) {
return true;
}
}
return false;
}
}

View File

@ -368,7 +368,7 @@ class WC_AJAX {
$woocommerce_checkout_payment = ob_get_clean();
// Get messages if reload checkout is not true.
$reload_checkout = isset( WC()->session->reload_checkout ) ? true : false;
$reload_checkout = isset( WC()->session->reload_checkout );
if ( ! $reload_checkout ) {
$messages = wc_print_notices( true );
} else {

View File

@ -1621,7 +1621,11 @@ class WC_Cart extends WC_Legacy_Cart {
$coupon_data_store = $coupon->get_data_store();
$billing_email = strtolower( sanitize_email( $billing_email ) );
if ( $coupon_data_store && $coupon_data_store->get_usage_by_email( $coupon, $billing_email ) >= $coupon_usage_limit ) {
$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
if ( $coupon_data_store->get_tentative_usages_for_user( $coupon->get_id(), array( $billing_email ) ) ) {
$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK_GUEST );
} else {
$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
}
}
}
}

View File

@ -340,6 +340,49 @@ class WC_Comments {
return $average;
}
/**
* Utility function for getting review counts for multiple products in one query. This is not cached.
*
* @since 5.0.0
*
* @param array $product_ids Array of product IDs.
*
* @return array
*/
public static function get_review_counts_for_product_ids( $product_ids ) {
global $wpdb;
if ( empty( $product_ids ) ) {
return array();
}
$product_id_string_placeholder = substr( str_repeat( ',%s', count( $product_ids ) ), 1 );
$review_counts = $wpdb->get_results(
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Ignored for allowing interpolation in IN query.
$wpdb->prepare(
"
SELECT comment_post_ID as product_id, COUNT( comment_post_ID ) as review_count
FROM $wpdb->comments
WHERE
comment_parent = 0
AND comment_post_ID IN ( $product_id_string_placeholder )
AND comment_approved = '1'
AND comment_type in ( 'review', '', 'comment' )
GROUP BY product_id
",
$product_ids
),
// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared.
ARRAY_A
);
// Convert to key value pairs.
$counts = array_replace( array_fill_keys( $product_ids, 0 ), array_column( $review_counts, 'review_count', 'product_id' ) );
return $counts;
}
/**
* Get product review count for a product (not replies). Please note this is not cached.
*
@ -348,22 +391,9 @@ class WC_Comments {
* @return int
*/
public static function get_review_count_for_product( &$product ) {
global $wpdb;
$counts = self::get_review_counts_for_product_ids( array( $product->get_id() ) );
$count = $wpdb->get_var(
$wpdb->prepare(
"
SELECT COUNT(*) FROM $wpdb->comments
WHERE comment_parent = 0
AND comment_post_ID = %d
AND comment_approved = '1'
AND comment_type = 'review'
",
$product->get_id()
)
);
return $count;
return $counts[ $product->get_id() ];
}
/**

View File

@ -358,9 +358,6 @@ class WC_Countries {
if ( 'eu_vat' === $type ) {
$countries[] = 'MC';
$countries[] = 'IM';
// The UK is still part of the EU VAT zone.
$countries[] = 'GB';
}
return apply_filters( 'woocommerce_european_union_countries', $countries, $type );
@ -528,7 +525,7 @@ class WC_Countries {
'NZ' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}",
'NO' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
'PL' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
'PR' => "{company}\n{name}\n{address_1} {address_2}\n{state} \n{country} {postcode}",
'PR' => "{company}\n{name}\n{address_1} {address_2}\n{city} \n{country} {postcode}",
'PT' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
'SK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
'RS' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",
@ -981,6 +978,15 @@ class WC_Countries {
'required' => false,
),
),
'GT' => array(
'postcode' => array(
'required' => false,
'hidden' => true,
),
'state' => array(
'label' => __( 'Department', 'woocommerce' ),
),
),
'HK' => array(
'postcode' => array(
'required' => false,
@ -1205,11 +1211,11 @@ class WC_Countries {
),
'PR' => array(
'city' => array(
'required' => false,
'hidden' => true,
'label' => __( 'Municipality', 'woocommerce' ),
),
'state' => array(
'label' => __( 'Municipality', 'woocommerce' ),
'required' => false,
'hidden' => true,
),
),
'PT' => array(

View File

@ -67,6 +67,8 @@ class WC_Coupon extends WC_Legacy_Coupon {
const E_WC_COUPON_MAX_SPEND_LIMIT_MET = 112;
const E_WC_COUPON_EXCLUDED_PRODUCTS = 113;
const E_WC_COUPON_EXCLUDED_CATEGORIES = 114;
const E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK = 115;
const E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK_GUEST = 116;
const WC_COUPON_SUCCESS = 200;
const WC_COUPON_REMOVED = 201;
@ -994,6 +996,17 @@ class WC_Coupon extends WC_Legacy_Coupon {
case self::E_WC_COUPON_NOT_APPLICABLE:
$err = __( 'Sorry, this coupon is not applicable to your cart contents.', 'woocommerce' );
break;
case self::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK:
if ( is_user_logged_in() && wc_get_page_id( 'myaccount' ) > 0 ) {
/* translators: %s: myaccount page link. */
$err = sprintf( __( 'Coupon usage limit has been reached. If you were using this coupon just now but order was not complete, you can retry or cancel the order by going to the <a href="%s">my account page</a>.', 'woocommerce' ), wc_get_endpoint_url( 'orders', '', wc_get_page_permalink( 'myaccount' ) ) );
} else {
$err = $this->get_coupon_error( self::E_WC_COUPON_USAGE_LIMIT_REACHED );
}
break;
case self::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK_GUEST:
$err = __( 'Coupon usage limit has been reached. Please try again after some time, or contact us for help.', 'woocommerce' );
break;
case self::E_WC_COUPON_EXCLUDED_PRODUCTS:
// Store excluded products that are in cart in $products.
$products = array();

View File

@ -111,7 +111,7 @@ class WC_Customer extends WC_Legacy_Customer {
}
// If this is a session, set or change the data store to sessions. Changes do not persist in the database.
if ( $is_session ) {
if ( $is_session && isset( WC()->session ) ) {
$this->data_store = WC_Data_Store::load( 'customer-session' );
$this->data_store->read( $this );
}

View File

@ -599,11 +599,40 @@ class WC_Discounts {
* @return bool
*/
protected function validate_coupon_usage_limit( $coupon ) {
if ( $coupon->get_usage_limit() > 0 && $coupon->get_usage_count() >= $coupon->get_usage_limit() ) {
throw new Exception( __( 'Coupon usage limit has been reached.', 'woocommerce' ), 106 );
if ( ! $coupon->get_usage_limit() ) {
return true;
}
return true;
$usage_count = $coupon->get_usage_count();
$data_store = $coupon->get_data_store();
$tentative_usage_count = is_callable( array( $data_store, 'get_tentative_usage_count' ) ) ? $data_store->get_tentative_usage_count( $coupon->get_id() ) : 0;
if ( $usage_count + $tentative_usage_count < $coupon->get_usage_limit() ) {
// All good.
return true;
}
// Coupon usage limit is reached. Let's show as informative error message as we can.
if ( 0 === $tentative_usage_count ) {
// No held coupon, usage limit is indeed reached.
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED;
} elseif ( is_user_logged_in() ) {
$recent_pending_orders = wc_get_orders(
array(
'limit' => 1,
'post_status' => array( 'wc-failed', 'wc-pending' ),
'customer' => get_current_user_id(),
'return' => 'ids',
)
);
if ( count( $recent_pending_orders ) > 0 ) {
// User logged in and have a pending order, maybe they are trying to use the coupon.
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK;
} else {
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED;
}
} else {
// Maybe this user was trying to use the coupon but got stuck. We can't know for sure (performantly). Show a slightly better error message.
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK_GUEST;
}
throw new Exception( $coupon->get_coupon_error( $error_code ), $error_code );
}
/**
@ -631,7 +660,14 @@ class WC_Discounts {
$data_store = $coupon->get_data_store();
$usage_count = $data_store->get_usage_by_user_id( $coupon, $user_id );
if ( $usage_count >= $coupon->get_usage_limit_per_user() ) {
throw new Exception( __( 'Coupon usage limit has been reached.', 'woocommerce' ), 106 );
if ( $data_store->get_tentative_usages_for_user( $coupon->get_id(), array( $user_id ) ) > 0 ) {
$error_message = $coupon->get_coupon_error( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK );
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_COUPON_STUCK;
} else {
$error_message = $coupon->get_coupon_error( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
$error_code = WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED;
}
throw new Exception( $error_message, $error_code );
}
}

View File

@ -157,6 +157,10 @@ class WC_Install {
'wc_update_450_sanitize_coupons_code',
'wc_update_450_db_version',
),
'5.0.0' => array(
'wc_update_500_fix_product_review_count',
'wc_update_500_db_version',
),
);
/**
@ -221,16 +225,17 @@ class WC_Install {
/**
* Run an update callback when triggered by ActionScheduler.
*
* @param string $update_callback Callback name.
*
* @since 3.6.0
* @param string $callback Callback name.
*/
public static function run_update_callback( $callback ) {
public static function run_update_callback( $update_callback ) {
include_once dirname( __FILE__ ) . '/wc-update-functions.php';
if ( is_callable( $callback ) ) {
self::run_update_callback_start( $callback );
$result = (bool) call_user_func( $callback );
self::run_update_callback_end( $callback, $result );
if ( is_callable( $update_callback ) ) {
self::run_update_callback_start( $update_callback );
$result = (bool) call_user_func( $update_callback );
self::run_update_callback_end( $update_callback, $result );
}
}
@ -1373,7 +1378,7 @@ CREATE TABLE {$wpdb->prefix}wc_reserved_stock (
);
if ( WCConnectionHelper::is_connected() ) {
$row_meta['premium_support'] = '<a href="' . esc_url( apply_filters( 'woocommerce_support_url', 'https://woocommerce.com/my-account/tickets/' ) ) . '" aria-label="' . esc_attr__( 'Visit premium customer support', 'woocommerce' ) . '">' . esc_html__( 'Premium support', 'woocommerce' ) . '</a>';
$row_meta['premium_support'] = '<a href="' . esc_url( apply_filters( 'woocommerce_support_url', 'https://woocommerce.com/my-account/create-a-ticket/' ) ) . '" aria-label="' . esc_attr__( 'Visit premium customer support', 'woocommerce' ) . '">' . esc_html__( 'Premium support', 'woocommerce' ) . '</a>';
}
return array_merge( $links, $row_meta );

View File

@ -41,6 +41,7 @@ class WC_Post_Data {
add_filter( 'update_post_metadata', array( __CLASS__, 'update_post_metadata' ), 10, 5 );
add_filter( 'wp_insert_post_data', array( __CLASS__, 'wp_insert_post_data' ) );
add_filter( 'oembed_response_data', array( __CLASS__, 'filter_oembed_response_data' ), 10, 2 );
add_filter( 'wp_untrash_post_status', array( __CLASS__, 'wp_untrash_post_status' ), 10, 3 );
// Status transitions.
add_action( 'transition_post_status', array( __CLASS__, 'transition_post_status' ), 10, 3 );
@ -122,12 +123,23 @@ class WC_Post_Data {
* Handle type changes.
*
* @since 3.0.0
*
* @param WC_Product $product Product data.
* @param string $from Origin type.
* @param string $to New type.
*/
public static function product_type_changed( $product, $from, $to ) {
if ( 'variable' === $from && 'variable' !== $to ) {
/**
* Filter to prevent variations from being deleted while switching from a variable product type to a variable product type.
*
* @since 5.0.0
*
* @param bool A boolean value of true will delete the variations.
* @param WC_Product $product Product data.
* @return string $from Origin type.
* @param string $to New type.
*/
if ( apply_filters( 'woocommerce_delete_variations_on_product_type_change', 'variable' === $from && 'variable' !== $to, $product, $from, $to ) ) {
// If the product is no longer variable, we should ensure all variations are removed.
$data_store = WC_Data_Store::load( 'product-variable' );
$data_store->delete_variations( $product->get_id(), true );
@ -406,8 +418,9 @@ class WC_Post_Data {
$customer->save();
}
// Delete order count meta.
// Delete order count and last order meta.
delete_user_meta( $customer_id, '_order_count' );
delete_user_meta( $customer_id, '_last_order' );
}
// Clean up items.
@ -489,6 +502,24 @@ class WC_Post_Data {
}
}
/**
* Ensure statuses are correctly reassigned when restoring orders and products.
*
* @param string $new_status The new status of the post being restored.
* @param int $post_id The ID of the post being restored.
* @param string $previous_status The status of the post at the point where it was trashed.
* @return string
*/
public static function wp_untrash_post_status( $new_status, $post_id, $previous_status ) {
$post_types = array( 'shop_order', 'shop_coupon', 'product', 'product_variation' );
if ( in_array( get_post_type( $post_id ), $post_types, true ) ) {
$new_status = $previous_status;
}
return $new_status;
}
/**
* When setting stock level, ensure the stock status is kept in sync.
*

View File

@ -313,63 +313,66 @@ class WC_Shipping {
$package['rates'] = array();
// If the package is not shippable, e.g. trying to ship to an invalid country, do not calculate rates.
if ( $this->is_package_shippable( $package ) ) {
// Check if we need to recalculate shipping for this package.
$package_to_hash = $package;
// Remove data objects so hashes are consistent.
foreach ( $package_to_hash['contents'] as $item_id => $item ) {
unset( $package_to_hash['contents'][ $item_id ]['data'] );
}
// Get rates stored in the WC session data for this package.
$wc_session_key = 'shipping_for_package_' . $package_key;
$stored_rates = WC()->session->get( $wc_session_key );
// Calculate the hash for this package so we can tell if it's changed since last calculation.
$package_hash = 'wc_ship_' . md5( wp_json_encode( $package_to_hash ) . WC_Cache_Helper::get_transient_version( 'shipping' ) );
if ( ! is_array( $stored_rates ) || $package_hash !== $stored_rates['package_hash'] || 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) ) {
foreach ( $this->load_shipping_methods( $package ) as $shipping_method ) {
if ( ! $shipping_method->supports( 'shipping-zones' ) || $shipping_method->get_instance_id() ) {
/**
* Fires before getting shipping rates for a package.
*
* @since 4.3.0
* @param array $package Package of cart items.
* @param WC_Shipping_Method $shipping_method Shipping method instance.
*/
do_action( 'woocommerce_before_get_rates_for_package', $package, $shipping_method );
// Use + instead of array_merge to maintain numeric keys.
$package['rates'] = $package['rates'] + $shipping_method->get_rates_for_package( $package );
/**
* Fires after getting shipping rates for a package.
*
* @since 4.3.0
* @param array $package Package of cart items.
* @param WC_Shipping_Method $shipping_method Shipping method instance.
*/
do_action( 'woocommerce_after_get_rates_for_package', $package, $shipping_method );
}
}
// Filter the calculated rates.
$package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package );
// Store in session to avoid recalculation.
WC()->session->set(
$wc_session_key,
array(
'package_hash' => $package_hash,
'rates' => $package['rates'],
)
);
} else {
$package['rates'] = $stored_rates['rates'];
}
if ( ! $this->is_package_shippable( $package ) ) {
return $package;
}
// Check if we need to recalculate shipping for this package.
$package_to_hash = $package;
// Remove data objects so hashes are consistent.
foreach ( $package_to_hash['contents'] as $item_id => $item ) {
unset( $package_to_hash['contents'][ $item_id ]['data'] );
}
// Get rates stored in the WC session data for this package.
$wc_session_key = 'shipping_for_package_' . $package_key;
$stored_rates = WC()->session->get( $wc_session_key );
// Calculate the hash for this package so we can tell if it's changed since last calculation.
$package_hash = 'wc_ship_' . md5( wp_json_encode( $package_to_hash ) . WC_Cache_Helper::get_transient_version( 'shipping' ) );
if ( ! is_array( $stored_rates ) || $package_hash !== $stored_rates['package_hash'] || 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) ) {
foreach ( $this->load_shipping_methods( $package ) as $shipping_method ) {
if ( ! $shipping_method->supports( 'shipping-zones' ) || $shipping_method->get_instance_id() ) {
/**
* Fires before getting shipping rates for a package.
*
* @since 4.3.0
* @param array $package Package of cart items.
* @param WC_Shipping_Method $shipping_method Shipping method instance.
*/
do_action( 'woocommerce_before_get_rates_for_package', $package, $shipping_method );
// Use + instead of array_merge to maintain numeric keys.
$package['rates'] = $package['rates'] + $shipping_method->get_rates_for_package( $package );
/**
* Fires after getting shipping rates for a package.
*
* @since 4.3.0
* @param array $package Package of cart items.
* @param WC_Shipping_Method $shipping_method Shipping method instance.
*/
do_action( 'woocommerce_after_get_rates_for_package', $package, $shipping_method );
}
}
// Filter the calculated rates.
$package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package );
// Store in session to avoid recalculation.
WC()->session->set(
$wc_session_key,
array(
'package_hash' => $package_hash,
'rates' => $package['rates'],
)
);
} else {
$package['rates'] = $stored_rates['rates'];
}
return $package;
}

View File

@ -352,30 +352,105 @@ class WC_Tracker {
}
/**
* Get order counts
*
* @return array
*/
private static function get_order_counts() {
$order_count = array();
$order_count_data = wp_count_posts( 'shop_order' );
foreach ( wc_get_order_statuses() as $status_slug => $status_name ) {
$order_count[ $status_slug ] = $order_count_data->{ $status_slug };
}
return $order_count;
}
/**
* Combine all order data.
* Get all order data.
*
* @return array
*/
private static function get_orders() {
$order_dates = self::get_order_dates();
$order_counts = self::get_order_counts();
$order_totals = self::get_order_totals();
$args = array(
'type' => array( 'shop_order', 'shop_order_refund' ),
'limit' => get_option( 'posts_per_page' ),
'paged' => 1,
);
return array_merge( $order_dates, $order_counts, $order_totals );
$first = time();
$last = 0;
$processing_first = time();
$processing_last = 0;
$orders = wc_get_orders( $args );
$orders_count = count( $orders );
while ( $orders_count ) {
foreach ( $orders as $order ) {
$date_created = (int) $order->get_date_created()->getTimestamp();
$type = $order->get_type();
$status = $order->get_status();
if ( 'shop_order' == $type ) {
// Find the first and last order dates for completed and processing statuses.
if ( 'completed' == $status && $date_created < $first ) {
$first = $date_created;
}
if ( 'completed' == $status && $date_created > $last ) {
$last = $date_created;
}
if ( 'processing' == $status && $date_created < $processing_first ) {
$processing_first = $date_created;
}
if ( 'processing' == $status && $date_created > $processing_last ) {
$processing_last = $date_created;
}
// Get order counts by status.
$status = 'wc-' . $status;
if ( ! isset( $order_data[ $status ] ) ) {
$order_data[ $status ] = 1;
} else {
$order_data[ $status ] += 1;
}
// Count number of orders by gateway used.
$gateway = $order->get_payment_method();
if ( ! empty( $gateway ) && in_array( $status, array( 'wc-completed', 'wc-refunded', 'wc-processing' ) ) ) {
$gateway = 'gateway_' . $gateway;
if ( ! isset( $order_data[ $gateway ] ) ) {
$order_data[ $gateway ] = 1;
} else {
$order_data[ $gateway ] += 1;
}
}
} else {
// If it is a refunded order (shop_order_refunnd type), add the prefix as this prefix gets
// added midway in the if clause.
$status = 'wc-' . $status;
}
// Calculate the gross total for 'completed' and 'processing' orders.
$total = $order->get_total();
if ( in_array( $status, array( 'wc-completed', 'wc-refunded' ) ) ) {
if ( ! isset( $order_data['gross'] ) ) {
$order_data['gross'] = $total;
} else {
$order_data['gross'] += $total;
}
} elseif ( 'wc-processing' == $status ) {
if ( ! isset( $order_data['processing_gross'] ) ) {
$order_data['processing_gross'] = $total;
} else {
$order_data['processing_gross'] += $total;
}
}
}
$args['paged']++;
$orders = wc_get_orders( $args );
$orders_count = count( $orders );
}
$order_data['first'] = gmdate( 'Y-m-d H:i:s', $first );
$order_data['last'] = gmdate( 'Y-m-d H:i:s', $last );
$order_data['processing_first'] = gmdate( 'Y-m-d H:i:s', $processing_first );
$order_data['processing_last'] = gmdate( 'Y-m-d H:i:s', $processing_last );
return $order_data;
}
/**
@ -543,94 +618,12 @@ class WC_Tracker {
/**
* Get order totals
*
* @deprecated 5.1.0 Logic moved to get_orders.
* @return array
*/
public static function get_order_totals() {
global $wpdb;
$gross_total = $wpdb->get_var(
"
SELECT
SUM( order_meta.meta_value ) AS 'gross_total'
FROM {$wpdb->prefix}posts AS orders
LEFT JOIN {$wpdb->prefix}postmeta AS order_meta ON order_meta.post_id = orders.ID
WHERE order_meta.meta_key = '_order_total'
AND orders.post_status in ( 'wc-completed', 'wc-refunded' )
GROUP BY order_meta.meta_key
"
);
if ( is_null( $gross_total ) ) {
$gross_total = 0;
}
$processing_gross_total = $wpdb->get_var(
"
SELECT
SUM( order_meta.meta_value ) AS 'gross_total'
FROM {$wpdb->prefix}posts AS orders
LEFT JOIN {$wpdb->prefix}postmeta AS order_meta ON order_meta.post_id = orders.ID
WHERE order_meta.meta_key = '_order_total'
AND orders.post_status = 'wc-processing'
GROUP BY order_meta.meta_key
"
);
if ( is_null( $processing_gross_total ) ) {
$processing_gross_total = 0;
}
return array(
'gross' => $gross_total,
'processing_gross' => $processing_gross_total,
);
}
/**
* Get last order date
*
* @return string
*/
private static function get_order_dates() {
global $wpdb;
$min_max = $wpdb->get_row(
"
SELECT
MIN( post_date_gmt ) as 'first', MAX( post_date_gmt ) as 'last'
FROM {$wpdb->prefix}posts
WHERE post_type = 'shop_order'
AND post_status = 'wc-completed'
",
ARRAY_A
);
if ( is_null( $min_max ) ) {
$min_max = array(
'first' => '-',
'last' => '-',
);
}
$processing_min_max = $wpdb->get_row(
"
SELECT
MIN( post_date_gmt ) as 'processing_first', MAX( post_date_gmt ) as 'processing_last'
FROM {$wpdb->prefix}posts
WHERE post_type = 'shop_order'
AND post_status = 'wc-processing'
",
ARRAY_A
);
if ( is_null( $processing_min_max ) ) {
$processing_min_max = array(
'processing_first' => '-',
'processing_last' => '-',
);
}
return array_merge( $min_max, $processing_min_max );
wc_deprecated_function( 'WC_Tracker::get_order_totals', '5.1.0', '' );
return self::get_orders();
}
/**
@ -660,49 +653,6 @@ class WC_Tracker {
return ( '0' !== $result ) ? 'Yes' : 'No';
}
/**
* Get blocks from a woocommerce page.
*
* @param string $woo_page_name A woocommerce page e.g. `checkout` or `cart`.
* @return array Array of blocks as returned by parse_blocks().
*/
private static function get_all_blocks_from_page( $woo_page_name ) {
$page_id = wc_get_page_id( $woo_page_name );
$page = get_post( $page_id );
if ( ! $page ) {
return array();
}
$blocks = parse_blocks( $page->post_content );
if ( ! $blocks ) {
return array();
}
return $blocks;
}
/**
* Get all instances of the specified block on a specific woo page
* (e.g. `cart` or `checkout` page).
*
* @param string $block_name The name (id) of a block, e.g. `woocommerce/cart`.
* @param string $woo_page_name The woo page to search, e.g. `cart`.
* @return array Array of blocks as returned by parse_blocks().
*/
private static function get_blocks_from_page( $block_name, $woo_page_name ) {
$page_blocks = self::get_all_blocks_from_page( $woo_page_name );
// Get any instances of the specified block.
return array_values(
array_filter(
$page_blocks,
function ( $block ) use ( $block_name ) {
return ( $block_name === $block['blockName'] );
}
)
);
}
/**
* Get tracker data for a specific block type on a woocommerce page.
@ -714,7 +664,7 @@ class WC_Tracker {
* - block_attributes
*/
public static function get_block_tracker_data( $block_name, $woo_page_name ) {
$blocks = self::get_blocks_from_page( $block_name, $woo_page_name );
$blocks = WC_Blocks_Utils::get_blocks_from_page( $block_name, $woo_page_name );
$block_present = false;
$attributes = array();

View File

@ -91,6 +91,7 @@ class WC_Validation {
case 'PT':
$valid = (bool) preg_match( '/^([0-9]{4})([-])([0-9]{3})$/', $postcode );
break;
case 'PR':
case 'US':
$valid = (bool) preg_match( '/^([0-9]{5})(-[0-9]{4})?$/i', $postcode );
break;

View File

@ -8,6 +8,7 @@
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Internal\DownloadPermissionsAdjuster;
use Automattic\WooCommerce\Proxies\LegacyProxy;
/**
@ -22,7 +23,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '4.9.0';
public $version = '5.0.0';
/**
* WooCommerce Schema version.
@ -203,6 +204,9 @@ final class WooCommerce {
add_action( 'activated_plugin', array( $this, 'activated_plugin' ) );
add_action( 'deactivated_plugin', array( $this, 'deactivated_plugin' ) );
add_filter( 'woocommerce_rest_prepare_note', array( 'WC_Admin_Notices', 'prepare_note_with_nonce' ) );
// These classes set up hooks on instantiation.
wc_get_container()->get( DownloadPermissionsAdjuster::class );
}
/**
@ -422,6 +426,7 @@ final class WooCommerce {
include_once WC_ABSPATH . 'includes/queue/class-wc-action-queue.php';
include_once WC_ABSPATH . 'includes/queue/class-wc-queue.php';
include_once WC_ABSPATH . 'includes/admin/marketplace-suggestions/class-wc-marketplace-updater.php';
include_once WC_ABSPATH . 'includes/blocks/class-wc-blocks-utils.php';
/**
* Data stores - used to store and retrieve CRUD object data from the database.
@ -603,13 +608,7 @@ final class WooCommerce {
* - WP_LANG_DIR/plugins/woocommerce-LOCALE.mo
*/
public function load_plugin_textdomain() {
if ( function_exists( 'determine_locale' ) ) {
$locale = determine_locale();
} else {
// @todo Remove when start supporting WP 5.0 or later.
$locale = is_admin() ? get_user_locale() : get_locale();
}
$locale = determine_locale();
$locale = apply_filters( 'plugin_locale', $locale, 'woocommerce' );
unload_textdomain( 'woocommerce' );
@ -808,6 +807,10 @@ final class WooCommerce {
public function activated_plugin( $filename ) {
include_once dirname( __FILE__ ) . '/admin/helper/class-wc-helper.php';
if ( '/woocommerce.php' === substr( $filename, -16 ) ) {
set_transient( 'woocommerce_activated_plugin', $filename );
}
WC_Helper::activated_plugin( $filename );
}
@ -904,7 +907,7 @@ final class WooCommerce {
'https://wordpress.org/plugins/woocommerce/',
'https://github.com/woocommerce/woocommerce/releases'
);
printf( '<div class="error"><p>%s %s</p></div>', $message_one, $message_two ); /* WPCS: xss ok. */
printf( '<div class="error"><p>%s %s</p></div>', $message_one, $message_two ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**

View File

@ -422,12 +422,13 @@ class WC_Coupon_Data_Store_CPT extends WC_Data_Store_WP implements WC_Coupon_Dat
$this->get_tentative_usage_query( $coupon_id )
);
}
/**
* Get the number of uses for a coupon by user ID.
*
* @since 3.0.0
* @param WC_Coupon $coupon Coupon object.
* @param id $user_id User ID.
* @param int $user_id User ID.
* @return int
*/
public function get_usage_by_user_id( &$coupon, $user_id ) {

View File

@ -64,6 +64,7 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
'syntax_highlighting',
'_order_count',
'_money_spent',
'_last_order',
'_woocommerce_tracks_anon_id',
);
@ -325,21 +326,30 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
* @return WC_Order|false
*/
public function get_last_order( &$customer ) {
global $wpdb;
$last_order = $wpdb->get_var(
// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
"SELECT posts.ID
FROM $wpdb->posts AS posts
LEFT JOIN {$wpdb->postmeta} AS meta on posts.ID = meta.post_id
WHERE meta.meta_key = '_customer_user'
AND meta.meta_value = '" . esc_sql( $customer->get_id() ) . "'
AND posts.post_type = 'shop_order'
AND posts.post_status IN ( '" . implode( "','", array_map( 'esc_sql', array_keys( wc_get_order_statuses() ) ) ) . "' )
ORDER BY posts.ID DESC"
// phpcs:enable
$last_order = apply_filters(
'woocommerce_customer_get_last_order',
get_user_meta( $customer->get_id(), '_last_order', true ),
$customer
);
if ( '' === $last_order ) {
global $wpdb;
$last_order = $wpdb->get_var(
// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
"SELECT posts.ID
FROM $wpdb->posts AS posts
LEFT JOIN {$wpdb->postmeta} AS meta on posts.ID = meta.post_id
WHERE meta.meta_key = '_customer_user'
AND meta.meta_value = '" . esc_sql( $customer->get_id() ) . "'
AND posts.post_type = 'shop_order'
AND posts.post_status IN ( '" . implode( "','", array_map( 'esc_sql', array_keys( wc_get_order_statuses() ) ) ) . "' )
ORDER BY posts.ID DESC"
// phpcs:enable
);
update_user_meta( $customer->get_id(), '_last_order', $last_order );
}
if ( ! $last_order ) {
return false;
}
@ -355,7 +365,11 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
* @return integer
*/
public function get_order_count( &$customer ) {
$count = get_user_meta( $customer->get_id(), '_order_count', true );
$count = apply_filters(
'woocommerce_customer_get_order_count',
get_user_meta( $customer->get_id(), '_order_count', true ),
$customer
);
if ( '' === $count ) {
global $wpdb;

View File

@ -16,6 +16,38 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store_Interface {
/**
* Names of the database fields for the download permissions table.
*/
const DOWNLOAD_PERMISSION_DB_FIELDS = array(
'download_id',
'product_id',
'user_id',
'user_email',
'order_id',
'order_key',
'downloads_remaining',
'access_granted',
'download_count',
'access_expires',
);
/**
* Create download permission for a user, from an array of data.
*
* @param array $data Data to create the permission for.
* @returns int The database id of the created permission, or false if the permission creation failed.
*/
public function create_from_data( $data ) {
$data = array_intersect_key( $data, array_flip( self::DOWNLOAD_PERMISSION_DB_FIELDS ) );
$id = $this->insert_new_download_permission( $data );
do_action( 'woocommerce_grant_product_download_access', $data );
return $id;
}
/**
* Create download permission for a user.
*
@ -29,18 +61,41 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
$download->set_access_granted( time() );
}
$data = array(
'download_id' => $download->get_download_id( 'edit' ),
'product_id' => $download->get_product_id( 'edit' ),
'user_id' => $download->get_user_id( 'edit' ),
'user_email' => $download->get_user_email( 'edit' ),
'order_id' => $download->get_order_id( 'edit' ),
'order_key' => $download->get_order_key( 'edit' ),
'downloads_remaining' => $download->get_downloads_remaining( 'edit' ),
'access_granted' => date( 'Y-m-d', $download->get_access_granted( 'edit' )->getTimestamp() ),
'download_count' => $download->get_download_count( 'edit' ),
'access_expires' => ! is_null( $download->get_access_expires( 'edit' ) ) ? date( 'Y-m-d', $download->get_access_expires( 'edit' )->getTimestamp() ) : null,
);
$data = array();
foreach ( self::DOWNLOAD_PERMISSION_DB_FIELDS as $db_field_name ) {
$value = call_user_func( array( $download, 'get_' . $db_field_name ), 'edit' );
$data[ $db_field_name ] = $value;
}
$inserted_id = $this->insert_new_download_permission( $data );
if ( $inserted_id ) {
$download->set_id( $inserted_id );
$download->apply_changes();
}
do_action( 'woocommerce_grant_product_download_access', $data );
}
/**
* Create download permission for a user, from an array of data.
* Assumes that all the keys in the passed data are valid.
*
* @param array $data Data to create the permission for.
* @return int The database id of the created permission, or false if the permission creation failed.
*/
private function insert_new_download_permission( $data ) {
global $wpdb;
// Always set a access granted date.
if ( ! isset( $data['access_granted'] ) ) {
$data['access_granted'] = time();
}
$data['access_granted'] = $this->adjust_date_for_db( $data['access_granted'] );
if ( isset( $data['access_expires'] ) ) {
$data['access_expires'] = $this->adjust_date_for_db( $data['access_expires'] );
}
$format = array(
'%s',
@ -61,12 +116,29 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
apply_filters( 'woocommerce_downloadable_file_permission_format', $format, $data )
);
if ( $result ) {
$download->set_id( $wpdb->insert_id );
$download->apply_changes();
return $result ? $wpdb->insert_id : false;
}
/**
* Adjust a date value to be inserted in the database.
*
* @param mixed $date The date value. Can be a WC_DateTime, a timestamp, or anything else that "date" recognizes.
* @return string The date converted to 'Y-m-d' format.
* @throws Exception The passed value can't be converted to a date.
*/
private function adjust_date_for_db( $date ) {
if ( 'WC_DateTime' === get_class( $date ) ) {
$date = $date->getTimestamp();
}
do_action( 'woocommerce_grant_product_download_access', $data );
$adjusted_date = date( 'Y-m-d', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
if ( $adjusted_date ) {
return $adjusted_date;
}
$msg = sprintf( __( "I don't know how to get a date from a %s", 'woocommerce' ), is_object( $date ) ? get_class( $date ) : gettype( $date ) );
throw new Exception( $msg );
}
/**
@ -128,8 +200,10 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
'order_id' => $download->get_order_id( 'edit' ),
'order_key' => $download->get_order_key( 'edit' ),
'downloads_remaining' => $download->get_downloads_remaining( 'edit' ),
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'access_granted' => date( 'Y-m-d', $download->get_access_granted( 'edit' )->getTimestamp() ),
'download_count' => $download->get_download_count( 'edit' ),
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
'access_expires' => ! is_null( $download->get_access_expires( 'edit' ) ) ? date( 'Y-m-d', $download->get_access_expires( 'edit' )->getTimestamp() ) : null,
);
@ -412,7 +486,7 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
)
ORDER BY permissions.order_id, permissions.product_id, permissions.permission_id;",
$customer_id,
date( 'Y-m-d', current_time( 'timestamp' ) )
date( 'Y-m-d', current_time( 'timestamp' ) ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
)
);
}

View File

@ -305,7 +305,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Should contain the fields token_id, gateway_id, token, user_id, type, is_default.
*
* @since 3.0.0
* @param id $token_id Token ID.
* @param int $token_id Token ID.
* @return object
*/
public function get_token_by_id( $token_id ) {
@ -322,7 +322,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Returns metadata for a specific payment token.
*
* @since 3.0.0
* @param id $token_id Token ID.
* @param int $token_id Token ID.
* @return array
*/
public function get_metadata( $token_id ) {
@ -333,7 +333,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Get a token's type by ID.
*
* @since 3.0.0
* @param id $token_id Token ID.
* @param int $token_id Token ID.
* @return string
*/
public function get_token_type_by_id( $token_id ) {
@ -353,7 +353,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
*
* @since 3.0.0
*
* @param id $token_id Token ID.
* @param int $token_id Token ID.
* @param bool $status Whether given payment token is the default payment token or not.
*
* @return void

View File

@ -6,6 +6,7 @@
*/
use Automattic\Jetpack\Constants;
use Automattic\WooCommerce\Internal\DownloadPermissionsAdjuster;
use Automattic\WooCommerce\Utilities\NumberUtil;
if ( ! defined( 'ABSPATH' ) ) {
@ -265,6 +266,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$this->handle_updated_props( $product );
$this->clear_caches( $product );
wc_get_container()
->get( DownloadPermissionsAdjuster::class )
->maybe_schedule_adjust_download_permissions( $product );
$product->apply_changes();
do_action( 'woocommerce_update_product', $product->get_id(), $product );
@ -1636,7 +1641,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
// Variations should also search the parent's meta table for fallback fields.
if ( $include_variations ) {
$variation_query = $wpdb->prepare( ' OR ( wc_product_meta_lookup.sku = "" AND parent_wc_product_meta_lookup.sku LIKE %s ) ', $like );
$variation_query = $wpdb->prepare( " OR ( wc_product_meta_lookup.sku = '' AND parent_wc_product_meta_lookup.sku LIKE %s ) ", $like );
} else {
$variation_query = '';
}

View File

@ -74,33 +74,41 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin
public function read( &$zone ) {
global $wpdb;
$zone_data = false;
if ( 0 !== $zone->get_id() || '0' !== $zone->get_id() ) {
$zone_data = $wpdb->get_row(
$wpdb->prepare(
"SELECT zone_name, zone_order FROM {$wpdb->prefix}woocommerce_shipping_zones WHERE zone_id = %d LIMIT 1",
$zone->get_id()
)
);
}
// Zone 0 is used as a default if no other zones fit.
if ( 0 === $zone->get_id() || '0' === $zone->get_id() ) {
$this->read_zone_locations( $zone );
$zone->set_zone_name( __( 'Locations not covered by your other zones', 'woocommerce' ) );
$zone->read_meta_data();
$zone->set_object_read( true );
/**
* Indicate that the WooCommerce shipping zone has been loaded.
*
* @param WC_Shipping_Zone $zone The shipping zone that has been loaded.
*/
do_action( 'woocommerce_shipping_zone_loaded', $zone );
} elseif ( $zone_data ) {
$zone->set_zone_name( $zone_data->zone_name );
$zone->set_zone_order( $zone_data->zone_order );
$this->read_zone_locations( $zone );
$zone->read_meta_data();
$zone->set_object_read( true );
do_action( 'woocommerce_shipping_zone_loaded', $zone );
} else {
return;
}
$zone_data = $wpdb->get_row(
$wpdb->prepare(
"SELECT zone_name, zone_order FROM {$wpdb->prefix}woocommerce_shipping_zones WHERE zone_id = %d LIMIT 1",
$zone->get_id()
)
);
if ( ! $zone_data ) {
throw new Exception( __( 'Invalid data store.', 'woocommerce' ) );
}
$zone->set_zone_name( $zone_data->zone_name );
$zone->set_zone_order( $zone_data->zone_order );
$this->read_zone_locations( $zone );
$zone->read_meta_data();
$zone->set_object_read( true );
/** This action is documented in includes/datastores/class-wc-shipping-zone-data-store.php. */
do_action( 'woocommerce_shipping_zone_loaded', $zone );
}
/**

View File

@ -92,10 +92,25 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) :
$this->object = $order;
$this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
$this->placeholders['{order_number}'] = $this->object->get_order_number();
$email_already_sent = $order->get_meta( '_new_order_email_sent' );
}
/**
* Controls if new order emails can be resend multiple times.
*
* @since 5.0.0
* @param bool $allows Defaults to true.
*/
if ( 'true' === $email_already_sent && ! apply_filters( 'woocommerce_new_order_email_allows_resend', false ) ) {
return;
}
if ( $this->is_enabled() && $this->get_recipient() ) {
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
$order->update_meta_data( '_new_order_email_sent', 'true' );
$order->save();
}
$this->restore_locale();

View File

@ -1048,7 +1048,7 @@ class WC_Email extends WC_Settings_API {
var view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "';
var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "';
jQuery( 'a.toggle_editor' ).text( view ).click( function() {
jQuery( 'a.toggle_editor' ).text( view ).on( 'click', function() {
var label = hide;
if ( jQuery( this ).closest(' .template' ).find( '.editor' ).is(':visible') ) {
@ -1059,7 +1059,7 @@ class WC_Email extends WC_Settings_API {
return false;
} );
jQuery( 'a.delete_template' ).click( function() {
jQuery( 'a.delete_template' ).on( 'click', function() {
if ( window.confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "') ) {
return true;
}

View File

@ -127,7 +127,6 @@ class WC_Gateway_Paypal_Request {
'upload' => 1,
'return' => esc_url_raw( add_query_arg( 'utm_nooverride', '1', $this->gateway->get_return_url( $order ) ) ),
'cancel_return' => esc_url_raw( $order->get_cancel_order_url_raw() ),
'page_style' => $this->gateway->get_option( 'page_style' ),
'image_url' => esc_url_raw( $this->gateway->get_option( 'image_url' ) ),
'paymentaction' => $this->gateway->get_option( 'paymentaction' ),
'invoice' => $this->limit_length( $this->gateway->get_option( 'invoice_prefix' ) . $order->get_order_number(), 127 ),

View File

@ -113,14 +113,6 @@ return array(
'authorization' => __( 'Authorize', 'woocommerce' ),
),
),
'page_style' => array(
'title' => __( 'Page style', 'woocommerce' ),
'type' => 'text',
'description' => __( 'Optionally enter the name of the page style you wish to use. These are defined within your PayPal account. This affects classic PayPal checkout screens.', 'woocommerce' ),
'default' => '',
'desc_tip' => true,
'placeholder' => __( 'Optional', 'woocommerce' ),
),
'image_url' => array(
'title' => __( 'Image url', 'woocommerce' ),
'type' => 'text',

View File

@ -126,7 +126,7 @@ class WC_Action_Queue implements WC_Queue_Interface {
$next_timestamp = as_next_scheduled_action( $hook, $args, $group );
if ( $next_timestamp ) {
if ( is_numeric( $next_timestamp ) ) {
return new WC_DateTime( "@{$next_timestamp}", new DateTimeZone( 'UTC' ) );
}

View File

@ -251,16 +251,75 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller {
/**
* Get formatted item data.
*
* @since 3.0.0
* @param WC_Data $object WC_Data instance.
* @since 3.0.0
* @param WC_Order $order WC_Data instance.
*
* @return array
*/
protected function get_formatted_item_data( $object ) {
$data = $object->get_data();
protected function get_formatted_item_data( $order ) {
$extra_fields = array( 'meta_data', 'line_items', 'tax_lines', 'shipping_lines', 'fee_lines', 'coupon_lines', 'refunds' );
$format_decimal = array( 'discount_total', 'discount_tax', 'shipping_total', 'shipping_tax', 'shipping_total', 'shipping_tax', 'cart_tax', 'total', 'total_tax' );
$format_date = array( 'date_created', 'date_modified', 'date_completed', 'date_paid' );
// These fields are dependent on other fields.
$dependent_fields = array(
'date_created_gmt' => 'date_created',
'date_modified_gmt' => 'date_modified',
'date_completed_gmt' => 'date_completed',
'date_paid_gmt' => 'date_paid',
);
$format_line_items = array( 'line_items', 'tax_lines', 'shipping_lines', 'fee_lines', 'coupon_lines' );
// Only fetch fields that we need.
$fields = $this->get_fields_for_response( $this->request );
foreach ( $dependent_fields as $field_key => $dependency ) {
if ( in_array( $field_key, $fields ) && ! in_array( $dependency, $fields ) ) {
$fields[] = $dependency;
}
}
$extra_fields = array_intersect( $extra_fields, $fields );
$format_decimal = array_intersect( $format_decimal, $fields );
$format_date = array_intersect( $format_date, $fields );
$format_line_items = array_intersect( $format_line_items, $fields );
$data = $order->get_base_data();
// Add extra data as necessary.
foreach ( $extra_fields as $field ) {
switch ( $field ) {
case 'meta_data':
$data['meta_data'] = $order->get_meta_data();
break;
case 'line_items':
$data['line_items'] = $order->get_items( 'line_item' );
break;
case 'tax_lines':
$data['tax_lines'] = $order->get_items( 'tax' );
break;
case 'shipping_lines':
$data['shipping_lines'] = $order->get_items( 'shipping' );
break;
case 'fee_lines':
$data['fee_lines'] = $order->get_items( 'fee' );
break;
case 'coupon_lines':
$data['coupon_lines'] = $order->get_items( 'coupon' );
break;
case 'refunds':
$data['refunds'] = array();
foreach ( $order->get_refunds() as $refund ) {
$data['refunds'][] = array(
'id' => $refund->get_id(),
'reason' => $refund->get_reason() ? $refund->get_reason() : '',
'total' => '-' . wc_format_decimal( $refund->get_amount(), $this->request['dp'] ),
);
}
break;
}
}
// Format decimal values.
foreach ( $format_decimal as $key ) {
$data[ $key ] = wc_format_decimal( $data[ $key ], $this->request['dp'] );
@ -281,59 +340,53 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller {
$data[ $key ] = array_values( array_map( array( $this, 'get_order_item_data' ), $data[ $key ] ) );
}
// Refunds.
$data['refunds'] = array();
foreach ( $object->get_refunds() as $refund ) {
$data['refunds'][] = array(
'id' => $refund->get_id(),
'reason' => $refund->get_reason() ? $refund->get_reason() : '',
'total' => '-' . wc_format_decimal( $refund->get_amount(), $this->request['dp'] ),
);
}
return array(
'id' => $object->get_id(),
'parent_id' => $data['parent_id'],
'number' => $data['number'],
'order_key' => $data['order_key'],
'created_via' => $data['created_via'],
'version' => $data['version'],
'status' => $data['status'],
'currency' => $data['currency'],
'date_created' => $data['date_created'],
'date_created_gmt' => $data['date_created_gmt'],
'date_modified' => $data['date_modified'],
'date_modified_gmt' => $data['date_modified_gmt'],
'discount_total' => $data['discount_total'],
'discount_tax' => $data['discount_tax'],
'shipping_total' => $data['shipping_total'],
'shipping_tax' => $data['shipping_tax'],
'cart_tax' => $data['cart_tax'],
'total' => $data['total'],
'total_tax' => $data['total_tax'],
'prices_include_tax' => $data['prices_include_tax'],
'customer_id' => $data['customer_id'],
'customer_ip_address' => $data['customer_ip_address'],
'customer_user_agent' => $data['customer_user_agent'],
'customer_note' => $data['customer_note'],
'billing' => $data['billing'],
'shipping' => $data['shipping'],
'payment_method' => $data['payment_method'],
'payment_method_title' => $data['payment_method_title'],
'transaction_id' => $data['transaction_id'],
'date_paid' => $data['date_paid'],
'date_paid_gmt' => $data['date_paid_gmt'],
'date_completed' => $data['date_completed'],
'date_completed_gmt' => $data['date_completed_gmt'],
'cart_hash' => $data['cart_hash'],
'meta_data' => $data['meta_data'],
'line_items' => $data['line_items'],
'tax_lines' => $data['tax_lines'],
'shipping_lines' => $data['shipping_lines'],
'fee_lines' => $data['fee_lines'],
'coupon_lines' => $data['coupon_lines'],
'refunds' => $data['refunds'],
$allowed_fields = array(
'id',
'parent_id',
'number',
'order_key',
'created_via',
'version',
'status',
'currency',
'date_created',
'date_created_gmt',
'date_modified',
'date_modified_gmt',
'discount_total',
'discount_tax',
'shipping_total',
'shipping_tax',
'cart_tax',
'total',
'total_tax',
'prices_include_tax',
'customer_id',
'customer_ip_address',
'customer_user_agent',
'customer_note',
'billing',
'shipping',
'payment_method',
'payment_method_title',
'transaction_id',
'date_paid',
'date_paid_gmt',
'date_completed',
'date_completed_gmt',
'cart_hash',
'meta_data',
'line_items',
'tax_lines',
'shipping_lines',
'fee_lines',
'coupon_lines',
'refunds',
);
$data = array_intersect_key( $data, array_flip( $allowed_fields ) );
return $data;
}
/**
@ -347,10 +400,10 @@ class WC_REST_Orders_V2_Controller extends WC_REST_CRUD_Controller {
public function prepare_object_for_response( $object, $request ) {
$this->request = $request;
$this->request['dp'] = is_null( $this->request['dp'] ) ? wc_get_price_decimals() : absint( $this->request['dp'] );
$request['context'] = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->get_formatted_item_data( $object );
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->add_additional_fields_to_object( $data, $request );
$data = $this->filter_response_by_context( $data, $context );
$data = $this->filter_response_by_context( $data, $request['context'] );
$response = rest_ensure_response( $data );
$response->add_links( $this->prepare_links( $object, $request ) );

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