merge upstream

This commit is contained in:
Ron Rennick 2021-01-05 14:56:27 -04:00
commit b3b73e069a
138 changed files with 7584 additions and 13054 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,24 @@
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"
env:
- WP_VERSION=latest WP_MULTISITE=0
@ -33,32 +33,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
php: "7.2"
env: WP_VERSION=5.4 WP_MULTISITE=0
- name: "WP Latest - 2"
php: 7.2
php: "7.2"
env: WP_VERSION=5.3 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"
- |
@ -81,20 +99,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,8 +179,8 @@
width: 1em;
}
@mixin icon( $glyph: '\e001' ) {
font-family: 'WooCommerce';
@mixin icon( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: none;
font-weight: normal;
font-variant: normal;
@ -190,8 +197,8 @@
content: $glyph;
}
@mixin icon_dashicons( $glyph: '\f333' ) {
font-family: 'Dashicons';
@mixin icon_dashicons( $glyph: "\f333" ) {
font-family: "Dashicons";
speak: none;
font-weight: normal;
font-variant: normal;
@ -209,8 +216,8 @@
content: $glyph;
}
@mixin iconbefore( $glyph: '\e001' ) {
font-family: 'WooCommerce';
@mixin iconbefore( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: none;
font-weight: normal;
font-variant: normal;
@ -222,8 +229,8 @@
text-decoration: none;
}
@mixin iconbeforedashicons( $glyph: '\f333' ) {
font-family: 'Dashicons';
@mixin iconbeforedashicons( $glyph: "\f333" ) {
font-family: "Dashicons";
speak: none;
font-weight: normal;
font-variant: normal;
@ -234,8 +241,8 @@
text-decoration: none;
}
@mixin iconafter( $glyph: '\e001' ) {
font-family: 'WooCommerce';
@mixin iconafter( $glyph: "\e001" ) {
font-family: "WooCommerce";
speak: none;
font-weight: normal;
font-variant: normal;
@ -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

@ -360,7 +360,7 @@
}
.addons-button-solid {
background-color:#674399;
background-color: #674399;
color: #fff;
}
@ -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

@ -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;
@ -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

@ -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();

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.2",
"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": "6db323c812269cb58e44afbd04ee46cb",
"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.2",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-admin.git",
"reference": "efd94d917504fe71bae650233de47344c8d5c005"
"reference": "a890bc4131d3cf8c93bb8aeefff96db1a95f547d"
},
"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/a890bc4131d3cf8c93bb8aeefff96db1a95f547d",
"reference": "a890bc4131d3cf8c93bb8aeefff96db1a95f547d",
"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.2"
},
"time": "2020-11-19T17:48:33+00:00"
"time": "2020-12-23T01:26:52+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

@ -1237,6 +1237,7 @@ return array(
'SD' => __( 'Sindh', 'woocommerce' ),
),
'PL' => array(),
'PR' => array(),
'PT' => array(),
'PY' => array( // Paraguay states.
'PY-ASU' => __( 'Asunción', 'woocommerce' ),

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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -357,7 +357,7 @@ class WC_Comments {
WHERE comment_parent = 0
AND comment_post_ID = %d
AND comment_approved = '1'
AND comment_type = 'review'
AND comment_type in ( 'review', '', 'comment' )
",
$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}",
@ -1205,11 +1202,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

@ -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

@ -190,7 +190,7 @@ class WC_Emails {
$this->init();
// Email Header, Footer and content hooks.
add_action( 'woocommerce_email_header', array( $this, 'email_header' ) );
add_action( 'woocommerce_email_header', array( $this, 'email_header' ), 10, 2 );
add_action( 'woocommerce_email_footer', array( $this, 'email_footer' ) );
add_action( 'woocommerce_email_order_details', array( $this, 'order_downloads' ), 10, 4 );
add_action( 'woocommerce_email_order_details', array( $this, 'order_details' ), 10, 4 );
@ -263,17 +263,26 @@ class WC_Emails {
/**
* Get the email header.
*
* @param mixed $email_heading Heading for the email.
* @param mixed $email_heading Heading for the email.
* @param WC_Email $email Email object for the email.
*/
public function email_header( $email_heading ) {
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
public function email_header( $email_heading, $email ) {
wc_get_template(
'emails/email-header.php',
array(
'email_heading' => $email_heading,
'email' => $email,
)
);
}
/**
* Get the email footer.
*
* @param WC_Email $email Email object for the email.
*/
public function email_footer() {
wc_get_template( 'emails/email-footer.php' );
public function email_footer( $email ) {
wc_get_template( 'emails/email-footer.php', array( 'email' => $email ) );
}
/**

View File

@ -221,16 +221,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 +1374,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

@ -122,12 +122,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 4.9.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 +417,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.

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

@ -22,7 +22,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '4.9.0';
public $version = '5.0.0';
/**
* WooCommerce Schema version.
@ -602,13 +602,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' );

View File

@ -422,6 +422,7 @@ 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.
*

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

@ -1636,7 +1636,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

@ -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,59 @@ 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' );
$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 );
$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':
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 +324,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 +384,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 ) );

View File

@ -159,7 +159,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_CRUD_Controller {
*/
public function prepare_object_for_response( $object, $request ) {
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
$data = $this->get_product_data( $object, $context );
$data = $this->get_product_data( $object, $context, $request );
// Add variations to variable products.
if ( $object->is_type( 'variable' ) && $object->has_child() ) {
@ -589,86 +589,258 @@ class WC_REST_Products_V2_Controller extends WC_REST_CRUD_Controller {
return $attributes;
}
/**
* Fetch price HTML.
*
* @param WC_Product $product Product object.
* @param string $context Context of request, can be `view` or `edit`.
*
* @return string
*/
protected function api_get_price_html( $product, $context ) {
return $product->get_price_html();
}
/**
* Fetch related IDs.
*
* @param WC_Product $product Product object.
* @param string $context Context of request, can be `view` or `edit`.
*
* @return array
*/
protected function api_get_related_ids( $product, $context ) {
return array_map( 'absint', array_values( wc_get_related_products( $product->get_id() ) ) );
}
/**
* Fetch meta data.
*
* @param WC_Product $product Product object.
* @param string $context Context of request, can be `view` or `edit`.
*
* @return array
*/
protected function api_get_meta_data( $product, $context ) {
return $product->get_meta_data();
}
/**
* Get product data.
*
* @param WC_Product $product Product instance.
* @param string $context Request context.
* Options: 'view' and 'edit'.
* @param string $context Request context. Options: 'view' and 'edit'.
*
* @return array
*/
protected function get_product_data( $product, $context = 'view' ) {
$data = array(
'id' => $product->get_id(),
'name' => $product->get_name( $context ),
'slug' => $product->get_slug( $context ),
'permalink' => $product->get_permalink(),
'date_created' => wc_rest_prepare_date_response( $product->get_date_created( $context ), false ),
'date_created_gmt' => wc_rest_prepare_date_response( $product->get_date_created( $context ) ),
'date_modified' => wc_rest_prepare_date_response( $product->get_date_modified( $context ), false ),
'date_modified_gmt' => wc_rest_prepare_date_response( $product->get_date_modified( $context ) ),
'type' => $product->get_type(),
'status' => $product->get_status( $context ),
'featured' => $product->is_featured(),
'catalog_visibility' => $product->get_catalog_visibility( $context ),
'description' => 'view' === $context ? wpautop( do_shortcode( $product->get_description() ) ) : $product->get_description( $context ),
'short_description' => 'view' === $context ? apply_filters( 'woocommerce_short_description', $product->get_short_description() ) : $product->get_short_description( $context ),
'sku' => $product->get_sku( $context ),
'price' => $product->get_price( $context ),
'regular_price' => $product->get_regular_price( $context ),
'sale_price' => $product->get_sale_price( $context ) ? $product->get_sale_price( $context ) : '',
'date_on_sale_from' => wc_rest_prepare_date_response( $product->get_date_on_sale_from( $context ), false ),
'date_on_sale_from_gmt' => wc_rest_prepare_date_response( $product->get_date_on_sale_from( $context ) ),
'date_on_sale_to' => wc_rest_prepare_date_response( $product->get_date_on_sale_to( $context ), false ),
'date_on_sale_to_gmt' => wc_rest_prepare_date_response( $product->get_date_on_sale_to( $context ) ),
'price_html' => $product->get_price_html(),
'on_sale' => $product->is_on_sale( $context ),
'purchasable' => $product->is_purchasable(),
'total_sales' => $product->get_total_sales( $context ),
'virtual' => $product->is_virtual(),
'downloadable' => $product->is_downloadable(),
'downloads' => $this->get_downloads( $product ),
'download_limit' => $product->get_download_limit( $context ),
'download_expiry' => $product->get_download_expiry( $context ),
'external_url' => $product->is_type( 'external' ) ? $product->get_product_url( $context ) : '',
'button_text' => $product->is_type( 'external' ) ? $product->get_button_text( $context ) : '',
'tax_status' => $product->get_tax_status( $context ),
'tax_class' => $product->get_tax_class( $context ),
'manage_stock' => $product->managing_stock(),
'stock_quantity' => $product->get_stock_quantity( $context ),
'in_stock' => $product->is_in_stock(),
'backorders' => $product->get_backorders( $context ),
'backorders_allowed' => $product->backorders_allowed(),
'backordered' => $product->is_on_backorder(),
'sold_individually' => $product->is_sold_individually(),
'weight' => $product->get_weight( $context ),
'dimensions' => array(
'length' => $product->get_length( $context ),
'width' => $product->get_width( $context ),
'height' => $product->get_height( $context ),
),
'shipping_required' => $product->needs_shipping(),
'shipping_taxable' => $product->is_shipping_taxable(),
'shipping_class' => $product->get_shipping_class(),
'shipping_class_id' => $product->get_shipping_class_id( $context ),
'reviews_allowed' => $product->get_reviews_allowed( $context ),
'average_rating' => 'view' === $context ? wc_format_decimal( $product->get_average_rating(), 2 ) : $product->get_average_rating( $context ),
'rating_count' => $product->get_rating_count(),
'related_ids' => array_map( 'absint', array_values( wc_get_related_products( $product->get_id() ) ) ),
'upsell_ids' => array_map( 'absint', $product->get_upsell_ids( $context ) ),
'cross_sell_ids' => array_map( 'absint', $product->get_cross_sell_ids( $context ) ),
'parent_id' => $product->get_parent_id( $context ),
'purchase_note' => 'view' === $context ? wpautop( do_shortcode( wp_kses_post( $product->get_purchase_note() ) ) ) : $product->get_purchase_note( $context ),
'categories' => $this->get_taxonomy_terms( $product ),
'tags' => $this->get_taxonomy_terms( $product, 'tag' ),
'images' => $this->get_images( $product ),
'attributes' => $this->get_attributes( $product ),
'default_attributes' => $this->get_default_attributes( $product ),
'variations' => array(),
'grouped_products' => array(),
'menu_order' => $product->get_menu_order( $context ),
'meta_data' => $product->get_meta_data(),
/*
* @param WP_REST_Request $request Current request object. For backward compatibility, we pass this argument silently.
*
* TODO: Refactor to fix this behavior when DI gets included to make it obvious and clean.
*/
$request = func_num_args() >= 2 ? func_get_arg( 2 ) : new WP_REST_Request( '', '', array( 'context' => $context ) );
$fields = $this->get_fields_for_response( $request );
$base_data = array();
foreach ( $fields as $field ) {
switch ( $field ) {
case 'id':
$base_data['id'] = $product->get_id();
break;
case 'name':
$base_data['name'] = $product->get_name( $context );
break;
case 'slug':
$base_data['slug'] = $product->get_slug( $context );
break;
case 'permalink':
$base_data['permalink'] = $product->get_permalink();
break;
case 'date_created':
$base_data['date_created'] = wc_rest_prepare_date_response( $product->get_date_created( $context ), false );
break;
case 'date_created_gmt':
$base_data['date_created_gmt'] = wc_rest_prepare_date_response( $product->get_date_created( $context ) );
break;
case 'date_modified':
$base_data['date_modified'] = wc_rest_prepare_date_response( $product->get_date_modified( $context ), false );
break;
case 'date_modified_gmt':
$base_data['date_modified_gmt'] = wc_rest_prepare_date_response( $product->get_date_modified( $context ) );
break;
case 'type':
$base_data['type'] = $product->get_type();
break;
case 'status':
$base_data['status'] = $product->get_status( $context );
break;
case 'featured':
$base_data['featured'] = $product->is_featured();
break;
case 'catalog_visibility':
$base_data['catalog_visibility'] = $product->get_catalog_visibility( $context );
break;
case 'description':
$base_data['description'] = 'view' === $context ? wpautop( do_shortcode( $product->get_description() ) ) : $product->get_description( $context );
break;
case 'short_description':
$base_data['short_description'] = 'view' === $context ? apply_filters( 'woocommerce_short_description', $product->get_short_description() ) : $product->get_short_description( $context );
break;
case 'sku':
$base_data['sku'] = $product->get_sku( $context );
break;
case 'price':
$base_data['price'] = $product->get_price( $context );
break;
case 'regular_price':
$base_data['regular_price'] = $product->get_regular_price( $context );
break;
case 'sale_price':
$base_data['sale_price'] = $product->get_sale_price( $context ) ? $product->get_sale_price( $context ) : '';
break;
case 'date_on_sale_from':
$base_data['date_on_sale_from'] = wc_rest_prepare_date_response( $product->get_date_on_sale_from( $context ), false );
break;
case 'date_on_sale_from_gmt':
$base_data['date_on_sale_from_gmt'] = wc_rest_prepare_date_response( $product->get_date_on_sale_from( $context ) );
break;
case 'date_on_sale_to':
$base_data['date_on_sale_to'] = wc_rest_prepare_date_response( $product->get_date_on_sale_to( $context ), false );
break;
case 'date_on_sale_to_gmt':
$base_data['date_on_sale_to_gmt'] = wc_rest_prepare_date_response( $product->get_date_on_sale_to( $context ) );
break;
case 'on_sale':
$base_data['on_sale'] = $product->is_on_sale( $context );
break;
case 'purchasable':
$base_data['purchasable'] = $product->is_purchasable();
break;
case 'total_sales':
$base_data['total_sales'] = $product->get_total_sales( $context );
break;
case 'virtual':
$base_data['virtual'] = $product->is_virtual();
break;
case 'downloadable':
$base_data['downloadable'] = $product->is_downloadable();
break;
case 'downloads':
$base_data['downloads'] = $this->get_downloads( $product );
break;
case 'download_limit':
$base_data['download_limit'] = $product->get_download_limit( $context );
break;
case 'download_expiry':
$base_data['download_expiry'] = $product->get_download_expiry( $context );
break;
case 'external_url':
$base_data['external_url'] = $product->is_type( 'external' ) ? $product->get_product_url( $context ) : '';
break;
case 'button_text':
$base_data['button_text'] = $product->is_type( 'external' ) ? $product->get_button_text( $context ) : '';
break;
case 'tax_status':
$base_data['tax_status'] = $product->get_tax_status( $context );
break;
case 'tax_class':
$base_data['tax_class'] = $product->get_tax_class( $context );
break;
case 'manage_stock':
$base_data['manage_stock'] = $product->managing_stock();
break;
case 'stock_quantity':
$base_data['stock_quantity'] = $product->get_stock_quantity( $context );
break;
case 'in_stock':
$base_data['in_stock'] = $product->is_in_stock();
break;
case 'backorders':
$base_data['backorders'] = $product->get_backorders( $context );
break;
case 'backorders_allowed':
$base_data['backorders_allowed'] = $product->backorders_allowed();
break;
case 'backordered':
$base_data['backordered'] = $product->is_on_backorder();
break;
case 'sold_individually':
$base_data['sold_individually'] = $product->is_sold_individually();
break;
case 'weight':
$base_data['weight'] = $product->get_weight( $context );
break;
case 'dimensions':
$base_data['dimensions'] = array(
'length' => $product->get_length( $context ),
'width' => $product->get_width( $context ),
'height' => $product->get_height( $context ),
);
break;
case 'shipping_required':
$base_data['shipping_required'] = $product->needs_shipping();
break;
case 'shipping_taxable':
$base_data['shipping_taxable'] = $product->is_shipping_taxable();
break;
case 'shipping_class':
$base_data['shipping_class'] = $product->get_shipping_class();
break;
case 'shipping_class_id':
$base_data['shipping_class_id'] = $product->get_shipping_class_id( $context );
break;
case 'reviews_allowed':
$base_data['reviews_allowed'] = $product->get_reviews_allowed( $context );
break;
case 'average_rating':
$base_data['average_rating'] = 'view' === $context ? wc_format_decimal( $product->get_average_rating(), 2 ) : $product->get_average_rating( $context );
break;
case 'rating_count':
$base_data['rating_count'] = $product->get_rating_count();
break;
case 'upsell_ids':
$base_data['upsell_ids'] = array_map( 'absint', $product->get_upsell_ids( $context ) );
break;
case 'cross_sell_ids':
$base_data['cross_sell_ids'] = array_map( 'absint', $product->get_cross_sell_ids( $context ) );
break;
case 'parent_id':
$base_data['parent_id'] = $product->get_parent_id( $context );
break;
case 'purchase_note':
$base_data['purchase_note'] = 'view' === $context ? wpautop( do_shortcode( wp_kses_post( $product->get_purchase_note() ) ) ) : $product->get_purchase_note( $context );
break;
case 'categories':
$base_data['categories'] = $this->get_taxonomy_terms( $product );
break;
case 'tags':
$base_data['tags'] = $this->get_taxonomy_terms( $product, 'tag' );
break;
case 'images':
$base_data['images'] = $this->get_images( $product );
break;
case 'attributes':
$base_data['attributes'] = $this->get_attributes( $product );
break;
case 'default_attributes':
$base_data['default_attributes'] = $this->get_default_attributes( $product );
break;
case 'variations':
$base_data['variations'] = array();
break;
case 'grouped_products':
$base_data['grouped_products'] = array();
break;
case 'menu_order':
$base_data['menu_order'] = $product->get_menu_order( $context );
break;
}
}
$data = array_merge(
$base_data,
$this->fetch_fields_using_getters( $product, $context, $fields )
);
return $data;
@ -680,7 +852,7 @@ class WC_REST_Products_V2_Controller extends WC_REST_CRUD_Controller {
* @param WC_Data $object Object data.
* @param WP_REST_Request $request Request object.
*
* @return array Links for the given post.
* @return array Links for the given post.
*/
protected function prepare_links( $object, $request ) {
$links = array(

View File

@ -43,6 +43,20 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
*/
protected $rest_base = '';
/**
* Used to cache computed return fields.
*
* @var null|array
*/
private $_fields = null;
/**
* Used to verify if cached fields are for correct request object.
*
* @var null|WP_REST_Request
*/
private $_request = null;
/**
* Add the schema from additional fields to an schema array.
*
@ -513,10 +527,19 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
* @return array Fields to be included in the response.
*/
public function get_fields_for_response( $request ) {
// From xdebug profiling, this method could take upto 25% of request time in index calls.
// Cache it and make sure _fields was cached on current request object!
// TODO: Submit this caching behavior in core.
if ( isset( $this->_fields ) && is_array( $this->_fields ) && $request === $this->_request ) {
return $this->_fields;
}
$this->_request = $request;
$schema = $this->get_item_schema();
$properties = isset( $schema['properties'] ) ? $schema['properties'] : array();
$additional_fields = $this->get_additional_fields();
foreach ( $additional_fields as $field_name => $field_options ) {
// For back-compat, include any field with an empty schema
// because it won't be present in $this->get_item_schema().
@ -538,10 +561,12 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
$fields = array_keys( $properties );
if ( ! isset( $request['_fields'] ) ) {
$this->_fields = $fields;
return $fields;
}
$requested_fields = wp_parse_list( $request['_fields'] );
if ( 0 === count( $requested_fields ) ) {
$this->_fields = $fields;
return $fields;
}
// Trim off outside whitespace from the comma delimited list.
@ -551,7 +576,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
$requested_fields[] = 'id';
}
// Return the list of all requested fields which appear in the schema.
return array_reduce(
$this->_fields = array_reduce(
$requested_fields,
function( $response_fields, $field ) use ( $fields ) {
if ( in_array( $field, $fields, true ) ) {
@ -560,8 +585,8 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
}
// Check for nested fields if $field is not a direct match.
$nested_fields = explode( '.', $field );
// A nested field is included so long as its top-level property is
// present in the schema.
// A nested field is included so long as its top-level property
// is present in the schema.
if ( in_array( $nested_fields[0], $fields, true ) ) {
$response_fields[] = $field;
}
@ -569,5 +594,6 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
},
array()
);
return $this->_fields;
}
}

View File

@ -479,6 +479,24 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
return $response;
}
/**
* Get fields for an object if getter is defined.
*
* @param object $object Object we are fetching response for.
* @param string $context Context of the request. Can be `view` or `edit`.
* @param array $fields List of fields to fetch.
* @return array Data fetched from getters.
*/
public function fetch_fields_using_getters( $object, $context, $fields ) {
$data = array();
foreach ( $fields as $field ) {
if ( method_exists( $this, "api_get_$field" ) ) {
$data[ $field ] = $this->{"api_get_$field"}( $object, $context );
}
}
return $data;
}
/**
* Prepare links for the request.
*

View File

@ -25,6 +25,25 @@ class WC_REST_Orders_Controller extends WC_REST_Orders_V2_Controller {
*/
protected $namespace = 'wc/v3';
/**
* Get Orders.
*
* @param array $query_args Query args.
*
* @return array Products.
*/
protected function get_objects( $query_args ) {
$query_args['paginate'] = true;
$results = wc_get_orders( $query_args );
return array(
'objects' => $results->orders,
'total' => $results->total,
'pages' => $results->max_num_pages,
);
}
/**
* Calculate coupons.
*

View File

@ -217,6 +217,25 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
return $args;
}
/**
* Get products.
*
* @param array $query_args Query args.
*
* @return array Products.
*/
protected function get_objects( $query_args ) {
$query_args['paginate'] = true;
$query_args['return'] = 'objects';
$results = wc_get_products( $query_args );
return array(
'objects' => $results->products,
'total' => $results->total,
'pages' => $results->max_num_pages,
);
}
/**
* Set product images.
*
@ -1324,18 +1343,19 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
* Get product data.
*
* @param WC_Product $product Product instance.
* @param string $context Request context.
* Options: 'view' and 'edit'.
* @param string $context Request context. Options: 'view' and 'edit'.
*
* @return array
*/
protected function get_product_data( $product, $context = 'view' ) {
$data = parent::get_product_data( $product, $context );
$data = parent::get_product_data( ...func_get_args() );
// Replace in_stock with stock_status.
$pos = array_search( 'in_stock', array_keys( $data ), true );
$array_section_1 = array_slice( $data, 0, $pos, true );
$array_section_2 = array_slice( $data, $pos + 1, null, true );
return $array_section_1 + array( 'stock_status' => $product->get_stock_status( $context ) ) + $array_section_2;
$pos = array_search( 'in_stock', array_keys( $data ), true );
if ( false !== $pos ) {
$array_section_1 = array_slice( $data, 0, $pos, true );
$array_section_2 = array_slice( $data, $pos + 1, null, true );
$data = $array_section_1 + array( 'stock_status' => $product->get_stock_status( $context ) ) + $array_section_2;
}
return $data;
}
}

View File

@ -131,7 +131,7 @@ class WC_Products_Tracking {
var initialStockValue = $( '#_stock' ).val();
var hasRecordedEvent = false;
$( '#publish' ).click( function() {
$( '#publish' ).on( 'click', function() {
if ( hasRecordedEvent ) {
return;
}

View File

@ -37,7 +37,7 @@ class WC_Status_Tracking {
if ( 'status' === $tab ) {
wc_enqueue_js(
"
$( 'a.debug-report' ).click( function() {
$( 'a.debug-report' ).on( 'click', function() {
window.wcTracks.recordEvent( 'status_view_reports' );
} );
"

View File

@ -962,6 +962,7 @@ function wc_format_postcode( $postcode, $country ) {
case 'PT':
$postcode = substr_replace( $postcode, '-', 4, 0 );
break;
case 'PR':
case 'US':
$postcode = rtrim( substr_replace( $postcode, '-', 5, 0 ), '-' );
break;

View File

@ -456,11 +456,12 @@ function wc_delete_shop_order_transients( $order = 0 ) {
delete_transient( $transient );
}
// Clear money spent for user associated with order.
// Clear customer's order related caches.
if ( is_a( $order, 'WC_Order' ) ) {
$order_id = $order->get_id();
delete_user_meta( $order->get_customer_id(), '_money_spent' );
delete_user_meta( $order->get_customer_id(), '_order_count' );
delete_user_meta( $order->get_customer_id(), '_last_order' );
} else {
$order_id = 0;
}

View File

@ -949,7 +949,7 @@ function wc_get_product_term_ids( $product_id, $taxonomy ) {
* @since 3.0.0
* @param WC_Product $product WC_Product object.
* @param array $args Optional arguments to pass product quantity and price.
* @return float
* @return float|string Price with tax included, or an empty string if price calculation failed.
*/
function wc_get_price_including_tax( $product, $args = array() ) {
$args = wp_parse_args(
@ -1033,7 +1033,7 @@ function wc_get_price_including_tax( $product, $args = array() ) {
* @since 3.0.0
* @param WC_Product $product WC_Product object.
* @param array $args Optional arguments to pass product quantity and price.
* @return float
* @return float|string Price with tax excluded, or an empty string if price calculation failed.
*/
function wc_get_price_excluding_tax( $product, $args = array() ) {
$args = wp_parse_args(

View File

@ -2748,7 +2748,7 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
} else {
$field = '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . '><option value="default">' . esc_html__( 'Select a country / region&hellip;', 'woocommerce' ) . '</option>';
$field = '<select name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" class="country_to_state country_select ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" ' . implode( ' ', $custom_attributes ) . ' data-placeholder="' . esc_attr( $args['placeholder'] ? $args['placeholder'] : esc_attr__( 'Select a country / region&hellip;', 'woocommerce' ) ) . '"><option value="">' . esc_html__( 'Select a country / region&hellip;', 'woocommerce' ) . '</option>';
foreach ( $countries as $ckey => $cvalue ) {
$field .= '<option value="' . esc_attr( $ckey ) . '" ' . selected( $value, $ckey, false ) . '>' . esc_html( $cvalue ) . '</option>';

View File

@ -701,6 +701,7 @@ function wc_update_230_options() {
// _money_spent and _order_count may be out of sync - clear them
delete_metadata( 'user', 0, '_money_spent', '', true );
delete_metadata( 'user', 0, '_order_count', '', true );
delete_metadata( 'user', 0, '_last_order', '', true );
// To prevent taxes being hidden when using a default 'no address' in a store with tax inc prices, set the woocommerce_default_customer_address to use the store base address by default.
if ( '' === get_option( 'woocommerce_default_customer_address', false ) && wc_prices_include_tax() ) {

View File

@ -272,6 +272,7 @@ function wc_update_new_customer_past_orders( $customer_id ) {
update_user_meta( $customer_id, 'paying_customer', 1 );
update_user_meta( $customer_id, '_order_count', '' );
update_user_meta( $customer_id, '_money_spent', '' );
delete_user_meta( $customer_id, '_last_order' );
}
return $linked;
@ -897,7 +898,7 @@ function wc_update_user_last_active( $user_id ) {
if ( ! $user_id ) {
return;
}
update_user_meta( $user_id, 'wc_last_active', (string) strtotime( date( 'Y-m-d', time() ) ) );
update_user_meta( $user_id, 'wc_last_active', (string) strtotime( gmdate( 'Y-m-d', time() ) ) );
}
/**

46
package-lock.json generated
View File

@ -6150,7 +6150,8 @@
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ=="
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"optional": true
},
"gensync": {
"version": "1.0.0-beta.1",
@ -6790,6 +6791,7 @@
"@types/graceful-fs": "^4.1.2",
"anymatch": "^3.0.3",
"fb-watchman": "^2.0.0",
"fsevents": "^2.1.2",
"graceful-fs": "^4.2.4",
"jest-serializer": "^25.5.0",
"jest-util": "^25.5.0",
@ -8838,7 +8840,7 @@
"dev": true,
"requires": {
"@jest/globals": "^26.4.2",
"@woocommerce/e2e-utils": "file:tests/e2e/utils"
"config": "3.3.3"
},
"dependencies": {
"@jest/environment": {
@ -20613,8 +20615,8 @@
"version": "file:tests/e2e/utils",
"dev": true,
"requires": {
"@woocommerce/api": "0.1.0",
"@wordpress/e2e-test-utils": "^4.6.0",
"config": "3.3.3",
"faker": "^5.1.0",
"fishery": "^1.0.1"
},
@ -21081,7 +21083,7 @@
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=",
"dev": true
},
"acorn": {
@ -21278,7 +21280,7 @@
"aproba": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=",
"dev": true
},
"are-we-there-yet": {
@ -21327,7 +21329,7 @@
"arr-flatten": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
"integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
"integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=",
"dev": true
},
"arr-union": {
@ -22051,7 +22053,7 @@
"babylon": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
"integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
"integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=",
"dev": true
},
"bail": {
@ -24020,7 +24022,7 @@
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"dev": true,
"requires": {
"ms": "2.0.0"
@ -24821,7 +24823,7 @@
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
"dev": true,
"requires": {
@ -25962,7 +25964,7 @@
"fs-readdir-recursive": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz",
"integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==",
"integrity": "sha1-4y/AMKLM7kSmtTcTCNpUvgs5fSc=",
"dev": true
},
"fs-write-stream-atomic": {
@ -27354,6 +27356,16 @@
}
}
},
"grunt-newer": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/grunt-newer/-/grunt-newer-1.3.0.tgz",
"integrity": "sha1-g8y3od2ny9irI7BZAk6+YUrS80I=",
"dev": true,
"requires": {
"async": "^1.5.2",
"rimraf": "^2.5.2"
}
},
"grunt-phpcs": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/grunt-phpcs/-/grunt-phpcs-0.4.0.tgz",
@ -27363,7 +27375,7 @@
"grunt-postcss": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/grunt-postcss/-/grunt-postcss-0.9.0.tgz",
"integrity": "sha512-lglLcVaoOIqH0sFv7RqwUKkEFGQwnlqyAKbatxZderwZGV1nDyKHN7gZS9LUiTx1t5GOvRBx0BEalHMyVwFAIA==",
"integrity": "sha1-++WTSmvp6siTr20FfiMYyX+unaM=",
"dev": true,
"requires": {
"chalk": "^2.1.0",
@ -28726,7 +28738,7 @@
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=",
"dev": true
},
"is-callable": {
@ -28893,7 +28905,7 @@
},
"is-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
@ -31954,7 +31966,7 @@
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
@ -33122,7 +33134,7 @@
"npmlog": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=",
"dev": true,
"requires": {
"are-we-there-yet": "~1.1.2",
@ -35059,7 +35071,7 @@
},
"safe-regex": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"dev": true,
"requires": {
@ -36843,7 +36855,7 @@
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
"integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=",
"dev": true,
"requires": {
"os-tmpdir": "~1.0.2"

View File

@ -1,7 +1,7 @@
{
"name": "woocommerce",
"title": "WooCommerce",
"version": "4.9.0",
"version": "5.0.0",
"homepage": "https://woocommerce.com/",
"repository": {
"type": "git",
@ -28,6 +28,7 @@
"test:e2e": "npm explore @woocommerce/e2e-environment -- npm run test:e2e",
"test:e2e-debug": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-debug",
"test:e2e-dev": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev",
"test:unit": "./vendor/bin/phpunit -c ./phpunit.xml",
"makepot": "composer run-script makepot",
"packages:fix:textdomain": "node ./bin/package-update-textdomain.js",
"publish-packages": "lerna publish from-package",
@ -69,6 +70,7 @@
"grunt-contrib-cssmin": "3.0.0",
"grunt-contrib-uglify": "4.0.1",
"grunt-contrib-watch": "1.1.0",
"grunt-newer": "^1.3.0",
"grunt-phpcs": "0.4.0",
"grunt-postcss": "0.9.0",
"grunt-rtlcss": "2.0.2",

View File

@ -4,7 +4,7 @@ Tags: e-commerce, store, sales, sell, woo, shop, cart, checkout, downloadable, d
Requires at least: 5.3
Tested up to: 5.6
Requires PHP: 7.0
Stable tag: 4.6.2
Stable tag: 4.8.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

View File

@ -1,8 +1,15 @@
# Unreleased
## Added
- Merchant Order Status Filter tests
- Merchant Order Refund tests
- Merchant Apply Coupon tests
- Added new config variable for Simple Product price to `tests/e2e/env/config/default.json`. Defaults to 9.99
## Fixed
- Flaky Create Product, Coupon, and Order tests
- Missing `config` package dependency
# 0.1.0

View File

@ -11,7 +11,10 @@
"main": "index.js",
"dependencies": {
"@jest/globals": "^26.4.2",
"@woocommerce/e2e-utils": "file:../utils"
"config": "3.3.3"
},
"peerDependencies": {
"@woocommerce/e2e-utils": "^0.1.1"
},
"publishConfig": {
"access": "public"

View File

@ -2,7 +2,7 @@
/**
* Internal dependencies
*/
const { StoreOwnerFlow } = require( '@woocommerce/e2e-utils' );
const { merchant } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
@ -16,12 +16,12 @@ const {
const runActivationTest = () => {
describe('Store owner can login and make sure WooCommerce is activated', () => {
beforeAll(async () => {
await StoreOwnerFlow.login();
await merchant.login();
});
it('can make sure WooCommerce is activated. If not, activate it', async () => {
const slug = 'woocommerce';
await StoreOwnerFlow.openPlugins();
await merchant.openPlugins();
const disableLink = await page.$(`tr[data-slug="${slug}"] .deactivate a`);
if (disableLink) {
return;

View File

@ -3,7 +3,7 @@
* Internal dependencies
*/
const {
StoreOwnerFlow,
merchant,
completeOnboardingWizard,
} = require( '@woocommerce/e2e-utils' );
@ -19,7 +19,7 @@ const runOnboardingFlowTest = () => {
describe('Store owner can go through store Onboarding', () => {
it('can start and complete onboarding when visiting the site for the first time.', async () => {
await StoreOwnerFlow.runSetupWizard();
await merchant.runSetupWizard();
await completeOnboardingWizard();
});
});
@ -35,9 +35,10 @@ const runTaskListTest = () => {
const taskListItems = await page.$$('.woocommerce-list__item-title');
expect(taskListItems).toHaveLength(6);
const [ setupTaskListItem ] = await page.$x( '//div[contains(text(),"Set up shipping")]' );
await Promise.all([
// Click on "Set up shipping" task to move to the next step
taskListItems[3].click(),
setupTaskListItem.click(),
// Wait for shipping setup section to load
page.waitForNavigation({waitUntil: 'networkidle0'}),

View File

@ -13,7 +13,7 @@ const {
* Internal dependencies
*/
const {
StoreOwnerFlow,
merchant,
permalinkSettingsPageSaveChanges,
setCheckbox,
settingsPageSaveChanges,
@ -31,7 +31,7 @@ const runInitialStoreSettingsTest = () => {
it('can enable tax rates and calculations', async () => {
// Go to general settings page
await StoreOwnerFlow.openSettings('general');
await merchant.openSettings('general');
// Make sure the general tab is active
await expect(page).toMatchElement('a.nav-tab-active', {text: 'General'});
@ -50,7 +50,7 @@ const runInitialStoreSettingsTest = () => {
it('can configure permalink settings', async () => {
// Go to Permalink Settings page
await StoreOwnerFlow.openPermalinkSettings();
await merchant.openPermalinkSettings();
// Select "Post name" option in common settings section
await page.click('input[value="/%postname%/"]', {text: ' Post name'});

View File

@ -2,19 +2,28 @@
/*
* Internal dependencies
*/
// Setup and onboarding tests
const runActivationTest = require( './activate-and-setup/activate.test' );
const { runOnboardingFlowTest, runTaskListTest } = require( './activate-and-setup/onboarding-tasklist.test' );
const runInitialStoreSettingsTest = require( './activate-and-setup/setup.test' );
// Shopper tests
const runCartPageTest = require( './shopper/front-end-cart.test' );
const runCheckoutPageTest = require( './shopper/front-end-checkout.test' );
const runMyAccountPageTest = require( './shopper/front-end-my-account.test' );
const runSingleProductPageTest = require( './shopper/front-end-single-product.test' );
// Merchant tests
const runCreateCouponTest = require( './merchant/wp-admin-coupon-new.test' );
const runCreateOrderTest = require( './merchant/wp-admin-order-new.test' );
const { runAddSimpleProductTest, runAddVariableProductTest } = require( './merchant/wp-admin-product-new.test' );
const runUpdateGeneralSettingsTest = require( './merchant/wp-admin-settings-general.test' );
const runProductSettingsTest = require( './merchant/wp-admin-settings-product.test' );
const runTaxSettingsTest = require( './merchant/wp-admin-settings-tax.test' );
const runOrderStatusFiltersTest = require( './merchant/wp-admin-order-status-filters.test' );
const runOrderRefundTest = require( './merchant/wp-admin-order-refund.test' );
const runOrderApplyCouponTest = require( './merchant/wp-admin-order-apply-coupon.test' );
const runSetupOnboardingTests = () => {
runActivationTest();
@ -38,6 +47,9 @@ const runMerchantTests = () => {
runUpdateGeneralSettingsTest();
runProductSettingsTest();
runTaxSettingsTest();
runOrderStatusFiltersTest();
runOrderRefundTest();
runOrderApplyCouponTest();
}
module.exports = {
@ -58,5 +70,8 @@ module.exports = {
runUpdateGeneralSettingsTest,
runProductSettingsTest,
runTaxSettingsTest,
runOrderStatusFiltersTest,
runOrderRefundTest,
runOrderApplyCouponTest,
runMerchantTests,
};

View File

@ -3,7 +3,7 @@
* Internal dependencies
*/
const {
StoreOwnerFlow,
merchant,
clickTab,
verifyPublishAndTrash
} = require( '@woocommerce/e2e-utils' );
@ -20,12 +20,12 @@ const {
const runCreateCouponTest = () => {
describe('Add New Coupon Page', () => {
beforeAll(async () => {
await StoreOwnerFlow.login();
await merchant.login();
});
it('can create new coupon', async () => {
// Go to "add coupon" page
await StoreOwnerFlow.openNewCoupon();
await merchant.openNewCoupon();
// Make sure we're on the add coupon page
await expect(page.title()).resolves.toMatch('Add new coupon');

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