Resolve conflicts and bring up to date with master
This commit is contained in:
commit
d60456cc73
11
.travis.yml
11
.travis.yml
|
@ -6,7 +6,6 @@ sudo: false
|
|||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
env:
|
||||
- WP_VERSION=latest WP_MULTISITE=0
|
||||
|
@ -20,6 +19,8 @@ matrix:
|
|||
dist: precise
|
||||
- php: 5.2
|
||||
dist: precise
|
||||
- php: 7.1
|
||||
env: WP_VERSION=latest WP_MULTISITE=0 RUN_PHPCS=1
|
||||
- php: 7.1
|
||||
env: WP_VERSION=latest WP_MULTISITE=0 RUN_CODE_COVERAGE=1
|
||||
allow_failures:
|
||||
|
@ -27,7 +28,6 @@ matrix:
|
|||
|
||||
before_script:
|
||||
- export PATH="$HOME/.composer/vendor/bin:$PATH"
|
||||
- if [[ $TRAVIS_PHP_VERSION == '7.1' ]]; then composer install; fi
|
||||
- bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION
|
||||
- bash tests/bin/travis.sh before
|
||||
|
||||
|
@ -37,3 +37,10 @@ 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\//
|
||||
|
|
14
Gruntfile.js
14
Gruntfile.js
|
@ -199,6 +199,7 @@ module.exports = function( grunt ) {
|
|||
potFilename: 'woocommerce.pot',
|
||||
exclude: [
|
||||
'apigen/.*',
|
||||
'vendor/.*',
|
||||
'tests/.*',
|
||||
'tmp/.*'
|
||||
]
|
||||
|
@ -333,9 +334,9 @@ module.exports = function( grunt ) {
|
|||
|
||||
// Register tasks
|
||||
grunt.registerTask( 'default', [
|
||||
'jshint',
|
||||
'uglify',
|
||||
'css'
|
||||
'js',
|
||||
'css',
|
||||
'i18n'
|
||||
]);
|
||||
|
||||
grunt.registerTask( 'js', [
|
||||
|
@ -357,8 +358,13 @@ module.exports = function( grunt ) {
|
|||
'shell:apigen'
|
||||
]);
|
||||
|
||||
// Only an alias to 'default' task.
|
||||
grunt.registerTask( 'dev', [
|
||||
'default',
|
||||
'default'
|
||||
]);
|
||||
|
||||
grunt.registerTask( 'i18n', [
|
||||
'checktextdomain',
|
||||
'makepot'
|
||||
]);
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,-1px 0 1px #a36597,0 1px 1px #a36597,1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}
|
||||
div.woocommerce-message{overflow:hidden;position:relative;border-right-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,-1px 0 1px #a36597,0 1px 1px #a36597,1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;left:0;padding:10px 21px 10px 15px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;right:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-right:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;left:12px;position:absolute}
|
|
@ -1 +1 @@
|
|||
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}
|
||||
div.woocommerce-message{overflow:hidden;position:relative;border-left-color:#cc99c2!important}div.woocommerce-message p{max-width:700px}.woocommerce-message .button-primary,p.woocommerce-actions .button-primary{background:#bb77ae;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597;color:#fff;text-shadow:0 -1px 1px #a36597,1px 0 1px #a36597,0 1px 1px #a36597,-1px 0 1px #a36597}.woocommerce-message .button-primary:active,.woocommerce-message .button-primary:focus,.woocommerce-message .button-primary:hover,p.woocommerce-actions .button-primary:active,p.woocommerce-actions .button-primary:focus,p.woocommerce-actions .button-primary:hover{background:#a36597;border-color:#a36597;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 #a36597}.woocommerce-message a.woocommerce-message-close,p.woocommerce-actions a.woocommerce-message-close{position:absolute;top:0;right:0;padding:10px 15px 10px 21px;font-size:13px;line-height:1.23076923;text-decoration:none}.woocommerce-message a.woocommerce-message-close::before,p.woocommerce-actions a.woocommerce-message-close::before{position:absolute;top:8px;left:0;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}.woocommerce-message .button-primary,.woocommerce-message .button-secondary,p.woocommerce-actions .button-primary,p.woocommerce-actions .button-secondary{text-decoration:none!important}.woocommerce-message .twitter-share-button,p.woocommerce-actions .twitter-share-button{margin-top:-3px;margin-left:3px;vertical-align:middle}.woocommerce-about-text,p.woocommerce-actions{margin-bottom:1em!important}div.woocommerce-legacy-shipping-notice,div.woocommerce-no-shipping-methods-notice{overflow:hidden;padding:1px 12px}div.woocommerce-legacy-shipping-notice p,div.woocommerce-no-shipping-methods-notice p{position:relative;z-index:1;max-width:700px;line-height:1.5em;margin:12px 0}div.woocommerce-legacy-shipping-notice p.main,div.woocommerce-no-shipping-methods-notice p.main{font-size:1.1em}div.woocommerce-legacy-shipping-notice::before,div.woocommerce-no-shipping-methods-notice::before{content:'\e01b';font-family:WooCommerce;text-align:center;line-height:1;color:#f7f1f6;display:block;width:1em;font-size:20em;top:36px;right:12px;position:absolute}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1867,17 +1867,21 @@ ul.wc_coupon_list_block {
|
|||
width: 11%;
|
||||
}
|
||||
|
||||
.column-order_actions,
|
||||
.column-user_actions,
|
||||
.column-wc_actions {
|
||||
width: 110px;
|
||||
|
||||
a.button {
|
||||
float: left;
|
||||
margin: 0 4px 2px 0;
|
||||
cursor: pointer;
|
||||
padding: 3px 4px;
|
||||
height: auto;
|
||||
@include ir();
|
||||
display: inline-block;
|
||||
margin: 2px 4px 2px 0;
|
||||
padding: 0 !important;
|
||||
height: 2em !important;
|
||||
width: 2em;
|
||||
|
||||
&::after {
|
||||
@include icon_dashicons;
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
|
@ -1885,6 +1889,32 @@ ul.wc_coupon_list_block {
|
|||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
a.edit::after {
|
||||
content: '\f464';
|
||||
}
|
||||
|
||||
a.link::after {
|
||||
content: '\e00d';
|
||||
}
|
||||
|
||||
a.view::after {
|
||||
content: '\f177';
|
||||
}
|
||||
|
||||
a.refresh::after {
|
||||
font-family: 'WooCommerce';
|
||||
content: '\e031';
|
||||
}
|
||||
|
||||
a.processing::after {
|
||||
font-family: 'WooCommerce';
|
||||
content: '\e00f';
|
||||
}
|
||||
|
||||
a.complete::after {
|
||||
content: '\f147';
|
||||
}
|
||||
}
|
||||
|
||||
small.meta {
|
||||
|
@ -1893,73 +1923,293 @@ ul.wc_coupon_list_block {
|
|||
font-size: inherit;
|
||||
margin: 3px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.column-order_total,
|
||||
.column-order_date {
|
||||
width: 9%;
|
||||
.post-type-shop_order {
|
||||
.tablenav .one-page .displaying-num {
|
||||
display: none;
|
||||
}
|
||||
.wp-list-table {
|
||||
margin-top: 1em;
|
||||
|
||||
.column-order_status {
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
|
||||
mark {
|
||||
@include ir();
|
||||
background: none;
|
||||
font-size: 1.4em;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
mark.pending,
|
||||
mark.completed,
|
||||
mark.on-hold,
|
||||
mark.failed,
|
||||
mark.cancelled,
|
||||
mark.processing,
|
||||
mark.refunded {
|
||||
&::after {
|
||||
@include icon;
|
||||
thead,
|
||||
tfoot {
|
||||
th {
|
||||
padding: .75em 1em;
|
||||
}
|
||||
th.sortable a, th.sorted a {
|
||||
padding: 0;
|
||||
}
|
||||
th:first-child {
|
||||
padding-left: 2em;
|
||||
}
|
||||
th:last-child {
|
||||
padding-right: 2em;
|
||||
}
|
||||
}
|
||||
|
||||
mark.pending::after {
|
||||
content: '\e012';
|
||||
color: $orange;
|
||||
tbody {
|
||||
td,
|
||||
th {
|
||||
padding: 1em;
|
||||
line-height: 26px;
|
||||
}
|
||||
td:first-child {
|
||||
padding-left: 2em;
|
||||
}
|
||||
td:last-child {
|
||||
padding-right: 2em;
|
||||
}
|
||||
}
|
||||
tbody tr {
|
||||
border-top: 1px solid #f5f5f5;
|
||||
}
|
||||
tbody tr:hover:not(.status-trash) td {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
mark.completed::after {
|
||||
content: '\e015';
|
||||
color: $blue;
|
||||
// Columns.
|
||||
td,
|
||||
th {
|
||||
width: 12ch;
|
||||
vertical-align: middle;
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
mark.on-hold::after {
|
||||
content: '\e033';
|
||||
color: #999;
|
||||
.check-column {
|
||||
width: 1px;
|
||||
white-space: nowrap;
|
||||
padding: 1em 1em 1em 1em !important;
|
||||
vertical-align: middle;
|
||||
input {
|
||||
vertical-align: text-top;
|
||||
margin: 1px 0;
|
||||
}
|
||||
}
|
||||
|
||||
mark.failed::after {
|
||||
content: '\e016';
|
||||
color: #d0c21f;
|
||||
.column-order_number {
|
||||
width: 35ch;
|
||||
}
|
||||
.column-order_total {
|
||||
width: 8ch;
|
||||
text-align: right;
|
||||
|
||||
mark.cancelled::after {
|
||||
content: '\e013';
|
||||
color: $red;
|
||||
a span {
|
||||
float:right;
|
||||
}
|
||||
}
|
||||
|
||||
mark.processing::after {
|
||||
content: '\e011';
|
||||
color: #73a724;
|
||||
.column-order_date,
|
||||
.column-order_status {
|
||||
width: 10ch;
|
||||
}
|
||||
.column-order_status {
|
||||
width: 14ch;
|
||||
}
|
||||
.column-shipping_address,
|
||||
.column-billing_address {
|
||||
width: 20ch;
|
||||
line-height: 1.5em;
|
||||
.description {
|
||||
display: block;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.column-wc_actions {
|
||||
text-align: right;
|
||||
|
||||
mark.refunded::after {
|
||||
content: '\e014';
|
||||
color: #999;
|
||||
a.button {
|
||||
text-indent: 9999px;
|
||||
margin: 2px 0 2px 4px;
|
||||
}
|
||||
}
|
||||
.order-preview {
|
||||
float:right;
|
||||
width: 16px;
|
||||
padding: 20px 4px 4px 4px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 4px;
|
||||
|
||||
&::before {
|
||||
@include icon( '\e010' );
|
||||
line-height: 16px;
|
||||
font-size: 14px;
|
||||
vertical-align:middle;
|
||||
top: 4px;
|
||||
|
||||
}
|
||||
&:hover {
|
||||
border: 2px solid #00a0d2;
|
||||
}
|
||||
}
|
||||
.order-preview.disabled {
|
||||
&::before {
|
||||
content: '';
|
||||
background: url('../images/wpspin.gif') no-repeat center top;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
td.column-order_status {
|
||||
padding-top: 9px;
|
||||
.order-status {
|
||||
display: inline-flex;
|
||||
padding: 0px 1em;
|
||||
line-height: 2.5em;
|
||||
color: #777;
|
||||
background: #E5E5E5;
|
||||
border-radius: 4px;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.05);
|
||||
margin: -.25em 0;
|
||||
cursor: inherit !important;
|
||||
white-space: nowrap;
|
||||
|
||||
&.status-completed {
|
||||
background: #C8D7E1;
|
||||
color: #2e4453;
|
||||
}
|
||||
|
||||
&.status-on-hold {
|
||||
background: #f8dda7;
|
||||
color: #94660c;
|
||||
}
|
||||
|
||||
&.status-failed {
|
||||
background: #eba3a3;
|
||||
color: #761919;
|
||||
}
|
||||
|
||||
&.status-processing {
|
||||
background: #C6E1C6;
|
||||
color: #5B841B;
|
||||
}
|
||||
|
||||
&.status-trash {
|
||||
background: #eba3a3;
|
||||
color: #761919;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-order-preview {
|
||||
.order-status {
|
||||
float: right;
|
||||
margin-right: 54px;
|
||||
}
|
||||
article {
|
||||
padding: 0 !important;
|
||||
}
|
||||
.modal-close {
|
||||
border-radius: 0;
|
||||
}
|
||||
.wc-order-preview-table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
th, td {
|
||||
padding: 1em 1.5em;
|
||||
text-align: left;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
text-align: right;
|
||||
vertical-align: top;
|
||||
}
|
||||
td:first-child,
|
||||
th:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
border-color: #ccc;
|
||||
}
|
||||
tr:last-child td {
|
||||
border: 0;
|
||||
}
|
||||
.wc-order-item-sku {
|
||||
margin-top: .5em;
|
||||
}
|
||||
.wc-order-item-meta {
|
||||
margin-top: .5em;
|
||||
th, td {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
td:last-child {
|
||||
padding-left: .5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
.wc-order-preview-addresses {
|
||||
overflow:hidden;
|
||||
.wc-order-preview-address {
|
||||
width: 50%;
|
||||
float: left;
|
||||
padding: 1.5em;
|
||||
box-sizing: border-box;
|
||||
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
}
|
||||
strong {
|
||||
display: block;
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
.wc-action-button,
|
||||
.wc-action-button-group {
|
||||
float: left;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.wc-action-button-group {
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wc-action-button-group {
|
||||
vertical-align: middle;
|
||||
line-height: 26px;
|
||||
text-align: left;
|
||||
margin-bottom: 4px;
|
||||
label {
|
||||
margin-right: 6px;
|
||||
cursor: default;
|
||||
font-weight: bold;
|
||||
}
|
||||
.wc-action-button-group__items {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wc-action-button {
|
||||
margin: -1px !important;
|
||||
border: 1px solid #ccc;
|
||||
padding: 1px 10px !important;
|
||||
border-radius: 0 !important;
|
||||
float: none;
|
||||
line-height: 28px;
|
||||
height: auto;
|
||||
z-index: 1;
|
||||
position:relative;
|
||||
}
|
||||
.wc-action-button:hover,
|
||||
.wc-action-button:focus {
|
||||
border: 1px solid #999;
|
||||
z-index: 2;
|
||||
}
|
||||
.wc-action-button:first-child {
|
||||
border-top-left-radius: 3px !important;
|
||||
border-bottom-left-radius: 3px !important;
|
||||
}
|
||||
.wc-action-button:last-child {
|
||||
border-top-right-radius: 3px !important;
|
||||
border-bottom-right-radius: 3px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1985,66 +2235,6 @@ ul.wc_coupon_list_block {
|
|||
}
|
||||
}
|
||||
|
||||
.order_actions {
|
||||
.processing,
|
||||
.complete,
|
||||
.view {
|
||||
@include ir();
|
||||
padding: 0 !important;
|
||||
height: 2em !important;
|
||||
width: 2em;
|
||||
}
|
||||
|
||||
.processing::after {
|
||||
@include icon( '\e00f' );
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.complete::after {
|
||||
@include icon_dashicons( '\f147' );
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.view::after {
|
||||
@include icon_dashicons( '\f177' );
|
||||
line-height: 1.85;
|
||||
}
|
||||
}
|
||||
|
||||
.user_actions {
|
||||
.edit,
|
||||
.link,
|
||||
.view,
|
||||
.refresh {
|
||||
@include ir();
|
||||
padding: 0 !important;
|
||||
height: 2em !important;
|
||||
width: 2em;
|
||||
|
||||
&::after {
|
||||
@include icon;
|
||||
line-height: 1.85;
|
||||
}
|
||||
}
|
||||
|
||||
.edit::after {
|
||||
font-family: 'Dashicons';
|
||||
content: '\f464';
|
||||
}
|
||||
|
||||
.link::after {
|
||||
content: '\e00d';
|
||||
}
|
||||
|
||||
.view::after {
|
||||
content: '\e010';
|
||||
}
|
||||
|
||||
.refresh::after {
|
||||
content: '\e031';
|
||||
}
|
||||
}
|
||||
|
||||
.attributes-table {
|
||||
td,
|
||||
th {
|
||||
|
@ -2303,18 +2493,26 @@ table.wp-list-table {
|
|||
}
|
||||
}
|
||||
|
||||
mark.instock {
|
||||
font-weight: 700;
|
||||
color: $green;
|
||||
background: transparent none;
|
||||
line-height: 1;
|
||||
}
|
||||
mark {
|
||||
&.instock,
|
||||
&.outofstock,
|
||||
&.onbackorder {
|
||||
font-weight: 700;
|
||||
background: transparent none;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
mark.outofstock {
|
||||
font-weight: 700;
|
||||
color: #aa4444;
|
||||
background: transparent none;
|
||||
line-height: 1;
|
||||
&.instock {
|
||||
color: $green;
|
||||
}
|
||||
|
||||
&.outofstock {
|
||||
color: #aa4444;
|
||||
}
|
||||
|
||||
&.onbackorder {
|
||||
color: #eaa600;
|
||||
}
|
||||
}
|
||||
|
||||
.order-notes_head,
|
||||
|
@ -4559,6 +4757,10 @@ img.ui-datepicker-trigger {
|
|||
/**
|
||||
* Reports
|
||||
*/
|
||||
.woocommerce-reports-remove-filter {
|
||||
color: red;
|
||||
text-decoration: none;
|
||||
}
|
||||
.woocommerce-reports-wrap,
|
||||
.woocommerce-reports-wide {
|
||||
&.woocommerce-reports-wrap {
|
||||
|
@ -4572,6 +4774,10 @@ img.ui-datepicker-trigger {
|
|||
zoom: 1;
|
||||
}
|
||||
|
||||
.widefat th {
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
vertical-align: top;
|
||||
padding: 7px;
|
||||
|
@ -4960,29 +5166,6 @@ img.ui-datepicker-trigger {
|
|||
width: 49.5%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.column-wc_actions {
|
||||
a.edit,
|
||||
a.view {
|
||||
@include ir();
|
||||
padding: 0 !important;
|
||||
height: 2em !important;
|
||||
width: 2em;
|
||||
|
||||
&::after {
|
||||
@include icon_dashicons;
|
||||
line-height: 1.85;
|
||||
}
|
||||
}
|
||||
|
||||
a.edit::after {
|
||||
content: '\f464';
|
||||
}
|
||||
|
||||
a.view::after {
|
||||
content: '\f177';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.woocommerce-wide-reports-wrap {
|
||||
|
@ -5311,20 +5494,6 @@ table.bar_chart {
|
|||
|
||||
.post-type-shop_order {
|
||||
.wp-list-table {
|
||||
.column-order_status {
|
||||
display: none;
|
||||
text-align: left;
|
||||
padding-bottom: 0;
|
||||
|
||||
mark {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
&::before {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.column-customer_message,
|
||||
.column-order_notes {
|
||||
text-align: inherit;
|
||||
|
@ -5414,6 +5583,14 @@ table.bar_chart {
|
|||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 782px) {
|
||||
.wc-backbone-modal .wc-backbone-modal-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wc-backbone-modal-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
@ -5515,7 +5692,7 @@ table.bar_chart {
|
|||
box-shadow: 0 -4px 4px -4px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.inner {
|
||||
float: right;
|
||||
text-align: right;
|
||||
line-height: 23px;
|
||||
|
||||
.button {
|
||||
|
@ -5609,7 +5786,7 @@ table.bar_chart {
|
|||
}
|
||||
select,
|
||||
input {
|
||||
line-height: 32px;
|
||||
line-height: 1;
|
||||
height: 32px;
|
||||
}
|
||||
.select2-container {
|
||||
|
|
|
@ -1 +1 @@
|
|||
@charset "UTF-8";@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
|
||||
@charset "UTF-8";@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:right;font-size:.8em;border-right:1px solid #fff;border-left:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-right:0}ul.woocommerce_stats li:last-child{border-left:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:right;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:left;position:absolute;left:0;top:50%;margin-left:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;right:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:right;margin-left:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-left:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:right;margin:0 0 5px 10px}#woocommerce_dashboard_recent_reviews .star-rating{float:left;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-right:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:right;top:0;right:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:right;top:0;right:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;right:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
|
|
@ -1 +1 @@
|
|||
@charset "UTF-8";@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
|
||||
@charset "UTF-8";@font-face{font-family:star;src:url(../fonts/star.eot);src:url(../fonts/star.eot?#iefix) format("embedded-opentype"),url(../fonts/star.woff) format("woff"),url(../fonts/star.ttf) format("truetype"),url(../fonts/star.svg#star) format("svg");font-weight:400;font-style:normal}@font-face{font-family:WooCommerce;src:url(../fonts/WooCommerce.eot);src:url(../fonts/WooCommerce.eot?#iefix) format("embedded-opentype"),url(../fonts/WooCommerce.woff) format("woff"),url(../fonts/WooCommerce.ttf) format("truetype"),url(../fonts/WooCommerce.svg#WooCommerce) format("svg");font-weight:400;font-style:normal}ul.woocommerce_stats{overflow:hidden;zoom:1}ul.woocommerce_stats li{width:25%;padding:0 1em;text-align:center;float:left;font-size:.8em;border-left:1px solid #fff;border-right:1px solid #ececec;box-sizing:border-box}ul.woocommerce_stats li:first-child{border-left:0}ul.woocommerce_stats li:last-child{border-right:0}ul.woocommerce_stats strong{font-family:Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size:4em;line-height:1.2em;font-weight:400;text-align:center;display:block}#woocommerce_dashboard_status .inside{padding:0;margin:0}#woocommerce_dashboard_status .wc_status_list{overflow:hidden;margin:0}#woocommerce_dashboard_status .wc_status_list li{width:50%;float:left;padding:0;box-sizing:border-box;margin:0;border-top:1px solid #ececec;color:#aaa}#woocommerce_dashboard_status .wc_status_list li a{display:block;color:#aaa;padding:9px 12px;-webkit-transition:all ease .5s;transition:all ease .5s;position:relative;font-size:12px}#woocommerce_dashboard_status .wc_status_list li a .wc_sparkline{width:4em;height:2em;display:block;float:right;position:absolute;right:0;top:50%;margin-right:12px;margin-top:-1.25em}#woocommerce_dashboard_status .wc_status_list li a strong{font-size:18px;line-height:1.2em;font-weight:400;display:block;color:#21759b}#woocommerce_dashboard_status .wc_status_list li a:hover{color:#2ea2cc}#woocommerce_dashboard_status .wc_status_list li a:hover strong,#woocommerce_dashboard_status .wc_status_list li a:hover::before{color:#2ea2cc!important}#woocommerce_dashboard_status .wc_status_list li a::before{font-family:WooCommerce;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;content:"";font-size:2em;position:relative;width:auto;line-height:1.2em;color:#464646;float:left;margin-right:12px;margin-bottom:12px}#woocommerce_dashboard_status .wc_status_list li:first-child{border-top:0}#woocommerce_dashboard_status .wc_status_list li.sales-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.sales-this-month a::before{font-family:Dashicons;content:'\f185'}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month{width:100%}#woocommerce_dashboard_status .wc_status_list li.best-seller-this-month a::before{content:'\e006'}#woocommerce_dashboard_status .wc_status_list li.processing-orders{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.processing-orders a::before{content:'\e011';color:#7ad03a}#woocommerce_dashboard_status .wc_status_list li.on-hold-orders a::before{content:'\e033';color:#999}#woocommerce_dashboard_status .wc_status_list li.low-in-stock{border-right:1px solid #ececec}#woocommerce_dashboard_status .wc_status_list li.low-in-stock a::before{content:'\e016';color:#ffba00}#woocommerce_dashboard_status .wc_status_list li.out-of-stock a::before{content:'\e013';color:#a00}#woocommerce_dashboard_recent_reviews li{line-height:1.5em;margin-bottom:12px}#woocommerce_dashboard_recent_reviews h4.meta{line-height:1.4;margin:-.2em 0 0 0;font-weight:400;color:#999}#woocommerce_dashboard_recent_reviews blockquote{padding:0;margin:0}#woocommerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0}#woocommerce_dashboard_recent_reviews .star-rating{float:right;overflow:hidden;position:relative;height:1.5em;line-height:1.5;margin-left:.5em;width:5.4em;font-family:WooCommerce!important}#woocommerce_dashboard_recent_reviews .star-rating::before{content:'\e021\e021\e021\e021\e021';color:#b3b2b2;float:left;top:0;left:0;position:absolute;letter-spacing:.1em}#woocommerce_dashboard_recent_reviews .star-rating span{overflow:hidden;float:left;top:0;left:0;position:absolute;padding-top:1.5em}#woocommerce_dashboard_recent_reviews .star-rating span::before{content:'\e020\e020\e020\e020\e020';top:0;position:absolute;left:0;letter-spacing:.1em;color:#9c5d90}#dash-right-now li.product-count a::before{font-family:WooCommerce;content:'\e01d'}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
*{background:0 0!important;color:#000!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
|
||||
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-right:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-right:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-right:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
|
|
@ -1 +1 @@
|
|||
*{background:0 0!important;color:#000!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
|
||||
*{background:0 0!important;color:#000!important;text-shadow:none!important;-webkit-filter:none!important;filter:none!important;-ms-filter:none!important;font-size:9pt!important;opacity:1;-webkit-transition:none!important;transition:none!important}@page{margin:.5cm}#adminmenuback,#adminmenuwrap,#screen-meta-links,#wpadminbar,#wpfooter,.update-nag,.updated,.woo-nav-tab-wrapper,.woocommerce-reports-wide .button,.woocommerce-reports-wide .postbox h3.stats_range .export_csv,.woocommerce-reports-wrap .postbox h3.stats_range .export_csv{display:none}h2 .nav-tab{line-height:14px}.woocommerce-reports-wide .postbox h3.stats_range ul li a,.woocommerce-reports-wide .postbox h3.stats_range ul li.custom,.woocommerce-reports-wrap .postbox h3.stats_range ul li a,.woocommerce-reports-wrap .postbox h3.stats_range ul li.custom{padding:5px;line-height:14px}#wpcontent{margin-left:0}.woocommerce-reports-wide .postbox .chart-with-sidebar .chart-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar .chart-sidebar{margin-left:-130px;width:130px;display:block}.woocommerce-reports-wide .postbox .chart-with-sidebar,.woocommerce-reports-wrap .postbox .chart-with-sidebar{padding-left:130px}.chart-legend{overflow:hidden;zoom:1}.chart-legend li{padding:.25em .5em!important;box-shadow:none!important;border-bottom:1px solid gray!important}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -602,6 +602,7 @@ body {
|
|||
.wc-wizard-service-enable input {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&:before {
|
||||
content: "\f347"; // down chevron
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
|
@ -9,8 +9,7 @@
|
|||
*/
|
||||
$.fn.WCBackboneModal = function( options ) {
|
||||
return this.each( function() {
|
||||
var WCeachBackboneModal = new $.WCBackboneModal( $( this ), options )
|
||||
( WCeachBackboneModal() );
|
||||
( new $.WCBackboneModal( $( this ), options ) );
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -25,12 +24,10 @@
|
|||
var settings = $.extend( {}, $.WCBackboneModal.defaultOptions, options );
|
||||
|
||||
if ( settings.template ) {
|
||||
|
||||
var BackboneModal = new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
BackboneModal();
|
||||
new $.WCBackboneModal.View({
|
||||
target: settings.template,
|
||||
string: settings.variable
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){var n=new e.WCBackboneModal(e(this),t)(n())})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})()},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
||||
!function(e,t,n){"use strict";e.fn.WCBackboneModal=function(t){return this.each(function(){new e.WCBackboneModal(e(this),t)})},e.WCBackboneModal=function(t,n){var o=e.extend({},e.WCBackboneModal.defaultOptions,n);o.template&&new e.WCBackboneModal.View({target:o.template,string:o.variable})},e.WCBackboneModal.defaultOptions={template:"",variable:{}},e.WCBackboneModal.View=t.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var t=e(".wc-backbone-modal-content").find("article"),n=.75*e(window).height();t.css({"max-height":n+"px"})},initialize:function(t){var o=this;this._target=t.target,this._string=t.string,n.bindAll(this,"render"),this.render(),e(window).resize(function(){o.resizeContent()})},render:function(){var t=wp.template(this._target);this.$el.append(t(this._string)),e(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),e(document.body).trigger("init_tooltips"),e(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(t){t.preventDefault(),e(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),e(document).off("focusin"),e(document.body).css({overflow:"auto"}),this.remove(),e(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(t){e(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(t)},getFormData:function(){var t={};return e(document.body).trigger("wc_backbone_modal_before_update",this._target),e.each(e("form",this.$el).serializeArray(),function(n,o){-1!==o.name.indexOf("[]")?(o.name=o.name.replace("[]",""),t[o.name]=e.makeArray(t[o.name]),t[o.name].push(o.value)):t[o.name]=o.value}),t},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_);
|
|
@ -472,13 +472,13 @@ jQuery( function ( $ ) {
|
|||
if ( value != null ) {
|
||||
wc_meta_boxes_order_items.block();
|
||||
|
||||
var data = {
|
||||
var data = $.extend( {}, wc_meta_boxes_order_items.get_taxable_address(), {
|
||||
action : 'woocommerce_add_order_fee',
|
||||
dataType: 'json',
|
||||
order_id: woocommerce_admin_meta_boxes.post_id,
|
||||
security: woocommerce_admin_meta_boxes.order_item_nonce,
|
||||
amount : value
|
||||
};
|
||||
} );
|
||||
|
||||
$.post( woocommerce_admin_meta_boxes.ajax_url, data, function( response ) {
|
||||
if ( response.success ) {
|
||||
|
@ -543,12 +543,13 @@ jQuery( function ( $ ) {
|
|||
|
||||
wc_meta_boxes_order_items.block();
|
||||
|
||||
var data = {
|
||||
var data = $.extend( {}, wc_meta_boxes_order_items.get_taxable_address(), {
|
||||
order_id : woocommerce_admin_meta_boxes.post_id,
|
||||
order_item_ids: order_item_id,
|
||||
action : 'woocommerce_remove_order_item',
|
||||
security : woocommerce_admin_meta_boxes.order_item_nonce
|
||||
};
|
||||
} );
|
||||
|
||||
// Check if items have changed, if so pass them through so we can save them before deleting.
|
||||
if ( 'true' === $( 'button.cancel-action' ).attr( 'data-reload' ) ) {
|
||||
data.items = $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize();
|
||||
|
@ -607,39 +608,44 @@ jQuery( function ( $ ) {
|
|||
return false;
|
||||
},
|
||||
|
||||
get_taxable_address: function() {
|
||||
var country = '';
|
||||
var state = '';
|
||||
var postcode = '';
|
||||
var city = '';
|
||||
|
||||
if ( 'shipping' === woocommerce_admin_meta_boxes.tax_based_on ) {
|
||||
country = $( '#_shipping_country' ).val();
|
||||
state = $( '#_shipping_state' ).val();
|
||||
postcode = $( '#_shipping_postcode' ).val();
|
||||
city = $( '#_shipping_city' ).val();
|
||||
}
|
||||
|
||||
if ( 'billing' === woocommerce_admin_meta_boxes.tax_based_on || ! country ) {
|
||||
country = $( '#_billing_country' ).val();
|
||||
state = $( '#_billing_state' ).val();
|
||||
postcode = $( '#_billing_postcode' ).val();
|
||||
city = $( '#_billing_city' ).val();
|
||||
}
|
||||
|
||||
return {
|
||||
country: country,
|
||||
state: state,
|
||||
postcode: postcode,
|
||||
city: city
|
||||
};
|
||||
},
|
||||
|
||||
recalculate: function() {
|
||||
if ( window.confirm( woocommerce_admin_meta_boxes.calc_totals ) ) {
|
||||
wc_meta_boxes_order_items.block();
|
||||
|
||||
var country = '';
|
||||
var state = '';
|
||||
var postcode = '';
|
||||
var city = '';
|
||||
|
||||
if ( 'shipping' === woocommerce_admin_meta_boxes.tax_based_on ) {
|
||||
country = $( '#_shipping_country' ).val();
|
||||
state = $( '#_shipping_state' ).val();
|
||||
postcode = $( '#_shipping_postcode' ).val();
|
||||
city = $( '#_shipping_city' ).val();
|
||||
}
|
||||
|
||||
if ( 'billing' === woocommerce_admin_meta_boxes.tax_based_on || ! country ) {
|
||||
country = $( '#_billing_country' ).val();
|
||||
state = $( '#_billing_state' ).val();
|
||||
postcode = $( '#_billing_postcode' ).val();
|
||||
city = $( '#_billing_city' ).val();
|
||||
}
|
||||
|
||||
var data = {
|
||||
var data = $.extend( {}, wc_meta_boxes_order_items.get_taxable_address(), {
|
||||
action: 'woocommerce_calc_line_taxes',
|
||||
order_id: woocommerce_admin_meta_boxes.post_id,
|
||||
items: $( 'table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]' ).serialize(),
|
||||
country: country,
|
||||
state: state,
|
||||
postcode: postcode,
|
||||
city: city,
|
||||
security: woocommerce_admin_meta_boxes.calc_totals_nonce
|
||||
};
|
||||
} );
|
||||
|
||||
$.ajax({
|
||||
url: woocommerce_admin_meta_boxes.ajax_url,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -232,8 +232,12 @@ jQuery( function( $ ) {
|
|||
$( 'input#_manage_stock' ).change( function() {
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
$( 'div.stock_fields' ).show();
|
||||
$( 'p.stock_status_field' ).hide();
|
||||
} else {
|
||||
var product_type = $( 'select#product-type' ).val();
|
||||
|
||||
$( 'div.stock_fields' ).hide();
|
||||
$( 'p.stock_status_field:not( .hide_if_' + product_type + ' )' ).show();
|
||||
}
|
||||
}).change();
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -60,10 +60,12 @@ jQuery(function( $ ) {
|
|||
}
|
||||
|
||||
if ( 'yes' === manage_stock ) {
|
||||
$( '.stock_qty_field', '.inline-edit-row' ).show().removeAttr( 'style' );
|
||||
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
|
||||
$( '.stock_status_field' ).hide();
|
||||
$( 'input[name="_manage_stock"]', '.inline-edit-row' ).attr( 'checked', 'checked' );
|
||||
} else {
|
||||
$( '.stock_qty_field', '.inline-edit-row' ).hide();
|
||||
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
|
||||
$( '.stock_status_field' ).show().removeAttr( 'style' );
|
||||
$( 'input[name="_manage_stock"]', '.inline-edit-row' ).removeAttr( 'checked' );
|
||||
}
|
||||
|
||||
|
@ -96,9 +98,11 @@ jQuery(function( $ ) {
|
|||
$( '#the-list' ).on( 'change', '.inline-edit-row input[name="_manage_stock"]', function() {
|
||||
|
||||
if ( $( this ).is( ':checked' ) ) {
|
||||
$( '.stock_qty_field', '.inline-edit-row' ).show().removeAttr( 'style' );
|
||||
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).show().removeAttr( 'style' );
|
||||
$( '.stock_status_field' ).hide();
|
||||
} else {
|
||||
$( '.stock_qty_field', '.inline-edit-row' ).hide();
|
||||
$( '.stock_qty_field, .backorder_field', '.inline-edit-row' ).hide();
|
||||
$( '.stock_status_field' ).show().removeAttr( 'style' );
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){e("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var t=e(this).closest("tr").attr("id");t=t.replace("post-","");var i=e("#woocommerce_inline_"+t),n=i.find(".sku").text(),o=i.find(".regular_price").text(),l=i.find(".sale_price ").text(),d=i.find(".weight").text(),s=i.find(".length").text(),c=i.find(".width").text(),a=i.find(".height").text(),r=i.find(".shipping_class").text(),_=i.find(".visibility").text(),m=i.find(".stock_status").text(),p=i.find(".stock").text(),u=i.find(".featured").text(),w=i.find(".manage_stock").text(),h=i.find(".menu_order").text(),f=i.find(".tax_status").text(),v=i.find(".tax_class").text(),k=i.find(".backorders").text(),x=o.replace(".",woocommerce_admin.mon_decimal_point),g=l.replace(".",woocommerce_admin.mon_decimal_point);e('input[name="_sku"]',".inline-edit-row").val(n),e('input[name="_regular_price"]',".inline-edit-row").val(x),e('input[name="_sale_price"]',".inline-edit-row").val(g),e('input[name="_weight"]',".inline-edit-row").val(d),e('input[name="_length"]',".inline-edit-row").val(s),e('input[name="_width"]',".inline-edit-row").val(c),e('input[name="_height"]',".inline-edit-row").val(a),e('select[name="_shipping_class"] option:selected',".inline-edit-row").attr("selected",!1).change(),e('select[name="_shipping_class"] option[value="'+r+'"]').attr("selected","selected").change(),e('input[name="_stock"]',".inline-edit-row").val(p),e('input[name="menu_order"]',".inline-edit-row").val(h),e('select[name="_tax_status"] option, select[name="_tax_class"] option, select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected"),e('select[name="_tax_status"] option[value="'+f+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_tax_class"] option[value="'+v+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_visibility"] option[value="'+_+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_stock_status"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_backorders"] option[value="'+k+'"]',".inline-edit-row").attr("selected","selected"),"yes"===u?e('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):e('input[name="_featured"]',".inline-edit-row").removeAttr("checked"),"yes"===w?(e(".stock_qty_field",".inline-edit-row").show().removeAttr("style"),e('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")):(e(".stock_qty_field",".inline-edit-row").hide(),e('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked"));var y=i.find(".product_type").text(),b=i.find(".product_is_virtual").text();"simple"===y||"external"===y?e(".price_fields",".inline-edit-row").show().removeAttr("style"):e(".price_fields",".inline-edit-row").hide(),"yes"===b?e(".dimension_fields",".inline-edit-row").hide():e(".dimension_fields",".inline-edit-row").show().removeAttr("style"),"grouped"===y?e(".stock_fields",".inline-edit-row").hide():e(".stock_fields",".inline-edit-row").show().removeAttr("style"),e('input[name="comment_status"]').parent().find(".checkbox-title").text(woocommerce_quick_edit.strings.allow_reviews)}),e("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){e(this).is(":checked")?e(".stock_qty_field",".inline-edit-row").show().removeAttr("style"):e(".stock_qty_field",".inline-edit-row").hide()}),e("#wpbody").on("click","#doaction, #doaction2",function(){e("input.text",".inline-edit-row").val(""),e("#woocommerce-fields").find("select").prop("selectedIndex",0),e("#woocommerce-fields-bulk").find(".inline-edit-group .change-input").hide()}),e("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){0<e(this).val()?e(this).closest("div").find(".change-input").show():e(this).closest("div").find(".change-input").hide()}),e("#wpbody").on("click",".trash-product",function(){return window.confirm(woocommerce_admin.i18_delete_product_notice)})});
|
||||
jQuery(function(e){e("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var t=e(this).closest("tr").attr("id");t=t.replace("post-","");var i=e("#woocommerce_inline_"+t),n=i.find(".sku").text(),o=i.find(".regular_price").text(),d=i.find(".sale_price ").text(),l=i.find(".weight").text(),s=i.find(".length").text(),c=i.find(".width").text(),r=i.find(".height").text(),a=i.find(".shipping_class").text(),_=i.find(".visibility").text(),m=i.find(".stock_status").text(),p=i.find(".stock").text(),u=i.find(".featured").text(),w=i.find(".manage_stock").text(),f=i.find(".menu_order").text(),h=i.find(".tax_status").text(),k=i.find(".tax_class").text(),v=i.find(".backorders").text(),x=o.replace(".",woocommerce_admin.mon_decimal_point),g=d.replace(".",woocommerce_admin.mon_decimal_point);e('input[name="_sku"]',".inline-edit-row").val(n),e('input[name="_regular_price"]',".inline-edit-row").val(x),e('input[name="_sale_price"]',".inline-edit-row").val(g),e('input[name="_weight"]',".inline-edit-row").val(l),e('input[name="_length"]',".inline-edit-row").val(s),e('input[name="_width"]',".inline-edit-row").val(c),e('input[name="_height"]',".inline-edit-row").val(r),e('select[name="_shipping_class"] option:selected',".inline-edit-row").attr("selected",!1).change(),e('select[name="_shipping_class"] option[value="'+a+'"]').attr("selected","selected").change(),e('input[name="_stock"]',".inline-edit-row").val(p),e('input[name="menu_order"]',".inline-edit-row").val(f),e('select[name="_tax_status"] option, select[name="_tax_class"] option, select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected"),e('select[name="_tax_status"] option[value="'+h+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_tax_class"] option[value="'+k+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_visibility"] option[value="'+_+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_stock_status"] option[value="'+m+'"]',".inline-edit-row").attr("selected","selected"),e('select[name="_backorders"] option[value="'+v+'"]',".inline-edit-row").attr("selected","selected"),"yes"===u?e('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):e('input[name="_featured"]',".inline-edit-row").removeAttr("checked"),"yes"===w?(e(".stock_qty_field, .backorder_field",".inline-edit-row").show().removeAttr("style"),e(".stock_status_field").hide(),e('input[name="_manage_stock"]',".inline-edit-row").attr("checked","checked")):(e(".stock_qty_field, .backorder_field",".inline-edit-row").hide(),e(".stock_status_field").show().removeAttr("style"),e('input[name="_manage_stock"]',".inline-edit-row").removeAttr("checked"));var y=i.find(".product_type").text(),b=i.find(".product_is_virtual").text();"simple"===y||"external"===y?e(".price_fields",".inline-edit-row").show().removeAttr("style"):e(".price_fields",".inline-edit-row").hide(),"yes"===b?e(".dimension_fields",".inline-edit-row").hide():e(".dimension_fields",".inline-edit-row").show().removeAttr("style"),"grouped"===y?e(".stock_fields",".inline-edit-row").hide():e(".stock_fields",".inline-edit-row").show().removeAttr("style"),e('input[name="comment_status"]').parent().find(".checkbox-title").text(woocommerce_quick_edit.strings.allow_reviews)}),e("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){e(this).is(":checked")?(e(".stock_qty_field, .backorder_field",".inline-edit-row").show().removeAttr("style"),e(".stock_status_field").hide()):(e(".stock_qty_field, .backorder_field",".inline-edit-row").hide(),e(".stock_status_field").show().removeAttr("style"))}),e("#wpbody").on("click","#doaction, #doaction2",function(){e("input.text",".inline-edit-row").val(""),e("#woocommerce-fields").find("select").prop("selectedIndex",0),e("#woocommerce-fields-bulk").find(".inline-edit-group .change-input").hide()}),e("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){0<e(this).val()?e(this).closest("div").find(".change-input").show():e(this).closest("div").find(".change-input").hide()}),e("#wpbody").on("click",".trash-product",function(){return window.confirm(woocommerce_admin.i18_delete_product_notice)})});
|
|
@ -0,0 +1,84 @@
|
|||
/* global wc_orders_params */
|
||||
jQuery( function( $ ) {
|
||||
|
||||
if ( typeof wc_orders_params === 'undefined' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* WCOrdersTable class.
|
||||
*/
|
||||
var WCOrdersTable = function() {
|
||||
$( document )
|
||||
.on( 'click', '.post-type-shop_order .wp-list-table tbody td', this.onRowClick )
|
||||
.on( 'click', '.order-preview:not(.disabled)', this.onPreview );
|
||||
};
|
||||
|
||||
/**
|
||||
* Click a row.
|
||||
*/
|
||||
WCOrdersTable.prototype.onRowClick = function( e ) {
|
||||
if ( $( e.target ).filter( 'a' ).length ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var $row = $( this ).closest( 'tr' ),
|
||||
href = $row.find( 'a.order-view' ).attr( 'href' );
|
||||
|
||||
if ( href.length ) {
|
||||
e.preventDefault();
|
||||
|
||||
if ( e.metaKey ) {
|
||||
window.open( href, '_blank' );
|
||||
} else {
|
||||
window.location = href;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Preview an order.
|
||||
*/
|
||||
WCOrdersTable.prototype.onPreview = function() {
|
||||
var $previewButton = $( this ),
|
||||
$order_id = $previewButton.data( 'order-id' );
|
||||
|
||||
if ( $previewButton.data( 'order-data' ) ) {
|
||||
$( this ).WCBackboneModal({
|
||||
template: 'wc-modal-view-order',
|
||||
variable : $previewButton.data( 'order-data' )
|
||||
});
|
||||
} else {
|
||||
$previewButton.addClass( 'disabled' );
|
||||
|
||||
$.ajax({
|
||||
url: wc_orders_params.ajax_url,
|
||||
data: {
|
||||
order_id: $order_id,
|
||||
action : 'woocommerce_get_order_details',
|
||||
security: wc_orders_params.preview_nonce
|
||||
},
|
||||
type: 'GET',
|
||||
success: function( response ) {
|
||||
$( '.order-preview' ).removeClass( 'disabled' );
|
||||
|
||||
if ( response.success ) {
|
||||
$previewButton.data( 'order-data', response.data );
|
||||
|
||||
$( this ).WCBackboneModal({
|
||||
template: 'wc-modal-view-order',
|
||||
variable : response.data
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Init WCOrdersTable.
|
||||
*/
|
||||
new WCOrdersTable();
|
||||
} );
|
|
@ -0,0 +1 @@
|
|||
jQuery(function(e){if("undefined"==typeof wc_orders_params)return!1;var r=function(){e(document).on("click",".post-type-shop_order .wp-list-table tbody td",this.onRowClick).on("click",".order-preview:not(.disabled)",this.onPreview)};r.prototype.onRowClick=function(r){if(e(r.target).filter("a").length)return!0;var a=e(this).closest("tr").find("a.order-view").attr("href");a.length&&(r.preventDefault(),r.metaKey?window.open(a,"_blank"):window.location=a)},r.prototype.onPreview=function(){var r=e(this),a=r.data("order-id");return r.data("order-data")?e(this).WCBackboneModal({template:"wc-modal-view-order",variable:r.data("order-data")}):(r.addClass("disabled"),e.ajax({url:wc_orders_params.ajax_url,data:{order_id:a,action:"woocommerce_get_order_details",security:wc_orders_params.preview_nonce},type:"GET",success:function(a){e(".order-preview").removeClass("disabled"),a.success&&(r.data("order-data",a.data),e(this).WCBackboneModal({template:"wc-modal-view-order",variable:a.data}))}})),!1},new r});
|
|
@ -36,17 +36,23 @@ jQuery( function( $ ) {
|
|||
} );
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'click', '.wc-wizard-service-enable', function( e ) {
|
||||
e.stopPropagation();
|
||||
var eventTarget = $( e.target );
|
||||
|
||||
if ( eventTarget.is( 'input' ) ) {
|
||||
e.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
var $checkbox = $( this ).find( 'input[type="checkbox"]' );
|
||||
|
||||
var $checkbox = $( this ).find( '.wc-wizard-service-toggle input' );
|
||||
$checkbox.prop( 'checked', ! $checkbox.prop( 'checked' ) ).change();
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services-list-toggle' ).on( 'change', '.wc-wizard-service-enable input', function() {
|
||||
$( this ).closest( '.wc-wizard-services-list-toggle' ).toggleClass( 'closed' );
|
||||
$( this ).closest( '.wc-wizard-services' ).find( '.wc-wizard-service-item' )
|
||||
.slideToggle()
|
||||
.css( 'display', 'flex' );
|
||||
$( this ).closest( '.wc-wizard-services-list-toggle' ).toggleClass( 'closed' );
|
||||
$( this ).closest( '.wc-wizard-services' ).find( '.wc-wizard-service-item' )
|
||||
.slideToggle()
|
||||
.css( 'display', 'flex' );
|
||||
} );
|
||||
|
||||
$( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-select .method', function( e ) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){i.stopPropagation();var s=e(this).find(".wc-wizard-service-toggle input");s.prop("checked",!s.prop("checked")).change()}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").hide())}),e(".wc-wizard-services input#stripe_create_account").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
|
||||
jQuery(function(e){function i(){e(".wc-setup-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function s(){e("form.activate-jetpack").submit()}function t(){wp.ajax.post("setup_wizard_check_jetpack").then(function(e){if(!e||!e.is_active||"yes"===e.is_active)return s();setTimeout(t,3e3)}).fail(function(){s()})}e(".button-next").on("click",function(){var s=e(this).parents("form").get(0);return("function"!=typeof s.checkValidity||s.checkValidity())&&i(),!0}),e(".wc-wizard-services").on("change",".wc-wizard-service-enable input",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-toggle").removeClass("disabled"),e(this).closest(".wc-wizard-service-item").addClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").removeClass("hide")):(e(this).closest(".wc-wizard-service-toggle").addClass("disabled"),e(this).closest(".wc-wizard-service-item").removeClass("checked"),e(this).closest(".wc-wizard-service-item").find(".wc-wizard-service-settings").addClass("hide"))}),e(".wc-wizard-services").on("click",".wc-wizard-service-enable",function(i){if(e(i.target).is("input"))i.stopPropagation();else{var s=e(this).find('input[type="checkbox"]');s.prop("checked",!s.prop("checked")).change()}}),e(".wc-wizard-services-list-toggle").on("change",".wc-wizard-service-enable input",function(){e(this).closest(".wc-wizard-services-list-toggle").toggleClass("closed"),e(this).closest(".wc-wizard-services").find(".wc-wizard-service-item").slideToggle().css("display","flex")}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-select .method",function(i){var s=e(this).closest(".wc-wizard-service-description"),t=i.target.value,c=s.find(".shipping-method-descriptions");c.find(".shipping-method-description").addClass("hide"),c.find("."+t).removeClass("hide");var r=s.find(".shipping-method-settings");r.find(".shipping-method-setting").addClass("hide").find(".shipping-method-required-field").prop("required",!1),r.find("."+t).removeClass("hide").find(".shipping-method-required-field").prop("required",!0)}),e(".wc-wizard-services").on("change",".wc-wizard-shipping-method-enable",function(){var i=e(this).is(":checked");e(this).closest(".wc-wizard-service-item").find(".shipping-method-required-field").prop("required",i)}),e(".activate-jetpack").on("click",".button-primary",function(e){if(i(),"no"===wc_setup_params.pending_jetpack_install)return!0;e.preventDefault(),t()}),e(".wc-wizard-services").on("change","input#stripe_create_account",function(){e(this).is(":checked")?(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!0),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").show()):(e(this).closest(".wc-wizard-service-settings").find("input.payment-email-input").prop("required",!1),e(this).closest(".wc-wizard-service-settings").find(".wc-wizard-service-setting-stripe_email").hide())}),e(".wc-wizard-services input#stripe_create_account").change(),e("select#store_country_state").on("change",function(){var i=this.value.split(":")[0];e("select#currency_code").val(wc_setup_currencies[i]).change()})});
|
|
@ -145,7 +145,7 @@
|
|||
classes = _.indexBy( model.get( 'classes' ), 'term_id' ),
|
||||
changes = {},
|
||||
size = _.size( classes ),
|
||||
newRow = _.extend( {}, data.default_class, {
|
||||
newRow = _.extend( {}, data.default_shipping_class, {
|
||||
term_id: 'new-' + size + '-' + Date.now(),
|
||||
editing: true,
|
||||
newRow : true
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(e,i,s,n){e(function(){var t=e(".wc-shipping-class-rows"),a=e(".wc-shipping-class-save"),o=s.template("wc-shipping-class-row"),d=s.template("wc-shipping-class-row-blank"),c=Backbone.Model.extend({changes:{},logChanges:function(e){var i=this.changes||{};_.each(e,function(e,s){i[s]=_.extend(i[s]||{term_id:s},e)}),this.changes=i,this.trigger("change:classes")},save:function(){_.size(this.changes)?e.post(n+(n.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_classes_save_changes",{wc_shipping_classes_nonce:i.wc_shipping_classes_nonce,changes:this.changes},this.onSaveResponse,"json"):r.trigger("saved:classes")},discardChanges:function(e){delete(this.changes||{})[e],0===_.size(this.changes)&&h.clearUnloadConfirmation()},onSaveResponse:function(e,s){"success"===s&&(e.success?(r.set("classes",e.data.shipping_classes),r.trigger("change:classes"),r.changes={},r.trigger("saved:classes")):e.data?window.alert(e.data):window.alert(i.strings.save_failed)),h.unblock()}}),l=Backbone.View.extend({rowTemplate:o,initialize:function(){this.listenTo(this.model,"change:classes",this.setUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.render),t.on("change",{view:this},this.updateModelOnChange),e(window).on("beforeunload",{view:this},this.unloadConfirmation),a.on("click",{view:this},this.onSubmit),e(document.body).on("click",".wc-shipping-class-add",{view:this},this.onAddNewRow),e(document.body).on("click",".wc-shipping-class-save-changes",{view:this},this.onSubmit)},block:function(){e(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){e(this.el).unblock()},render:function(){var i=_.indexBy(this.model.get("classes"),"term_id"),s=this;this.$el.empty(),this.unblock(),_.size(i)?(i=_.sortBy(i,function(e){return e.name}),e.each(i,function(e,i){s.renderRow(i)})):s.$el.append(d)},renderRow:function(e){var i=this;i.$el.append(i.rowTemplate(e)),i.initRow(e)},initRow:function(i){var s=this.$el.find('tr[data-id="'+i.term_id+'"]');s.find("select").each(function(){var s=e(this).data("attribute");e(this).find('option[value="'+i[s]+'"]').prop("selected",!0)}),s.find(".view").show(),s.find(".edit").hide(),s.find(".wc-shipping-class-edit").on("click",{view:this},this.onEditRow),s.find(".wc-shipping-class-delete").on("click",{view:this},this.onDeleteRow),s.find(".editing .wc-shipping-class-edit").trigger("click"),s.find(".wc-shipping-class-cancel-edit").on("click",{view:this},this.onCancelEditRow),!0===i.editing&&(s.addClass("editing"),s.find(".wc-shipping-class-edit").trigger("click"))},onSubmit:function(e){e.data.view.block(),e.data.view.model.save(),e.preventDefault()},onAddNewRow:function(s){s.preventDefault();var n=s.data.view,t=n.model,a=_.indexBy(t.get("classes"),"term_id"),o={},d=_.size(a),c=_.extend({},i.default_class,{term_id:"new-"+d+"-"+Date.now(),editing:!0,newRow:!0});o[c.term_id]=c,t.logChanges(o),n.renderRow(c),e(".wc-shipping-classes-blank-state").remove()},onEditRow:function(i){i.preventDefault(),e(this).closest("tr").addClass("editing"),e(this).closest("tr").find(".view").hide(),e(this).closest("tr").find(".edit").show(),i.data.view.model.trigger("change:classes")},onDeleteRow:function(i){var s=i.data.view,n=s.model,t=_.indexBy(n.get("classes"),"term_id"),a={},o=e(this).closest("tr").data("id");i.preventDefault(),t[o]&&(delete t[o],a[o]=_.extend(a[o]||{},{deleted:"deleted"}),n.set("classes",t),n.logChanges(a)),s.render()},onCancelEditRow:function(i){var s=i.data.view,n=s.model,t=e(this).closest("tr"),a=e(this).closest("tr").data("id"),o=_.indexBy(n.get("classes"),"term_id");i.preventDefault(),n.discardChanges(a),o[a]&&(o[a].editing=!1,t.after(s.rowTemplate(o[a])),s.initRow(o[a])),t.remove()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,a.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,a.attr("disabled","disabled")},unloadConfirmation:function(e){if(e.data.view.needsUnloadConfirm)return e.returnValue=i.strings.unload_confirmation_msg,window.event.returnValue=i.strings.unload_confirmation_msg,i.strings.unload_confirmation_msg},updateModelOnChange:function(i){var s=i.data.view.model,n=e(i.target),t=n.closest("tr").data("id"),a=n.data("attribute"),o=n.val(),d=_.indexBy(s.get("classes"),"term_id"),c={};d[t]&&d[t][a]===o||(c[t]={},c[t][a]=o),s.logChanges(c)}}),r=new c({classes:i.classes}),h=new l({model:r,el:t});h.render()})}(jQuery,shippingClassesLocalizeScript,wp,ajaxurl);
|
||||
!function(e,i,s,n){e(function(){var t=e(".wc-shipping-class-rows"),a=e(".wc-shipping-class-save"),o=s.template("wc-shipping-class-row"),d=s.template("wc-shipping-class-row-blank"),c=Backbone.Model.extend({changes:{},logChanges:function(e){var i=this.changes||{};_.each(e,function(e,s){i[s]=_.extend(i[s]||{term_id:s},e)}),this.changes=i,this.trigger("change:classes")},save:function(){_.size(this.changes)?e.post(n+(n.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_classes_save_changes",{wc_shipping_classes_nonce:i.wc_shipping_classes_nonce,changes:this.changes},this.onSaveResponse,"json"):r.trigger("saved:classes")},discardChanges:function(e){delete(this.changes||{})[e],0===_.size(this.changes)&&h.clearUnloadConfirmation()},onSaveResponse:function(e,s){"success"===s&&(e.success?(r.set("classes",e.data.shipping_classes),r.trigger("change:classes"),r.changes={},r.trigger("saved:classes")):e.data?window.alert(e.data):window.alert(i.strings.save_failed)),h.unblock()}}),l=Backbone.View.extend({rowTemplate:o,initialize:function(){this.listenTo(this.model,"change:classes",this.setUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.render),t.on("change",{view:this},this.updateModelOnChange),e(window).on("beforeunload",{view:this},this.unloadConfirmation),a.on("click",{view:this},this.onSubmit),e(document.body).on("click",".wc-shipping-class-add",{view:this},this.onAddNewRow),e(document.body).on("click",".wc-shipping-class-save-changes",{view:this},this.onSubmit)},block:function(){e(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){e(this.el).unblock()},render:function(){var i=_.indexBy(this.model.get("classes"),"term_id"),s=this;this.$el.empty(),this.unblock(),_.size(i)?(i=_.sortBy(i,function(e){return e.name}),e.each(i,function(e,i){s.renderRow(i)})):s.$el.append(d)},renderRow:function(e){var i=this;i.$el.append(i.rowTemplate(e)),i.initRow(e)},initRow:function(i){var s=this.$el.find('tr[data-id="'+i.term_id+'"]');s.find("select").each(function(){var s=e(this).data("attribute");e(this).find('option[value="'+i[s]+'"]').prop("selected",!0)}),s.find(".view").show(),s.find(".edit").hide(),s.find(".wc-shipping-class-edit").on("click",{view:this},this.onEditRow),s.find(".wc-shipping-class-delete").on("click",{view:this},this.onDeleteRow),s.find(".editing .wc-shipping-class-edit").trigger("click"),s.find(".wc-shipping-class-cancel-edit").on("click",{view:this},this.onCancelEditRow),!0===i.editing&&(s.addClass("editing"),s.find(".wc-shipping-class-edit").trigger("click"))},onSubmit:function(e){e.data.view.block(),e.data.view.model.save(),e.preventDefault()},onAddNewRow:function(s){s.preventDefault();var n=s.data.view,t=n.model,a=_.indexBy(t.get("classes"),"term_id"),o={},d=_.size(a),c=_.extend({},i.default_shipping_class,{term_id:"new-"+d+"-"+Date.now(),editing:!0,newRow:!0});o[c.term_id]=c,t.logChanges(o),n.renderRow(c),e(".wc-shipping-classes-blank-state").remove()},onEditRow:function(i){i.preventDefault(),e(this).closest("tr").addClass("editing"),e(this).closest("tr").find(".view").hide(),e(this).closest("tr").find(".edit").show(),i.data.view.model.trigger("change:classes")},onDeleteRow:function(i){var s=i.data.view,n=s.model,t=_.indexBy(n.get("classes"),"term_id"),a={},o=e(this).closest("tr").data("id");i.preventDefault(),t[o]&&(delete t[o],a[o]=_.extend(a[o]||{},{deleted:"deleted"}),n.set("classes",t),n.logChanges(a)),s.render()},onCancelEditRow:function(i){var s=i.data.view,n=s.model,t=e(this).closest("tr"),a=e(this).closest("tr").data("id"),o=_.indexBy(n.get("classes"),"term_id");i.preventDefault(),n.discardChanges(a),o[a]&&(o[a].editing=!1,t.after(s.rowTemplate(o[a])),s.initRow(o[a])),t.remove()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,a.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,a.attr("disabled","disabled")},unloadConfirmation:function(e){if(e.data.view.needsUnloadConfirm)return e.returnValue=i.strings.unload_confirmation_msg,window.event.returnValue=i.strings.unload_confirmation_msg,i.strings.unload_confirmation_msg},updateModelOnChange:function(i){var s=i.data.view.model,n=e(i.target),t=n.closest("tr").data("id"),a=n.data("attribute"),o=n.val(),d=_.indexBy(s.get("classes"),"term_id"),c={};d[t]&&d[t][a]===o||(c[t]={},c[t][a]=o),s.logChanges(c)}}),r=new c({classes:i.classes}),h=new l({model:r,el:t});h.render()})}(jQuery,shippingClassesLocalizeScript,wp,ajaxurl);
|
|
@ -134,18 +134,27 @@ jQuery( function ( $ ) {
|
|||
})
|
||||
|
||||
.on( 'init_tooltips', function() {
|
||||
var tiptip_args = {
|
||||
$( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( {
|
||||
'attribute': 'data-tip',
|
||||
'fadeIn': 50,
|
||||
'fadeOut': 50,
|
||||
'delay': 200
|
||||
};
|
||||
} );
|
||||
|
||||
$( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( tiptip_args );
|
||||
$( '.column-wc_actions .wc-action-button' ).tipTip( {
|
||||
'fadeIn': 50,
|
||||
'fadeOut': 50,
|
||||
'delay': 200
|
||||
} );
|
||||
|
||||
// Add tiptip to parent element for widefat tables
|
||||
$( '.parent-tips' ).each( function() {
|
||||
$( this ).closest( 'a, th' ).attr( 'data-tip', $( this ).data( 'tip' ) ).tipTip( tiptip_args ).css( 'cursor', 'help' );
|
||||
$( this ).closest( 'a, th' ).attr( 'data-tip', $( this ).data( 'tip' ) ).tipTip( {
|
||||
'attribute': 'data-tip',
|
||||
'fadeIn': 50,
|
||||
'fadeOut': 50,
|
||||
'delay': 200
|
||||
} ).css( 'cursor', 'help' );
|
||||
});
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -181,8 +181,6 @@ jQuery( function( $ ) {
|
|||
|
||||
/**
|
||||
* Handles when a shipping method is selected.
|
||||
*
|
||||
* @param {Object} evt The JQuery event.
|
||||
*/
|
||||
shipping_method_selected: function() {
|
||||
var shipping_methods = {};
|
||||
|
|
|
@ -99,9 +99,9 @@ jQuery( function( $ ) {
|
|||
}
|
||||
|
||||
if ( $( this ).data( 'order_button_text' ) ) {
|
||||
$( '#place_order' ).val( $( this ).data( 'order_button_text' ) );
|
||||
$( '#place_order' ).text( $( this ).data( 'order_button_text' ) );
|
||||
} else {
|
||||
$( '#place_order' ).val( $( '#place_order' ).data( 'value' ) );
|
||||
$( '#place_order' ).text( $( '#place_order' ).data( 'value' ) );
|
||||
}
|
||||
|
||||
var selectedPaymentMethod = $( '.woocommerce-checkout input[name="payment_method"]:checked' ).attr( 'id' );
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1475,8 +1475,14 @@ S2.define('select2/selection/base',[
|
|||
}
|
||||
|
||||
var $element = $this.data('element');
|
||||
|
||||
$element.select2('close');
|
||||
|
||||
// Remove any focus when dropdown is closed by clicking outside the select area.
|
||||
// Timeout of 1 required for close to finish wrapping up.
|
||||
setTimeout(function(){
|
||||
$this.find('*:focus').blur();
|
||||
$target.focus();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1675,6 +1681,11 @@ S2.define('select2/selection/multiple',[
|
|||
container.open();
|
||||
}
|
||||
});
|
||||
|
||||
// Focus on the search field when the container is focused instead of the main container.
|
||||
container.on( 'focus', function(){
|
||||
self.focusOnSearch();
|
||||
});
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
|
@ -1700,8 +1711,25 @@ S2.define('select2/selection/multiple',[
|
|||
return $container;
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
/**
|
||||
* Focus on the search field instead of the main multiselect container.
|
||||
*/
|
||||
MultipleSelection.prototype.focusOnSearch = function() {
|
||||
var self = this;
|
||||
|
||||
if ('undefined' !== typeof self.$search) {
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
// Prevent the dropdown opening again when focused from this.
|
||||
// This gets reset automatically when focus is triggered.
|
||||
self._keyUpPrevented = true;
|
||||
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1727,14 +1755,6 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -1980,6 +2000,9 @@ S2.define('select2/selection/search',[
|
|||
|
||||
evt.preventDefault();
|
||||
}
|
||||
} else if (evt.which === KEYS.ENTER) {
|
||||
container.open();
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5480,18 +5503,9 @@ S2.define('select2/core',[
|
|||
self.focusOnActiveElement();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// If focus is in the search field, select the current active element on Enter key.
|
||||
$searchField.on('keydown', function (evt) {
|
||||
if (evt.which === KEYS.ENTER) {
|
||||
self.trigger('results:select', {});
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
} else if (self.hasFocus()) {
|
||||
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
||||
(key === KEYS.DOWN && evt.altKey)) {
|
||||
key === KEYS.DOWN) {
|
||||
self.open();
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
@ -5501,7 +5515,7 @@ S2.define('select2/core',[
|
|||
|
||||
Select2.prototype.focusOnActiveElement = function () {
|
||||
// Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
|
||||
if (! Utils.isTouchscreen()) {
|
||||
if (this.isOpen() && ! Utils.isTouchscreen()) {
|
||||
this.$results.find('li.select2-results__option--highlighted').focus();
|
||||
}
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1475,8 +1475,14 @@ S2.define('select2/selection/base',[
|
|||
}
|
||||
|
||||
var $element = $this.data('element');
|
||||
|
||||
$element.select2('close');
|
||||
|
||||
// Remove any focus when dropdown is closed by clicking outside the select area.
|
||||
// Timeout of 1 required for close to finish wrapping up.
|
||||
setTimeout(function(){
|
||||
$this.find('*:focus').blur();
|
||||
$target.focus();
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1675,6 +1681,11 @@ S2.define('select2/selection/multiple',[
|
|||
container.open();
|
||||
}
|
||||
});
|
||||
|
||||
// Focus on the search field when the container is focused instead of the main container.
|
||||
container.on( 'focus', function(){
|
||||
self.focusOnSearch();
|
||||
});
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.clear = function () {
|
||||
|
@ -1700,8 +1711,25 @@ S2.define('select2/selection/multiple',[
|
|||
return $container;
|
||||
};
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
/**
|
||||
* Focus on the search field instead of the main multiselect container.
|
||||
*/
|
||||
MultipleSelection.prototype.focusOnSearch = function() {
|
||||
var self = this;
|
||||
|
||||
if ('undefined' !== typeof self.$search) {
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
setTimeout(function(){
|
||||
// Prevent the dropdown opening again when focused from this.
|
||||
// This gets reset automatically when focus is triggered.
|
||||
self._keyUpPrevented = true;
|
||||
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
MultipleSelection.prototype.update = function (data) {
|
||||
this.clear();
|
||||
|
||||
if (data.length === 0) {
|
||||
|
@ -1727,14 +1755,6 @@ S2.define('select2/selection/multiple',[
|
|||
var $rendered = this.$selection.find('.select2-selection__rendered');
|
||||
|
||||
Utils.appendMany($rendered, $selections);
|
||||
|
||||
// Return cursor to search field after updating.
|
||||
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
|
||||
if ('undefined' !== typeof this.$search) {
|
||||
setTimeout(function(){
|
||||
self.$search.focus();
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
return MultipleSelection;
|
||||
|
@ -1980,6 +2000,9 @@ S2.define('select2/selection/search',[
|
|||
|
||||
evt.preventDefault();
|
||||
}
|
||||
} else if (evt.which === KEYS.ENTER) {
|
||||
container.open();
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -5480,18 +5503,9 @@ S2.define('select2/core',[
|
|||
self.focusOnActiveElement();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// If focus is in the search field, select the current active element on Enter key.
|
||||
$searchField.on('keydown', function (evt) {
|
||||
if (evt.which === KEYS.ENTER) {
|
||||
self.trigger('results:select', {});
|
||||
evt.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
} else if (self.hasFocus()) {
|
||||
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
||||
(key === KEYS.DOWN && evt.altKey)) {
|
||||
key === KEYS.DOWN) {
|
||||
self.open();
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
@ -5501,7 +5515,7 @@ S2.define('select2/core',[
|
|||
|
||||
Select2.prototype.focusOnActiveElement = function () {
|
||||
// Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
|
||||
if (! Utils.isTouchscreen()) {
|
||||
if (this.isOpen() && ! Utils.isTouchscreen()) {
|
||||
this.$results.find('li.select2-results__option--highlighted').focus();
|
||||
}
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"wp-coding-standards/wpcs": "0.13.1",
|
||||
"wp-coding-standards/wpcs": "^0.14",
|
||||
"phpunit/phpunit": "6.2.3",
|
||||
"woocommerce/woocommerce-git-hooks": "1.0.3",
|
||||
"wimg/php-compatibility": "^8.0",
|
||||
|
@ -27,6 +27,22 @@
|
|||
],
|
||||
"post-update-cmd": [
|
||||
"WooCommerce\\GitHooks\\Hooks::postHooks"
|
||||
],
|
||||
"test": [
|
||||
"phpunit"
|
||||
],
|
||||
"phpcs": [
|
||||
"phpcs -s -p --standard=./phpcs.ruleset.xml"
|
||||
],
|
||||
"phpcbf": [
|
||||
"phpcbf -p --standard=./phpcs.ruleset.xml"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"scripts-description": {
|
||||
"test": "Run unit tests",
|
||||
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer",
|
||||
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "9a9c7e81cc3a30935c03b1b2d64c201c",
|
||||
"content-hash": "f8dbe5807f695e87ad3453a8b629b6bf",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/installers",
|
||||
|
@ -1783,16 +1783,16 @@
|
|||
},
|
||||
{
|
||||
"name": "wp-coding-standards/wpcs",
|
||||
"version": "0.13.1",
|
||||
"version": "0.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc"
|
||||
"reference": "8cadf48fa1c70b2381988e0a79e029e011a8f41c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"reference": "1f64b1a0b5b789822d0303436ee4e30e0135e4dc",
|
||||
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/8cadf48fa1c70b2381988e0a79e029e011a8f41c",
|
||||
"reference": "8cadf48fa1c70b2381988e0a79e029e011a8f41c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1800,7 +1800,7 @@
|
|||
"squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
|
||||
},
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1"
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
|
@ -1819,7 +1819,7 @@
|
|||
"standards",
|
||||
"wordpress"
|
||||
],
|
||||
"time": "2017-08-05T16:08:58+00:00"
|
||||
"time": "2017-11-01T15:10:46+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,30 +14,30 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
$states['IE'] = array(
|
||||
'CW' => __( 'Carlow', 'woocommerce' ),
|
||||
'CN' => __( 'Cavan', 'woocommerce' ),
|
||||
'CE' => __( 'Clare', 'woocommerce' ),
|
||||
'CK' => __( 'Cork', 'woocommerce' ),
|
||||
'CN' => __( 'Cavan', 'woocommerce' ),
|
||||
'CW' => __( 'Carlow', 'woocommerce' ),
|
||||
'DL' => __( 'Donegal', 'woocommerce' ),
|
||||
'DN' => __( 'Dublin', 'woocommerce' ),
|
||||
'GY' => __( 'Galway', 'woocommerce' ),
|
||||
'KY' => __( 'Kerry', 'woocommerce' ),
|
||||
'KE' => __( 'Kildare', 'woocommerce' ),
|
||||
'KK' => __( 'Kilkenny', 'woocommerce' ),
|
||||
'KY' => __( 'Kerry', 'woocommerce' ),
|
||||
'LS' => __( 'Laois', 'woocommerce' ),
|
||||
'LM' => __( 'Leitrim', 'woocommerce' ),
|
||||
'LK' => __( 'Limerick', 'woocommerce' ),
|
||||
'LD' => __( 'Longford', 'woocommerce' ),
|
||||
'LH' => __( 'Louth', 'woocommerce' ),
|
||||
'LK' => __( 'Limerick', 'woocommerce' ),
|
||||
'LM' => __( 'Leitrim', 'woocommerce' ),
|
||||
'LS' => __( 'Laois', 'woocommerce' ),
|
||||
'MO' => __( 'Mayo', 'woocommerce' ),
|
||||
'MH' => __( 'Meath', 'woocommerce' ),
|
||||
'MN' => __( 'Monaghan', 'woocommerce' ),
|
||||
'MO' => __( 'Mayo', 'woocommerce' ),
|
||||
'OY' => __( 'Offaly', 'woocommerce' ),
|
||||
'RN' => __( 'Roscommon', 'woocommerce' ),
|
||||
'SO' => __( 'Sligo', 'woocommerce' ),
|
||||
'TY' => __( 'Tipperary', 'woocommerce' ),
|
||||
'WD' => __( 'Waterford', 'woocommerce' ),
|
||||
'WH' => __( 'Westmeath', 'woocommerce' ),
|
||||
'WW' => __( 'Wicklow', 'woocommerce' ),
|
||||
'WX' => __( 'Wexford', 'woocommerce' ),
|
||||
'WW' => __( 'Wicklow', 'woocommerce' )
|
||||
);
|
||||
|
|
|
@ -14,51 +14,51 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
$states['JP'] = array(
|
||||
'JP01' => __( 'Hokkaido', 'woocommerce' ),
|
||||
'JP02' => __( 'Aomori', 'woocommerce' ),
|
||||
'JP03' => __( 'Iwate', 'woocommerce' ),
|
||||
'JP04' => __( 'Miyagi', 'woocommerce' ),
|
||||
'JP05' => __( 'Akita', 'woocommerce' ),
|
||||
'JP06' => __( 'Yamagata', 'woocommerce' ),
|
||||
'JP07' => __( 'Fukushima', 'woocommerce' ),
|
||||
'JP08' => __( 'Ibaraki', 'woocommerce' ),
|
||||
'JP09' => __( 'Tochigi', 'woocommerce' ),
|
||||
'JP10' => __( 'Gunma', 'woocommerce' ),
|
||||
'JP11' => __( 'Saitama', 'woocommerce' ),
|
||||
'JP12' => __( 'Chiba', 'woocommerce' ),
|
||||
'JP13' => __( 'Tokyo', 'woocommerce' ),
|
||||
'JP14' => __( 'Kanagawa', 'woocommerce' ),
|
||||
'JP15' => __( 'Niigata', 'woocommerce' ),
|
||||
'JP16' => __( 'Toyama', 'woocommerce' ),
|
||||
'JP17' => __( 'Ishikawa', 'woocommerce' ),
|
||||
'JP18' => __( 'Fukui', 'woocommerce' ),
|
||||
'JP19' => __( 'Yamanashi', 'woocommerce' ),
|
||||
'JP20' => __( 'Nagano', 'woocommerce' ),
|
||||
'JP21' => __( 'Gifu', 'woocommerce' ),
|
||||
'JP22' => __( 'Shizuoka', 'woocommerce' ),
|
||||
'JP23' => __( 'Aichi', 'woocommerce' ),
|
||||
'JP24' => __( 'Mie', 'woocommerce' ),
|
||||
'JP25' => __( 'Shiga', 'woocommerce' ),
|
||||
'JP26' => __( 'Kyoto', 'woocommerce' ),
|
||||
'JP27' => __( 'Osaka', 'woocommerce' ),
|
||||
'JP28' => __( 'Hyogo', 'woocommerce' ),
|
||||
'JP29' => __( 'Nara', 'woocommerce' ),
|
||||
'JP30' => __( 'Wakayama', 'woocommerce' ),
|
||||
'JP31' => __( 'Tottori', 'woocommerce' ),
|
||||
'JP32' => __( 'Shimane', 'woocommerce' ),
|
||||
'JP33' => __( 'Okayama', 'woocommerce' ),
|
||||
'JP34' => __( 'Hiroshima', 'woocommerce' ),
|
||||
'JP35' => __( 'Yamaguchi', 'woocommerce' ),
|
||||
'JP36' => __( 'Tokushima', 'woocommerce' ),
|
||||
'JP37' => __( 'Kagawa', 'woocommerce' ),
|
||||
'JP38' => __( 'Ehime', 'woocommerce' ),
|
||||
'JP39' => __( 'Kochi', 'woocommerce' ),
|
||||
'JP40' => __( 'Fukuoka', 'woocommerce' ),
|
||||
'JP41' => __( 'Saga', 'woocommerce' ),
|
||||
'JP42' => __( 'Nagasaki', 'woocommerce' ),
|
||||
'JP43' => __( 'Kumamoto', 'woocommerce' ),
|
||||
'JP44' => __( 'Oita', 'woocommerce' ),
|
||||
'JP45' => __( 'Miyazaki', 'woocommerce' ),
|
||||
'JP46' => __( 'Kagoshima', 'woocommerce' ),
|
||||
'JP47' => __( 'Okinawa', 'woocommerce' ),
|
||||
'JP01' => __( 'Hokkaido-dō', 'woocommerce' ),
|
||||
'JP02' => __( 'Aomori-ken', 'woocommerce' ),
|
||||
'JP03' => __( 'Iwate-ken', 'woocommerce' ),
|
||||
'JP04' => __( 'Miyagi-ken', 'woocommerce' ),
|
||||
'JP05' => __( 'Akita-ken', 'woocommerce' ),
|
||||
'JP06' => __( 'Yamagata-ken', 'woocommerce' ),
|
||||
'JP07' => __( 'Fukushima-ken', 'woocommerce' ),
|
||||
'JP08' => __( 'Ibaraki-ken', 'woocommerce' ),
|
||||
'JP09' => __( 'Tochigi-ken', 'woocommerce' ),
|
||||
'JP10' => __( 'Gunma-ken', 'woocommerce' ),
|
||||
'JP11' => __( 'Saitama-ken', 'woocommerce' ),
|
||||
'JP12' => __( 'Chiba-ken', 'woocommerce' ),
|
||||
'JP13' => __( 'Tokyo-to', 'woocommerce' ),
|
||||
'JP14' => __( 'Kanagawa-ken', 'woocommerce' ),
|
||||
'JP15' => __( 'Niigata-ken', 'woocommerce' ),
|
||||
'JP16' => __( 'Toyama-ken', 'woocommerce' ),
|
||||
'JP17' => __( 'Ishikawa-ken', 'woocommerce' ),
|
||||
'JP18' => __( 'Fukui-ken', 'woocommerce' ),
|
||||
'JP19' => __( 'Yamanashi-ken', 'woocommerce' ),
|
||||
'JP20' => __( 'Nagano-ken', 'woocommerce' ),
|
||||
'JP21' => __( 'Gifu-ken', 'woocommerce' ),
|
||||
'JP22' => __( 'Shizuoka-ken', 'woocommerce' ),
|
||||
'JP23' => __( 'Aichi-ken', 'woocommerce' ),
|
||||
'JP24' => __( 'Mie-ken', 'woocommerce' ),
|
||||
'JP25' => __( 'Shiga-ken', 'woocommerce' ),
|
||||
'JP26' => __( 'Kyoto-fu', 'woocommerce' ),
|
||||
'JP27' => __( 'Osaka-fu', 'woocommerce' ),
|
||||
'JP28' => __( 'Hyogo-ken', 'woocommerce' ),
|
||||
'JP29' => __( 'Nara-ken', 'woocommerce' ),
|
||||
'JP30' => __( 'Wakayama-ken', 'woocommerce' ),
|
||||
'JP31' => __( 'Tottori-ken', 'woocommerce' ),
|
||||
'JP32' => __( 'Shimane-ken', 'woocommerce' ),
|
||||
'JP33' => __( 'Okayama-ken', 'woocommerce' ),
|
||||
'JP34' => __( 'Hiroshima-ken', 'woocommerce' ),
|
||||
'JP35' => __( 'Yamaguchi-ken', 'woocommerce' ),
|
||||
'JP36' => __( 'Tokushima-ken', 'woocommerce' ),
|
||||
'JP37' => __( 'Kagawa-ken', 'woocommerce' ),
|
||||
'JP38' => __( 'Ehime-ken', 'woocommerce' ),
|
||||
'JP39' => __( 'Kochi-ken', 'woocommerce' ),
|
||||
'JP40' => __( 'Fukuoka-ken', 'woocommerce' ),
|
||||
'JP41' => __( 'Saga-ken', 'woocommerce' ),
|
||||
'JP42' => __( 'Nagasaki-ken', 'woocommerce' ),
|
||||
'JP43' => __( 'Kumamoto-ken', 'woocommerce' ),
|
||||
'JP44' => __( 'Oita-ken', 'woocommerce' ),
|
||||
'JP45' => __( 'Miyazaki-ken', 'woocommerce' ),
|
||||
'JP46' => __( 'Kagoshima-ken', 'woocommerce' ),
|
||||
'JP47' => __( 'Okinawa-ken', 'woocommerce' ),
|
||||
);
|
||||
|
|
|
@ -285,7 +285,7 @@ abstract class WC_Data {
|
|||
if ( ! $has_setter_or_getter ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* translators: %s: $key Key to check */
|
||||
wc_doing_it_wrong( __FUNCTION__, sprintf( __( 'Generic add/update/get meta methods should not be used for internal meta data, including "%s". Use getters and setters.', 'woocommerce' ), $key ), '3.2.0' );
|
||||
|
||||
return true;
|
||||
|
@ -400,7 +400,7 @@ abstract class WC_Data {
|
|||
* @param string $value
|
||||
* @param int $meta_id
|
||||
*/
|
||||
public function update_meta_data( $key, $value, $meta_id = '' ) {
|
||||
public function update_meta_data( $key, $value, $meta_id = 0 ) {
|
||||
if ( $this->is_internal_meta_key( $key ) ) {
|
||||
$function = 'set_' . $key;
|
||||
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* Abstract deprecated hooks
|
||||
*
|
||||
* @package WooCommerce\Abstracts
|
||||
* @since 3.0.0
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
@ -7,8 +15,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* WC_Deprecated_Hooks class maps old actions and filters to new ones. This is the base class for handling those deprecated hooks.
|
||||
*
|
||||
* Based on the WCS_Hook_Deprecator class by Prospress.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
abstract class WC_Deprecated_Hooks {
|
||||
|
||||
|
@ -19,6 +25,13 @@ abstract class WC_Deprecated_Hooks {
|
|||
*/
|
||||
protected $deprecated_hooks = array();
|
||||
|
||||
/**
|
||||
* Array of versions on each hook has been deprecated.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $deprecated_version = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
@ -30,14 +43,14 @@ abstract class WC_Deprecated_Hooks {
|
|||
/**
|
||||
* Hook into the new hook so we can handle deprecated hooks once fired.
|
||||
*
|
||||
* @param string $hook_name
|
||||
* @param string $hook_name Hook name.
|
||||
*/
|
||||
abstract function hook_in( $hook_name );
|
||||
abstract public function hook_in( $hook_name );
|
||||
|
||||
/**
|
||||
* Get old hooks to map to new hook.
|
||||
*
|
||||
* @param string $new_hook
|
||||
* @param string $new_hook New hook name.
|
||||
* @return array
|
||||
*/
|
||||
public function get_old_hooks( $new_hook ) {
|
||||
|
@ -66,29 +79,39 @@ abstract class WC_Deprecated_Hooks {
|
|||
/**
|
||||
* If the old hook is in-use, trigger it.
|
||||
*
|
||||
* @param string $new_hook
|
||||
* @param string $old_hook
|
||||
* @param array $new_callback_args
|
||||
* @param mixed $return_value
|
||||
* @param string $new_hook New hook name.
|
||||
* @param string $old_hook Old hook name.
|
||||
* @param array $new_callback_args New callback args.
|
||||
* @param mixed $return_value Returned value.
|
||||
* @return mixed
|
||||
*/
|
||||
abstract function handle_deprecated_hook( $new_hook, $old_hook, $new_callback_args, $return_value );
|
||||
abstract public function handle_deprecated_hook( $new_hook, $old_hook, $new_callback_args, $return_value );
|
||||
|
||||
/**
|
||||
* Get deprecated version.
|
||||
*
|
||||
* @param string $old_hook Old hook name.
|
||||
* @return string
|
||||
*/
|
||||
protected function get_deprecated_version( $old_hook ) {
|
||||
return ! empty( $this->deprecated_version[ $old_hook ] ) ? $this->deprecated_version[ $old_hook ] : WC_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a deprecated notice for old hooks.
|
||||
*
|
||||
* @param string $old_hook
|
||||
* @param string $new_hook
|
||||
* @param string $old_hook Old hook.
|
||||
* @param string $new_hook New hook.
|
||||
*/
|
||||
protected function display_notice( $old_hook, $new_hook ) {
|
||||
wc_deprecated_function( sprintf( 'The "%s" hook uses out of date data structures and', esc_html( $old_hook ) ), WC_VERSION, esc_html( $new_hook ) );
|
||||
wc_deprecated_hook( esc_html( $old_hook ), esc_html( $this->get_deprecated_version( $old_hook ) ), esc_html( $new_hook ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire off a legacy hook with it's args.
|
||||
*
|
||||
* @param string $old_hook
|
||||
* @param array $new_callback_args
|
||||
* @param string $old_hook Old hook name.
|
||||
* @param array $new_callback_args New callback args.
|
||||
* @return mixed
|
||||
*/
|
||||
abstract protected function trigger_hook( $old_hook, $new_callback_args );
|
||||
|
|
|
@ -708,7 +708,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
}
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_order_get_items', $items, $this );
|
||||
return apply_filters( 'woocommerce_order_get_items', $items, $this, $types );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1599,7 +1599,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
public function get_subtotal_to_display( $compound = false, $tax_display = '' ) {
|
||||
$tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' );
|
||||
$subtotal = 0;
|
||||
|
||||
|
||||
if ( ! $compound ) {
|
||||
foreach ( $this->get_items() as $item ) {
|
||||
$subtotal += $item->get_subtotal();
|
||||
|
@ -1672,7 +1672,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
}
|
||||
}
|
||||
|
||||
/* translators: %s: shipping method */
|
||||
/* translators: %s: method */
|
||||
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', ' <small class="shipped_via">' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '</small>', $this );
|
||||
|
||||
} elseif ( $this->get_shipping_method() ) {
|
||||
|
|
|
@ -945,8 +945,14 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*
|
||||
* @param string $status New status.
|
||||
*/
|
||||
public function set_stock_status( $status = '' ) {
|
||||
$this->set_prop( 'stock_status', 'outofstock' === $status ? 'outofstock' : 'instock' );
|
||||
public function set_stock_status( $status = 'instock' ) {
|
||||
$valid_statuses = wc_get_product_stock_status_options();
|
||||
|
||||
if ( isset( $valid_statuses[ $status ] ) ) {
|
||||
$this->set_prop( 'stock_status', $status );
|
||||
} else {
|
||||
$this->set_prop( 'stock_status', 'instock' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1172,13 +1178,15 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$download_object = $download;
|
||||
} else {
|
||||
$download_object = new WC_Product_Download();
|
||||
$download['previous_hash'] = isset( $download['previous_hash'] ) ? $download['previous_hash'] : '';
|
||||
$file_hash = apply_filters( 'woocommerce_downloadable_file_hash', md5( $download['file'] ), $this->get_id(), $download['name'], $download['file'], $download['previous_hash'] );
|
||||
|
||||
$download_object->set_id( $file_hash );
|
||||
// If we don't have a previous hash, generate UUID for download.
|
||||
if ( empty( $download['download_id'] ) ) {
|
||||
$download['download_id'] = wp_generate_uuid4();
|
||||
}
|
||||
|
||||
$download_object->set_id( $download['download_id'] );
|
||||
$download_object->set_name( $download['name'] );
|
||||
$download_object->set_file( $download['file'] );
|
||||
$download_object->set_previous_hash( $download['previous_hash'] );
|
||||
}
|
||||
|
||||
// Validate the file extension.
|
||||
|
@ -1298,11 +1306,15 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
$this->set_backorders( 'no' );
|
||||
|
||||
// If we are stock managing and we don't have stock, force out of stock status.
|
||||
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount' ) && 'no' === $this->get_backorders() ) {
|
||||
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount', 0 ) && 'no' === $this->get_backorders() ) {
|
||||
$this->set_stock_status( 'outofstock' );
|
||||
|
||||
// If we are stock managing, backorders are allowed, and we don't have stock, force on backorder status.
|
||||
} elseif ( $this->get_stock_quantity() <= get_option( 'woocommerce_notify_no_stock_amount', 0 ) && 'no' !== $this->get_backorders() ) {
|
||||
$this->set_stock_status( 'onbackorder' );
|
||||
|
||||
// If the stock level is changing and we do now have enough, force in stock status.
|
||||
} elseif ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount' ) && array_key_exists( 'stock_quantity', $this->get_changes() ) ) {
|
||||
} elseif ( $this->get_stock_quantity() > get_option( 'woocommerce_notify_no_stock_amount', 0 ) && array_key_exists( 'stock_quantity', $this->get_changes() ) ) {
|
||||
$this->set_stock_status( 'instock' );
|
||||
}
|
||||
}
|
||||
|
@ -1486,12 +1498,13 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the product is in stock.
|
||||
* Returns whether or not the product can be purchased.
|
||||
* This returns true for 'instock' and 'onbackorder' stock statuses.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_in_stock() {
|
||||
return apply_filters( 'woocommerce_product_is_in_stock', 'instock' === $this->get_stock_status(), $this );
|
||||
return apply_filters( 'woocommerce_product_is_in_stock', 'outofstock' !== $this->get_stock_status(), $this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1518,7 +1531,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_shipping_taxable() {
|
||||
return $this->get_tax_status() === 'taxable' || $this->get_tax_status() === 'shipping';
|
||||
return $this->needs_shipping() && ( $this->get_tax_status() === 'taxable' || $this->get_tax_status() === 'shipping' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1558,6 +1571,10 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_on_backorder( $qty_in_cart = 0 ) {
|
||||
if ( 'onbackorder' === $this->get_stock_status() ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->managing_stock() && $this->backorders_allowed() && ( $this->get_stock_quantity() - $qty_in_cart ) < 0 ? true : false;
|
||||
}
|
||||
|
||||
|
@ -1760,6 +1777,17 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
return apply_filters( 'woocommerce_product_add_to_cart_text', __( 'Read more', 'woocommerce' ), $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the add to cart button text description - used in aria tags.
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @return string
|
||||
*/
|
||||
public function add_to_cart_description() {
|
||||
/* translators: %s: Product title */
|
||||
return apply_filters( 'woocommerce_product_add_to_cart_description', sprintf( __( 'Read more about “%s”', 'woocommerce' ), $this->get_name() ), $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the main product image.
|
||||
*
|
||||
|
|
|
@ -93,7 +93,6 @@ class WC_Admin_Assets {
|
|||
wp_register_script( 'woocommerce_admin', WC()->plugin_url() . '/assets/js/admin/woocommerce_admin' . $suffix . '.js', array( 'jquery', 'jquery-blockui', 'jquery-ui-sortable', 'jquery-ui-widget', 'jquery-ui-core', 'jquery-tiptip' ), WC_VERSION );
|
||||
wp_register_script( 'jquery-blockui', WC()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
|
||||
wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true );
|
||||
wp_register_script( 'accounting', WC()->plugin_url() . '/assets/js/accounting/accounting' . $suffix . '.js', array( 'jquery' ), '0.4.2' );
|
||||
wp_register_script( 'round', WC()->plugin_url() . '/assets/js/round/round' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
|
||||
wp_register_script( 'wc-admin-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'accounting', 'round', 'wc-enhanced-select', 'plupload-all', 'stupidtable', 'jquery-tiptip' ), WC_VERSION );
|
||||
wp_register_script( 'zeroclipboard', WC()->plugin_url() . '/assets/js/zeroclipboard/jquery.zeroclipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
|
||||
|
@ -112,7 +111,7 @@ class WC_Admin_Assets {
|
|||
wp_register_script( 'wc-shipping-classes', WC()->plugin_url() . '/assets/js/admin/wc-shipping-classes' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone' ), WC_VERSION );
|
||||
wp_register_script( 'wc-clipboard', WC()->plugin_url() . '/assets/js/admin/wc-clipboard' . $suffix . '.js', array( 'jquery' ), WC_VERSION );
|
||||
wp_register_script( 'select2', WC()->plugin_url() . '/assets/js/select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.3' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.1' );
|
||||
wp_register_script( 'selectWoo', WC()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.2' );
|
||||
wp_register_script( 'wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), WC_VERSION );
|
||||
wp_localize_script( 'wc-enhanced-select', 'wc_enhanced_select_params', array(
|
||||
'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'woocommerce' ),
|
||||
|
@ -131,12 +130,18 @@ class WC_Admin_Assets {
|
|||
'search_categories_nonce' => wp_create_nonce( 'search-categories' ),
|
||||
) );
|
||||
|
||||
// Accounting
|
||||
wp_register_script( 'accounting', WC()->plugin_url() . '/assets/js/accounting/accounting' . $suffix . '.js', array( 'jquery' ), '0.4.2' );
|
||||
wp_localize_script( 'accounting', 'accounting_params', array(
|
||||
'mon_decimal_point' => wc_get_price_decimal_separator(),
|
||||
) );
|
||||
|
||||
// WooCommerce admin pages
|
||||
wp_register_script( 'wc-orders', WC()->plugin_url() . '/assets/js/admin/wc-orders' . $suffix . '.js', array( 'jquery', 'wp-util', 'underscore', 'backbone', 'jquery-blockui' ), WC_VERSION );
|
||||
wp_localize_script( 'wc-orders', 'wc_orders_params', array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'preview_nonce' => wp_create_nonce( 'woocommerce-preview-order' ),
|
||||
) );
|
||||
|
||||
// WooCommerce admin pages.
|
||||
if ( in_array( $screen_id, wc_get_screen_ids() ) ) {
|
||||
wp_enqueue_script( 'iris' );
|
||||
wp_enqueue_script( 'woocommerce_admin' );
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -179,7 +179,7 @@ class WC_Admin_Profile {
|
|||
<?php elseif ( ! empty( $field['type'] ) && 'checkbox' === $field['type'] ) : ?>
|
||||
<input type="checkbox" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="1" class="<?php echo esc_attr( $field['class'] ); ?>" <?php checked( (int) get_user_meta( $user->ID, $key, true ), 1, true ); ?> />
|
||||
<?php elseif ( ! empty( $field['type'] ) && 'button' === $field['type'] ) : ?>
|
||||
<button id="<?php echo esc_attr( $key ); ?>" class="button <?php echo esc_attr( $field['class'] ); ?>"><?php echo esc_html( $field['text'] ); ?></button>
|
||||
<button type="button" id="<?php echo esc_attr( $key ); ?>" class="button <?php echo esc_attr( $field['class'] ); ?>"><?php echo esc_html( $field['text'] ); ?></button>
|
||||
<?php else : ?>
|
||||
<input type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>" />
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -11,10 +11,12 @@
|
|||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_Reports', false ) ) :
|
||||
if ( class_exists( 'WC_Admin_Reports', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Reports Class.
|
||||
|
@ -44,42 +46,48 @@ class WC_Admin_Reports {
|
|||
'orders' => array(
|
||||
'title' => __( 'Orders', 'woocommerce' ),
|
||||
'reports' => array(
|
||||
"sales_by_date" => array(
|
||||
'sales_by_date' => array(
|
||||
'title' => __( 'Sales by date', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"sales_by_product" => array(
|
||||
'sales_by_product' => array(
|
||||
'title' => __( 'Sales by product', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"sales_by_category" => array(
|
||||
'sales_by_category' => array(
|
||||
'title' => __( 'Sales by category', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"coupon_usage" => array(
|
||||
'coupon_usage' => array(
|
||||
'title' => __( 'Coupons by date', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
'downloads' => array(
|
||||
'title' => __( 'Customer downloads', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
'customers' => array(
|
||||
'title' => __( 'Customers', 'woocommerce' ),
|
||||
'reports' => array(
|
||||
"customers" => array(
|
||||
'customers' => array(
|
||||
'title' => __( 'Customers vs. guests', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"customer_list" => array(
|
||||
'customer_list' => array(
|
||||
'title' => __( 'Customer list', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
|
@ -90,20 +98,20 @@ class WC_Admin_Reports {
|
|||
'stock' => array(
|
||||
'title' => __( 'Stock', 'woocommerce' ),
|
||||
'reports' => array(
|
||||
"low_in_stock" => array(
|
||||
'low_in_stock' => array(
|
||||
'title' => __( 'Low in stock', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"out_of_stock" => array(
|
||||
'out_of_stock' => array(
|
||||
'title' => __( 'Out of stock', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"most_stocked" => array(
|
||||
'title' => __( 'Most Stocked', 'woocommerce' ),
|
||||
'most_stocked' => array(
|
||||
'title' => __( 'Most stocked', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
|
@ -116,13 +124,13 @@ class WC_Admin_Reports {
|
|||
$reports['taxes'] = array(
|
||||
'title' => __( 'Taxes', 'woocommerce' ),
|
||||
'reports' => array(
|
||||
"taxes_by_code" => array(
|
||||
'taxes_by_code' => array(
|
||||
'title' => __( 'Taxes by code', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
'callback' => array( __CLASS__, 'get_report' ),
|
||||
),
|
||||
"taxes_by_date" => array(
|
||||
'taxes_by_date' => array(
|
||||
'title' => __( 'Taxes by date', 'woocommerce' ),
|
||||
'description' => '',
|
||||
'hide_title' => true,
|
||||
|
@ -169,5 +177,3 @@ class WC_Admin_Reports {
|
|||
$report->output_report();
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
|
|
@ -83,11 +83,11 @@ class WC_Admin_Settings {
|
|||
self::add_message( __( 'Your settings have been saved.', 'woocommerce' ) );
|
||||
self::check_download_folder_protection();
|
||||
|
||||
// Clear any unwanted data and flush rules
|
||||
// Clear any unwanted data and flush rules on next init.
|
||||
add_option( 'woocommerce_queue_flush_rewrite_rules', 'true' );
|
||||
delete_transient( 'woocommerce_cache_excluded_uris' );
|
||||
WC()->query->init_query_vars();
|
||||
WC()->query->add_endpoints();
|
||||
wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );
|
||||
|
||||
do_action( 'woocommerce_settings_saved' );
|
||||
}
|
||||
|
|
|
@ -1265,8 +1265,14 @@ class WC_Admin_Setup_Wizard {
|
|||
<form method="post" class="wc-wizard-payment-gateway-form">
|
||||
<p>
|
||||
<?php printf(
|
||||
esc_html__(
|
||||
'WooCommerce can accept both online and offline payments. <a href="%1$s" target="_blank">Additional payment methods</a> can be installed later.', 'woocommerce'
|
||||
wp_kses(
|
||||
__( 'WooCommerce can accept both online and offline payments. <a href="%1$s" target="_blank">Additional payment methods</a> can be installed later.', 'woocommerce' ),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'target' => array(),
|
||||
),
|
||||
)
|
||||
),
|
||||
esc_url( admin_url( 'admin.php?page=wc-addons&view=payment-gateways' ) )
|
||||
); ?>
|
||||
|
@ -1658,7 +1664,7 @@ class WC_Admin_Setup_Wizard {
|
|||
$docs_url = 'https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin';
|
||||
$help_text = sprintf(
|
||||
/* translators: %1$s: link to videos, %2$s: link to docs */
|
||||
__( 'Watch our <a href="%1$s" target="_blank">guided tour videos</a> to learn more about WooCommerce, and visit WooCommerce.com to learn more about <a href="%2$s" target="_blank">getting started</a>.' ),
|
||||
__( 'Watch our <a href="%1$s" target="_blank">guided tour videos</a> to learn more about WooCommerce, and visit WooCommerce.com to learn more about <a href="%2$s" target="_blank">getting started</a>.', 'woocommerce' ),
|
||||
$videos_url,
|
||||
$docs_url
|
||||
);
|
||||
|
|
|
@ -115,7 +115,7 @@ class WC_Admin_Status {
|
|||
}
|
||||
|
||||
// Bulk actions
|
||||
if ( isset( $_GET['action'] ) && isset( $_GET['log'] ) ) {
|
||||
if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['log'] ) ) {
|
||||
self::log_table_bulk_actions();
|
||||
}
|
||||
|
||||
|
@ -315,9 +315,9 @@ class WC_Admin_Status {
|
|||
wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
$log_ids = array_map( 'absint', (array) $_GET['log'] );
|
||||
$log_ids = array_map( 'absint', (array) $_REQUEST['log'] );
|
||||
|
||||
if ( 'delete' === $_GET['action'] || 'delete' === $_GET['action2'] ) {
|
||||
if ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) {
|
||||
WC_Log_Handler_DB::delete( $log_ids );
|
||||
wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) );
|
||||
exit();
|
||||
|
|
|
@ -321,11 +321,9 @@ class WC_Helper {
|
|||
/**
|
||||
* Get available subscriptions filters.
|
||||
*
|
||||
* @param array Optional subscriptions array to generate counts.
|
||||
*
|
||||
* @return array An array of filter keys and labels.
|
||||
*/
|
||||
public static function get_filters( $subscriptions = null ) {
|
||||
public static function get_filters() {
|
||||
$filters = array(
|
||||
'all' => __( 'All', 'woocommerce' ),
|
||||
'active' => __( 'Active', 'woocommerce' ),
|
||||
|
|
|
@ -0,0 +1,278 @@
|
|||
<?php
|
||||
/**
|
||||
* List tables.
|
||||
*
|
||||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_List_Table Class.
|
||||
*/
|
||||
abstract class WC_Admin_List_Table {
|
||||
|
||||
/**
|
||||
* Post type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $list_table_type = '';
|
||||
|
||||
/**
|
||||
* Object being shown on the row.
|
||||
*
|
||||
* @var object|null
|
||||
*/
|
||||
protected $object = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( $this->list_table_type ) {
|
||||
add_action( 'manage_posts_extra_tablenav', array( $this, 'maybe_render_blank_state' ) );
|
||||
add_filter( 'view_mode_post_types', array( $this, 'disable_view_mode' ) );
|
||||
add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ) );
|
||||
add_filter( 'request', array( $this, 'request_query' ) );
|
||||
add_filter( 'post_row_actions', array( $this, 'row_actions' ), 100, 2 );
|
||||
add_filter( 'default_hidden_columns', array( $this, 'default_hidden_columns' ), 10, 2 );
|
||||
add_filter( 'list_table_primary_column', array( $this, 'list_table_primary_column' ), 10, 2 );
|
||||
add_filter( 'manage_edit-' . $this->list_table_type . '_sortable_columns', array( $this, 'define_sortable_columns' ) );
|
||||
add_filter( 'manage_' . $this->list_table_type . '_posts_columns', array( $this, 'define_columns' ) );
|
||||
add_filter( 'bulk_actions-edit-' . $this->list_table_type, array( $this, 'define_bulk_actions' ) );
|
||||
add_action( 'manage_' . $this->list_table_type . '_posts_custom_column', array( $this, 'render_columns' ), 10, 2 );
|
||||
add_filter( 'handle_bulk_actions-edit-' . $this->list_table_type, array( $this, 'handle_bulk_actions' ), 10, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show blank slate.
|
||||
*
|
||||
* @param string $which String which tablenav is being shown.
|
||||
*/
|
||||
public function maybe_render_blank_state( $which ) {
|
||||
global $post_type;
|
||||
|
||||
if ( $post_type === $this->list_table_type && 'bottom' === $which ) {
|
||||
$counts = (array) wp_count_posts( $post_type );
|
||||
unset( $counts['auto-draft'] );
|
||||
$count = array_sum( $counts );
|
||||
|
||||
if ( 0 < $count ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->render_blank_state();
|
||||
|
||||
echo '<style type="text/css">#posts-filter .wp-list-table, #posts-filter .tablenav.top, .tablenav.bottom .actions, .wrap .subsubsub { display: none; } </style>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render blank state. Extend to add content.
|
||||
*/
|
||||
protected function render_blank_state() {}
|
||||
|
||||
/**
|
||||
* Removes this type from list of post types that support "View Mode" switching.
|
||||
* View mode is seen on posts where you can switch between list or excerpt. Our post types don't support
|
||||
* it, so we want to hide the useless UI from the screen options tab.
|
||||
*
|
||||
* @param array $post_types Array of post types supporting view mode.
|
||||
* @return array Array of post types supporting view mode, without this type.
|
||||
*/
|
||||
public function disable_view_mode( $post_types ) {
|
||||
unset( $post_types[ $this->list_table_type ] );
|
||||
return $post_types;
|
||||
}
|
||||
|
||||
/**
|
||||
* See if we should render search filters or not.
|
||||
*/
|
||||
public function restrict_manage_posts() {
|
||||
global $typenow;
|
||||
|
||||
if ( $this->list_table_type === $typenow ) {
|
||||
$this->render_filters();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
public function request_query( $query_vars ) {
|
||||
global $typenow;
|
||||
|
||||
if ( $this->list_table_type === $typenow ) {
|
||||
return $this->query_filters( $query_vars );
|
||||
}
|
||||
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render any custom filters and search inputs for the list table.
|
||||
*/
|
||||
protected function render_filters() {}
|
||||
|
||||
/**
|
||||
* Handle any custom filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
protected function query_filters( $query_vars ) {
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set row actions.
|
||||
*
|
||||
* @param array $actions Array of actions.
|
||||
* @param WP_Post $post Current post object.
|
||||
* @return array
|
||||
*/
|
||||
public function row_actions( $actions, $post ) {
|
||||
if ( $this->list_table_type === $post->post_type ) {
|
||||
return $this->get_row_actions( $actions, $post );
|
||||
}
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get row actions to show in the list table.
|
||||
*
|
||||
* @param array $actions Array of actions.
|
||||
* @param WP_Post $post Current post object.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_row_actions( $actions, $post ) {
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust which columns are displayed by default.
|
||||
*
|
||||
* @param array $hidden Current hidden columns.
|
||||
* @param object $screen Current screen.
|
||||
* @return array
|
||||
*/
|
||||
public function default_hidden_columns( $hidden, $screen ) {
|
||||
if ( isset( $screen->id ) && 'edit-' . $this->list_table_type === $screen->id ) {
|
||||
$hidden = array_merge( $hidden, $this->define_hidden_columns() );
|
||||
}
|
||||
return $hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set list table primary column.
|
||||
*
|
||||
* @param string $default Default value.
|
||||
* @param string $screen_id Current screen ID.
|
||||
* @return string
|
||||
*/
|
||||
public function list_table_primary_column( $default, $screen_id ) {
|
||||
if ( 'edit-' . $this->list_table_type === $screen_id && $this->get_primary_column() ) {
|
||||
return $this->get_primary_column();
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define primary column.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_primary_column() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define hidden columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function define_hidden_columns() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns are sortable.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_sortable_columns( $columns ) {
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns to show on this screen.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_columns( $columns ) {
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define bulk actions.
|
||||
*
|
||||
* @param array $actions Existing actions.
|
||||
* @return array
|
||||
*/
|
||||
public function define_bulk_actions( $actions ) {
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-fetch any data for the row each column has access to it.
|
||||
*
|
||||
* @param int $post_id Post ID being shown.
|
||||
*/
|
||||
protected function prepare_row_data( $post_id ) {}
|
||||
|
||||
/**
|
||||
* Render individual columns.
|
||||
*
|
||||
* @param string $column Column ID to render.
|
||||
* @param int $post_id Post ID being shown.
|
||||
*/
|
||||
public function render_columns( $column, $post_id ) {
|
||||
$this->prepare_row_data( $post_id );
|
||||
|
||||
if ( ! $this->object ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( is_callable( array( $this, 'render_' . $column . '_column' ) ) ) {
|
||||
$this->{"render_{$column}_column"}();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle bulk actions.
|
||||
*
|
||||
* @param string $redirect_to URL to redirect to.
|
||||
* @param string $action Action name.
|
||||
* @param array $ids List of ids.
|
||||
* @return string
|
||||
*/
|
||||
public function handle_bulk_actions( $redirect_to, $action, $ids ) {
|
||||
return esc_url_raw( $redirect_to );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
/**
|
||||
* List tables: coupons.
|
||||
*
|
||||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'WC_Admin_List_Table_Coupons', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once( 'abstract-class-wc-admin-list-table.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_List_Table_Coupons Class.
|
||||
*/
|
||||
class WC_Admin_List_Table_Coupons extends WC_Admin_List_Table {
|
||||
|
||||
/**
|
||||
* Post type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $list_table_type = 'shop_coupon';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
add_filter( 'disable_months_dropdown', '__return_true' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render blank state.
|
||||
*/
|
||||
protected function render_blank_state() {
|
||||
echo '<div class="woocommerce-BlankState">';
|
||||
echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'Coupons are a great way to offer discounts and rewards to your customers. They will appear here once created.', 'woocommerce' ) . '</h2>';
|
||||
echo '<a class="woocommerce-BlankState-cta button-primary button" target="_blank" href="https://docs.woocommerce.com/document/coupon-management/?utm_source=blankslate&utm_medium=product&utm_content=couponsdoc&utm_campaign=woocommerceplugin">' . esc_html__( 'Learn more about coupons', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define primary column.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_primary_column() {
|
||||
return 'coupon_code';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get row actions to show in the list table.
|
||||
*
|
||||
* @param array $actions Array of actions.
|
||||
* @param WP_Post $post Current post object.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_row_actions( $actions, $post ) {
|
||||
unset( $actions['inline hide-if-no-js'] );
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns to show on this screen.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_columns( $columns ) {
|
||||
$show_columns = array();
|
||||
$show_columns['cb'] = $columns['cb'];
|
||||
$show_columns['coupon_code'] = __( 'Code', 'woocommerce' );
|
||||
$show_columns['type'] = __( 'Coupon type', 'woocommerce' );
|
||||
$show_columns['amount'] = __( 'Coupon amount', 'woocommerce' );
|
||||
$show_columns['description'] = __( 'Description', 'woocommerce' );
|
||||
$show_columns['products'] = __( 'Product IDs', 'woocommerce' );
|
||||
$show_columns['usage'] = __( 'Usage / Limit', 'woocommerce' );
|
||||
$show_columns['expiry_date'] = __( 'Expiry date', 'woocommerce' );
|
||||
|
||||
return $show_columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-fetch any data for the row each column has access to it. the_coupon global is there for bw compat.
|
||||
*
|
||||
* @param int $post_id Post ID being shown.
|
||||
*/
|
||||
protected function prepare_row_data( $post_id ) {
|
||||
global $the_coupon;
|
||||
|
||||
if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
|
||||
$this->object = $the_coupon = new WC_Coupon( $post_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: coupon_code.
|
||||
*/
|
||||
protected function render_coupon_code_column() {
|
||||
global $post;
|
||||
|
||||
$edit_link = get_edit_post_link( $this->object->get_id() );
|
||||
$title = $this->object->get_code();
|
||||
|
||||
echo '<strong><a class="row-title" href="' . esc_url( $edit_link ) . '">' . esc_html( $title ) . '</a>';
|
||||
_post_states( $post );
|
||||
echo '</strong>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: type.
|
||||
*/
|
||||
protected function render_type_column() {
|
||||
echo esc_html( wc_get_coupon_type( $this->object->get_discount_type() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: amount.
|
||||
*/
|
||||
protected function render_amount_column() {
|
||||
echo esc_html( wc_format_localized_price( $this->object->get_amount() ) );
|
||||
}
|
||||
/**
|
||||
* Render columm: products.
|
||||
*/
|
||||
protected function render_products_column() {
|
||||
$product_ids = $this->object->get_product_ids();
|
||||
|
||||
if ( count( $product_ids ) > 0 ) {
|
||||
echo esc_html( implode( ', ', $product_ids ) );
|
||||
} else {
|
||||
echo '–';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: usage_limit.
|
||||
*/
|
||||
protected function render_usage_limit_column() {
|
||||
$usage_limit = $this->object->get_usage_limit();
|
||||
|
||||
if ( $usage_limit ) {
|
||||
echo esc_html( $usage_limit );
|
||||
} else {
|
||||
echo '–';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: usage.
|
||||
*/
|
||||
protected function render_usage_column() {
|
||||
$usage_count = $this->object->get_usage_count();
|
||||
$usage_limit = $this->object->get_usage_limit();
|
||||
|
||||
/* translators: 1: count 2: limit */
|
||||
printf(
|
||||
__( '%1$s / %2$s', 'woocommerce' ),
|
||||
esc_html( $usage_count ),
|
||||
$usage_limit ? esc_html( $usage_limit ) : '∞'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: expiry_date.
|
||||
*/
|
||||
protected function render_expiry_date_column() {
|
||||
$expiry_date = $this->object->get_date_expires();
|
||||
|
||||
if ( $expiry_date ) {
|
||||
echo esc_html( $expiry_date->date_i18n( 'F j, Y' ) );
|
||||
} else {
|
||||
echo '–';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: description.
|
||||
*/
|
||||
protected function render_description_column() {
|
||||
echo wp_kses_post( $this->object->get_description() ? $this->object->get_description() : '–' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render any custom filters and search inputs for the list table.
|
||||
*/
|
||||
protected function render_filters() {
|
||||
?>
|
||||
<select name="coupon_type" id="dropdown_shop_coupon_type">
|
||||
<option value=""><?php esc_html_e( 'Show all types', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
$types = wc_get_coupon_types();
|
||||
|
||||
foreach ( $types as $name => $type ) {
|
||||
echo '<option value="' . esc_attr( $name ) . '"';
|
||||
|
||||
if ( isset( $_GET['coupon_type'] ) ) { // WPCS: input var ok.
|
||||
selected( $name, wc_clean( wp_unslash( $_GET['coupon_type'] ) ) ); // WPCS: input var ok, sanitization ok.
|
||||
}
|
||||
|
||||
echo '>' . esc_html( $type ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any custom filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
protected function query_filters( $query_vars ) {
|
||||
if ( ! empty( $_GET['coupon_type'] ) ) { // WPCS: input var ok, sanitization ok.
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars['meta_key'] = 'discount_type';
|
||||
$query_vars['meta_value'] = wc_clean( wp_unslash( $_GET['coupon_type'] ) ); // WPCS: input var ok, sanitization ok.
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
return $query_vars;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,805 @@
|
|||
<?php
|
||||
/**
|
||||
* List tables: orders.
|
||||
*
|
||||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'WC_Admin_List_Table_Orders', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once( 'abstract-class-wc-admin-list-table.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_List_Table_Orders Class.
|
||||
*/
|
||||
class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
|
||||
|
||||
/**
|
||||
* Post type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $list_table_type = 'shop_order';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
add_action( 'admin_notices', array( $this, 'bulk_admin_notices' ) );
|
||||
add_action( 'admin_footer', array( $this, 'order_preview_template' ) );
|
||||
add_filter( 'get_search_query', array( $this, 'search_label' ) );
|
||||
add_filter( 'query_vars', array( $this, 'add_custom_query_var' ) );
|
||||
add_action( 'parse_query', array( $this, 'search_custom_fields' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render blank state.
|
||||
*/
|
||||
protected function render_blank_state() {
|
||||
echo '<div class="woocommerce-BlankState">';
|
||||
echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'When you receive a new order, it will appear here.', 'woocommerce' ) . '</h2>';
|
||||
echo '<a class="woocommerce-BlankState-cta button-primary button" target="_blank" href="https://docs.woocommerce.com/document/managing-orders/?utm_source=blankslate&utm_medium=product&utm_content=ordersdoc&utm_campaign=woocommerceplugin">' . esc_html__( 'Learn more about orders', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define primary column.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_primary_column() {
|
||||
return 'order_number';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get row actions to show in the list table.
|
||||
*
|
||||
* @param array $actions Array of actions.
|
||||
* @param WP_Post $post Current post object.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_row_actions( $actions, $post ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define hidden columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function define_hidden_columns() {
|
||||
return array(
|
||||
'shipping_address',
|
||||
'billing_address',
|
||||
'wc_actions',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns are sortable.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_sortable_columns( $columns ) {
|
||||
$custom = array(
|
||||
'order_number' => 'ID',
|
||||
'order_total' => 'order_total',
|
||||
'order_date' => 'date',
|
||||
);
|
||||
unset( $columns['comments'] );
|
||||
|
||||
return wp_parse_args( $custom, $columns );
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns to show on this screen.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_columns( $columns ) {
|
||||
$show_columns = array();
|
||||
$show_columns['cb'] = $columns['cb'];
|
||||
$show_columns['order_number'] = __( 'Order', 'woocommerce' );
|
||||
$show_columns['order_date'] = __( 'Date', 'woocommerce' );
|
||||
$show_columns['order_status'] = __( 'Status', 'woocommerce' );
|
||||
$show_columns['billing_address'] = __( 'Billing', 'woocommerce' );
|
||||
$show_columns['shipping_address'] = __( 'Ship to', 'woocommerce' );
|
||||
$show_columns['order_total'] = __( 'Total', 'woocommerce' );
|
||||
$show_columns['wc_actions'] = __( 'Actions', 'woocommerce' );
|
||||
|
||||
wp_enqueue_script( 'wc-orders' );
|
||||
|
||||
return $show_columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define bulk actions.
|
||||
*
|
||||
* @param array $actions Existing actions.
|
||||
* @return array
|
||||
*/
|
||||
public function define_bulk_actions( $actions ) {
|
||||
if ( isset( $actions['edit'] ) ) {
|
||||
unset( $actions['edit'] );
|
||||
}
|
||||
|
||||
$actions['mark_processing'] = __( 'Change status to processing', 'woocommerce' );
|
||||
$actions['mark_on-hold'] = __( 'Change status to on-hold', 'woocommerce' );
|
||||
$actions['mark_completed'] = __( 'Change status to completed', 'woocommerce' );
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-fetch any data for the row each column has access to it. the_order global is there for bw compat.
|
||||
*
|
||||
* @param int $post_id Post ID being shown.
|
||||
*/
|
||||
protected function prepare_row_data( $post_id ) {
|
||||
global $the_order;
|
||||
|
||||
if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
|
||||
$this->object = $the_order = wc_get_order( $post_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: order_number.
|
||||
*/
|
||||
protected function render_order_number_column() {
|
||||
$buyer = '';
|
||||
|
||||
if ( $this->object->get_billing_first_name() || $this->object->get_billing_last_name() ) {
|
||||
/* translators: 1: first name 2: last name */
|
||||
$buyer = trim( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->object->get_billing_first_name(), $this->object->get_billing_last_name() ) );
|
||||
} elseif ( $this->object->get_billing_company() ) {
|
||||
$buyer = trim( $this->object->get_billing_company() );
|
||||
} elseif ( $this->object->get_customer_id() ) {
|
||||
$user = get_user_by( 'id', $this->object->get_customer_id() );
|
||||
$buyer = ucwords( $user->display_name );
|
||||
}
|
||||
|
||||
if ( $this->object->get_status() === 'trash' ) {
|
||||
echo '<strong>#' . esc_attr( $this->object->get_order_number() ) . ' ' . esc_html( $buyer ) . '</strong>';
|
||||
} else {
|
||||
echo '<a href="#" class="order-preview" data-order-id="' . absint( $this->object->get_id() ) . '" title="' . esc_attr( __( 'Preview', 'woocommerce' ) ) . '">' . esc_html( __( 'Preview', 'woocommerce' ) ) . '</a>';
|
||||
echo '<a href="' . esc_url( admin_url( 'post.php?post=' . absint( $this->object->get_id() ) ) . '&action=edit' ) . '" class="order-view"><strong>#' . esc_attr( $this->object->get_order_number() ) . ' ' . esc_html( $buyer ) . '</strong></a>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: order_status.
|
||||
*/
|
||||
protected function render_order_status_column() {
|
||||
$tooltip = '';
|
||||
$comment_count = absint( get_comment_count( $this->object->get_id() )['approved'] );
|
||||
|
||||
if ( $comment_count ) {
|
||||
$latest_notes = wc_get_order_notes( array(
|
||||
'order_id' => $this->object->get_id(),
|
||||
'limit' => 1,
|
||||
'orderby' => 'date_created_gmt',
|
||||
) );
|
||||
|
||||
$latest_note = current( $latest_notes );
|
||||
|
||||
if ( isset( $latest_note->content ) && 1 === $comment_count ) {
|
||||
$tooltip = wc_sanitize_tooltip( $latest_note->content );
|
||||
} elseif ( isset( $latest_note->content ) ) {
|
||||
/* translators: %d: notes count */
|
||||
$tooltip = wc_sanitize_tooltip( $latest_note->content . '<br/><small style="display:block">' . sprintf( _n( 'Plus %d other note', 'Plus %d other notes', ( $comment_count - 1 ), 'woocommerce' ), $comment_count - 1 ) . '</small>' );
|
||||
} else {
|
||||
/* translators: %d: notes count */
|
||||
$tooltip = wc_sanitize_tooltip( sprintf( _n( '%d note', '%d notes', $comment_count, 'woocommerce' ), $comment_count ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $tooltip ) {
|
||||
printf( '<mark class="order-status %s tips" data-tip="%s"><span>%s</span></mark>', esc_attr( sanitize_html_class( 'status-' . $this->object->get_status() ) ), wp_kses_post( $tooltip ), esc_html( wc_get_order_status_name( $this->object->get_status() ) ) );
|
||||
} else {
|
||||
printf( '<mark class="order-status %s"><span>%s</span></mark>', esc_attr( sanitize_html_class( 'status-' . $this->object->get_status() ) ), esc_html( wc_get_order_status_name( $this->object->get_status() ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: order_date.
|
||||
*/
|
||||
protected function render_order_date_column() {
|
||||
$order_timestamp = $this->object->get_date_created()->getTimestamp();
|
||||
|
||||
if ( $order_timestamp > strtotime( '-1 day', current_time( 'timestamp', true ) ) ) {
|
||||
$show_date = sprintf( _x( '%s ago', '%s = human-readable time difference', 'woocommerce' ), human_time_diff( $this->object->get_date_created()->getTimestamp(), current_time( 'timestamp', true ) ) );
|
||||
} else {
|
||||
$show_date = $this->object->get_date_created()->date_i18n( apply_filters( 'woocommerce_admin_order_date_format', __( 'M j, Y', 'woocommerce' ) ) );
|
||||
}
|
||||
printf(
|
||||
'<time datetime="%1$s" title="%2$s">%3$s</time>',
|
||||
esc_attr( $this->object->get_date_created()->date( 'c' ) ),
|
||||
esc_html( $this->object->get_date_created()->date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ),
|
||||
esc_html( $show_date )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: order_total.
|
||||
*/
|
||||
protected function render_order_total_column() {
|
||||
if ( $this->object->get_payment_method_title() ) {
|
||||
/* translators: %s: method */
|
||||
echo '<span class="tips" data-tip="' . esc_attr( sprintf( __( 'via %s', 'woocommerce' ), $this->object->get_payment_method_title() ) ) . '">' . wp_kses_post( $this->object->get_formatted_order_total() ) . '</span>';
|
||||
} else {
|
||||
echo wp_kses_post( $this->object->get_formatted_order_total() );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: wc_actions.
|
||||
*/
|
||||
protected function render_wc_actions_column() {
|
||||
echo '<p>';
|
||||
|
||||
do_action( 'woocommerce_admin_order_actions_start', $this->object );
|
||||
|
||||
$actions = array();
|
||||
|
||||
if ( $this->object->has_status( array( 'pending', 'on-hold' ) ) ) {
|
||||
$actions['processing'] = array(
|
||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action = woocommerce_mark_order_status&status = processing&order_id = ' . $this->object->get_id() ), 'woocommerce-mark-order-status' ),
|
||||
'name' => __( 'Processing', 'woocommerce' ),
|
||||
'action' => 'processing',
|
||||
);
|
||||
}
|
||||
|
||||
if ( $this->object->has_status( array( 'pending', 'on-hold', 'processing' ) ) ) {
|
||||
$actions['complete'] = array(
|
||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action = woocommerce_mark_order_status&status = completed&order_id = ' . $this->object->get_id() ), 'woocommerce-mark-order-status' ),
|
||||
'name' => __( 'Complete', 'woocommerce' ),
|
||||
'action' => 'complete',
|
||||
);
|
||||
}
|
||||
|
||||
$actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $this->object );
|
||||
|
||||
echo wc_render_action_buttons( $actions ); // WPCS: XSS ok.
|
||||
|
||||
do_action( 'woocommerce_admin_order_actions_end', $this->object );
|
||||
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: billing_address.
|
||||
*/
|
||||
protected function render_billing_address_column() {
|
||||
if ( $address = $this->object->get_formatted_billing_address() ) {
|
||||
echo esc_html( preg_replace( '#<br\s*/?>#i', ', ', $address ) );
|
||||
|
||||
if ( $this->object->get_payment_method() ) {
|
||||
/* translators: %s: payment method */
|
||||
echo '<span class="description">' . sprintf( __( 'via %s', 'woocommerce' ), esc_html( $this->object->get_payment_method_title() ) ) . '</span>';
|
||||
}
|
||||
} else {
|
||||
echo '–';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: shipping_address.
|
||||
*/
|
||||
protected function render_shipping_address_column() {
|
||||
if ( $address = $this->object->get_formatted_shipping_address() ) {
|
||||
echo '<a target="_blank" href="' . esc_url( $this->object->get_shipping_address_map_url() ) . '">' . esc_html( preg_replace( '#<br\s*/?>#i', ', ', $address ) ) . '</a>';
|
||||
if ( $this->object->get_shipping_method() ) {
|
||||
/* translators: %s: shipping method */
|
||||
echo '<span class="description">' . sprintf( __( 'via %s', 'woocommerce' ), esc_html( $this->object->get_shipping_method() ) ) . '</span>';
|
||||
}
|
||||
} else {
|
||||
echo '–';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Template for order preview.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function order_preview_template() {
|
||||
?>
|
||||
<script type="text/template" id="tmpl-wc-modal-view-order">
|
||||
<div class="wc-backbone-modal wc-order-preview">
|
||||
<div class="wc-backbone-modal-content">
|
||||
<section class="wc-backbone-modal-main" role="main">
|
||||
<header class="wc-backbone-modal-header">
|
||||
<mark class="order-status status-{{ data.status }}"><span>{{ data.status_name }}</span></mark>
|
||||
<h1><?php echo esc_html( sprintf( __( 'Order #%s', 'woocommerce' ), '{{ data.order_number }}' ) ); ?></h1>
|
||||
<button class="modal-close modal-close-link dashicons dashicons-no-alt">
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Close modal panel', 'woocommerce' ); ?></span>
|
||||
</button>
|
||||
</header>
|
||||
<article>
|
||||
<?php do_action( 'woocommerce_admin_order_preview_start' ); ?>
|
||||
|
||||
<div class="wc-order-preview-addresses">
|
||||
<div class="wc-order-preview-address">
|
||||
<h2><?php esc_html_e( 'Billing details', 'woocommerce' ); ?></h2>
|
||||
{{{ data.formatted_billing_address }}}
|
||||
|
||||
<# if ( data.data.billing.email ) { #>
|
||||
<strong><?php esc_html_e( 'Email', 'woocommerce' ); ?></strong>
|
||||
<a href="mailto:{{ data.data.billing.email }}">{{ data.data.billing.email }}</a>
|
||||
<# } #>
|
||||
|
||||
<# if ( data.data.billing.phone ) { #>
|
||||
<strong><?php esc_html_e( 'Phone', 'woocommerce' ); ?></strong>
|
||||
<a href="tel:{{ data.data.billing.phone }}">{{ data.data.billing.phone }}</a>
|
||||
<# } #>
|
||||
|
||||
<# if ( data.payment_via ) { #>
|
||||
<strong><?php esc_html_e( 'Payment via', 'woocommerce' ); ?></strong>
|
||||
{{{ data.payment_via }}}
|
||||
<# } #>
|
||||
</div>
|
||||
<# if ( data.needs_shipping ) { #>
|
||||
<div class="wc-order-preview-address">
|
||||
<h2><?php esc_html_e( 'Shipping details', 'woocommerce' ); ?></h2>
|
||||
<# if ( data.ship_to_billing ) { #>
|
||||
{{{ data.formatted_billing_address }}}
|
||||
<# } else { #>
|
||||
<a href="{{ data.shipping_address_map_url }}" target="_blank">{{{ data.formatted_shipping_address }}}</a>
|
||||
<# } #>
|
||||
|
||||
<# if ( data.data.customer_note ) { #>
|
||||
<strong><?php esc_html_e( 'Note', 'woocommerce' ); ?></strong>
|
||||
{{ data.data.customer_note }}
|
||||
<# } #>
|
||||
|
||||
<# if ( data.shipping_via ) { #>
|
||||
<strong><?php esc_html_e( 'Shipping method', 'woocommerce' ); ?></strong>
|
||||
{{ data.shipping_via }}
|
||||
<# } #>
|
||||
</div>
|
||||
<# } #>
|
||||
</div>
|
||||
|
||||
{{{ data.item_html }}}
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_preview_end' ); ?>
|
||||
</article>
|
||||
<footer>
|
||||
<div class="inner">
|
||||
{{{ data.actions_html }}}
|
||||
|
||||
<a class="button button-primary button-large" href="<?php echo esc_url( admin_url( 'post.php?action=edit' ) ); ?>&post={{ data.data.id }}"><?php esc_html_e( 'Edit order', 'woocommerce' ); ?></a>
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wc-backbone-modal-backdrop modal-close"></div>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items to display in the preview as HTML.
|
||||
*
|
||||
* @param WC_Order $order Order object.
|
||||
* @return string
|
||||
*/
|
||||
public static function get_order_preview_item_html( $order ) {
|
||||
$hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', array(
|
||||
'_qty',
|
||||
'_tax_class',
|
||||
'_product_id',
|
||||
'_variation_id',
|
||||
'_line_subtotal',
|
||||
'_line_subtotal_tax',
|
||||
'_line_total',
|
||||
'_line_tax',
|
||||
'method_id',
|
||||
'cost',
|
||||
) );
|
||||
|
||||
$line_items = apply_filters( 'woocommerce_admin_order_preview_line_items', $order->get_items(), $order );
|
||||
$columns = apply_filters( 'woocommerce_admin_order_preview_line_item_columns', array(
|
||||
'product' => __( 'Product', 'woocommerce' ),
|
||||
'quantity' => __( 'Quantity', 'woocommerce' ),
|
||||
'tax' => __( 'Tax', 'woocommerce' ),
|
||||
'total' => __( 'Total', 'woocommerce' ),
|
||||
), $order );
|
||||
|
||||
if ( ! wc_tax_enabled() ) {
|
||||
unset( $columns['tax'] );
|
||||
}
|
||||
|
||||
$html = '
|
||||
<div class="wc-order-preview-table-wrapper">
|
||||
<table cellspacing="0" class="wc-order-preview-table">
|
||||
<thead>
|
||||
<tr>';
|
||||
|
||||
foreach ( $columns as $column => $label ) {
|
||||
$html .= '<th class="wc-order-preview-table__column--' . esc_attr( $column ) . '">' . esc_html( $label ) . '</th>';
|
||||
}
|
||||
|
||||
$html .= '
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
foreach ( $line_items as $item_id => $item ) {
|
||||
$product_object = is_callable( array( $item, 'get_product' ) ) ? $item->get_product() : null;
|
||||
|
||||
$html .= '<tr class="wc-order-preview-table__item wc-order-preview-table__item--' . esc_attr( $item_id ) . '">';
|
||||
|
||||
foreach ( $columns as $column => $label ) {
|
||||
$html .= '<td class="wc-order-preview-table__column--' . esc_attr( $column ) . '">';
|
||||
switch ( $column ) {
|
||||
case 'product':
|
||||
$html .= wp_kses_post( $item->get_name() );
|
||||
|
||||
if ( $product_object ) {
|
||||
$html .= '<div class="wc-order-item-sku">' . esc_html( $product_object->get_sku() ) . '</div>';
|
||||
}
|
||||
|
||||
if ( $meta_data = $item->get_formatted_meta_data( '' ) ) {
|
||||
$html .= '<table cellspacing="0" class="wc-order-item-meta">';
|
||||
|
||||
foreach ( $meta_data as $meta_id => $meta ) {
|
||||
if ( in_array( $meta->key, $hidden_order_itemmeta ) ) {
|
||||
continue;
|
||||
}
|
||||
$html .= '<tr><th>' . wp_kses_post( $meta->display_key ) . ':</th><td>' . wp_kses_post( force_balance_tags( $meta->display_value ) ) . '</td></tr>';
|
||||
}
|
||||
$html .= '</table>';
|
||||
}
|
||||
break;
|
||||
case 'quantity':
|
||||
$html .= esc_html( $item->get_quantity() );
|
||||
break;
|
||||
case 'tax':
|
||||
$html .= wc_price( $item->get_total_tax(), array( 'currency' => $order->get_currency() ) );
|
||||
break;
|
||||
case 'total':
|
||||
$html .= wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) );
|
||||
break;
|
||||
default :
|
||||
$html .= apply_filters( 'woocommerce_admin_order_preview_line_item_column_' . sanitize_key( $column ), '', $item, $item_id, $order );
|
||||
break;
|
||||
}
|
||||
$html .= '</td>';
|
||||
}
|
||||
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$html .= '
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get actions to display in the preview as HTML.
|
||||
*
|
||||
* @param WC_Order $order Order object.
|
||||
* @return string
|
||||
*/
|
||||
public static function get_order_preview_actions_html( $order ) {
|
||||
$actions = array();
|
||||
$status_actions = array();
|
||||
|
||||
if ( $order->has_status( array( 'pending' ) ) ) {
|
||||
$status_actions['on-hold'] = array(
|
||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=on-hold&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
|
||||
'name' => __( 'On-hold', 'woocommerce' ),
|
||||
'action' => 'on-hold',
|
||||
);
|
||||
}
|
||||
|
||||
if ( $order->has_status( array( 'pending', 'on-hold' ) ) ) {
|
||||
$status_actions['processing'] = array(
|
||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=processing&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
|
||||
'name' => __( 'Processing', 'woocommerce' ),
|
||||
'action' => 'processing',
|
||||
);
|
||||
}
|
||||
|
||||
if ( $order->has_status( array( 'pending', 'on-hold', 'processing' ) ) ) {
|
||||
$status_actions['complete'] = array(
|
||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
|
||||
'name' => __( 'Completed', 'woocommerce' ),
|
||||
'action' => 'complete',
|
||||
);
|
||||
}
|
||||
|
||||
if ( $status_actions ) {
|
||||
$actions['status'] = array(
|
||||
'group' => __( 'Change status: ', 'woocommerce' ),
|
||||
'actions' => $status_actions,
|
||||
);
|
||||
}
|
||||
|
||||
return wc_render_action_buttons( apply_filters( 'woocommerce_admin_order_preview_actions', $actions, $order ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get order details to send to the ajax endpoint for previews.
|
||||
*
|
||||
* @param WC_Order $order Order object.
|
||||
* @return array
|
||||
*/
|
||||
public static function order_preview_get_order_details( $order ) {
|
||||
if ( ! $order ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$payment_via = $order->get_payment_method_title();
|
||||
$payment_method = $order->get_payment_method();
|
||||
$payment_gateways = WC()->payment_gateways() ? WC()->payment_gateways->payment_gateways() : array();
|
||||
|
||||
if ( $transaction_id = $order->get_transaction_id() ) {
|
||||
if ( isset( $payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) {
|
||||
$payment_via .= ' (<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>)';
|
||||
} else {
|
||||
$payment_via .= ' (' . esc_html( $transaction_id ) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters( 'woocommerce_admin_order_preview_get_order_details', array(
|
||||
'data' => $order->get_data(),
|
||||
'order_number' => $order->get_order_number(),
|
||||
'item_html' => WC_Admin_List_Table_Orders::get_order_preview_item_html( $order ),
|
||||
'actions_html' => WC_Admin_List_Table_Orders::get_order_preview_actions_html( $order ),
|
||||
'ship_to_billing' => wc_ship_to_billing_address_only(),
|
||||
'needs_shipping' => $order->needs_shipping_address(),
|
||||
'formatted_billing_address' => ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ),
|
||||
'formatted_shipping_address' => ( $address = $order->get_formatted_shipping_address() ) ? $address: __( 'N/A', 'woocommerce' ),
|
||||
'shipping_address_map_url' => $order->get_shipping_address_map_url(),
|
||||
'payment_via' => $payment_via,
|
||||
'shipping_via' => $order->get_shipping_method(),
|
||||
'status' => $order->get_status(),
|
||||
'status_name' => wc_get_order_status_name( $order->get_status() ),
|
||||
), $order );
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle bulk actions.
|
||||
*
|
||||
* @param string $redirect_to URL to redirect to.
|
||||
* @param string $action Action name.
|
||||
* @param array $ids List of ids.
|
||||
* @return string
|
||||
*/
|
||||
public function handle_bulk_actions( $redirect_to, $action, $ids ) {
|
||||
// Bail out if this is not a status-changing action.
|
||||
if ( false === strpos( $action, 'mark_' ) ) {
|
||||
return $redirect_to;
|
||||
}
|
||||
|
||||
$order_statuses = wc_get_order_statuses();
|
||||
$new_status = substr( $action, 5 ); // Get the status name from action.
|
||||
$report_action = 'marked_' . $new_status;
|
||||
|
||||
// Sanity check: bail out if this is actually not a status, or is
|
||||
// not a registered status.
|
||||
if ( ! isset( $order_statuses[ 'wc-' . $new_status ] ) ) {
|
||||
return $redirect_to;
|
||||
}
|
||||
|
||||
$changed = 0;
|
||||
$ids = array_map( 'absint', $ids );
|
||||
|
||||
foreach ( $ids as $id ) {
|
||||
$order = wc_get_order( $id );
|
||||
$order->update_status( $new_status, __( 'Order status changed by bulk edit:', 'woocommerce' ), true );
|
||||
do_action( 'woocommerce_order_edit_status', $id, $new_status );
|
||||
$changed++;
|
||||
}
|
||||
|
||||
$redirect_to = add_query_arg( array(
|
||||
'post_type' => $this->list_table_type,
|
||||
$report_action => true,
|
||||
'changed' => $changed,
|
||||
'ids' => join( ',', $ids ),
|
||||
), $redirect_to );
|
||||
|
||||
return esc_url_raw( $redirect_to );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show confirmation message that order status changed for number of orders.
|
||||
*/
|
||||
public function bulk_admin_notices() {
|
||||
global $post_type, $pagenow;
|
||||
|
||||
// Bail out if not on shop order list page.
|
||||
if ( 'edit.php' !== $pagenow || 'shop_order' !== $post_type ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$order_statuses = wc_get_order_statuses();
|
||||
|
||||
// Check if any status changes happened.
|
||||
foreach ( $order_statuses as $slug => $name ) {
|
||||
if ( isset( $_REQUEST[ 'marked_' . str_replace( 'wc-', '', $slug ) ] ) ) { // WPCS: input var ok.
|
||||
|
||||
$number = isset( $_REQUEST['changed'] ) ? absint( $_REQUEST['changed'] ) : 0; // WPCS: input var ok.
|
||||
/* translators: %s: orders count */
|
||||
$message = sprintf( _n( '%d order status changed.', '%d order statuses changed.', $number, 'woocommerce' ), number_format_i18n( $number ) );
|
||||
echo '<div class="updated"><p>' . esc_html( $message ) . '</p></div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See if we should render search filters or not.
|
||||
*/
|
||||
public function restrict_manage_posts() {
|
||||
global $typenow;
|
||||
|
||||
if ( in_array( $typenow, wc_get_order_types( 'order-meta-boxes' ), true ) ) {
|
||||
$this->render_filters();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render any custom filters and search inputs for the list table.
|
||||
*/
|
||||
protected function render_filters() {
|
||||
$user_string = '';
|
||||
$user_id = '';
|
||||
|
||||
if ( ! empty( $_GET['_customer_user'] ) ) { // WPCS: input var ok.
|
||||
$user_id = absint( $_GET['_customer_user'] ); // WPCS: input var ok, sanitization ok.
|
||||
$user = get_user_by( 'id', $user_id );
|
||||
/* translators: 1: user display name 2: user ID 3: user email */
|
||||
$user_string = sprintf(
|
||||
esc_html__( '%1$s (#%2$s – %3$s)', 'woocommerce' ),
|
||||
$user->display_name,
|
||||
absint( $user->ID ),
|
||||
$user->user_email
|
||||
);
|
||||
}
|
||||
?>
|
||||
<select class="wc-customer-search" name="_customer_user" data-placeholder="<?php esc_attr_e( 'Search for a customer…', 'woocommerce' ); ?>" data-allow_clear="true">
|
||||
<option value="<?php echo esc_attr( $user_id ); ?>" selected="selected"><?php echo wp_kses_post( $user_string ); ?><option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
public function request_query( $query_vars ) {
|
||||
global $typenow;
|
||||
|
||||
if ( in_array( $typenow, wc_get_order_types( 'order-meta-boxes' ), true ) ) {
|
||||
return $this->query_filters( $query_vars );
|
||||
}
|
||||
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any custom filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
protected function query_filters( $query_vars ) {
|
||||
global $wp_post_statuses;
|
||||
|
||||
// Filter the orders by the posted customer.
|
||||
if ( ! empty( $_GET['_customer_user'] ) ) { // WPCS: input var ok.
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars['meta_query'] = array(
|
||||
array(
|
||||
'key' => '_customer_user',
|
||||
'value' => (int) $_GET['_customer_user'], // WPCS: input var ok, sanitization ok.
|
||||
'compare' => '=',
|
||||
),
|
||||
);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
|
||||
// Sorting.
|
||||
if ( isset( $query_vars['orderby'] ) ) {
|
||||
if ( 'order_total' === $query_vars['orderby'] ) {
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars = array_merge( $query_vars, array(
|
||||
'meta_key' => '_order_total',
|
||||
'orderby' => 'meta_value_num',
|
||||
) );
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
// Status.
|
||||
if ( ! isset( $query_vars['post_status'] ) ) {
|
||||
$post_statuses = wc_get_order_statuses();
|
||||
|
||||
foreach ( $post_statuses as $status => $value ) {
|
||||
if ( isset( $wp_post_statuses[ $status ] ) && false === $wp_post_statuses[ $status ]->show_in_admin_all_list ) {
|
||||
unset( $post_statuses[ $status ] );
|
||||
}
|
||||
}
|
||||
|
||||
$query_vars['post_status'] = array_keys( $post_statuses );
|
||||
}
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the label when searching orders.
|
||||
*
|
||||
* @param mixed $query Current search query.
|
||||
* @return string
|
||||
*/
|
||||
public function search_label( $query ) {
|
||||
global $pagenow, $typenow;
|
||||
|
||||
if ( 'edit.php' !== $pagenow || 'shop_order' !== $typenow || ! get_query_var( 'shop_order_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.
|
||||
return $query;
|
||||
}
|
||||
|
||||
return wc_clean( wp_unslash( $_GET['s'] ) ); // WPCS: input var ok, sanitization ok.
|
||||
}
|
||||
|
||||
/**
|
||||
* Query vars for custom searches.
|
||||
*
|
||||
* @param mixed $public_query_vars Array of query vars.
|
||||
* @return array
|
||||
*/
|
||||
public function add_custom_query_var( $public_query_vars ) {
|
||||
$public_query_vars[] = 'shop_order_search';
|
||||
return $public_query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search custom fields as well as content.
|
||||
*
|
||||
* @param WP_Query $wp Query object.
|
||||
*/
|
||||
public function search_custom_fields( $wp ) {
|
||||
global $pagenow;
|
||||
|
||||
if ( 'edit.php' !== $pagenow || empty( $wp->query_vars['s'] ) || 'shop_order' !== $wp->query_vars['post_type'] || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.
|
||||
return;
|
||||
}
|
||||
|
||||
$post_ids = wc_order_search( wc_clean( wp_unslash( $_GET['s'] ) ) ); // WPCS: input var ok, sanitization ok.
|
||||
|
||||
if ( ! empty( $post_ids ) ) {
|
||||
// Remove "s" - we don't want to search order name.
|
||||
unset( $wp->query_vars['s'] );
|
||||
|
||||
// so we know we're doing this.
|
||||
$wp->query_vars['shop_order_search'] = true;
|
||||
|
||||
// Search by found posts.
|
||||
$wp->query_vars['post__in'] = array_merge( $post_ids, array( 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,508 @@
|
|||
<?php
|
||||
/**
|
||||
* List tables: products.
|
||||
*
|
||||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'WC_Admin_List_Table_Products', false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_List_Table', false ) ) {
|
||||
include_once( 'abstract-class-wc-admin-list-table.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_List_Table_Products Class.
|
||||
*/
|
||||
class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
|
||||
|
||||
/**
|
||||
* Post type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $list_table_type = 'product';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
add_filter( 'disable_months_dropdown', '__return_true' );
|
||||
add_filter( 'query_vars', array( $this, 'add_custom_query_var' ) );
|
||||
add_filter( 'posts_search', array( $this, 'sku_search' ) );
|
||||
add_filter( 'views_edit-product', array( $this, 'product_views' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render blank state.
|
||||
*/
|
||||
protected function render_blank_state() {
|
||||
echo '<div class="woocommerce-BlankState">';
|
||||
echo '<h2 class="woocommerce-BlankState-message">' . esc_html__( 'Ready to start selling something awesome?', 'woocommerce' ) . '</h2>';
|
||||
echo '<a class="woocommerce-BlankState-cta button-primary button" href="' . esc_url( admin_url( 'post-new.php?post_type=product&tutorial=true' ) ) . '">' . esc_html__( 'Create your first product!', 'woocommerce' ) . '</a>';
|
||||
echo '<a class="woocommerce-BlankState-cta button" href="' . esc_url( admin_url( 'edit.php?post_type=product&page=product_importer' ) ) . '">' . esc_html__( 'Import products from a CSV file', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define primary column.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_primary_column() {
|
||||
return 'name';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns are sortable.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_sortable_columns( $columns ) {
|
||||
$custom = array(
|
||||
'price' => 'price',
|
||||
'sku' => 'sku',
|
||||
'name' => 'title',
|
||||
);
|
||||
return wp_parse_args( $custom, $columns );
|
||||
}
|
||||
|
||||
/**
|
||||
* Define which columns to show on this screen.
|
||||
*
|
||||
* @param array $columns Existing columns.
|
||||
* @return array
|
||||
*/
|
||||
public function define_columns( $columns ) {
|
||||
if ( empty( $columns ) && ! is_array( $columns ) ) {
|
||||
$columns = array();
|
||||
}
|
||||
|
||||
unset( $columns['title'], $columns['comments'], $columns['date'] );
|
||||
|
||||
$show_columns = array();
|
||||
$show_columns['cb'] = '<input type="checkbox" />';
|
||||
$show_columns['thumb'] = '<span class="wc-image tips" data-tip="' . esc_attr__( 'Image', 'woocommerce' ) . '">' . __( 'Image', 'woocommerce' ) . '</span>';
|
||||
$show_columns['name'] = __( 'Name', 'woocommerce' );
|
||||
|
||||
if ( wc_product_sku_enabled() ) {
|
||||
$show_columns['sku'] = __( 'SKU', 'woocommerce' );
|
||||
}
|
||||
|
||||
if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {
|
||||
$show_columns['is_in_stock'] = __( 'Stock', 'woocommerce' );
|
||||
}
|
||||
|
||||
$show_columns['price'] = __( 'Price', 'woocommerce' );
|
||||
$show_columns['product_cat'] = __( 'Categories', 'woocommerce' );
|
||||
$show_columns['product_tag'] = __( 'Tags', 'woocommerce' );
|
||||
$show_columns['featured'] = '<span class="wc-featured parent-tips" data-tip="' . esc_attr__( 'Featured', 'woocommerce' ) . '">' . __( 'Featured', 'woocommerce' ) . '</span>';
|
||||
$show_columns['product_type'] = '<span class="wc-type parent-tips" data-tip="' . esc_attr__( 'Type', 'woocommerce' ) . '">' . __( 'Type', 'woocommerce' ) . '</span>';
|
||||
$show_columns['date'] = __( 'Date', 'woocommerce' );
|
||||
|
||||
return array_merge( $show_columns, $columns );
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-fetch any data for the row each column has access to it. the_product global is there for bw compat.
|
||||
*
|
||||
* @param int $post_id Post ID being shown.
|
||||
*/
|
||||
protected function prepare_row_data( $post_id ) {
|
||||
global $the_product;
|
||||
|
||||
if ( empty( $this->object ) || $this->object->get_id() !== $post_id ) {
|
||||
$this->object = $the_product = wc_get_product( $post_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: thumb.
|
||||
*/
|
||||
protected function render_thumb_column() {
|
||||
echo '<a href="' . esc_url( get_edit_post_link( $this->object->get_id() ) ) . '">' . $this->object->get_image( 'thumbnail' ) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: name.
|
||||
*/
|
||||
protected function render_name_column() {
|
||||
global $post;
|
||||
|
||||
$edit_link = get_edit_post_link( $this->object->get_id() );
|
||||
$title = _draft_or_post_title();
|
||||
|
||||
echo '<strong><a class="row-title" href="' . esc_url( $edit_link ) . '">' . esc_html( $title ) . '</a>';
|
||||
|
||||
_post_states( $post );
|
||||
|
||||
echo '</strong>';
|
||||
|
||||
if ( $this->object->get_parent_id() > 0 ) {
|
||||
echo ' ← <a href="' . esc_url( get_edit_post_link( $this->object->get_parent_id() ) ) . '">' . get_the_title( $this->object->get_parent_id() ) . '</a>';
|
||||
}
|
||||
|
||||
get_inline_data( $post );
|
||||
|
||||
/* Custom inline data for woocommerce. */
|
||||
echo '
|
||||
<div class="hidden" id="woocommerce_inline_' . absint( $this->object->get_id() ) . '">
|
||||
<div class="menu_order">' . absint( $this->object->get_menu_order() ) . '</div>
|
||||
<div class="sku">' . esc_html( $this->object->get_sku() ) . '</div>
|
||||
<div class="regular_price">' . esc_html( $this->object->get_regular_price() ) . '</div>
|
||||
<div class="sale_price">' . esc_html( $this->object->get_sale_price() ) . '</div>
|
||||
<div class="weight">' . esc_html( $this->object->get_weight() ) . '</div>
|
||||
<div class="length">' . esc_html( $this->object->get_length() ) . '</div>
|
||||
<div class="width">' . esc_html( $this->object->get_width() ) . '</div>
|
||||
<div class="height">' . esc_html( $this->object->get_height() ) . '</div>
|
||||
<div class="shipping_class">' . esc_html( $this->object->get_shipping_class() ) . '</div>
|
||||
<div class="visibility">' . esc_html( $this->object->get_catalog_visibility() ) . '</div>
|
||||
<div class="stock_status">' . esc_html( $this->object->get_stock_status() ) . '</div>
|
||||
<div class="stock">' . esc_html( $this->object->get_stock_quantity() ) . '</div>
|
||||
<div class="manage_stock">' . esc_html( wc_bool_to_string( $this->object->get_manage_stock() ) ) . '</div>
|
||||
<div class="featured">' . esc_html( wc_bool_to_string( $this->object->get_featured() ) ) . '</div>
|
||||
<div class="product_type">' . esc_html( $this->object->get_type() ) . '</div>
|
||||
<div class="product_is_virtual">' . esc_html( wc_bool_to_string( $this->object->get_virtual() ) ) . '</div>
|
||||
<div class="tax_status">' . esc_html( $this->object->get_tax_status() ) . '</div>
|
||||
<div class="tax_class">' . esc_html( $this->object->get_tax_class() ) . '</div>
|
||||
<div class="backorders">' . esc_html( $this->object->get_backorders() ) . '</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: sku.
|
||||
*/
|
||||
protected function render_sku_column() {
|
||||
echo $this->object->get_sku() ? esc_html( $this->object->get_sku() ) : '<span class="na">–</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: product_type.
|
||||
*/
|
||||
protected function render_product_type_column() {
|
||||
if ( $this->object->is_type( 'grouped' ) ) {
|
||||
echo '<span class="product-type tips grouped" data-tip="' . esc_attr__( 'Grouped', 'woocommerce' ) . '"></span>';
|
||||
} elseif ( $this->object->is_type( 'external' ) ) {
|
||||
echo '<span class="product-type tips external" data-tip="' . esc_attr__( 'External/Affiliate', 'woocommerce' ) . '"></span>';
|
||||
} elseif ( $this->object->is_type( 'simple' ) ) {
|
||||
|
||||
if ( $this->object->is_virtual() ) {
|
||||
echo '<span class="product-type tips virtual" data-tip="' . esc_attr__( 'Virtual', 'woocommerce' ) . '"></span>';
|
||||
} elseif ( $this->object->is_downloadable() ) {
|
||||
echo '<span class="product-type tips downloadable" data-tip="' . esc_attr__( 'Downloadable', 'woocommerce' ) . '"></span>';
|
||||
} else {
|
||||
echo '<span class="product-type tips simple" data-tip="' . esc_attr__( 'Simple', 'woocommerce' ) . '"></span>';
|
||||
}
|
||||
} elseif ( $this->object->is_type( 'variable' ) ) {
|
||||
echo '<span class="product-type tips variable" data-tip="' . esc_attr__( 'Variable', 'woocommerce' ) . '"></span>';
|
||||
} else {
|
||||
// Assuming that we have other types in future.
|
||||
echo '<span class="product-type tips ' . esc_attr( sanitize_html_class( $this->object->get_type() ) ) . '" data-tip="' . esc_attr( ucfirst( $this->object->get_type() ) ) . '"></span>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: price.
|
||||
*/
|
||||
protected function render_price_column() {
|
||||
echo $this->object->get_price_html() ? wp_kses_post( $this->object->get_price_html() ) : '<span class="na">–</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: product_cat.
|
||||
*/
|
||||
protected function render_product_cat_column() {
|
||||
if ( ! $terms = get_the_terms( $this->object->get_id(), 'product_cat' ) ) {
|
||||
echo '<span class="na">–</span>';
|
||||
} else {
|
||||
$termlist = array();
|
||||
foreach ( $terms as $term ) {
|
||||
$termlist[] = '<a href="' . esc_url( admin_url( 'edit.php?product_cat=' . $term->slug . '&post_type=product' ) ) . ' ">' . esc_html( $term->name ) . '</a>';
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_admin_product_term_list', implode( ', ', $termlist ), 'product_cat', $this->object->get_id(), $termlist, $terms ); // WPCS: XSS ok.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: product_tag.
|
||||
*/
|
||||
protected function render_product_tag_column() {
|
||||
if ( ! $terms = get_the_terms( $this->object->get_id(), 'product_tag' ) ) {
|
||||
echo '<span class="na">–</span>';
|
||||
} else {
|
||||
$termlist = array();
|
||||
foreach ( $terms as $term ) {
|
||||
$termlist[] = '<a href="' . esc_url( admin_url( 'edit.php?product_tag=' . $term->slug . '&post_type=product' ) ) . ' ">' . esc_html( $term->name ) . '</a>';
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_admin_product_term_list', implode( ', ', $termlist ), 'product_tag', $this->object->get_id(), $termlist, $terms ); // WPCS: XSS ok.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: featured.
|
||||
*/
|
||||
protected function render_featured_column() {
|
||||
$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_feature_product&product_id=' . $this->object->get_id() ), 'woocommerce-feature-product' );
|
||||
echo '<a href="' . esc_url( $url ) . '" aria-label="' . esc_attr__( 'Toggle featured', 'woocommerce' ) . '">';
|
||||
if ( $this->object->is_featured() ) {
|
||||
echo '<span class="wc-featured tips" data-tip="' . esc_attr__( 'Yes', 'woocommerce' ) . '">' . esc_html__( 'Yes', 'woocommerce' ) . '</span>';
|
||||
} else {
|
||||
echo '<span class="wc-featured not-featured tips" data-tip="' . esc_attr__( 'No', 'woocommerce' ) . '">' . esc_html__( 'No', 'woocommerce' ) . '</span>';
|
||||
}
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Render columm: is_in_stock.
|
||||
*/
|
||||
protected function render_is_in_stock_column() {
|
||||
if ( $this->object->is_on_backorder() ) {
|
||||
$stock_html = '<mark class="onbackorder">' . __( 'On backorder', 'woocommerce' ) . '</mark>';
|
||||
} elseif ( $this->object->is_in_stock() ) {
|
||||
$stock_html = '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
|
||||
} else {
|
||||
$stock_html = '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
|
||||
}
|
||||
|
||||
if ( $this->object->managing_stock() ) {
|
||||
$stock_html .= ' (' . wc_stock_amount( $this->object->get_stock_quantity() ) . ')';
|
||||
}
|
||||
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_admin_stock_html', $stock_html, $this->object ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Query vars for custom searches.
|
||||
*
|
||||
* @param mixed $public_query_vars Array of query vars.
|
||||
* @return array
|
||||
*/
|
||||
public function add_custom_query_var( $public_query_vars ) {
|
||||
$public_query_vars[] = 'sku';
|
||||
return $public_query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render any custom filters and search inputs for the list table.
|
||||
*/
|
||||
protected function render_filters() {
|
||||
$categories_count = (int) wp_count_terms( 'product_cat' );
|
||||
|
||||
if ( $categories_count <= apply_filters( 'woocommerce_product_category_filter_threshold', 100 ) ) {
|
||||
wc_product_dropdown_categories( array(
|
||||
'option_select_text' => __( 'Filter by category', 'woocommerce' ),
|
||||
) );
|
||||
} else {
|
||||
$current_category_slug = isset( $_GET['product_cat'] ) ? wc_clean( wp_unslash( $_GET['product_cat'] ) ) : false; // WPCS: input var ok, CSRF ok.
|
||||
$current_category = $current_category_slug ? get_term_by( 'slug', $current_category_slug, 'product_cat' ) : false;
|
||||
?>
|
||||
<select class="wc-category-search" name="product_cat" data-placeholder="<?php esc_attr_e( 'Filter by category', 'woocommerce' ); ?>" data-allow_clear="true">
|
||||
<?php if ( $current_category_slug && $current_category ) : ?>
|
||||
<option value="<?php echo esc_attr( $current_category_slug ); ?>" selected="selected"><?php echo esc_html( $current_category->name ); ?><option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
$current_product_type = isset( $_REQUEST['product_type'] ) ? wc_clean( wp_unslash( $_REQUEST['product_type'] ) ) : false; // WPCS: input var ok, sanitization ok.
|
||||
$terms = get_terms( 'product_type' );
|
||||
$output = '<select name="product_type" id="dropdown_product_type"><option value="">' . __( 'Filter by product type', 'woocommerce' ) . '</option>';
|
||||
|
||||
foreach ( $terms as $term ) {
|
||||
$output .= '<option value="' . sanitize_title( $term->name ) . '" ';
|
||||
$output .= selected( $term->slug, $current_product_type, false );
|
||||
$output .= '>';
|
||||
|
||||
switch ( $term->name ) {
|
||||
case 'grouped' :
|
||||
$output .= __( 'Grouped product', 'woocommerce' );
|
||||
break;
|
||||
case 'external' :
|
||||
$output .= __( 'External/Affiliate product', 'woocommerce' );
|
||||
break;
|
||||
case 'variable' :
|
||||
$output .= __( 'Variable product', 'woocommerce' );
|
||||
break;
|
||||
case 'simple' :
|
||||
$output .= __( 'Simple product', 'woocommerce' );
|
||||
break;
|
||||
default :
|
||||
// Assuming that we have other types in future.
|
||||
$output .= ucfirst( $term->name );
|
||||
break;
|
||||
}
|
||||
|
||||
$output .= '</option>';
|
||||
|
||||
if ( 'simple' === $term->name ) {
|
||||
|
||||
$output .= '<option value="downloadable" ';
|
||||
|
||||
if ( isset( $wp_query->query['product_type'] ) ) {
|
||||
$output .= selected( 'downloadable', $current_product_type, false );
|
||||
}
|
||||
|
||||
$output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Downloadable', 'woocommerce' ) . '</option>';
|
||||
|
||||
$output .= '<option value="virtual" ';
|
||||
|
||||
$output .= selected( 'virtual', $current_product_type, false );
|
||||
|
||||
$output .= '> ' . ( is_rtl() ? '←' : '→' ) . ' ' . __( 'Virtual', 'woocommerce' ) . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</select>';
|
||||
|
||||
$current_stock_status = isset( $_REQUEST['stock_status'] ) ? wc_clean( wp_unslash( $_REQUEST['stock_status'] ) ): false; // WPCS: input var ok, sanitization ok.
|
||||
$stock_statuses = wc_get_product_stock_status_options();
|
||||
$output .= '<select name="stock_status"><option value="">' . esc_html__( 'Filter by stock status', 'woocommerce' ) . '</option>';
|
||||
|
||||
foreach ( $stock_statuses as $status => $label ) {
|
||||
$output .= '<option ' . selected( $status, $current_stock_status, false ) . ' value="' . esc_attr( $status ) . '">' . esc_html( $label ) . '</option>';
|
||||
}
|
||||
|
||||
$output .= '</select>';
|
||||
|
||||
echo apply_filters( 'woocommerce_product_filters', $output ); // WPCS: XSS ok.
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle any custom filters.
|
||||
*
|
||||
* @param array $query_vars Query vars.
|
||||
* @return array
|
||||
*/
|
||||
protected function query_filters( $query_vars ) {
|
||||
|
||||
if ( isset( $query_vars['orderby'] ) ) {
|
||||
if ( 'price' === $vars['orderby'] ) {
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars = array_merge( $query_vars, array(
|
||||
'meta_key' => '_price',
|
||||
'orderby' => 'meta_value_num',
|
||||
) );
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
if ( 'sku' === $query_vars['orderby'] ) {
|
||||
// @codingStandardsIgnoreStart
|
||||
$query_vars = array_merge( $query_vars, array(
|
||||
'meta_key' => '_sku',
|
||||
'orderby' => 'meta_value',
|
||||
) );
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $query_vars['product_type'] ) ) {
|
||||
// @codingStandardsIgnoreStart
|
||||
if ( 'downloadable' === $query_vars['product_type'] ) {
|
||||
$query_vars['product_type'] = '';
|
||||
$query_vars['meta_value'] = 'yes';
|
||||
$query_vars['meta_key'] = '_downloadable';
|
||||
} elseif ( 'virtual' === $query_vars['product_type'] ) {
|
||||
$query_vars['product_type'] = '';
|
||||
$query_vars['meta_value'] = 'yes';
|
||||
$query_vars['meta_key'] = '_virtual';
|
||||
}
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
|
||||
if ( isset( $_GET['product_shipping_class'] ) && '0' === $_GET['product_shipping_class'] ) { // WPCS: input var ok.
|
||||
$query_vars['tax_query'][] = array(
|
||||
'taxonomy' => 'product_shipping_class',
|
||||
'field' => 'id',
|
||||
'terms' => get_terms( 'product_shipping_class', array( 'fields' => 'ids' ) ),
|
||||
'operator' => 'NOT IN',
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $_GET['stock_status'] ) ) {
|
||||
if ( ! isset( $query_vars['meta_query'] ) ) {
|
||||
$query_vars['meta_query'] = array();
|
||||
}
|
||||
|
||||
$query_vars['meta_query'][] = array(
|
||||
'key' => '_stock_status',
|
||||
'value' => wc_clean( wp_unslash( $_GET['stock_status'] ) ),
|
||||
);
|
||||
}
|
||||
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search by SKU or ID for products.
|
||||
*
|
||||
* @param string $where Where clause SQL.
|
||||
* @return string
|
||||
*/
|
||||
public function sku_search( $where ) {
|
||||
global $pagenow, $wpdb, $wp;
|
||||
|
||||
if ( 'edit.php' !== $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'product' !== $wp->query_vars['post_type'] ) {
|
||||
return $where;
|
||||
}
|
||||
|
||||
$search_ids = array();
|
||||
$terms = explode( ',', $wp->query_vars['s'] );
|
||||
|
||||
foreach ( $terms as $term ) {
|
||||
if ( is_numeric( $term ) ) {
|
||||
$search_ids[] = absint( $term );
|
||||
} else {
|
||||
$id_from_sku = wc_get_product_id_by_sku( wc_clean( $term ) );
|
||||
|
||||
if ( $id_from_sku ) {
|
||||
$search_ids[] = absint( $id_from_sku );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$search_ids = array_filter( array_unique( array_map( 'absint', $search_ids ) ) );
|
||||
|
||||
if ( count( $search_ids ) > 0 ) {
|
||||
$where = str_replace( 'AND (((', "AND ( ({$wpdb->posts}.ID IN (" . implode( ',', $search_ids ) . ')) OR ((', $where );
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change views on the edit product screen.
|
||||
*
|
||||
* @param array $views Array of views.
|
||||
* @return array
|
||||
*/
|
||||
public function product_views( $views ) {
|
||||
global $wp_query;
|
||||
|
||||
// Products do not have authors.
|
||||
unset( $views['mine'] );
|
||||
|
||||
// Add sorting link.
|
||||
if ( current_user_can( 'edit_others_pages' ) ) {
|
||||
$class = ( isset( $wp_query->query['orderby'] ) && 'menu_order title' === $wp_query->query['orderby'] ) ? 'current' : '';
|
||||
$query_string = remove_query_arg( array( 'orderby', 'order' ) );
|
||||
$query_string = add_query_arg( 'orderby', rawurlencode( 'menu_order title' ), $query_string );
|
||||
$query_string = add_query_arg( 'order', rawurlencode( 'ASC' ), $query_string );
|
||||
$views['byorder'] = '<a href="' . esc_url( $query_string ) . '" class="' . esc_attr( $class ) . '">' . __( 'Sorting', 'woocommerce' ) . '</a>';
|
||||
}
|
||||
|
||||
return $views;
|
||||
}
|
||||
}
|
|
@ -117,7 +117,7 @@ class WC_Meta_Box_Coupon_Data {
|
|||
'id' => 'minimum_amount',
|
||||
'label' => __( 'Minimum spend', 'woocommerce' ),
|
||||
'placeholder' => __( 'No minimum', 'woocommerce' ),
|
||||
'description' => __( 'This field allows you to set the minimum spend (subtotal, including taxes) allowed to use the coupon.', 'woocommerce' ),
|
||||
'description' => __( 'This field allows you to set the minimum spend (subtotal) allowed to use the coupon.', 'woocommerce' ),
|
||||
'data_type' => 'price',
|
||||
'desc_tip' => true,
|
||||
) );
|
||||
|
@ -127,7 +127,7 @@ class WC_Meta_Box_Coupon_Data {
|
|||
'id' => 'maximum_amount',
|
||||
'label' => __( 'Maximum spend', 'woocommerce' ),
|
||||
'placeholder' => __( 'No maximum', 'woocommerce' ),
|
||||
'description' => __( 'This field allows you to set the maximum spend (subtotal, including taxes) allowed when using the coupon.', 'woocommerce' ),
|
||||
'description' => __( 'This field allows you to set the maximum spend (subtotal) allowed when using the coupon.', 'woocommerce' ),
|
||||
'data_type' => 'price',
|
||||
'desc_tip' => true,
|
||||
) );
|
||||
|
|
|
@ -188,9 +188,9 @@ class WC_Meta_Box_Order_Data {
|
|||
|
||||
if ( $transaction_id = $order->get_transaction_id() ) {
|
||||
if ( isset( $payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) {
|
||||
$payment_method_string = ' (<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>)';
|
||||
$payment_method_string .= ' (<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>)';
|
||||
} else {
|
||||
$payment_method_string = ' (' . esc_html( $transaction_id ) . ')';
|
||||
$payment_method_string .= ' (' . esc_html( $transaction_id ) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,9 +45,12 @@ class WC_Meta_Box_Order_Items {
|
|||
* Save meta box data.
|
||||
*
|
||||
* @param int $post_id
|
||||
* @param WP_Post $post
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
public static function save( $post_id ) {
|
||||
/**
|
||||
* This $_POST variable's data has been validated and escaped
|
||||
* inside `wc_save_order_items()` function.
|
||||
*/
|
||||
wc_save_order_items( $post_id, $_POST );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ class WC_Meta_Box_Product_Data {
|
|||
$downloads[] = array(
|
||||
'name' => wc_clean( $file_names[ $i ] ),
|
||||
'file' => wp_unslash( trim( $file_urls[ $i ] ) ),
|
||||
'previous_hash' => wc_clean( $file_hashes[ $i ] ),
|
||||
'download_id' => wc_clean( $file_hashes[ $i ] ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -284,12 +284,18 @@ class WC_Meta_Box_Product_Data {
|
|||
$attribute_key = sanitize_title( $attribute->get_name() );
|
||||
|
||||
if ( ! is_null( $index ) ) {
|
||||
$value = isset( $_POST[ $key_prefix . $attribute_key ][ $index ] ) ? stripslashes( $_POST[ $key_prefix . $attribute_key ][ $index ] ) : '';
|
||||
$value = isset( $_POST[ $key_prefix . $attribute_key ][ $index ] ) ? wp_unslash( $_POST[ $key_prefix . $attribute_key ][ $index ] ) : '';
|
||||
} else {
|
||||
$value = isset( $_POST[ $key_prefix . $attribute_key ] ) ? stripslashes( $_POST[ $key_prefix . $attribute_key ] ) : '';
|
||||
$value = isset( $_POST[ $key_prefix . $attribute_key ] ) ? wp_unslash( $_POST[ $key_prefix . $attribute_key ] ) : '';
|
||||
}
|
||||
|
||||
if ( $attribute->is_taxonomy() ) {
|
||||
// Don't use wc_clean as it destroys sanitized characters.
|
||||
$value = sanitize_title( $value );
|
||||
} else {
|
||||
$value = html_entity_decode( wc_clean( $value ), ENT_QUOTES, get_bloginfo( 'charset' ) ); // WPCS: sanitization ok.
|
||||
}
|
||||
|
||||
$value = $attribute->is_taxonomy() ? sanitize_title( $value ) : wc_clean( $value ); // Don't use wc_clean as it destroys sanitized characters in terms.
|
||||
$attributes[ $attribute_key ] = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
<div class="wc-metabox closed">
|
||||
<h3 class="fixed">
|
||||
<button type="button" data-permission_id="<?php echo esc_attr( $download->get_id() ); ?>" rel="<?php echo esc_attr( $download->get_product_id() ) . ',' . esc_attr( $download->get_download_id() ); ?>" class="revoke_access button"><?php _e( 'Revoke access', 'woocommerce' ); ?></button>
|
||||
<button type="button" data-permission_id="<?php echo esc_attr( $download->get_id() ); ?>" rel="<?php echo esc_attr( $download->get_product_id() ) . ',' . esc_attr( $download->get_download_id() ); ?>" class="revoke_access button"><?php esc_html_e( 'Revoke access', 'woocommerce' ); ?></button>
|
||||
<div class="handlediv" aria-label="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div>
|
||||
<strong><?php
|
||||
printf(
|
||||
|
@ -16,22 +16,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
esc_html( wc_get_filename_from_url( $product->get_file_download_path( $download->get_download_id() ) ) )
|
||||
);
|
||||
printf( _n( 'Downloaded %s time', 'Downloaded %s times', $download->get_download_count(), 'woocommerce' ), esc_html( $download->get_download_count() ) )
|
||||
?></strong>
|
||||
?></strong>
|
||||
</h3>
|
||||
<table cellpadding="0" cellspacing="0" class="wc-metabox-content">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label><?php _e( 'Downloads remaining', 'woocommerce' ); ?></label>
|
||||
<input type="hidden" name="permission_id[<?php echo $loop; ?>]" value="<?php echo esc_attr( $download->get_id() ); ?>" />
|
||||
<input type="number" step="1" min="0" class="short" name="downloads_remaining[<?php echo $loop; ?>]" value="<?php echo esc_attr( $download->get_downloads_remaining() ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" />
|
||||
<label><?php esc_html_e( 'Downloads remaining', 'woocommerce' ); ?></label>
|
||||
<input type="hidden" name="permission_id[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $download->get_id() ); ?>" />
|
||||
<input type="number" step="1" min="0" class="short" name="downloads_remaining[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $download->get_downloads_remaining() ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" />
|
||||
</td>
|
||||
<td>
|
||||
<label><?php _e( 'Access expires', 'woocommerce' ); ?></label>
|
||||
<input type="text" class="short date-picker" name="access_expires[<?php echo $loop; ?>]" value="<?php echo ! is_null( $download->get_access_expires() ) ? date_i18n( 'Y-m-d', $download->get_access_expires()->getTimestamp() ) : ''; ?>" maxlength="10" placeholder="<?php esc_attr_e( 'Never', 'woocommerce' ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" />
|
||||
<label><?php esc_html_e( 'Access expires', 'woocommerce' ); ?></label>
|
||||
<input type="text" class="short date-picker" name="access_expires[<?php echo esc_attr( $loop ); ?>]" value="<?php echo ! is_null( $download->get_access_expires() ) ? esc_attr( date_i18n( 'Y-m-d', $download->get_access_expires()->getTimestamp() ) ) : ''; ?>" maxlength="10" placeholder="<?php esc_attr_e( 'Never', 'woocommerce' ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" />
|
||||
</td>
|
||||
<td>
|
||||
<label><?php _e( 'Customer download link', 'woocommerce' ); ?></label>
|
||||
<label><?php esc_html_e( 'Customer download link', 'woocommerce' ); ?></label>
|
||||
<?php
|
||||
$download_link = add_query_arg( array(
|
||||
'download_file' => $download->get_product_id(),
|
||||
|
@ -43,6 +43,19 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
echo '<a href="' . esc_url( $download_link ) . '">' . esc_html( $file_count ) . '</a>';
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<label><?php esc_html_e( 'Downloads completed', 'woocommerce' ); ?></label>
|
||||
<?php
|
||||
$report_url = add_query_arg(
|
||||
'permission_id',
|
||||
rawurlencode( $download->get_id() ),
|
||||
admin_url( 'admin.php?page=wc-reports&tab=orders&report=downloads' )
|
||||
);
|
||||
echo '<a href="' . esc_url( $report_url ) . '">';
|
||||
echo esc_html( number_format_i18n( $download->get_download_count() ) );
|
||||
echo '</a>';
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
?>
|
||||
<tr class="fee <?php echo ( ! empty( $class ) ) ? $class : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<tr class="fee <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<td class="thumb"><div></div></td>
|
||||
|
||||
<td class="name">
|
||||
|
@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
||||
<input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" />
|
||||
</div>
|
||||
<?php do_action( 'woocommerce_after_order_fee_item_name', $item_id, $item, null ) ?>
|
||||
<?php do_action( 'woocommerce_after_order_fee_item_name', $item_id, $item, null ); ?>
|
||||
</td>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?>
|
||||
|
@ -41,10 +41,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
</div>
|
||||
<div class="edit" style="display: none;">
|
||||
<input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" />
|
||||
<input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" />
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_total wc_input_price" />
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
@ -65,10 +65,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
</div>
|
||||
<div class="edit" style="display: none;">
|
||||
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" />
|
||||
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" />
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', arr
|
|||
?><div class="view">
|
||||
<?php if ( $meta_data = $item->get_formatted_meta_data( '' ) ) : ?>
|
||||
<table cellspacing="0" class="display_meta">
|
||||
<?php foreach ( $meta_data as $meta_id => $meta ) :
|
||||
if ( in_array( $meta->key, $hidden_order_itemmeta ) ) {
|
||||
<?php
|
||||
foreach ( $meta_data as $meta_id => $meta ) :
|
||||
if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
@ -35,8 +36,9 @@ $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', arr
|
|||
<table class="meta" cellspacing="0">
|
||||
<tbody class="meta_items">
|
||||
<?php if ( $meta_data = $item->get_formatted_meta_data( '' ) ) : ?>
|
||||
<?php foreach ( $meta_data as $meta_id => $meta ) :
|
||||
if ( in_array( $meta->key, $hidden_order_itemmeta ) ) {
|
||||
<?php
|
||||
foreach ( $meta_data as $meta_id => $meta ) :
|
||||
if ( in_array( $meta->key, $hidden_order_itemmeta, true ) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
@ -52,7 +54,7 @@ $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', arr
|
|||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4"><button class="add_order_item_meta button"><?php _e( 'Add meta', 'woocommerce' ); ?></button></td>
|
||||
<td colspan="4"><button class="add_order_item_meta button"><?php esc_html_e( 'Add meta', 'woocommerce' ); ?></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
|
|
@ -11,21 +11,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
$product = $item->get_product();
|
||||
$product_link = $product ? admin_url( 'post.php?post=' . $item->get_product_id() . '&action=edit' ) : '';
|
||||
$thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnail', $product->get_image( 'thumbnail', array( 'title' => '' ), false ), $item_id, $item ) : '';
|
||||
$row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empty( $class ) ? $class : '', $item, $order );
|
||||
?>
|
||||
<tr class="item <?php echo apply_filters( 'woocommerce_admin_html_order_item_class', ( ! empty( $class ) ? $class : '' ), $item, $order ); ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<tr class="item <?php echo esc_attr( $row_class ); ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<td class="thumb">
|
||||
<?php echo '<div class="wc-order-item-thumbnail">' . wp_kses_post( $thumbnail ) . '</div>'; ?>
|
||||
</td>
|
||||
<td class="name" data-sort-value="<?php echo esc_attr( $item->get_name() ); ?>">
|
||||
<?php
|
||||
echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . esc_html( $item->get_name() ) . '</a>' : '<div class="class="wc-order-item-name"">' . esc_html( $item->get_name() ) . '</div>';
|
||||
echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . esc_html( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . esc_html( $item->get_name() ) . '</div>';
|
||||
|
||||
if ( $product && $product->get_sku() ) {
|
||||
echo '<div class="wc-order-item-sku"><strong>' . __( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>';
|
||||
echo '<div class="wc-order-item-sku"><strong>' . esc_html__( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>';
|
||||
}
|
||||
|
||||
if ( $item->get_variation_id() ) {
|
||||
echo '<div class="wc-order-item-variation"><strong>' . __( 'Variation ID:', 'woocommerce' ) . '</strong> ';
|
||||
echo '<div class="wc-order-item-variation"><strong>' . esc_html__( 'Variation ID:', 'woocommerce' ) . '</strong> ';
|
||||
if ( 'product_variation' === get_post_type( $item->get_variation_id() ) ) {
|
||||
echo esc_html( $item->get_variation_id() );
|
||||
} else {
|
||||
|
@ -38,9 +39,9 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai
|
|||
<input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
||||
<input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" />
|
||||
|
||||
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $product ) ?>
|
||||
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $product ); ?>
|
||||
<?php include( 'html-order-item-meta.php' ); ?>
|
||||
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, $product ) ?>
|
||||
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, $product ); ?>
|
||||
</td>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_item_values', $product, $item, absint( $item_id ) ); ?>
|
||||
|
@ -67,10 +68,10 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai
|
|||
?>
|
||||
</div>
|
||||
<div class="edit" style="display: none;">
|
||||
<input type="number" step="<?php echo apply_filters( 'woocommerce_quantity_input_step', '1', $product ); ?>" min="0" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item->get_quantity() ); ?>" data-qty="<?php echo esc_attr( $item->get_quantity() ); ?>" size="4" class="quantity" />
|
||||
<input type="number" step="<?php echo esc_attr( apply_filters( 'woocommerce_quantity_input_step', '1', $product ) ); ?>" min="0" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item->get_quantity() ); ?>" data-qty="<?php echo esc_attr( $item->get_quantity() ); ?>" size="4" class="quantity" />
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="number" step="<?php echo apply_filters( 'woocommerce_quantity_input_step', '1', $product ); ?>" min="0" max="<?php echo $item->get_quantity(); ?>" autocomplete="off" name="refund_order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" size="4" class="refund_order_item_qty" />
|
||||
<input type="number" step="<?php echo esc_attr( apply_filters( 'woocommerce_quantity_input_step', '1', $product ) ); ?>" min="0" max="<?php echo absint( $item->get_quantity() ); ?>" autocomplete="off" name="refund_order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" size="4" class="refund_order_item_qty" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="line_cost" width="1%" data-sort-value="<?php echo esc_attr( $item->get_total() ); ?>">
|
||||
|
@ -91,16 +92,16 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai
|
|||
<div class="split-input">
|
||||
<div class="input">
|
||||
<label><?php esc_attr_e( 'Pre-discount:', 'woocommerce' ); ?></label>
|
||||
<input type="text" name="line_subtotal[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" class="line_subtotal wc_input_price" data-subtotal="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" />
|
||||
<input type="text" name="line_subtotal[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" class="line_subtotal wc_input_price" data-subtotal="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" />
|
||||
</div>
|
||||
<div class="input">
|
||||
<label><?php esc_attr_e( 'Total:', 'woocommerce' ); ?></label>
|
||||
<input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" data-tip="<?php esc_attr_e( 'After pre-tax discounts.', 'woocommerce' ); ?>" data-total="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" />
|
||||
<input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" data-tip="<?php esc_attr_e( 'After pre-tax discounts.', 'woocommerce' ); ?>" data-total="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_total wc_input_price" />
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
@ -114,7 +115,7 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai
|
|||
<td class="line_tax" width="1%">
|
||||
<div class="view">
|
||||
<?php
|
||||
if ( '' != $tax_item_total ) {
|
||||
if ( '' !== $tax_item_total ) {
|
||||
echo wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) );
|
||||
} else {
|
||||
echo '–';
|
||||
|
@ -137,16 +138,16 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai
|
|||
<div class="split-input">
|
||||
<div class="input">
|
||||
<label><?php esc_attr_e( 'Pre-discount:', 'woocommerce' ); ?></label>
|
||||
<input type="text" name="line_subtotal_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" class="line_subtotal_tax wc_input_price" data-subtotal_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
<input type="text" name="line_subtotal_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" class="line_subtotal_tax wc_input_price" data-subtotal_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
</div>
|
||||
<div class="input">
|
||||
<label><?php esc_attr_e( 'Total:', 'woocommerce' ); ?></label>
|
||||
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" class="line_tax wc_input_price" data-total_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" class="line_tax wc_input_price" data-total_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
|
|
|
@ -26,23 +26,24 @@ if ( wc_tax_enabled() ) {
|
|||
<table cellpadding="0" cellspacing="0" class="woocommerce_order_items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item sortable" colspan="2" data-sort="string-ins"><?php _e( 'Item', 'woocommerce' ); ?></th>
|
||||
<th class="item sortable" colspan="2" data-sort="string-ins"><?php esc_html_e( 'Item', 'woocommerce' ); ?></th>
|
||||
<?php do_action( 'woocommerce_admin_order_item_headers', $order ); ?>
|
||||
<th class="item_cost sortable" data-sort="float"><?php _e( 'Cost', 'woocommerce' ); ?></th>
|
||||
<th class="quantity sortable" data-sort="int"><?php _e( 'Qty', 'woocommerce' ); ?></th>
|
||||
<th class="line_cost sortable" data-sort="float"><?php _e( 'Total', 'woocommerce' ); ?></th>
|
||||
<th class="item_cost sortable" data-sort="float"><?php esc_html_e( 'Cost', 'woocommerce' ); ?></th>
|
||||
<th class="quantity sortable" data-sort="int"><?php esc_html_e( 'Qty', 'woocommerce' ); ?></th>
|
||||
<th class="line_cost sortable" data-sort="float"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
|
||||
<?php
|
||||
if ( ! empty( $order_taxes ) ) :
|
||||
foreach ( $order_taxes as $tax_id => $tax_item ) :
|
||||
$tax_class = wc_get_tax_class_by_tax_id( $tax_item['rate_id'] );
|
||||
$tax_class_name = isset( $classes_options[ $tax_class ] ) ? $classes_options[ $tax_class ] : __( 'Tax', 'woocommerce' );
|
||||
$column_label = ! empty( $tax_item['label'] ) ? $tax_item['label'] : __( 'Tax', 'woocommerce' );
|
||||
/* translators: %1$s: tax item name %2$s: tax class name */
|
||||
$column_tip = sprintf( esc_html__( '%1$s (%2$s)', 'woocommerce' ), $tax_item['name'], $tax_class_name );
|
||||
?>
|
||||
<th class="line_tax tips" data-tip="<?php echo esc_attr( $column_tip ); ?>">
|
||||
<?php echo esc_attr( $column_label ); ?>
|
||||
<input type="hidden" class="order-tax-id" name="order_taxes[<?php echo $tax_id; ?>]" value="<?php echo esc_attr( $tax_item['rate_id'] ); ?>">
|
||||
<a class="delete-order-tax" href="#" data-rate_id="<?php echo $tax_id; ?>"></a>
|
||||
<input type="hidden" class="order-tax-id" name="order_taxes[<?php echo esc_attr( $tax_id ); ?>]" value="<?php echo esc_attr( $tax_item['rate_id'] ); ?>">
|
||||
<a class="delete-order-tax" href="#" data-rate_id="<?php echo esc_attr( $tax_id ); ?>"></a>
|
||||
</th>
|
||||
<?php
|
||||
endforeach;
|
||||
|
@ -94,11 +95,11 @@ if ( wc_tax_enabled() ) {
|
|||
</div>
|
||||
<div class="wc-order-data-row wc-order-item-bulk-edit" style="display:none;">
|
||||
<?php if ( $order->is_editable() ) : ?>
|
||||
<button type="button" class="button bulk-delete-items"><?php _e( 'Delete selected row(s)', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button bulk-delete-items"><?php esc_html_e( 'Delete selected row(s)', 'woocommerce' ); ?></button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button bulk-decrease-stock"><?php _e( 'Reduce stock', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button bulk-increase-stock"><?php _e( 'Increase stock', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button bulk-decrease-stock"><?php esc_html_e( 'Reduce stock', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button bulk-increase-stock"><?php esc_html_e( 'Increase stock', 'woocommerce' ); ?></button>
|
||||
<?php do_action( 'woocommerce_admin_order_item_bulk_actions', $order ); ?>
|
||||
</div>
|
||||
<div class="wc-order-data-row wc-order-totals-items wc-order-items-editable">
|
||||
|
@ -108,7 +109,7 @@ if ( wc_tax_enabled() ) {
|
|||
?>
|
||||
<div class="wc-used-coupons">
|
||||
<ul class="wc_coupon_list"><?php
|
||||
echo '<li><strong>' . __( 'Coupon(s)', 'woocommerce' ) . '</strong></li>';
|
||||
echo '<li><strong>' . esc_html__( 'Coupon(s)', 'woocommerce' ) . '</strong></li>';
|
||||
foreach ( $coupons as $item_id => $item ) {
|
||||
$post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_title = %s AND post_type = 'shop_coupon' AND post_status = 'publish' LIMIT 1;", $item->get_code() ) );
|
||||
|
||||
|
@ -126,7 +127,7 @@ if ( wc_tax_enabled() ) {
|
|||
<table class="wc-order-totals">
|
||||
<?php if ( 0 < $order->get_total_discount() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Discount:', 'woocommerce' ); ?></td>
|
||||
<td class="label"><?php esc_html_e( 'Discount:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo wc_price( $order->get_total_discount(), array( 'currency' => $order->get_currency() ) ); ?>
|
||||
|
@ -138,10 +139,12 @@ if ( wc_tax_enabled() ) {
|
|||
|
||||
<?php if ( $order->get_shipping_methods() ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Shipping:', 'woocommerce' ); ?></td>
|
||||
<td class="label"><?php esc_html_e( 'Shipping:', 'woocommerce' ); ?></td>
|
||||
<td width="1%"></td>
|
||||
<td class="total"><?php
|
||||
if ( ( $refunded = $order->get_total_shipping_refunded() ) > 0 ) {
|
||||
<td class="total">
|
||||
<?php
|
||||
$refunded = $order->get_total_shipping_refunded();
|
||||
if ( $refunded > 0 ) {
|
||||
echo '<del>' . strip_tags( wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) ) ) . '</del> <ins>' . wc_price( $order->get_shipping_total() - $refunded, array( 'currency' => $order->get_currency() ) ) . '</ins>';
|
||||
} else {
|
||||
echo wc_price( $order->get_shipping_total(), array( 'currency' => $order->get_currency() ) );
|
||||
|
@ -155,15 +158,18 @@ if ( wc_tax_enabled() ) {
|
|||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
<?php foreach ( $order->get_tax_totals() as $code => $tax ) : ?>
|
||||
<tr>
|
||||
<td class="label"><?php echo $tax->label; ?>:</td>
|
||||
<td class="label"><?php echo esc_html( $tax->label ); ?>:</td>
|
||||
<td width="1%"></td>
|
||||
<td class="total"><?php
|
||||
if ( ( $refunded = $order->get_total_tax_refunded_by_rate_id( $tax->rate_id ) ) > 0 ) {
|
||||
<td class="total">
|
||||
<?php
|
||||
$refunded = $order->get_total_tax_refunded_by_rate_id( $tax->rate_id );
|
||||
if ( $refunded > 0 ) {
|
||||
echo '<del>' . strip_tags( $tax->formatted_amount ) . '</del> <ins>' . wc_price( WC_Tax::round( $tax->amount, wc_get_price_decimals() ) - WC_Tax::round( $refunded, wc_get_price_decimals() ), array( 'currency' => $order->get_currency() ) ) . '</ins>';
|
||||
} else {
|
||||
echo $tax->formatted_amount;
|
||||
}
|
||||
?></td>
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -171,7 +177,7 @@ if ( wc_tax_enabled() ) {
|
|||
<?php do_action( 'woocommerce_admin_order_totals_after_tax', $order->get_id() ); ?>
|
||||
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Total', 'woocommerce' ); ?>:</td>
|
||||
<td class="label"><?php esc_html_e( 'Total', 'woocommerce' ); ?>:</td>
|
||||
<td width="1%"></td>
|
||||
<td class="total">
|
||||
<?php echo $order->get_formatted_order_total(); ?>
|
||||
|
@ -182,7 +188,7 @@ if ( wc_tax_enabled() ) {
|
|||
|
||||
<?php if ( $order->get_total_refunded() ) : ?>
|
||||
<tr>
|
||||
<td class="label refunded-total"><?php _e( 'Refunded', 'woocommerce' ); ?>:</td>
|
||||
<td class="label refunded-total"><?php esc_html_e( 'Refunded', 'woocommerce' ); ?>:</td>
|
||||
<td width="1%"></td>
|
||||
<td class="total refunded-total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); ?></td>
|
||||
</tr>
|
||||
|
@ -196,63 +202,63 @@ if ( wc_tax_enabled() ) {
|
|||
<div class="wc-order-data-row wc-order-bulk-actions wc-order-data-row-toggle">
|
||||
<p class="add-items">
|
||||
<?php if ( $order->is_editable() ) : ?>
|
||||
<button type="button" class="button add-line-item"><?php _e( 'Add item(s)', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-coupon"><?php _e( 'Apply coupon', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-line-item"><?php esc_html_e( 'Add item(s)', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-coupon"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
|
||||
<?php else : ?>
|
||||
<span class="description"><?php echo wc_help_tip( __( 'To edit this order change the status back to "Pending"', 'woocommerce' ) ); ?> <?php _e( 'This order is no longer editable.', 'woocommerce' ); ?></span>
|
||||
<span class="description"><?php echo wc_help_tip( __( 'To edit this order change the status back to "Pending"', 'woocommerce' ) ); ?> <?php esc_html_e( 'This order is no longer editable.', 'woocommerce' ); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ( 0 < $order->get_total() - $order->get_total_refunded() || 0 < absint( $order->get_item_count() - $order->get_item_count_refunded() ) ) : ?>
|
||||
<button type="button" class="button refund-items"><?php _e( 'Refund', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button refund-items"><?php esc_html_e( 'Refund', 'woocommerce' ); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// allow adding custom buttons
|
||||
do_action( 'woocommerce_order_item_add_action_buttons', $order );
|
||||
?>
|
||||
<?php if ( $order->is_editable() ) : ?>
|
||||
<button type="button" class="button button-primary calculate-action"><?php _e( 'Recalculate', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button button-primary calculate-action"><?php esc_html_e( 'Recalculate', 'woocommerce' ); ?></button>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="wc-order-data-row wc-order-add-item wc-order-data-row-toggle" style="display:none;">
|
||||
<button type="button" class="button add-order-item"><?php _e( 'Add product(s)', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-fee"><?php _e( 'Add fee', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-shipping"><?php _e( 'Add shipping', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-item"><?php esc_html_e( 'Add product(s)', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-fee"><?php esc_html_e( 'Add fee', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-shipping"><?php esc_html_e( 'Add shipping', 'woocommerce' ); ?></button>
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
<button type="button" class="button add-order-tax"><?php _e( 'Add tax', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add-order-tax"><?php esc_html_e( 'Add tax', 'woocommerce' ); ?></button>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// allow adding custom buttons
|
||||
do_action( 'woocommerce_order_item_add_line_buttons', $order );
|
||||
?>
|
||||
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button button-primary save-action"><?php _e( 'Save', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button cancel-action"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button button-primary save-action"><?php esc_html_e( 'Save', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
<?php if ( 0 < $order->get_total() - $order->get_total_refunded() || 0 < absint( $order->get_item_count() - $order->get_item_count_refunded() ) ) : ?>
|
||||
<div class="wc-order-data-row wc-order-refund-items wc-order-data-row-toggle" style="display: none;">
|
||||
<table class="wc-order-totals">
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) : ?>
|
||||
<tr>
|
||||
<td class="label"><label for="restock_refunded_items"><?php _e( 'Restock refunded items', 'woocommerce' ); ?>:</label></td>
|
||||
<td class="label"><label for="restock_refunded_items"><?php esc_html_e( 'Restock refunded items', 'woocommerce' ); ?>:</label></td>
|
||||
<td class="total"><input type="checkbox" id="restock_refunded_items" name="restock_refunded_items" checked="checked" /></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Amount already refunded', 'woocommerce' ); ?>:</td>
|
||||
<td class="label"><?php esc_html_e( 'Amount already refunded', 'woocommerce' ); ?>:</td>
|
||||
<td class="total">-<?php echo wc_price( $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><?php _e( 'Total available to refund', 'woocommerce' ); ?>:</td>
|
||||
<td class="label"><?php esc_html_e( 'Total available to refund', 'woocommerce' ); ?>:</td>
|
||||
<td class="total"><?php echo wc_price( $order->get_total() - $order->get_total_refunded(), array( 'currency' => $order->get_currency() ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="refund_amount"><?php _e( 'Refund amount', 'woocommerce' ); ?>:</label></td>
|
||||
<td class="label"><label for="refund_amount"><?php esc_html_e( 'Refund amount', 'woocommerce' ); ?>:</label></td>
|
||||
<td class="total">
|
||||
<input type="text" id="refund_amount" name="refund_amount" class="wc_input_price" />
|
||||
<div class="clear"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="refund_reason"><?php echo wc_help_tip( __( 'Note: the refund reason will be visible by the customer.', 'woocommerce' ) ); ?> <?php _e( 'Reason for refund (optional):', 'woocommerce' ); ?></label></td>
|
||||
<td class="label"><label for="refund_reason"><?php echo wc_help_tip( __( 'Note: the refund reason will be visible by the customer.', 'woocommerce' ) ); ?> <?php esc_html_e( 'Reason for refund (optional):', 'woocommerce' ); ?></label></td>
|
||||
<td class="total">
|
||||
<input type="text" id="refund_reason" name="refund_reason" />
|
||||
<div class="clear"></div>
|
||||
|
@ -266,9 +272,11 @@ if ( wc_tax_enabled() ) {
|
|||
$gateway_supports_refunds = false !== $payment_gateway && $payment_gateway->supports( 'refunds' );
|
||||
$gateway_name = false !== $payment_gateway ? ( ! empty( $payment_gateway->method_title ) ? $payment_gateway->method_title : $payment_gateway->get_title() ) : __( 'Payment gateway', 'woocommerce' );
|
||||
?>
|
||||
<button type="button" class="button <?php echo $gateway_supports_refunds ? 'button-primary do-api-refund' : 'tips disabled'; ?>" <?php echo $gateway_supports_refunds ? '' : 'data-tip="' . esc_attr__( 'The payment gateway used to place this order does not support automatic refunds.', 'woocommerce' ) . '"'; ?>><?php printf( __( 'Refund %1$s via %2$s', 'woocommerce' ), $refund_amount, $gateway_name ); ?></button>
|
||||
<button type="button" class="button button-primary do-manual-refund tips" data-tip="<?php esc_attr_e( 'You will need to manually issue a refund through your payment gateway after using this.', 'woocommerce' ); ?>"><?php printf( __( 'Refund %s manually', 'woocommerce' ), $refund_amount ); ?></button>
|
||||
<button type="button" class="button cancel-action"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<?php /* translators: refund amount, gateway name */ ?>
|
||||
<button type="button" class="button <?php echo $gateway_supports_refunds ? 'button-primary do-api-refund' : 'tips disabled'; ?>" <?php echo $gateway_supports_refunds ? '' : 'data-tip="' . esc_attr__( 'The payment gateway used to place this order does not support automatic refunds.', 'woocommerce' ) . '"'; ?>><?php printf( esc_html__( 'Refund %1$s via %2$s', 'woocommerce' ), $refund_amount, $gateway_name ); ?></button>
|
||||
<?php /* translators: refund amount */ ?>
|
||||
<button type="button" class="button button-primary do-manual-refund tips" data-tip="<?php esc_attr_e( 'You will need to manually issue a refund through your payment gateway after using this.', 'woocommerce' ); ?>"><?php printf( esc_html__( 'Refund %s manually', 'woocommerce' ), $refund_amount ); ?></button>
|
||||
<button type="button" class="button cancel-action"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<input type="hidden" id="refunded_amount" name="refunded_amount" value="<?php echo esc_attr( $order->get_total_refunded() ); ?>" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -280,7 +288,7 @@ if ( wc_tax_enabled() ) {
|
|||
<div class="wc-backbone-modal-content">
|
||||
<section class="wc-backbone-modal-main" role="main">
|
||||
<header class="wc-backbone-modal-header">
|
||||
<h1><?php _e( 'Add products', 'woocommerce' ); ?></h1>
|
||||
<h1><?php esc_html_e( 'Add products', 'woocommerce' ); ?></h1>
|
||||
<button class="modal-close modal-close-link dashicons dashicons-no-alt">
|
||||
<span class="screen-reader-text">Close modal panel</span>
|
||||
</button>
|
||||
|
@ -292,7 +300,7 @@ if ( wc_tax_enabled() ) {
|
|||
</article>
|
||||
<footer>
|
||||
<div class="inner">
|
||||
<button id="btn-ok" class="button button-primary button-large"><?php _e( 'Add', 'woocommerce' ); ?></button>
|
||||
<button id="btn-ok" class="button button-primary button-large"><?php esc_html_e( 'Add', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
|
@ -306,7 +314,7 @@ if ( wc_tax_enabled() ) {
|
|||
<div class="wc-backbone-modal-content">
|
||||
<section class="wc-backbone-modal-main" role="main">
|
||||
<header class="wc-backbone-modal-header">
|
||||
<h1><?php _e( 'Add tax', 'woocommerce' ); ?></h1>
|
||||
<h1><?php esc_html_e( 'Add tax', 'woocommerce' ); ?></h1>
|
||||
<button class="modal-close modal-close-link dashicons dashicons-no-alt">
|
||||
<span class="screen-reader-text">Close modal panel</span>
|
||||
</button>
|
||||
|
@ -317,10 +325,10 @@ if ( wc_tax_enabled() ) {
|
|||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th><?php _e( 'Rate name', 'woocommerce' ); ?></th>
|
||||
<th><?php _e( 'Tax class', 'woocommerce' ); ?></th>
|
||||
<th><?php _e( 'Rate code', 'woocommerce' ); ?></th>
|
||||
<th><?php _e( 'Rate %', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Rate name', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Rate code', 'woocommerce' ); ?></th>
|
||||
<th><?php esc_html_e( 'Rate %', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
|
@ -341,7 +349,7 @@ if ( wc_tax_enabled() ) {
|
|||
</table>
|
||||
<?php if ( absint( $wpdb->get_var( "SELECT COUNT(tax_rate_id) FROM {$wpdb->prefix}woocommerce_tax_rates;" ) ) > 100 ) : ?>
|
||||
<p>
|
||||
<label for="manual_tax_rate_id"><?php _e( 'Or, enter tax rate ID:', 'woocommerce' ); ?></label><br/>
|
||||
<label for="manual_tax_rate_id"><?php esc_html_e( 'Or, enter tax rate ID:', 'woocommerce' ); ?></label><br/>
|
||||
<input type="number" name="manual_tax_rate_id" id="manual_tax_rate_id" step="1" placeholder="<?php esc_attr_e( 'Optional', 'woocommerce' ); ?>" />
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
@ -349,7 +357,7 @@ if ( wc_tax_enabled() ) {
|
|||
</article>
|
||||
<footer>
|
||||
<div class="inner">
|
||||
<button id="btn-ok" class="button button-primary button-large"><?php _e( 'Add', 'woocommerce' ); ?></button>
|
||||
<button id="btn-ok" class="button button-primary button-large"><?php esc_html_e( 'Add', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
</footer>
|
||||
</section>
|
||||
|
|
|
@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*/
|
||||
$who_refunded = new WP_User( $refund->get_refunded_by() );
|
||||
?>
|
||||
<tr class="refund <?php echo ( ! empty( $class ) ) ? $class : ''; ?>" data-order_refund_id="<?php echo $refund->get_id(); ?>">
|
||||
<tr class="refund <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_refund_id="<?php echo esc_attr( $refund->get_id() ); ?>">
|
||||
<td class="thumb"><div></div></td>
|
||||
|
||||
<td class="name">
|
||||
|
@ -16,11 +16,12 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
|
|||
if ( $who_refunded->exists() ) {
|
||||
printf(
|
||||
/* translators: 1: refund id 2: refund date 3: username */
|
||||
__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ),
|
||||
esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ),
|
||||
$refund->get_id(),
|
||||
wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ),
|
||||
sprintf(
|
||||
'<abbr class="refund_by" title="%1$s">%2$s</abbr>',
|
||||
/* translators: 1: ID who refunded */
|
||||
sprintf( esc_attr__( 'ID: %d', 'woocommerce' ), absint( $who_refunded->ID ) ),
|
||||
esc_html( $who_refunded->display_name )
|
||||
)
|
||||
|
@ -28,7 +29,7 @@ $who_refunded = new WP_User( $refund->get_refunded_by() );
|
|||
} else {
|
||||
printf(
|
||||
/* translators: 1: refund id 2: refund date */
|
||||
__( 'Refund #%1$s - %2$s', 'woocommerce' ),
|
||||
esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ),
|
||||
$refund->get_id(),
|
||||
wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) )
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
exit;
|
||||
}
|
||||
?>
|
||||
<tr class="shipping <?php echo ( ! empty( $class ) ) ? $class : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<tr class="shipping <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>">
|
||||
<td class="thumb"><div></div></td>
|
||||
|
||||
<td class="name">
|
||||
|
@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<input type="text" class="shipping_method_name" placeholder="<?php esc_attr_e( 'Shipping name', 'woocommerce' ); ?>" name="shipping_method_title[<?php echo esc_attr( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_name() ); ?>" />
|
||||
<select class="shipping_method" name="shipping_method[<?php echo esc_attr( $item_id ); ?>]">
|
||||
<optgroup label="<?php esc_attr_e( 'Shipping method', 'woocommerce' ); ?>">
|
||||
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
||||
<option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
$found_method = false;
|
||||
|
||||
|
@ -36,18 +36,18 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
|
||||
if ( ! $found_method && $item->get_method_id() ) {
|
||||
echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . __( 'Other', 'woocommerce' ) . '</option>';
|
||||
echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>';
|
||||
} else {
|
||||
echo '<option value="other">' . __( 'Other', 'woocommerce' ) . '</option>';
|
||||
echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ) ?>
|
||||
<?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ); ?>
|
||||
<?php include( 'html-order-item-meta.php' ); ?>
|
||||
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ) ?>
|
||||
<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ); ?>
|
||||
</td>
|
||||
|
||||
<?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?>
|
||||
|
@ -59,17 +59,17 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<div class="view">
|
||||
<?php
|
||||
echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) );
|
||||
|
||||
if ( $refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' ) ) {
|
||||
$refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' );
|
||||
if ( $refunded ) {
|
||||
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="edit" style="display: none;">
|
||||
<input type="text" name="shipping_cost[<?php echo esc_attr( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" />
|
||||
<input type="text" name="shipping_cost[<?php echo esc_attr( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" />
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_total wc_input_price" />
|
||||
<input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
@ -83,17 +83,17 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<div class="view">
|
||||
<?php
|
||||
echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '–';
|
||||
|
||||
if ( $refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ) ) {
|
||||
$refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' );
|
||||
if ( $refunded ) {
|
||||
echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="edit" style="display: none;">
|
||||
<input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" />
|
||||
<input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" />
|
||||
</div>
|
||||
<div class="refund" style="display: none;">
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo wc_format_localized_price( 0 ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
<input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" />
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
|
|
|
@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
<div data-taxonomy="<?php echo esc_attr( $attribute->get_taxonomy() ); ?>" class="woocommerce_attribute wc-metabox closed <?php echo esc_attr( implode( ' ', $metabox_class ) ); ?>" rel="<?php echo esc_attr( $attribute->get_position() ); ?>">
|
||||
<h3>
|
||||
<a href="#" class="remove_row delete"><?php _e( 'Remove', 'woocommerce' ); ?></a>
|
||||
<a href="#" class="remove_row delete"><?php esc_html_e( 'Remove', 'woocommerce' ); ?></a>
|
||||
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div>
|
||||
<strong class="attribute_name"><?php echo esc_html( wc_attribute_label( $attribute->get_name() ) ); ?></strong>
|
||||
</h3>
|
||||
|
@ -14,24 +14,26 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<tbody>
|
||||
<tr>
|
||||
<td class="attribute_name">
|
||||
<label><?php _e( 'Name', 'woocommerce' ); ?>:</label>
|
||||
<label><?php esc_html_e( 'Name', 'woocommerce' ); ?>:</label>
|
||||
|
||||
<?php if ( $attribute->is_taxonomy() ) : ?>
|
||||
<strong><?php echo esc_html( wc_attribute_label( $attribute->get_name() ) ); ?></strong>
|
||||
<input type="hidden" name="attribute_names[<?php echo $i; ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
|
||||
<input type="hidden" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
|
||||
<?php else : ?>
|
||||
<input type="text" class="attribute_name" name="attribute_names[<?php echo $i; ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
|
||||
<input type="text" class="attribute_name" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="attribute_position[<?php echo $i; ?>]" class="attribute_position" value="<?php echo esc_attr( $attribute->get_position() ); ?>" />
|
||||
<input type="hidden" name="attribute_position[<?php echo esc_attr( $i ); ?>]" class="attribute_position" value="<?php echo esc_attr( $attribute->get_position() ); ?>" />
|
||||
</td>
|
||||
<td rowspan="3">
|
||||
<label><?php _e( 'Value(s)', 'woocommerce' ); ?>:</label>
|
||||
<label><?php esc_html_e( 'Value(s)', 'woocommerce' ); ?>:</label>
|
||||
|
||||
<?php if ( $attribute->is_taxonomy() && ( $attribute_taxonomy = $attribute->get_taxonomy_object() ) ) : ?>
|
||||
<?php
|
||||
if ( $attribute->is_taxonomy() && $attribute_taxonomy = $attribute->get_taxonomy_object() ) :
|
||||
?>
|
||||
<?php if ( 'select' === $attribute_taxonomy->attribute_type ) : ?>
|
||||
|
||||
<select multiple="multiple" data-placeholder="<?php esc_attr_e( 'Select terms', 'woocommerce' ); ?>" class="multiselect attribute_values wc-enhanced-select" name="attribute_values[<?php echo $i; ?>][]">
|
||||
<select multiple="multiple" data-placeholder="<?php esc_attr_e( 'Select terms', 'woocommerce' ); ?>" class="multiselect attribute_values wc-enhanced-select" name="attribute_values[<?php echo esc_attr( $i ); ?>][]">
|
||||
<?php
|
||||
$args = array(
|
||||
'orderby' => 'name',
|
||||
|
@ -42,18 +44,18 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
foreach ( $all_terms as $term ) {
|
||||
$options = $attribute->get_options();
|
||||
$options = ! empty( $options ) ? $options : array();
|
||||
echo '<option value="' . esc_attr( $term->term_id ) . '" ' . selected( in_array( $term->term_id, $options ), true, false ) . '>' . esc_attr( apply_filters( 'woocommerce_product_attribute_term_name', $term->name, $term ) ) . '</option>';
|
||||
echo '<option value="' . esc_attr( $term->term_id ) . '" ' . selected( in_array( $term->term_id, $options, true ), true, false ) . '>' . esc_attr( apply_filters( 'woocommerce_product_attribute_term_name', $term->name, $term ) ) . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<button class="button plus select_all_attributes"><?php _e( 'Select all', 'woocommerce' ); ?></button>
|
||||
<button class="button minus select_no_attributes"><?php _e( 'Select none', 'woocommerce' ); ?></button>
|
||||
<button class="button fr plus add_new_attribute"><?php _e( 'Add new', 'woocommerce' ); ?></button>
|
||||
<button class="button plus select_all_attributes"><?php esc_html_e( 'Select all', 'woocommerce' ); ?></button>
|
||||
<button class="button minus select_no_attributes"><?php esc_html_e( 'Select none', 'woocommerce' ); ?></button>
|
||||
<button class="button fr plus add_new_attribute"><?php esc_html_e( 'Add new', 'woocommerce' ); ?></button>
|
||||
|
||||
<?php elseif ( 'text' == $attribute_taxonomy->attribute_type ) : ?>
|
||||
<?php elseif ( 'text' === $attribute_taxonomy->attribute_type ) : ?>
|
||||
|
||||
<input type="text" name="attribute_values[<?php echo $i; ?>]" value="<?php
|
||||
<input type="text" name="attribute_values[<?php echo esc_attr( $i ); ?>]" value="<?php
|
||||
|
||||
// Text attributes should list terms pipe separated
|
||||
echo esc_attr( wc_implode_text_attributes( wp_list_pluck( $attribute->get_terms(), 'name' ) ) );
|
||||
|
@ -70,21 +72,21 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php do_action( 'woocommerce_product_option_terms', $attribute_taxonomy, $i ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<textarea name="attribute_values[<?php echo $i; ?>]" cols="5" rows="5" placeholder="<?php printf( esc_attr__( 'Enter some text, or some attributes by "%s" separating values.', 'woocommerce' ), WC_DELIMITER ); ?>"><?php echo esc_textarea( wc_implode_text_attributes( $attribute->get_options() ) ); ?></textarea>
|
||||
<?php /* translators: %s: WC_DELIMITER */ ?>
|
||||
<textarea name="attribute_values[<?php echo esc_attr( $i ); ?>]" cols="5" rows="5" placeholder="<?php printf( esc_attr__( 'Enter some text, or some attributes by "%s" separating values.', 'woocommerce' ), WC_DELIMITER ); ?>"><?php echo esc_textarea( wc_implode_text_attributes( $attribute->get_options() ) ); ?></textarea>
|
||||
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label><input type="checkbox" class="checkbox" <?php checked( $attribute->get_visible(), true ); ?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /> <?php _e( 'Visible on the product page', 'woocommerce' ); ?></label>
|
||||
<label><input type="checkbox" class="checkbox" <?php checked( $attribute->get_visible(), true ); ?> name="attribute_visibility[<?php echo esc_attr( $i ); ?>]" value="1" /> <?php esc_html_e( 'Visible on the product page', 'woocommerce' ); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="enable_variation show_if_variable">
|
||||
<label><input type="checkbox" class="checkbox" <?php checked( $attribute->get_variation(), true ); ?> name="attribute_variation[<?php echo $i; ?>]" value="1" /> <?php _e( 'Used for variations', 'woocommerce' ); ?></label>
|
||||
<label><input type="checkbox" class="checkbox" <?php checked( $attribute->get_variation(), true ); ?> name="attribute_variation[<?php echo esc_attr( $i ); ?>]" value="1" /> <?php esc_html_e( 'Used for variations', 'woocommerce' ); ?></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -6,10 +6,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<div id="product_attributes" class="panel wc-metaboxes-wrapper hidden">
|
||||
<div class="toolbar toolbar-top">
|
||||
<span class="expand-close">
|
||||
<a href="#" class="expand_all"><?php _e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php _e( 'Close', 'woocommerce' ); ?></a>
|
||||
<a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a>
|
||||
</span>
|
||||
<select name="attribute_taxonomy" class="attribute_taxonomy">
|
||||
<option value=""><?php _e( 'Custom product attribute', 'woocommerce' ); ?></option>
|
||||
<option value=""><?php esc_html_e( 'Custom product attribute', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
global $wc_product_attributes;
|
||||
|
||||
|
@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<button type="button" class="button add_attribute"><?php _e( 'Add', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button add_attribute"><?php esc_html_e( 'Add', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
<div class="product_attributes wc-metaboxes">
|
||||
<?php
|
||||
|
@ -48,9 +48,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</div>
|
||||
<div class="toolbar">
|
||||
<span class="expand-close">
|
||||
<a href="#" class="expand_all"><?php _e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php _e( 'Close', 'woocommerce' ); ?></a>
|
||||
<a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a>
|
||||
</span>
|
||||
<button type="button" class="button save_attributes button-primary"><?php _e( 'Save attributes', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button save_attributes button-primary"><?php esc_html_e( 'Save attributes', 'woocommerce' ); ?></button>
|
||||
</div>
|
||||
<?php do_action( 'woocommerce_product_options_attributes' ); ?>
|
||||
</div>
|
||||
|
|
|
@ -46,10 +46,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
$sale_price_dates_to = $product_object->get_date_on_sale_to( 'edit' ) && ( $date = $product_object->get_date_on_sale_to( 'edit' )->getOffsetTimestamp() ) ? date_i18n( 'Y-m-d', $date ) : '';
|
||||
|
||||
echo '<p class="form-field sale_price_dates_fields">
|
||||
<label for="_sale_price_dates_from">' . __( 'Sale price dates', 'woocommerce' ) . '</label>
|
||||
<input type="text" class="short" name="_sale_price_dates_from" id="_sale_price_dates_from" value="' . esc_attr( $sale_price_dates_from ) . '" placeholder="' . _x( 'From…', 'placeholder', 'woocommerce' ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
<input type="text" class="short" name="_sale_price_dates_to" id="_sale_price_dates_to" value="' . esc_attr( $sale_price_dates_to ) . '" placeholder="' . _x( 'To…', 'placeholder', 'woocommerce' ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
<a href="#" class="description cancel_sale_schedule">' . __( 'Cancel', 'woocommerce' ) . '</a>' . wc_help_tip( __( 'The sale will end at the beginning of the set date.', 'woocommerce' ) ) . '
|
||||
<label for="_sale_price_dates_from">' . esc_html__( 'Sale price dates', 'woocommerce' ) . '</label>
|
||||
<input type="text" class="short" name="_sale_price_dates_from" id="_sale_price_dates_from" value="' . esc_attr( $sale_price_dates_from ) . '" placeholder="' . esc_html( _x( 'From…', 'placeholder', 'woocommerce' ) ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
<input type="text" class="short" name="_sale_price_dates_to" id="_sale_price_dates_to" value="' . esc_attr( $sale_price_dates_to ) . '" placeholder="' . esc_html( _x( 'To…', 'placeholder', 'woocommerce' ) ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
<a href="#" class="description cancel_sale_schedule">' . esc_html__( 'Cancel', 'woocommerce' ) . '</a>' . wc_help_tip( __( 'The sale will end at the beginning of the set date.', 'woocommerce' ) ) . '
|
||||
</p>';
|
||||
|
||||
do_action( 'woocommerce_product_options_pricing' );
|
||||
|
@ -58,19 +58,20 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="options_group show_if_downloadable hidden">
|
||||
<div class="form-field downloadable_files">
|
||||
<label><?php _e( 'Downloadable files', 'woocommerce' ); ?></label>
|
||||
<label><?php esc_html_e( 'Downloadable files', 'woocommerce' ); ?></label>
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sort"> </th>
|
||||
<th><?php _e( 'Name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the name of the download shown to the customer.', 'woocommerce' ) ); ?></th>
|
||||
<th colspan="2"><?php _e( 'File URL', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce' ) ); ?></th>
|
||||
<th><?php esc_html_e( 'Name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the name of the download shown to the customer.', 'woocommerce' ) ); ?></th>
|
||||
<th colspan="2"><?php esc_html_e( 'File URL', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce' ) ); ?></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ( $downloadable_files = $product_object->get_downloads( 'edit' ) ) {
|
||||
$downloadable_files = $product_object->get_downloads( 'edit' );
|
||||
if ( $downloadable_files ) {
|
||||
foreach ( $downloadable_files as $key => $file ) {
|
||||
include( 'html-product-download.php' );
|
||||
}
|
||||
|
@ -89,7 +90,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
ob_start();
|
||||
include( 'html-product-download.php' );
|
||||
echo esc_attr( ob_get_clean() );
|
||||
?>"><?php _e( 'Add File', 'woocommerce' ); ?></a>
|
||||
?>"><?php esc_html_e( 'Add File', 'woocommerce' ); ?></a>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
woocommerce_wp_text_input( array(
|
||||
'id' => '_sku',
|
||||
'value' => $product_object->get_sku( 'edit' ),
|
||||
'label' => '<abbr title="' . __( 'Stock Keeping Unit', 'woocommerce' ) . '">' . __( 'SKU', 'woocommerce' ) . '</abbr>',
|
||||
'label' => '<abbr title="' . esc_attr__( 'Stock Keeping Unit', 'woocommerce' ) . '">' . esc_html__( 'SKU', 'woocommerce' ) . '</abbr>',
|
||||
'desc_tip' => true,
|
||||
'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ),
|
||||
) );
|
||||
|
@ -65,7 +65,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
woocommerce_wp_select( array(
|
||||
'id' => '_stock_status',
|
||||
'value' => $product_object->get_stock_status( 'edit' ),
|
||||
'wrapper_class' => 'hide_if_variable hide_if_external',
|
||||
'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external',
|
||||
'label' => __( 'Stock status', 'woocommerce' ),
|
||||
'options' => wc_get_product_stock_status_options(),
|
||||
'desc_tip' => true,
|
||||
|
|
|
@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="options_group show_if_grouped">
|
||||
<p class="form-field">
|
||||
<label for="grouped_products"><?php _e( 'Grouped products', 'woocommerce' ); ?></label>
|
||||
<label for="grouped_products"><?php esc_html_e( 'Grouped products', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="grouped_products" name="grouped_products[]" data-sortable="true" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_children( 'edit' );
|
||||
|
@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="options_group">
|
||||
<p class="form-field">
|
||||
<label for="upsell_ids"><?php _e( 'Upsells', 'woocommerce' ); ?></label>
|
||||
<label for="upsell_ids"><?php esc_html_e( 'Upsells', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="upsell_ids" name="upsell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_upsell_ids( 'edit' );
|
||||
|
@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</p>
|
||||
|
||||
<p class="form-field hide_if_grouped hide_if_external">
|
||||
<label for="crosssell_ids"><?php _e( 'Cross-sells', 'woocommerce' ); ?></label>
|
||||
<label for="crosssell_ids"><?php esc_html_e( 'Cross-sells', 'woocommerce' ); ?></label>
|
||||
<select class="wc-product-search" multiple="multiple" style="width: 50%;" id="crosssell_ids" name="crosssell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>">
|
||||
<?php
|
||||
$product_ids = $product_object->get_cross_sell_ids( 'edit' );
|
||||
|
|
|
@ -32,8 +32,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<ul class="product_data_tabs wc-tabs">
|
||||
<?php foreach ( self::get_product_data_tabs() as $key => $tab ) : ?>
|
||||
<li class="<?php echo $key; ?>_options <?php echo $key; ?>_tab <?php echo esc_attr( isset( $tab['class'] ) ? implode( ' ' , (array) $tab['class'] ) : '' ); ?>">
|
||||
<a href="#<?php echo $tab['target']; ?>"><span><?php echo esc_html( $tab['label'] ); ?></span></a>
|
||||
<li class="<?php echo esc_attr( $key ); ?>_options <?php echo esc_attr( $key ); ?>_tab <?php echo esc_attr( isset( $tab['class'] ) ? implode( ' ' , (array) $tab['class'] ) : '' ); ?>">
|
||||
<a href="#<?php echo esc_attr( $tab['target'] ); ?>"><span><?php echo esc_html( $tab['label'] ); ?></span></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<?php do_action( 'woocommerce_product_write_panel_tabs' ); ?>
|
||||
|
|
|
@ -21,6 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
if ( wc_product_dimensions_enabled() ) {
|
||||
?><p class="form-field dimensions_field">
|
||||
<?php /* translators: WooCommerce dimension unit*/ ?>
|
||||
<label for="product_length"><?php printf( __( 'Dimensions (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?></label>
|
||||
<span class="wrap">
|
||||
<input id="product_length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" class="input-text wc_input_decimal" size="6" type="text" name="_length" value="<?php echo esc_attr( wc_format_localized_decimal( $product_object->get_length( 'edit' ) ) ); ?>" />
|
||||
|
@ -47,7 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
'class' => 'select short',
|
||||
);
|
||||
?><p class="form-field dimensions_field">
|
||||
<label for="product_shipping_class"><?php _e( 'Shipping class', 'woocommerce' ); ?></label>
|
||||
<label for="product_shipping_class"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></label>
|
||||
<?php wp_dropdown_categories( $args ); ?>
|
||||
<?php echo wc_help_tip( __( 'Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce' ) ); ?>
|
||||
</p><?php
|
||||
|
|
|
@ -9,20 +9,21 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php if ( ! count( $variation_attributes ) ) : ?>
|
||||
|
||||
<div id="message" class="inline notice woocommerce-message">
|
||||
<p><?php _e( 'Before you can add a variation you need to add some variation attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></p>
|
||||
<p><a class="button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'https://docs.woocommerce.com/document/variable-product/', 'product-variations' ) ); ?>" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
<p><?php echo wp_kses_post( __( 'Before you can add a variation you need to add some variation attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ) ); ?></p>
|
||||
<p><a class="button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'https://docs.woocommerce.com/document/variable-product/', 'product-variations' ) ); ?>" target="_blank"><?php esc_html_e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="toolbar toolbar-variations-defaults">
|
||||
<div class="variations-defaults">
|
||||
<strong><?php _e( 'Default Form Values', 'woocommerce' ); ?>: <?php echo wc_help_tip( __( 'These are the attributes that will be pre-selected on the frontend.', 'woocommerce' ) ); ?></strong>
|
||||
<strong><?php esc_html_e( 'Default Form Values', 'woocommerce' ); ?>: <?php echo wc_help_tip( __( 'These are the attributes that will be pre-selected on the frontend.', 'woocommerce' ) ); ?></strong>
|
||||
<?php
|
||||
foreach ( $variation_attributes as $attribute ) {
|
||||
$selected_value = isset( $default_attributes[ sanitize_title( $attribute->get_name() ) ] ) ? $default_attributes[ sanitize_title( $attribute->get_name() ) ] : '';
|
||||
?>
|
||||
<select name="default_attribute_<?php echo sanitize_title( $attribute->get_name() ); ?>" data-current="<?php echo esc_attr( $selected_value ); ?>">
|
||||
<?php /* translators: WooCommerce attribute label */ ?>
|
||||
<option value=""><?php printf( esc_html__( 'No default %s…', 'woocommerce' ), wc_attribute_label( $attribute->get_name() ) ); ?></option>
|
||||
<?php if ( $attribute->is_taxonomy() ) : ?>
|
||||
<?php foreach ( $attribute->get_terms() as $option ) : ?>
|
||||
|
@ -43,59 +44,61 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="toolbar toolbar-top">
|
||||
<select id="field_to_edit" class="variation_actions">
|
||||
<option data-global="true" value="add_variation"><?php _e( 'Add variation', 'woocommerce' ); ?></option>
|
||||
<option data-global="true" value="link_all_variations"><?php _e( 'Create variations from all attributes', 'woocommerce' ); ?></option>
|
||||
<option value="delete_all"><?php _e( 'Delete all variations', 'woocommerce' ); ?></option>
|
||||
<option data-global="true" value="add_variation"><?php esc_html_e( 'Add variation', 'woocommerce' ); ?></option>
|
||||
<option data-global="true" value="link_all_variations"><?php esc_html_e( 'Create variations from all attributes', 'woocommerce' ); ?></option>
|
||||
<option value="delete_all"><?php esc_html_e( 'Delete all variations', 'woocommerce' ); ?></option>
|
||||
<optgroup label="<?php esc_attr_e( 'Status', 'woocommerce' ); ?>">
|
||||
<option value="toggle_enabled"><?php _e( 'Toggle "Enabled"', 'woocommerce' ); ?></option>
|
||||
<option value="toggle_downloadable"><?php _e( 'Toggle "Downloadable"', 'woocommerce' ); ?></option>
|
||||
<option value="toggle_virtual"><?php _e( 'Toggle "Virtual"', 'woocommerce' ); ?></option>
|
||||
<option value="toggle_enabled"><?php esc_html_e( 'Toggle "Enabled"', 'woocommerce' ); ?></option>
|
||||
<option value="toggle_downloadable"><?php esc_html_e( 'Toggle "Downloadable"', 'woocommerce' ); ?></option>
|
||||
<option value="toggle_virtual"><?php esc_html_e( 'Toggle "Virtual"', 'woocommerce' ); ?></option>
|
||||
</optgroup>
|
||||
<optgroup label="<?php esc_attr_e( 'Pricing', 'woocommerce' ); ?>">
|
||||
<option value="variable_regular_price"><?php _e( 'Set regular prices', 'woocommerce' ); ?></option>
|
||||
<option value="variable_regular_price_increase"><?php _e( 'Increase regular prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_regular_price_decrease"><?php _e( 'Decrease regular prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price"><?php _e( 'Set sale prices', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price_increase"><?php _e( 'Increase sale prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price_decrease"><?php _e( 'Decrease sale prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_schedule"><?php _e( 'Set scheduled sale dates', 'woocommerce' ); ?></option>
|
||||
<option value="variable_regular_price"><?php esc_html_e( 'Set regular prices', 'woocommerce' ); ?></option>
|
||||
<option value="variable_regular_price_increase"><?php esc_html_e( 'Increase regular prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_regular_price_decrease"><?php esc_html_e( 'Decrease regular prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price"><?php esc_html_e( 'Set sale prices', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price_increase"><?php esc_html_e( 'Increase sale prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_price_decrease"><?php esc_html_e( 'Decrease sale prices (fixed amount or percentage)', 'woocommerce' ); ?></option>
|
||||
<option value="variable_sale_schedule"><?php esc_html_e( 'Set scheduled sale dates', 'woocommerce' ); ?></option>
|
||||
</optgroup>
|
||||
<optgroup label="<?php esc_attr_e( 'Inventory', 'woocommerce' ); ?>">
|
||||
<option value="toggle_manage_stock"><?php _e( 'Toggle "Manage stock"', 'woocommerce' ); ?></option>
|
||||
<option value="variable_stock"><?php _e( 'Stock', 'woocommerce' ); ?></option>
|
||||
<option value="variable_stock_status_instock"><?php _e( 'Set Status - In stock', 'woocommerce' ); ?></option>
|
||||
<option value="variable_stock_status_outofstock"><?php _e( 'Set Status - Out of stock', 'woocommerce' ); ?></option>
|
||||
<option value="variable_stock_status_onbackorder"><?php _e( 'Set Status - On backorder', 'woocommerce' ); ?></option>
|
||||
</optgroup>
|
||||
<optgroup label="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>">
|
||||
<option value="variable_length"><?php _e( 'Length', 'woocommerce' ); ?></option>
|
||||
<option value="variable_width"><?php _e( 'Width', 'woocommerce' ); ?></option>
|
||||
<option value="variable_height"><?php _e( 'Height', 'woocommerce' ); ?></option>
|
||||
<option value="variable_weight"><?php _e( 'Weight', 'woocommerce' ); ?></option>
|
||||
<option value="variable_length"><?php esc_html_e( 'Length', 'woocommerce' ); ?></option>
|
||||
<option value="variable_width"><?php esc_html_e( 'Width', 'woocommerce' ); ?></option>
|
||||
<option value="variable_height"><?php esc_html_e( 'Height', 'woocommerce' ); ?></option>
|
||||
<option value="variable_weight"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></option>
|
||||
</optgroup>
|
||||
<optgroup label="<?php esc_attr_e( 'Downloadable products', 'woocommerce' ); ?>">
|
||||
<option value="variable_download_limit"><?php _e( 'Download limit', 'woocommerce' ); ?></option>
|
||||
<option value="variable_download_expiry"><?php _e( 'Download expiry', 'woocommerce' ); ?></option>
|
||||
<option value="variable_download_limit"><?php esc_html_e( 'Download limit', 'woocommerce' ); ?></option>
|
||||
<option value="variable_download_expiry"><?php esc_html_e( 'Download expiry', 'woocommerce' ); ?></option>
|
||||
</optgroup>
|
||||
<?php do_action( 'woocommerce_variable_product_bulk_edit_actions' ); ?>
|
||||
</select>
|
||||
<a class="button bulk_edit do_variation_action"><?php _e( 'Go', 'woocommerce' ); ?></a>
|
||||
<a class="button bulk_edit do_variation_action"><?php esc_html_e( 'Go', 'woocommerce' ); ?></a>
|
||||
|
||||
<div class="variations-pagenav">
|
||||
<span class="displaying-num"><?php printf( _n( '%s item', '%s items', $variations_count, 'woocommerce' ), $variations_count ); ?></span>
|
||||
<?php /* translators: variations count */ ?>
|
||||
<span class="displaying-num"><?php printf( esc_html( _n( '%s item', '%s items', $variations_count, 'woocommerce' ), $variations_count ) ); ?></span>
|
||||
<span class="expand-close">
|
||||
(<a href="#" class="expand_all"><?php _e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php _e( 'Close', 'woocommerce' ); ?></a>)
|
||||
(<a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a>)
|
||||
</span>
|
||||
<span class="pagination-links">
|
||||
<a class="first-page disabled" title="<?php esc_attr_e( 'Go to the first page', 'woocommerce' ); ?>" href="#">«</a>
|
||||
<a class="prev-page disabled" title="<?php esc_attr_e( 'Go to the previous page', 'woocommerce' ); ?>" href="#">‹</a>
|
||||
<span class="paging-select">
|
||||
<label for="current-page-selector-1" class="screen-reader-text"><?php _e( 'Select Page', 'woocommerce' ); ?></label>
|
||||
<label for="current-page-selector-1" class="screen-reader-text"><?php esc_html_e( 'Select Page', 'woocommerce' ); ?></label>
|
||||
<select class="page-selector" id="current-page-selector-1" title="<?php esc_attr_e( 'Current page', 'woocommerce' ); ?>">
|
||||
<?php for ( $i = 1; $i <= $variations_total_pages; $i++ ) : ?>
|
||||
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
<?php _ex( 'of', 'number of pages', 'woocommerce' ); ?> <span class="total-pages"><?php echo $variations_total_pages; ?></span>
|
||||
<?php _ex( 'of', 'number of pages', 'woocommerce' ); ?> <span class="total-pages"><?php echo esc_html( $variations_total_pages ); ?></span>
|
||||
</span>
|
||||
<a class="next-page" title="<?php esc_attr_e( 'Go to the next page', 'woocommerce' ); ?>" href="#">›</a>
|
||||
<a class="last-page" title="<?php esc_attr_e( 'Go to the last page', 'woocommerce' ); ?>" href="#">»</a>
|
||||
|
@ -106,24 +109,25 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="woocommerce_variations wc-metaboxes" data-attributes="<?php
|
||||
// esc_attr does not double encode - htmlspecialchars does
|
||||
echo htmlspecialchars( json_encode( wc_list_pluck( $variation_attributes, 'get_data' ) ) );
|
||||
?>" data-total="<?php echo $variations_count; ?>" data-total_pages="<?php echo $variations_total_pages; ?>" data-page="1" data-edited="false">
|
||||
echo htmlspecialchars( wp_json_encode( wc_list_pluck( $variation_attributes, 'get_data' ) ) );
|
||||
?>" data-total="<?php echo esc_attr( $variations_count ); ?>" data-total_pages="<?php echo esc_attr( $variations_total_pages ); ?>" data-page="1" data-edited="false">
|
||||
</div>
|
||||
|
||||
<div class="toolbar">
|
||||
<button type="button" class="button-primary save-variation-changes" disabled="disabled"><?php _e( 'Save changes', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button cancel-variation-changes" disabled="disabled"><?php _e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button-primary save-variation-changes" disabled="disabled"><?php esc_html_e( 'Save changes', 'woocommerce' ); ?></button>
|
||||
<button type="button" class="button cancel-variation-changes" disabled="disabled"><?php esc_html_e( 'Cancel', 'woocommerce' ); ?></button>
|
||||
|
||||
<div class="variations-pagenav">
|
||||
<?php /* translators: variations count*/ ?>
|
||||
<span class="displaying-num"><?php printf( _n( '%s item', '%s items', $variations_count, 'woocommerce' ), $variations_count ); ?></span>
|
||||
<span class="expand-close">
|
||||
(<a href="#" class="expand_all"><?php _e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php _e( 'Close', 'woocommerce' ); ?></a>)
|
||||
(<a href="#" class="expand_all"><?php esc_html_e( 'Expand', 'woocommerce' ); ?></a> / <a href="#" class="close_all"><?php esc_html_e( 'Close', 'woocommerce' ); ?></a>)
|
||||
</span>
|
||||
<span class="pagination-links">
|
||||
<a class="first-page disabled" title="<?php esc_attr_e( 'Go to the first page', 'woocommerce' ); ?>" href="#">«</a>
|
||||
<a class="prev-page disabled" title="<?php esc_attr_e( 'Go to the previous page', 'woocommerce' ); ?>" href="#">‹</a>
|
||||
<span class="paging-select">
|
||||
<label for="current-page-selector-1" class="screen-reader-text"><?php _e( 'Select Page', 'woocommerce' ); ?></label>
|
||||
<label for="current-page-selector-1" class="screen-reader-text"><?php esc_html_e( 'Select Page', 'woocommerce' ); ?></label>
|
||||
<select class="page-selector" id="current-page-selector-1" title="<?php esc_attr_e( 'Current page', 'woocommerce' ); ?>">
|
||||
<?php for ( $i = 1; $i <= $variations_total_pages; $i++ ) : ?>
|
||||
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<input type="text" class="input_text" placeholder="<?php esc_attr_e( 'File name', 'woocommerce' ); ?>" name="_wc_file_names[]" value="<?php echo esc_attr( $file['name'] ); ?>" />
|
||||
<input type="hidden" name="_wc_file_hashes[]" value="<?php echo esc_attr( $key ); ?>" />
|
||||
</td>
|
||||
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( "http://", 'woocommerce' ); ?>" name="_wc_file_urls[]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
|
||||
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php echo str_replace( ' ', ' ', __( 'Choose file', 'woocommerce' ) ); ?></a></td>
|
||||
<td width="1%"><a href="#" class="delete"><?php _e( 'Delete', 'woocommerce' ); ?></a></td>
|
||||
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( 'http://', 'woocommerce' ); ?>" name="_wc_file_urls[]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
|
||||
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php echo esc_html__( 'Choose file', 'woocommerce' ); ?></a></td>
|
||||
<td width="1%"><a href="#" class="delete"><?php esc_html_e( 'Delete', 'woocommerce' ); ?></a></td>
|
||||
</tr>
|
||||
|
|
|
@ -5,10 +5,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
<tr>
|
||||
<td class="file_name">
|
||||
<input type="text" class="input_text" placeholder="<?php esc_attr_e( 'File name', 'woocommerce' ); ?>" name="_wc_variation_file_names[<?php echo $variation_id; ?>][]" value="<?php echo esc_attr( $file['name'] ); ?>" />
|
||||
<input type="hidden" name="_wc_variation_file_hashes[<?php echo $variation_id; ?>][]" value="<?php echo esc_attr( $key ); ?>" />
|
||||
<input type="text" class="input_text" placeholder="<?php esc_attr_e( 'File name', 'woocommerce' ); ?>" name="_wc_variation_file_names[<?php echo esc_attr( $variation_id ); ?>][]" value="<?php echo esc_attr( $file['name'] ); ?>" />
|
||||
<input type="hidden" name="_wc_variation_file_hashes[<?php echo esc_attr( $variation_id ); ?>][]" value="<?php echo esc_attr( $key ); ?>" />
|
||||
</td>
|
||||
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( "http://", 'woocommerce' ); ?>" name="_wc_variation_file_urls[<?php echo $variation_id; ?>][]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
|
||||
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php echo str_replace( ' ', ' ', __( 'Choose file', 'woocommerce' ) ); ?></a></td>
|
||||
<td width="1%"><a href="#" class="delete"><?php _e( 'Delete', 'woocommerce' ); ?></a></td>
|
||||
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( 'http://', 'woocommerce' ); ?>" name="_wc_variation_file_urls[<?php echo esc_attr( $variation_id ); ?>][]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
|
||||
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php esc_html_e( 'Choose file', 'woocommerce' ); ?></a></td>
|
||||
<td width="1%"><a href="#" class="delete"><?php esc_html_e( 'Delete', 'woocommerce' ); ?></a></td>
|
||||
</tr>
|
||||
|
|
|
@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
<div class="woocommerce_variation wc-metabox closed">
|
||||
<h3>
|
||||
<a href="#" class="remove_variation delete" rel="<?php echo esc_attr( $variation_id ); ?>"><?php _e( 'Remove', 'woocommerce' ); ?></a>
|
||||
<a href="#" class="remove_variation delete" rel="<?php echo esc_attr( $variation_id ); ?>"><?php esc_html_e( 'Remove', 'woocommerce' ); ?></a>
|
||||
<div class="handlediv" aria-label="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div>
|
||||
<div class="tips sort" data-tip="<?php esc_attr_e( 'Drag and drop, or click to set admin variation order', 'woocommerce' ); ?>"></div>
|
||||
<strong>#<?php echo esc_html( $variation_id ); ?> </strong>
|
||||
|
@ -44,14 +44,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="variable_post_id[<?php echo $loop; ?>]" value="<?php echo esc_attr( $variation_id ); ?>" />
|
||||
<input type="hidden" class="variation_menu_order" name="variation_menu_order[<?php echo $loop; ?>]" value="<?php echo esc_attr( $variation_object->get_menu_order( 'edit' ) ); ?>" />
|
||||
<input type="hidden" name="variable_post_id[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $variation_id ); ?>" />
|
||||
<input type="hidden" class="variation_menu_order" name="variation_menu_order[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $variation_object->get_menu_order( 'edit' ) ); ?>" />
|
||||
</h3>
|
||||
<div class="woocommerce_variable_attributes wc-metabox-content" style="display: none;">
|
||||
<div class="data">
|
||||
<p class="form-row form-row-first upload_image">
|
||||
<a href="#" class="upload_image_button tips <?php echo $variation_object->get_image_id( 'edit' ) ? 'remove' : ''; ?>" data-tip="<?php echo $variation_object->get_image_id( 'edit' ) ? esc_attr__( 'Remove this image', 'woocommerce' ) : esc_attr__( 'Upload an image', 'woocommerce' ); ?>" rel="<?php echo esc_attr( $variation_id ); ?>">
|
||||
<img src="<?php echo $variation_object->get_image_id( 'edit' ) ? esc_url( wp_get_attachment_thumb_url( $variation_object->get_image_id( 'edit' ) ) ) : esc_url( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo $loop; ?>]" class="upload_image_id" value="<?php echo esc_attr( $variation_object->get_image_id( 'edit' ) ); ?>" />
|
||||
<img src="<?php echo $variation_object->get_image_id( 'edit' ) ? esc_url( wp_get_attachment_thumb_url( $variation_object->get_image_id( 'edit' ) ) ) : esc_url( wc_placeholder_img_src() ); ?>" /><input type="hidden" name="upload_image_id[<?php echo esc_attr( $loop ); ?>]" class="upload_image_id" value="<?php echo esc_attr( $variation_object->get_image_id( 'edit' ) ); ?>" />
|
||||
</a>
|
||||
</p>
|
||||
<?php
|
||||
|
@ -70,22 +70,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
<p class="form-row form-row-full options">
|
||||
<label>
|
||||
<?php _e( 'Enabled', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox" name="variable_enabled[<?php echo $loop; ?>]" <?php checked( in_array( $variation_object->get_status( 'edit' ), array( 'publish', false ) ), true ); ?> />
|
||||
<?php esc_html_e( 'Enabled', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox" name="variable_enabled[<?php echo $loop; ?>]" <?php checked( in_array( $variation_object->get_status( 'edit' ), array( 'publish', false ), true ), true ); ?> />
|
||||
</label>
|
||||
<label class="tips" data-tip="<?php _e( 'Enable this option if access is given to a downloadable file upon purchase of a product', 'woocommerce' ); ?>">
|
||||
<?php _e( 'Downloadable', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox variable_is_downloadable" name="variable_is_downloadable[<?php echo $loop; ?>]" <?php checked( $variation_object->get_downloadable( 'edit' ), true ); ?> />
|
||||
<label class="tips" data-tip="<?php esc_html_e( 'Enable this option if access is given to a downloadable file upon purchase of a product', 'woocommerce' ); ?>">
|
||||
<?php esc_html_e( 'Downloadable', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox variable_is_downloadable" name="variable_is_downloadable[<?php echo esc_attr( $loop ); ?>]" <?php checked( $variation_object->get_downloadable( 'edit' ), true ); ?> />
|
||||
</label>
|
||||
<label class="tips" data-tip="<?php _e( 'Enable this option if a product is not shipped or there is no shipping cost', 'woocommerce' ); ?>">
|
||||
<?php _e( 'Virtual', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox variable_is_virtual" name="variable_is_virtual[<?php echo $loop; ?>]" <?php checked( $variation_object->get_virtual( 'edit' ), true ); ?> />
|
||||
<label class="tips" data-tip="<?php esc_html_e( 'Enable this option if a product is not shipped or there is no shipping cost', 'woocommerce' ); ?>">
|
||||
<?php esc_html_e( 'Virtual', 'woocommerce' ); ?>:
|
||||
<input type="checkbox" class="checkbox variable_is_virtual" name="variable_is_virtual[<?php echo esc_attr( $loop ); ?>]" <?php checked( $variation_object->get_virtual( 'edit' ), true ); ?> />
|
||||
</label>
|
||||
|
||||
<?php if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) : ?>
|
||||
<label class="tips" data-tip="<?php _e( 'Enable this option to enable stock management at variation level', 'woocommerce' ); ?>">
|
||||
<?php _e( 'Manage stock?', 'woocommerce' ); ?>
|
||||
<input type="checkbox" class="checkbox variable_manage_stock" name="variable_manage_stock[<?php echo $loop; ?>]" <?php checked( $variation_object->get_manage_stock( 'edit' ), true ); ?> />
|
||||
<label class="tips" data-tip="<?php esc_html_e( 'Enable this option to enable stock management at variation level', 'woocommerce' ); ?>">
|
||||
<?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?>
|
||||
<input type="checkbox" class="checkbox variable_manage_stock" name="variable_manage_stock[<?php echo esc_attr( $loop ); ?>]" <?php checked( $variation_object->get_manage_stock( 'edit' ), true ); ?> />
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -94,8 +94,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="variable_pricing">
|
||||
<?php
|
||||
/* translators: %s: currency symbol */
|
||||
$label = sprintf(
|
||||
/* translators: %s: currency symbol */
|
||||
__( 'Regular price (%s)', 'woocommerce' ),
|
||||
get_woocommerce_currency_symbol()
|
||||
);
|
||||
|
@ -109,9 +109,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
'wrapper_class' => 'form-row form-row-first',
|
||||
'placeholder' => __( 'Variation price (required)', 'woocommerce' ),
|
||||
) );
|
||||
|
||||
/* translators: %s: currency symbol */
|
||||
|
||||
$label = sprintf(
|
||||
/* translators: %s: currency symbol */
|
||||
__( 'Sale price (%s)', 'woocommerce' ),
|
||||
get_woocommerce_currency_symbol()
|
||||
);
|
||||
|
@ -121,7 +121,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
'name' => "variable_sale_price[{$loop}]",
|
||||
'value' => wc_format_localized_price( $variation_object->get_sale_price( 'edit' ) ),
|
||||
'data_type' => 'price',
|
||||
'label' => $label . ' <a href="#" class="sale_schedule">' . __( 'Schedule', 'woocommerce' ) . '</a><a href="#" class="cancel_sale_schedule hidden">' . __( 'Cancel schedule', 'woocommerce' ) . '</a>',
|
||||
'label' => $label . ' <a href="#" class="sale_schedule">' . esc_html__( 'Schedule', 'woocommerce' ) . '</a><a href="#" class="cancel_sale_schedule hidden">' . esc_html__( 'Cancel schedule', 'woocommerce' ) . '</a>',
|
||||
'wrapper_class' => 'form-row form-row-last',
|
||||
) );
|
||||
|
||||
|
@ -135,7 +135,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</p>
|
||||
<p class="form-row form-row-last">
|
||||
<label>' . __( 'Sale end date', 'woocommerce' ) . '</label>
|
||||
<input type="text" class="sale_price_dates_to" name="variable_sale_price_dates_to[' . $loop . ']" value="' . esc_attr( $sale_price_dates_to ) . '" placeholder="' . _x( 'To…', 'placeholder', 'woocommerce' ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
<input type="text" class="sale_price_dates_to" name="variable_sale_price_dates_to[' . esc_attr( $loop ) . ']" value="' . esc_attr( $sale_price_dates_to ) . '" placeholder="' . esc_html_x( 'To…', 'placeholder', 'woocommerce' ) . ' YYYY-MM-DD" maxlength="10" pattern="' . esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ) . '" />
|
||||
</p>
|
||||
</div>';
|
||||
|
||||
|
@ -170,7 +170,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
'wrapper_class' => 'form-row form-row-first',
|
||||
) );
|
||||
|
||||
echo '<input type="hidden" name="variable_original_stock[' . $loop . ']" value="' . esc_attr( wc_stock_amount( $variation_object->get_stock_quantity( 'edit' ) ) ) . '" />';
|
||||
echo '<input type="hidden" name="variable_original_stock[' . esc_attr( $loop ) . ']" value="' . esc_attr( wc_stock_amount( $variation_object->get_stock_quantity( 'edit' ) ) ) . '" />';
|
||||
|
||||
woocommerce_wp_select( array(
|
||||
'id' => "variable_backorders{$loop}",
|
||||
|
@ -211,8 +211,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
) );
|
||||
|
||||
if ( wc_product_weight_enabled() ) {
|
||||
/* translators: %s: weight unit */
|
||||
$label = sprintf(
|
||||
/* translators: %s: weight unit */
|
||||
__( 'Weight (%s)', 'woocommerce' ),
|
||||
esc_html( get_option( 'woocommerce_weight_unit' ) )
|
||||
);
|
||||
|
@ -238,17 +238,17 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
?><p class="form-field form-row dimensions_field hide_if_variation_virtual form-row-last">
|
||||
<label for="product_length"><?php
|
||||
/* translators: %s: dimension unit */
|
||||
printf(
|
||||
__( 'Dimensions (L×W×H) (%s)', 'woocommerce' ),
|
||||
/* translators: %s: dimension unit */
|
||||
esc_html__( 'Dimensions (L×W×H) (%s)', 'woocommerce' ),
|
||||
get_option( 'woocommerce_dimension_unit' )
|
||||
);
|
||||
?></label>
|
||||
<?php echo wc_help_tip( __( 'Length x width x height in decimal form', 'woocommerce' ) ); ?>
|
||||
<span class="wrap">
|
||||
<input id="product_length" placeholder="<?php echo $parent_length ? esc_attr( $parent_length ) : esc_attr__( 'Length', 'woocommerce' ); ?>" class="input-text wc_input_decimal" size="6" type="text" name="variable_length[<?php echo $loop; ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_length( 'edit' ) ) ); ?>" />
|
||||
<input placeholder="<?php echo $parent_width ? esc_attr( $parent_width ) : esc_attr__( 'Width', 'woocommerce' ); ?>" class="input-text wc_input_decimal" size="6" type="text" name="variable_width[<?php echo $loop; ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_width( 'edit' ) ) ); ?>" />
|
||||
<input placeholder="<?php echo $parent_height ? esc_attr( $parent_height ) : esc_attr__( 'Height', 'woocommerce' ); ?>" class="input-text wc_input_decimal last" size="6" type="text" name="variable_height[<?php echo $loop; ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_height( 'edit' ) ) ); ?>" />
|
||||
<input id="product_length" placeholder="<?php echo $parent_length ? esc_attr( $parent_length ) : esc_attr__( 'Length', 'woocommerce' ); ?>" class="input-text wc_input_decimal" size="6" type="text" name="variable_length[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_length( 'edit' ) ) ); ?>" />
|
||||
<input placeholder="<?php echo $parent_width ? esc_attr( $parent_width ) : esc_attr__( 'Width', 'woocommerce' ); ?>" class="input-text wc_input_decimal" size="6" type="text" name="variable_width[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_width( 'edit' ) ) ); ?>" />
|
||||
<input placeholder="<?php echo $parent_height ? esc_attr( $parent_height ) : esc_attr__( 'Height', 'woocommerce' ); ?>" class="input-text wc_input_decimal last" size="6" type="text" name="variable_height[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( wc_format_localized_decimal( $variation_object->get_height( 'edit' ) ) ); ?>" />
|
||||
</span>
|
||||
</p><?php
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<p class="form-row hide_if_variation_virtual form-row-full"><label><?php _e( 'Shipping class', 'woocommerce' ); ?></label> <?php
|
||||
<p class="form-row hide_if_variation_virtual form-row-full"><label><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></label> <?php
|
||||
wp_dropdown_categories( array(
|
||||
'taxonomy' => 'product_shipping_class',
|
||||
'hide_empty' => 0,
|
||||
|
@ -319,12 +319,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</div>
|
||||
<div class="show_if_variation_downloadable" style="display: none;">
|
||||
<div class="form-row form-row-full downloadable_files">
|
||||
<label><?php _e( 'Downloadable files', 'woocommerce' ); ?></label>
|
||||
<label><?php esc_html_e( 'Downloadable files', 'woocommerce' ); ?></label>
|
||||
<table class="widefat">
|
||||
<thead>
|
||||
<div>
|
||||
<th><?php _e( 'Name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the name of the download shown to the customer.', 'woocommerce' ) ); ?></th>
|
||||
<th colspan="2"><?php _e( 'File URL', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce' ) ); ?></th>
|
||||
<th><?php esc_html_e( 'Name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the name of the download shown to the customer.', 'woocommerce' ) ); ?></th>
|
||||
<th colspan="2"><?php esc_html_e( 'File URL', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce' ) ); ?></th>
|
||||
<th> </th>
|
||||
</div>
|
||||
</thead>
|
||||
|
@ -349,7 +349,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
ob_start();
|
||||
include( 'html-product-variation-download.php' );
|
||||
echo esc_attr( ob_get_clean() );
|
||||
?>"><?php _e( 'Add file', 'woocommerce' ); ?></a>
|
||||
?>"><?php esc_html_e( 'Add file', 'woocommerce' ); ?></a>
|
||||
</th>
|
||||
</div>
|
||||
</tfoot>
|
||||
|
|
|
@ -658,8 +658,12 @@ class WC_Admin_Report {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ! isset( $_GET['wc_reports_nonce'] ) || ! wp_verify_nonce( $_GET['wc_reports_nonce'], 'custom_range' ) ) {
|
||||
wp_safe_redirect( remove_query_arg( array( 'start_date', 'end_date', 'range', 'wc_reports_nonce' ) ) );
|
||||
if ( ! isset( $_GET['wc_reports_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['wc_reports_nonce'] ), 'custom_range' ) ) { // WPCS: input var ok, CSRF ok.
|
||||
wp_die(
|
||||
/* translators: %1$s: open link, %2$s: close link */
|
||||
sprintf( esc_html__( 'This report link has expired. %1$sClick here to view the filtered report%2$s.', 'woocommerce' ), '<a href="' . esc_url( wp_nonce_url( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'custom_range', 'wc_reports_nonce' ) ) . '">', '</a>' ), // @codingStandardsIgnoreLine.
|
||||
esc_attr__( 'Confirm navigation', 'woocommerce' )
|
||||
);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ class WC_Report_Customer_List extends WP_List_Table {
|
|||
|
||||
break;
|
||||
|
||||
case 'user_actions' :
|
||||
case 'wc_actions' :
|
||||
ob_start();
|
||||
?><p>
|
||||
<?php
|
||||
|
@ -210,7 +210,7 @@ class WC_Report_Customer_List extends WP_List_Table {
|
|||
'orders' => __( 'Orders', 'woocommerce' ),
|
||||
'spent' => __( 'Money spent', 'woocommerce' ),
|
||||
'last_order' => __( 'Last order', 'woocommerce' ),
|
||||
'user_actions' => __( 'Actions', 'woocommerce' ),
|
||||
'wc_actions' => __( 'Actions', 'woocommerce' ),
|
||||
);
|
||||
|
||||
return $columns;
|
||||
|
|
|
@ -0,0 +1,324 @@
|
|||
<?php
|
||||
/**
|
||||
* Download report.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin/Reports
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_List_Table' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Report_Downloads.
|
||||
*/
|
||||
class WC_Report_Downloads extends WP_List_Table {
|
||||
|
||||
/**
|
||||
* Max items.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $max_items;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
parent::__construct( array(
|
||||
'singular' => 'download',
|
||||
'plural' => 'downloads',
|
||||
'ajax' => false,
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't need this.
|
||||
*
|
||||
* @param string $position Top or bottom.
|
||||
*/
|
||||
public function display_tablenav( $position ) {
|
||||
if ( 'top' !== $position ) {
|
||||
parent::display_tablenav( $position );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the report.
|
||||
*/
|
||||
public function output_report() {
|
||||
|
||||
$this->prepare_items();
|
||||
|
||||
// Subtitle for permission if set.
|
||||
if ( ! empty( $_GET['permission_id'] ) ) { // WPCS: input var ok.
|
||||
$permission_id = absint( $_GET['permission_id'] ); // WPCS: input var ok.
|
||||
|
||||
// Load the permission, order, etc. so we can render more information.
|
||||
$permission = null;
|
||||
$product = null;
|
||||
|
||||
try {
|
||||
$permission = new WC_Customer_Download( $permission_id );
|
||||
$product = wc_get_product( $permission->product_id );
|
||||
} catch ( Exception $e ) {
|
||||
wp_die( sprintf( esc_html__( 'Permission #%d not found.', 'woocommerce' ), esc_html( $permission_id ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
echo '<h1>' . esc_html__( 'Customer downloads', 'woocommerce' );
|
||||
|
||||
$filters = $this->get_filter_vars();
|
||||
$filter_list = array();
|
||||
$filter_names = array(
|
||||
'product_id' => __( 'Product', 'woocommerce' ),
|
||||
'download_id' => __( 'File ID', 'woocommerce' ),
|
||||
'permission_id' => __( 'Permission ID', 'woocommerce' ),
|
||||
'order_id' => __( 'Order', 'woocommerce' ),
|
||||
'user_id' => __( 'User', 'woocommerce' ),
|
||||
'user_ip_address' => __( 'IP address', 'woocommerce' ),
|
||||
);
|
||||
|
||||
foreach ( $filters as $key => $value ) {
|
||||
if ( is_null( $value ) ) {
|
||||
continue;
|
||||
}
|
||||
switch ( $key ) {
|
||||
case 'order_id' :
|
||||
$order = wc_get_order( $value );
|
||||
if ( $order ) {
|
||||
$display_value = _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number();
|
||||
} else {
|
||||
break 2;
|
||||
}
|
||||
break;
|
||||
case 'product_id' :
|
||||
$product = wc_get_product( $value );
|
||||
if ( $product ) {
|
||||
$display_value = $product->get_formatted_name();
|
||||
} else {
|
||||
break 2;
|
||||
}
|
||||
break;
|
||||
default :
|
||||
$display_value = $value;
|
||||
break;
|
||||
}
|
||||
$filter_list[] = $filter_names[ $key ] . ' ' . $display_value . ' <a href="' . esc_url( remove_query_arg( $key ) ) . '" class="woocommerce-reports-remove-filter">×</a>';
|
||||
}
|
||||
|
||||
echo $filter_list ? ' - ' . wp_kses_post( implode( ', ', $filter_list ) ) : '';
|
||||
echo '</h1>';
|
||||
|
||||
echo '<div id="poststuff" class="woocommerce-reports-wide">';
|
||||
$this->display();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get column value.
|
||||
*
|
||||
* @param mixed $item Item being displayed.
|
||||
* @param string $column_name Column name.
|
||||
*/
|
||||
public function column_default( $item, $column_name ) {
|
||||
$permission = null;
|
||||
$product = null;
|
||||
try {
|
||||
$permission = new WC_Customer_Download( $item->permission_id );
|
||||
$product = wc_get_product( $permission->product_id );
|
||||
} catch ( Exception $e ) {
|
||||
// Ok to continue rendering other information even if permission and/or product is not found.
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( $column_name ) {
|
||||
case 'timestamp' :
|
||||
echo esc_html( $item->timestamp );
|
||||
break;
|
||||
case 'product' :
|
||||
if ( ! empty( $product ) ) {
|
||||
edit_post_link( esc_html( $product->get_formatted_name() ), '', '', $product->get_id(), 'view-link' );
|
||||
|
||||
echo '<div class="row-actions">';
|
||||
echo '<a href="' . esc_url( add_query_arg( 'product_id', $product->get_id() ) ) . '">' . esc_html__( 'Filter by product', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
case 'file' :
|
||||
if ( ! empty( $permission ) && ! empty( $product ) ) {
|
||||
// File information.
|
||||
$file = $product->get_file( $permission->get_download_id() );
|
||||
|
||||
echo esc_html( $file->get_name() . ' - ' . basename( $file->get_file() ) );
|
||||
|
||||
echo '<div class="row-actions">';
|
||||
echo '<a href="' . esc_url( add_query_arg( 'download_id', $permission->get_download_id() ) ) . '">' . esc_html__( 'Filter by file', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
case 'order' :
|
||||
if ( ! empty( $permission ) && ( $order = wc_get_order( $permission->order_id ) ) ) {
|
||||
edit_post_link( esc_html( _x( '#', 'hash before order number', 'woocommerce' ) . $order->get_order_number() ), '', '', $permission->order_id, 'view-link' );
|
||||
|
||||
echo '<div class="row-actions">';
|
||||
echo '<a href="' . esc_url( add_query_arg( 'order_id', $order->get_id() ) ) . '">' . esc_html__( 'Filter by order', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
case 'user' :
|
||||
if ( $item->user_id > 0 ) {
|
||||
$user = get_user_by( 'id', $item->user_id );
|
||||
|
||||
if ( ! empty( $user ) ) {
|
||||
echo '<a href="' . esc_url( get_edit_user_link( $item->user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>';
|
||||
echo '<div class="row-actions">';
|
||||
echo '<a href="' . esc_url( add_query_arg( 'user_id', $item->user_id ) ) . '">' . esc_html__( 'Filter by user', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
}
|
||||
} else {
|
||||
esc_html_e( 'Guest', 'woocommerce' );
|
||||
}
|
||||
break;
|
||||
case 'user_ip_address' :
|
||||
echo esc_html( $item->user_ip_address );
|
||||
|
||||
echo '<div class="row-actions">';
|
||||
echo '<a href="' . esc_url( add_query_arg( 'user_ip_address', $item->user_ip_address ) ) . '">' . esc_html__( 'Filter by IP address', 'woocommerce' ) . '</a>';
|
||||
echo '</div>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_columns() {
|
||||
$columns = array(
|
||||
'timestamp' => __( 'Timestamp', 'woocommerce' ),
|
||||
'product' => __( 'Product', 'woocommerce' ),
|
||||
'file' => __( 'File', 'woocommerce' ),
|
||||
'order' => __( 'Order', 'woocommerce' ),
|
||||
'user' => __( 'User', 'woocommerce' ),
|
||||
'user_ip_address' => __( 'IP address', 'woocommerce' ),
|
||||
);
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare download list items.
|
||||
*/
|
||||
public function prepare_items() {
|
||||
|
||||
$this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );
|
||||
$current_page = absint( $this->get_pagenum() );
|
||||
// Allow filtering per_page value, but ensure it's at least 1.
|
||||
$per_page = max( 1, apply_filters( 'woocommerce_admin_downloads_report_downloads_per_page', 20 ) );
|
||||
|
||||
$this->get_items( $current_page, $per_page );
|
||||
|
||||
/**
|
||||
* Pagination.
|
||||
*/
|
||||
$this->set_pagination_args( array(
|
||||
'total_items' => $this->max_items,
|
||||
'per_page' => $per_page,
|
||||
'total_pages' => ceil( $this->max_items / $per_page ),
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* No items found text.
|
||||
*/
|
||||
public function no_items() {
|
||||
esc_html_e( 'No customer downloads found.', 'woocommerce' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filters from querystring.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
protected function get_filter_vars() {
|
||||
$product_id = ! empty( $_GET['product_id'] ) ? absint( wp_unslash( $_GET['product_id'] ) ) : null; // WPCS: input var ok.
|
||||
$download_id = ! empty( $_GET['download_id'] ) ? wc_clean( wp_unslash( $_GET['download_id'] ) ) : null; // WPCS: input var ok.
|
||||
$permission_id = ! empty( $_GET['permission_id'] ) ? absint( wp_unslash( $_GET['permission_id'] ) ) : null; // WPCS: input var ok.
|
||||
$order_id = ! empty( $_GET['order_id'] ) ? absint( wp_unslash( $_GET['order_id'] ) ) : null; // WPCS: input var ok.
|
||||
$user_id = ! empty( $_GET['user_id'] ) ? absint( wp_unslash( $_GET['user_id'] ) ) : null; // WPCS: input var ok.
|
||||
$user_ip_address = ! empty( $_GET['user_ip_address'] ) ? wc_clean( wp_unslash( $_GET['user_ip_address'] ) ): null; // WPCS: input var ok.
|
||||
|
||||
return (object) array(
|
||||
'product_id' => $product_id,
|
||||
'download_id' => $download_id,
|
||||
'permission_id' => $permission_id,
|
||||
'order_id' => $order_id,
|
||||
'user_id' => $user_id,
|
||||
'user_ip_address' => $user_ip_address,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get downloads matching criteria.
|
||||
*
|
||||
* @param int $current_page Current viewed page.
|
||||
* @param int $per_page How many results to show per page.
|
||||
*/
|
||||
public function get_items( $current_page, $per_page ) {
|
||||
global $wpdb;
|
||||
|
||||
$this->max_items = 0;
|
||||
$this->items = array();
|
||||
$filters = $this->get_filter_vars();
|
||||
|
||||
// Get downloads from database.
|
||||
$table = $wpdb->prefix . WC_Customer_Download_Log_Data_Store::get_table_name();
|
||||
$query_from = " FROM {$table} as downloads ";
|
||||
|
||||
if ( ! is_null( $filters->product_id ) || ! is_null( $filters->download_id ) || ! is_null( $filters->order_id ) ) {
|
||||
$query_from .= " LEFT JOIN {$wpdb->prefix}woocommerce_downloadable_product_permissions as permissions on downloads.permission_id = permissions.permission_id ";
|
||||
}
|
||||
|
||||
$query_from .= ' WHERE 1=1 ';
|
||||
|
||||
if ( ! is_null( $filters->product_id ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND product_id = %d ', $filters->product_id );
|
||||
}
|
||||
|
||||
if ( ! is_null( $filters->download_id ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND download_id = %s ', $filters->download_id );
|
||||
}
|
||||
|
||||
if ( ! is_null( $filters->order_id ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND order_id = %d ', $filters->order_id );
|
||||
}
|
||||
|
||||
if ( ! is_null( $filters->permission_id ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND downloads.permission_id = %d ', $filters->permission_id );
|
||||
}
|
||||
|
||||
if ( ! is_null( $filters->user_id ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND downloads.user_id = %d ', $filters->user_id );
|
||||
}
|
||||
|
||||
if ( ! is_null( $filters->user_ip_address ) ) {
|
||||
$query_from .= $wpdb->prepare( ' AND user_ip_address = %s ', $filters->user_ip_address );
|
||||
}
|
||||
|
||||
$query_from = apply_filters( 'woocommerce_report_downloads_query_from', $query_from );
|
||||
$query_order = $wpdb->prepare( 'ORDER BY timestamp DESC LIMIT %d, %d;', ( $current_page - 1 ) * $per_page, $per_page );
|
||||
|
||||
$this->items = $wpdb->get_results( "SELECT * {$query_from} {$query_order}" ); // WPCS: cache ok, db call ok, unprepared SQL ok.
|
||||
$this->max_items = $wpdb->get_var( "SELECT COUNT( DISTINCT download_log_id ) {$query_from};" ); // WPCS: cache ok, db call ok, unprepared SQL ok.
|
||||
}
|
||||
}
|
|
@ -108,7 +108,9 @@ class WC_Report_Stock extends WP_List_Table {
|
|||
break;
|
||||
|
||||
case 'stock_status' :
|
||||
if ( $product->is_in_stock() ) {
|
||||
if ( $product->is_on_backorder() ) {
|
||||
$stock_html = '<mark class="onbackorder">' . __( 'On backorder', 'woocommerce' ) . '</mark>';
|
||||
} elseif ( $product->is_in_stock() ) {
|
||||
$stock_html = '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
|
||||
} else {
|
||||
$stock_html = '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
|
||||
|
|
|
@ -308,6 +308,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php do_action( 'woocommerce_product_bulk_edit_end' ); ?>
|
||||
|
||||
<input type="hidden" name="woocommerce_bulk_edit" value="1" />
|
||||
<input type="hidden" name="woocommerce_bulk_edit_nonce" value="<?php echo wp_create_nonce( 'woocommerce_bulk_edit_nonce' ); ?>" />
|
||||
<input type="hidden" name="woocommerce_quick_edit_nonce" value="<?php echo wp_create_nonce( 'woocommerce_quick_edit_nonce' ); ?>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
|
@ -12,14 +12,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<fieldset class="inline-edit-col-left">
|
||||
<div id="woocommerce-fields" class="inline-edit-col">
|
||||
|
||||
<h4><?php _e( 'Product data', 'woocommerce' ); ?></h4>
|
||||
<h4><?php esc_html_e( 'Product data', 'woocommerce' ); ?></h4>
|
||||
|
||||
<?php do_action( 'woocommerce_product_quick_edit_start' ); ?>
|
||||
|
||||
<?php if ( wc_product_sku_enabled() ) : ?>
|
||||
|
||||
<label>
|
||||
<span class="title"><?php _e( 'SKU', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'SKU', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_sku" class="text sku" value="">
|
||||
</span>
|
||||
|
@ -30,14 +30,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<div class="price_fields">
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Price', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Price', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_regular_price" class="text wc_input_price regular_price" placeholder="<?php esc_attr_e( 'Regular price', 'woocommerce' ); ?>" value="">
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Sale', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Sale', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_sale_price" class="text wc_input_price sale_price" placeholder="<?php esc_attr_e( 'Sale price', 'woocommerce' ); ?>" value="">
|
||||
</span>
|
||||
|
@ -47,7 +47,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<?php if ( wc_tax_enabled() ) : ?>
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Tax status', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Tax status', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_status" name="_tax_status">
|
||||
<?php
|
||||
|
@ -57,7 +57,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
|
||||
);
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -65,7 +65,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</label>
|
||||
<br class="clear" />
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Tax class', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Tax class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="tax_class" name="_tax_class">
|
||||
<?php
|
||||
|
@ -96,7 +96,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<?php if ( wc_product_weight_enabled() ) : ?>
|
||||
<label>
|
||||
<span class="title"><?php _e( 'Weight', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Weight', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_weight" class="text weight" placeholder="<?php echo wc_format_localized_decimal( 0 ); ?>" value="">
|
||||
</span>
|
||||
|
@ -107,7 +107,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<?php if ( wc_product_dimensions_enabled() ) : ?>
|
||||
<div class="inline-edit-group dimensions">
|
||||
<div>
|
||||
<span class="title"><?php _e( 'L/W/H', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'L/W/H', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="text" name="_length" class="text wc_input_decimal length" placeholder="<?php esc_attr_e( 'Length', 'woocommerce' ); ?>" value="">
|
||||
<input type="text" name="_width" class="text wc_input_decimal width" placeholder="<?php esc_attr_e( 'Width', 'woocommerce' ); ?>" value="">
|
||||
|
@ -120,51 +120,61 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Shipping class', 'woocommerce' ); ?></span>
|
||||
<div class="inline-edit-group">
|
||||
<span class="title"><?php esc_html_e( 'Shipping class', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="shipping_class" name="_shipping_class">
|
||||
<option value="_no_shipping_class"><?php _e( 'No shipping class', 'woocommerce' ); ?></option>
|
||||
<option value="_no_shipping_class"><?php esc_html_e( 'No shipping class', 'woocommerce' ); ?></option>
|
||||
<?php
|
||||
foreach ( $shipping_class as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $value->slug ) . '">' . $value->name . '</option>';
|
||||
echo '<option value="' . esc_attr( $value->slug ) . '">' . esc_html( $value->name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Visibility', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="visibility" name="_visibility">
|
||||
<?php
|
||||
$options = apply_filters( 'woocommerce_product_visibility_options', array(
|
||||
'visible' => __( 'Catalog & search', 'woocommerce' ),
|
||||
'catalog' => __( 'Catalog', 'woocommerce' ),
|
||||
'search' => __( 'Search', 'woocommerce' ),
|
||||
'hidden' => __( 'Hidden', 'woocommerce' ),
|
||||
) );
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="alignleft featured">
|
||||
<input type="checkbox" name="_featured" value="1">
|
||||
<span class="checkbox-title"><?php _e( 'Featured', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'In stock?', 'woocommerce' ); ?></span>
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php esc_html_e( 'Visibility', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="visibility" name="_visibility">
|
||||
<?php
|
||||
$options = apply_filters( 'woocommerce_product_visibility_options', array(
|
||||
'visible' => __( 'Catalog & search', 'woocommerce' ),
|
||||
'catalog' => __( 'Catalog', 'woocommerce' ),
|
||||
'search' => __( 'Search', 'woocommerce' ),
|
||||
'hidden' => __( 'Hidden', 'woocommerce' ),
|
||||
) );
|
||||
foreach ( $options as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</label>
|
||||
<label class="alignleft featured">
|
||||
<input type="checkbox" name="_featured" value="1">
|
||||
<span class="checkbox-title"><?php esc_html_e( 'Featured', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if ( get_option( 'woocommerce_manage_stock' ) == 'yes' ) : ?>
|
||||
<div class="inline-edit-group">
|
||||
<label class="manage_stock">
|
||||
<input type="checkbox" name="_manage_stock" value="1">
|
||||
<span class="checkbox-title"><?php esc_html_e( 'Manage stock?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<label class="stock_status_field">
|
||||
<span class="title"><?php esc_html_e( 'In stock?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="stock_status" name="_stock_status">
|
||||
<?php
|
||||
foreach ( wc_get_product_stock_status_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -172,30 +182,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
</label>
|
||||
|
||||
<div class="stock_fields">
|
||||
|
||||
<?php if ( get_option( 'woocommerce_manage_stock' ) == 'yes' ) : ?>
|
||||
<label class="alignleft manage_stock">
|
||||
<input type="checkbox" name="_manage_stock" value="1">
|
||||
<span class="checkbox-title"><?php _e( 'Manage stock?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
<br class="clear" />
|
||||
<label class="stock_qty_field">
|
||||
<span class="title"><?php _e( 'Stock qty', 'woocommerce' ); ?></span>
|
||||
<span class="title"><?php esc_html_e( 'Stock qty', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<input type="number" name="_stock" class="text stock" step="any" value="">
|
||||
</span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<label class="alignleft">
|
||||
<span class="title"><?php _e( 'Backorders?', 'woocommerce' ); ?></span>
|
||||
<label class="alignleft backorder_field">
|
||||
<span class="title"><?php esc_html_e( 'Backorders?', 'woocommerce' ); ?></span>
|
||||
<span class="input-text-wrap">
|
||||
<select class="backorders" name="_backorders">
|
||||
<?php
|
||||
foreach ( wc_get_product_backorder_options() as $key => $value ) {
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
|
||||
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
|
|
@ -309,3 +309,24 @@ function wc_save_order_items( $order_id, $items ) {
|
|||
// Inform other plugins that the items have been saved
|
||||
do_action( 'woocommerce_saved_order_items', $order_id, $items );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HTML for some action buttons. Used in list tables.
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @param array $actions Actions to output.
|
||||
* @return string
|
||||
*/
|
||||
function wc_render_action_buttons( $actions ) {
|
||||
$actions_html = '';
|
||||
|
||||
foreach ( $actions as $action ) {
|
||||
if ( isset( $action['group'] ) ) {
|
||||
$actions_html .= '<div class="wc-action-button-group"><label>' . $action['group'] . '</label> <span class="wc-action-button-group__items">' . wc_render_action_buttons( $action['actions'] ) . '</span></div>';
|
||||
} elseif ( isset( $action['action'], $action['url'], $action['name'] ) ) {
|
||||
$actions_html .= sprintf( '<a class="button wc-action-button wc-action-button-%s %s" href="%s" title="%s">%s</a>', esc_attr( $action['action'] ), esc_attr( $action['action'] ), esc_url( $action['url'] ), esc_attr( $action['name'] ), esc_attr( $action['name'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $actions_html;
|
||||
}
|
||||
|
|
|
@ -507,7 +507,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
|
|||
),
|
||||
'value' => array(
|
||||
'description' => __( 'Meta value.', 'woocommerce' ),
|
||||
'type' => 'string',
|
||||
'type' => 'mixed',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue