This commit is contained in:
Nicola Mustone 2015-02-19 09:59:14 +01:00
parent 2dbfadd9fa
commit 9493c5a7b1
82 changed files with 1379 additions and 1346 deletions

View File

@ -1,17 +1,28 @@
filter:
excluded_paths:
- tests/*
- apigen/*
- includes/api/v1/*
- includes/libraries/*
- includes/updates/*
- includes/gateways/simplify-commerce/includes/*
- tests/*
- apigen/*
- dummy-data/*
- i18n/*
- includes/api/v1/*
- includes/libraries/*
- includes/updates/*
- includes/gateways/simplify-commerce/includes/*
checks:
php:
code_rating: true
duplication: true
variable_existence: false
verify_access_scope_valid: false
verify_argument_usable_as_reference: false
verify_property_names: false
no_global_keyword: false
psr2_switch_declaration: false
psr2_control_structure_declaration: false
psr2_class_declaration: false
one_class_per_file: false
no_exit: false
avoid_superglobals: false
avoid_closing_tag: false
tools:
external_code_coverage:
timeout: 600
sensiolabs_security_checker: true

View File

@ -12,7 +12,6 @@ env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=4.1 WP_MULTISITE=0
- WP_VERSION=4.0 WP_MULTISITE=0
- WP_VERSION=3.9.2 WP_MULTISITE=0
matrix:
include:

File diff suppressed because one or more lines are too long

View File

@ -3642,6 +3642,11 @@ img.ui-datepicker-trigger {
font-weight: normal;
display: block;
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
del {
color: #e74c3c;
font-weight: normal;
}
}
&:hover {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@ jQuery( function( $ ) {
$( 'body' ).bind( 'init_checkout', this.init_checkout );
// Payment methods
this.$order_review.on( 'click', '.payment_methods input.input-radio', this.payment_method_selected );
this.$order_review.on( 'click', 'input[name=payment_method]', this.payment_method_selected );
// Form submission
this.$checkout_form.on( 'submit', this.submit );
@ -37,7 +37,7 @@ jQuery( function( $ ) {
this.$checkout_form.on( 'change', '#ship-to-different-address input', this.ship_to_different_address );
// Trigger events
this.$order_review.find( 'input[name=payment_method]:checked' ).triggerHandler( 'click' );
this.$order_review.find( 'input[name=payment_method]:checked' ).trigger( 'click' );
this.$checkout_form.find( '#ship-to-different-address input' ).change();
// Update on page load
@ -161,11 +161,20 @@ jQuery( function( $ ) {
$parent.removeClass( 'woocommerce-invalid woocommerce-invalid-required-field' ).addClass( 'woocommerce-validated' );
}
},
update_checkout: function() {
update_checkout: function() {
// Small timeout to prevent multiple requests when several fields update at the same time
wc_checkout_form.reset_update_checkout_timer();
wc_checkout_form.updateTimer = setTimeout( wc_checkout_form.update_checkout_action, '5' );
},
update_checkout_action: function() {
if ( wc_checkout_form.xhr ) {
wc_checkout_form.xhr.abort();
}
if ( $( 'form.checkout' ).size() === 0 ) {
return;
}
var shipping_methods = [];
$( 'select.shipping_method, input[name^=shipping_method][type=radio]:checked, input[name^=shipping_method][type=hidden]' ).each( function( index, input ) {
@ -273,7 +282,7 @@ jQuery( function( $ ) {
}
// Trigger click e on selected payment method
$( '.woocommerce-checkout' ).find( 'input[name=payment_method]:checked' ).triggerHandler( 'click' );
$( '.woocommerce-checkout' ).find( 'input[name=payment_method]:checked' ).trigger( 'click' );
// Fire updated_checkout e
$( 'body' ).trigger( 'updated_checkout' );

File diff suppressed because one or more lines are too long

View File

@ -2,9 +2,9 @@
# This file is distributed under the same license as the WooCommerce package.
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce 2.3.3 Admin\n"
"Project-Id-Version: WooCommerce 2.3.4 Admin\n"
"Report-Msgid-Bugs-To: https://github.com/woothemes/woocommerce/issues\n"
"POT-Creation-Date: 2015-02-12 16:44:41+00:00\n"
"POT-Creation-Date: 2015-02-17 16:43:18+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -145,7 +145,7 @@ msgstr ""
#: includes/admin/meta-boxes/views/html-variation-admin.php:196
#: includes/admin/settings/class-wc-settings-shipping.php:204
#: includes/admin/settings/views/html-webhooks-edit.php:15
#: includes/admin/views/html-admin-page-status-report.php:530
#: includes/admin/views/html-admin-page-status-report.php:552
msgid "Name"
msgstr ""
@ -434,47 +434,47 @@ msgstr ""
msgid "WooCommerce Status"
msgstr ""
#: includes/admin/class-wc-admin-dashboard.php:134
#: includes/admin/class-wc-admin-dashboard.php:135
msgid "<strong>%s</strong> sales this month"
msgstr ""
#: includes/admin/class-wc-admin-dashboard.php:141
#: includes/admin/class-wc-admin-dashboard.php:142
msgid "%s top seller this month (sold %d)"
msgstr ""
#: includes/admin/class-wc-admin-dashboard.php:147
#: includes/admin/class-wc-admin-dashboard.php:148
msgid "<strong>%s order</strong> awaiting processing"
msgid_plural "<strong>%s orders</strong> awaiting processing"
msgstr[0] ""
msgstr[1] ""
#: includes/admin/class-wc-admin-dashboard.php:152
#: includes/admin/class-wc-admin-dashboard.php:153
msgid "<strong>%s order</strong> on-hold"
msgid_plural "<strong>%s orders</strong> on-hold"
msgstr[0] ""
msgstr[1] ""
#: includes/admin/class-wc-admin-dashboard.php:157
#: includes/admin/class-wc-admin-dashboard.php:158
msgid "<strong>%s product</strong> low in stock"
msgid_plural "<strong>%s products</strong> low in stock"
msgstr[0] ""
msgstr[1] ""
#: includes/admin/class-wc-admin-dashboard.php:162
#: includes/admin/class-wc-admin-dashboard.php:163
msgid "<strong>%s product</strong> out of stock"
msgid_plural "<strong>%s products</strong> out of stock"
msgstr[0] ""
msgstr[1] ""
#: includes/admin/class-wc-admin-dashboard.php:195
#: includes/admin/class-wc-admin-dashboard.php:196
msgid "out of 5"
msgstr ""
#: includes/admin/class-wc-admin-dashboard.php:197
#: includes/admin/class-wc-admin-dashboard.php:198
msgid "reviewed by"
msgstr ""
#: includes/admin/class-wc-admin-dashboard.php:203
#: includes/admin/class-wc-admin-dashboard.php:204
msgid "There are no product reviews yet."
msgstr ""
@ -619,7 +619,7 @@ msgstr ""
#: includes/admin/class-wc-admin-welcome.php:209
#: includes/admin/settings/class-wc-settings-checkout.php:287
#: includes/admin/settings/class-wc-settings-shipping.php:236
#: includes/admin/views/html-admin-page-status-report.php:345
#: includes/admin/views/html-admin-page-status-report.php:367
msgid "Settings"
msgstr ""
@ -790,8 +790,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:334
#: includes/admin/reports/class-wc-report-customers.php:210
#: includes/admin/reports/class-wc-report-sales-by-category.php:235
#: includes/admin/reports/class-wc-report-sales-by-date.php:240
#: includes/admin/reports/class-wc-report-sales-by-product.php:366
#: includes/admin/reports/class-wc-report-sales-by-date.php:375
#: includes/admin/reports/class-wc-report-sales-by-product.php:365
#: includes/admin/settings/views/html-webhook-logs.php:17
#: includes/admin/settings/views/html-webhook-logs.php:25
msgid "Date"
@ -807,7 +807,7 @@ msgstr ""
#: includes/admin/class-wc-admin-post-types.php:140
#: includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php:68
#: includes/admin/reports/class-wc-report-sales-by-date.php:472
#: includes/admin/reports/class-wc-report-sales-by-date.php:458
msgid "Coupon amount"
msgstr ""
@ -859,7 +859,7 @@ msgstr ""
#: includes/admin/class-wc-admin-post-types.php:164
#: includes/admin/meta-boxes/views/html-order-items.php:57
#: includes/admin/reports/class-wc-report-taxes-by-code.php:170
#: includes/admin/reports/class-wc-report-taxes-by-code.php:172
msgid "Total"
msgstr ""
@ -2206,7 +2206,7 @@ msgstr ""
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:477
#: includes/admin/meta-boxes/class-wc-meta-box-product-data.php:490
#: includes/admin/meta-boxes/views/html-order-items.php:305
#: includes/admin/reports/class-wc-report-sales-by-product.php:182
#: includes/admin/reports/class-wc-report-sales-by-product.php:181
msgid "Search for a product&hellip;"
msgstr ""
@ -2403,7 +2403,7 @@ msgstr ""
#: includes/admin/meta-boxes/class-wc-meta-box-order-data.php:280
#: includes/admin/meta-boxes/views/html-order-shipping.php:26
#: includes/admin/views/html-admin-page-status-report.php:265
#: includes/admin/views/html-admin-page-status-report.php:287
msgid "N/A"
msgstr ""
@ -3082,17 +3082,17 @@ msgstr ""
msgid "Product SKU:"
msgstr ""
#: includes/admin/meta-boxes/views/html-order-item.php:151
#: includes/admin/meta-boxes/views/html-order-item.php:142
msgid "Add&nbsp;meta"
msgstr ""
#: includes/admin/meta-boxes/views/html-order-item.php:213
#: includes/admin/meta-boxes/views/html-order-item.php:256
#: includes/admin/meta-boxes/views/html-order-item.php:204
#: includes/admin/meta-boxes/views/html-order-item.php:247
msgid "After pre-tax discounts."
msgstr ""
#: includes/admin/meta-boxes/views/html-order-item.php:216
#: includes/admin/meta-boxes/views/html-order-item.php:259
#: includes/admin/meta-boxes/views/html-order-item.php:207
#: includes/admin/meta-boxes/views/html-order-item.php:250
msgid "Before pre-tax discounts."
msgstr ""
@ -3110,7 +3110,7 @@ msgstr ""
#: includes/admin/meta-boxes/views/html-order-items.php:63
#: includes/admin/meta-boxes/views/html-order-items.php:64
#: includes/admin/reports/class-wc-report-taxes-by-code.php:121
#: includes/admin/reports/class-wc-report-taxes-by-code.php:144
#: includes/admin/settings/class-wc-settings-tax.php:28
msgid "Tax"
msgstr ""
@ -3213,7 +3213,7 @@ msgid "Total available to refund"
msgstr ""
#: includes/admin/meta-boxes/views/html-order-items.php:266
#: includes/admin/reports/class-wc-report-sales-by-date.php:482
#: includes/admin/reports/class-wc-report-sales-by-date.php:468
msgid "Refund amount"
msgstr ""
@ -3435,8 +3435,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:111
#: includes/admin/reports/class-wc-report-customers.php:146
#: includes/admin/reports/class-wc-report-sales-by-category.php:85
#: includes/admin/reports/class-wc-report-sales-by-date.php:200
#: includes/admin/reports/class-wc-report-sales-by-product.php:106
#: includes/admin/reports/class-wc-report-sales-by-date.php:336
#: includes/admin/reports/class-wc-report-sales-by-product.php:105
#: includes/admin/reports/class-wc-report-taxes-by-code.php:44
#: includes/admin/reports/class-wc-report-taxes-by-date.php:44
msgid "Year"
@ -3445,8 +3445,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:112
#: includes/admin/reports/class-wc-report-customers.php:147
#: includes/admin/reports/class-wc-report-sales-by-category.php:86
#: includes/admin/reports/class-wc-report-sales-by-date.php:201
#: includes/admin/reports/class-wc-report-sales-by-product.php:107
#: includes/admin/reports/class-wc-report-sales-by-date.php:337
#: includes/admin/reports/class-wc-report-sales-by-product.php:106
#: includes/admin/reports/class-wc-report-taxes-by-code.php:45
#: includes/admin/reports/class-wc-report-taxes-by-date.php:45
msgid "Last Month"
@ -3455,8 +3455,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:113
#: includes/admin/reports/class-wc-report-customers.php:148
#: includes/admin/reports/class-wc-report-sales-by-category.php:87
#: includes/admin/reports/class-wc-report-sales-by-date.php:202
#: includes/admin/reports/class-wc-report-sales-by-product.php:108
#: includes/admin/reports/class-wc-report-sales-by-date.php:338
#: includes/admin/reports/class-wc-report-sales-by-product.php:107
#: includes/admin/reports/class-wc-report-taxes-by-code.php:46
#: includes/admin/reports/class-wc-report-taxes-by-date.php:46
msgid "This Month"
@ -3465,8 +3465,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:114
#: includes/admin/reports/class-wc-report-customers.php:149
#: includes/admin/reports/class-wc-report-sales-by-category.php:88
#: includes/admin/reports/class-wc-report-sales-by-date.php:203
#: includes/admin/reports/class-wc-report-sales-by-product.php:109
#: includes/admin/reports/class-wc-report-sales-by-date.php:339
#: includes/admin/reports/class-wc-report-sales-by-product.php:108
msgid "Last 7 Days"
msgstr ""
@ -3484,7 +3484,7 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:191
#: includes/admin/reports/class-wc-report-sales-by-category.php:195
#: includes/admin/reports/class-wc-report-sales-by-product.php:183
#: includes/admin/reports/class-wc-report-sales-by-product.php:182
msgid "Show"
msgstr ""
@ -3508,8 +3508,8 @@ msgstr ""
#: includes/admin/reports/class-wc-report-coupon-usage.php:337
#: includes/admin/reports/class-wc-report-customers.php:213
#: includes/admin/reports/class-wc-report-sales-by-category.php:238
#: includes/admin/reports/class-wc-report-sales-by-date.php:244
#: includes/admin/reports/class-wc-report-sales-by-product.php:369
#: includes/admin/reports/class-wc-report-sales-by-date.php:379
#: includes/admin/reports/class-wc-report-sales-by-product.php:368
#: includes/admin/reports/class-wc-report-taxes-by-code.php:33
#: includes/admin/reports/class-wc-report-taxes-by-date.php:33
#: includes/admin/settings/views/html-settings-tax.php:119
@ -3648,123 +3648,120 @@ msgstr ""
msgid "&larr; Choose a category to view stats"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:140
#: includes/admin/reports/class-wc-report-sales-by-date.php:275
msgid "%s average daily sales"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:144
#: includes/admin/reports/class-wc-report-sales-by-date.php:279
msgid "%s average monthly sales"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:149
#: includes/admin/reports/class-wc-report-sales-by-date.php:284
msgid "%s gross sales in this period"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:150
#: includes/admin/reports/class-wc-report-sales-by-date.php:285
msgid ""
"This is the sum of the order totals, including shipping and taxes. This "
"does not include refunds."
"This is the sum of the order totals after any refunds and including "
"shipping and taxes."
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:155
#: includes/admin/reports/class-wc-report-sales-by-date.php:290
msgid "%s net sales in this period"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:156
msgid ""
"This is the net sales figure excluding shipping and taxes. This does not "
"include refunds."
#: includes/admin/reports/class-wc-report-sales-by-date.php:291
msgid "This is the net sales figure excluding refunds, shipping and taxes."
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:166
#: includes/admin/reports/class-wc-report-sales-by-date.php:301
msgid "%s orders placed"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:171
#: includes/admin/reports/class-wc-report-sales-by-date.php:307
msgid "%s items purchased"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:176
#: includes/admin/reports/class-wc-report-sales-by-date.php:313
msgid "%s charged for shipping"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:181
#: includes/admin/reports/class-wc-report-sales-by-date.php:318
msgid "%s in refunds"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:186
#: includes/admin/reports/class-wc-report-sales-by-date.php:323
msgid "%s worth of coupons used"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:446
#: includes/admin/reports/class-wc-report-sales-by-product.php:483
#: includes/admin/reports/class-wc-report-sales-by-date.php:432
#: includes/admin/reports/class-wc-report-sales-by-product.php:482
msgid "Number of items sold"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:454
#: includes/admin/reports/class-wc-report-taxes-by-code.php:123
#: includes/admin/reports/class-wc-report-sales-by-date.php:440
msgid "Number of orders"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:462
#: includes/admin/reports/class-wc-report-sales-by-date.php:448
msgid "Average sales amount"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:492
#: includes/admin/reports/class-wc-report-sales-by-date.php:478
msgid "Shipping amount"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:502
#: includes/admin/reports/class-wc-report-sales-by-date.php:488
msgid "Gross Sales amount"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-date.php:512
#: includes/admin/reports/class-wc-report-sales-by-date.php:498
msgid "Net Sales amount"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:86
#: includes/admin/reports/class-wc-report-sales-by-product.php:85
msgid "%s sales for the selected items"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:92
#: includes/admin/reports/class-wc-report-sales-by-product.php:91
msgid "%s purchases for the selected items"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:138
#: includes/admin/reports/class-wc-report-sales-by-product.php:137
msgid "Showing reports for:"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:170
#: includes/admin/reports/class-wc-report-sales-by-product.php:169
msgid "Reset"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:178
#: includes/admin/reports/class-wc-report-sales-by-product.php:177
msgid "Product Search"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:193
#: includes/admin/reports/class-wc-report-sales-by-product.php:192
msgid "Top Sellers"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:237
#: includes/admin/reports/class-wc-report-sales-by-product.php:287
#: includes/admin/reports/class-wc-report-sales-by-product.php:327
#: includes/admin/reports/class-wc-report-sales-by-product.php:236
#: includes/admin/reports/class-wc-report-sales-by-product.php:286
#: includes/admin/reports/class-wc-report-sales-by-product.php:326
msgid "No products found in range"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:242
#: includes/admin/reports/class-wc-report-sales-by-product.php:241
msgid "Top Freebies"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:292
#: includes/admin/reports/class-wc-report-sales-by-product.php:291
msgid "Top Earners"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:385
#: includes/admin/reports/class-wc-report-sales-by-product.php:384
msgid "&larr; Choose a product to view stats"
msgstr ""
#: includes/admin/reports/class-wc-report-sales-by-product.php:491
#: includes/admin/reports/class-wc-report-sales-by-product.php:490
msgid "Sales amount"
msgstr ""
@ -3784,74 +3781,75 @@ msgstr ""
msgid "Units in stock"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:122
#: includes/admin/reports/class-wc-report-taxes-by-code.php:145
msgid "Rate"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:124
#: includes/admin/reports/class-wc-report-taxes-by-code.php:146
#: includes/admin/reports/class-wc-report-taxes-by-date.php:148
msgid "Number of Orders"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:147
msgid "Tax Amount"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:124
#: includes/admin/reports/class-wc-report-taxes-by-code.php:147
msgid "This is the sum of the \"Tax Rows\" tax amount within your orders."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:125
#: includes/admin/reports/class-wc-report-taxes-by-code.php:148
msgid "Shipping Tax Amount"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:125
#: includes/admin/reports/class-wc-report-taxes-by-code.php:148
msgid "This is the sum of the \"Tax Rows\" shipping tax amount within your orders."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:126
#: includes/admin/reports/class-wc-report-taxes-by-date.php:117
#: includes/admin/reports/class-wc-report-taxes-by-code.php:149
#: includes/admin/reports/class-wc-report-taxes-by-date.php:151
msgid "Total Tax"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:126
#: includes/admin/reports/class-wc-report-taxes-by-date.php:117
#: includes/admin/reports/class-wc-report-taxes-by-code.php:149
#: includes/admin/reports/class-wc-report-taxes-by-date.php:151
msgid "This is the total tax for the rate (shipping tax + product tax)."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-code.php:179
#: includes/admin/reports/class-wc-report-taxes-by-date.php:162
#: includes/admin/reports/class-wc-report-taxes-by-code.php:181
#: includes/admin/reports/class-wc-report-taxes-by-date.php:196
msgid "No taxes found in this period"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:113
#: includes/admin/reports/class-wc-report-taxes-by-date.php:147
msgid "Period"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:114
msgid "Orders/refunds"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:115
#: includes/admin/reports/class-wc-report-taxes-by-date.php:149
msgid "Total Sales"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:115
#: includes/admin/reports/class-wc-report-taxes-by-date.php:149
msgid "This is the sum of the 'Order Total' field within your orders."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:116
#: includes/admin/reports/class-wc-report-taxes-by-date.php:150
msgid "Total Shipping"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:116
#: includes/admin/reports/class-wc-report-taxes-by-date.php:150
msgid "This is the sum of the 'Shipping Total' field within your orders."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:118
#: includes/admin/reports/class-wc-report-taxes-by-date.php:152
msgid "Net profit"
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:118
#: includes/admin/reports/class-wc-report-taxes-by-date.php:152
msgid "Total sales minus shipping and tax."
msgstr ""
#: includes/admin/reports/class-wc-report-taxes-by-date.php:151
#: includes/admin/reports/class-wc-report-taxes-by-date.php:185
msgid "Totals"
msgstr ""
@ -4253,7 +4251,7 @@ msgid "The following options affect how prices are displayed on the frontend."
msgstr ""
#: includes/admin/settings/class-wc-settings-general.php:117
#: includes/admin/views/html-admin-page-status-report.php:370
#: includes/admin/views/html-admin-page-status-report.php:392
msgid "Currency"
msgstr ""
@ -4264,7 +4262,7 @@ msgid ""
msgstr ""
#: includes/admin/settings/class-wc-settings-general.php:129
#: includes/admin/views/html-admin-page-status-report.php:375
#: includes/admin/views/html-admin-page-status-report.php:397
msgid "Currency Position"
msgstr ""
@ -4289,7 +4287,7 @@ msgid "Right with space"
msgstr ""
#: includes/admin/settings/class-wc-settings-general.php:146
#: includes/admin/views/html-admin-page-status-report.php:380
#: includes/admin/views/html-admin-page-status-report.php:402
msgid "Thousand Separator"
msgstr ""
@ -4298,7 +4296,7 @@ msgid "This sets the thousand separator of displayed prices."
msgstr ""
#: includes/admin/settings/class-wc-settings-general.php:156
#: includes/admin/views/html-admin-page-status-report.php:385
#: includes/admin/views/html-admin-page-status-report.php:407
msgid "Decimal Separator"
msgstr ""
@ -4307,7 +4305,7 @@ msgid "This sets the decimal separator of displayed prices."
msgstr ""
#: includes/admin/settings/class-wc-settings-general.php:166
#: includes/admin/views/html-admin-page-status-report.php:390
#: includes/admin/views/html-admin-page-status-report.php:412
msgid "Number of Decimals"
msgstr ""
@ -5561,280 +5559,302 @@ msgid ""
"- some gateway plugins which use SOAP may not work as expected."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:189
#: includes/admin/views/html-admin-page-status-report.php:190
msgid "HTML/Multipart emails use DOMDocument to generate inline CSS in templates."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:196
msgid ""
"Your server does not have the <a href=\"%s\">DOMDocument</a> class enabled "
"- HTML/Multipart emails, and also some extensions, will not work without "
"DOMDocument."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:201
msgid "GZip (gzopen) is used to open the GEOIP database from MaxMind."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:207
msgid ""
"Your server does not support the <a href=\"%s\">gzopen</a> function - this "
"is required to use the GeoIP database from MaxMind. The API fallback will "
"be used instead for geolocation."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:211
msgid "Remote Post"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:190
#: includes/admin/views/html-admin-page-status-report.php:212
msgid ""
"PayPal uses this method of communicating when sending back transaction "
"information."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:204
#: includes/admin/views/html-admin-page-status-report.php:226
msgid ""
"wp_remote_post() failed. PayPal IPN won't work with your server. Contact "
"your hosting provider."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:206
#: includes/admin/views/html-admin-page-status-report.php:222
#: includes/admin/views/html-admin-page-status-report.php:228
#: includes/admin/views/html-admin-page-status-report.php:244
msgid "Error: %s"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:212
#: includes/admin/views/html-admin-page-status-report.php:234
msgid "Remote Get"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:213
#: includes/admin/views/html-admin-page-status-report.php:235
msgid ""
"WooCommerce plugins may use this method of communication when checking for "
"plugin updates."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:220
#: includes/admin/views/html-admin-page-status-report.php:242
msgid ""
"wp_remote_get() failed. The WooCommerce plugin updater won't work with your "
"server. Contact your hosting provider."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:250
#: includes/admin/views/html-admin-page-status-report.php:272
msgid "Server Locale"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:257
#: includes/admin/views/html-admin-page-status-report.php:279
msgid "The character used for decimal points."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:258
#: includes/admin/views/html-admin-page-status-report.php:280
msgid "The character used for a thousands separator."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:259
#: includes/admin/views/html-admin-page-status-report.php:281
msgid "The character used for decimal points in monetary values."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:260
#: includes/admin/views/html-admin-page-status-report.php:282
msgid "The character used for a thousands separator in monetary values."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:274
#: includes/admin/views/html-admin-page-status-report.php:296
msgid "Active Plugins"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:298
#: includes/admin/views/html-admin-page-status-report.php:320
msgid "Visit plugin homepage"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:326
#: includes/admin/views/html-admin-page-status-report.php:348
msgid "Network enabled"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:350
#: includes/admin/views/html-admin-page-status-report.php:372
msgid "API Enabled"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:351
#: includes/admin/views/html-admin-page-status-report.php:373
msgid "Does your site have REST API enabled?"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:355
#: includes/admin/views/html-admin-page-status-report.php:377
msgid "Taxes Enabled"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:356
#: includes/admin/views/html-admin-page-status-report.php:378
msgid "Does your site have taxes enabled?"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:360
#: includes/admin/views/html-admin-page-status-report.php:382
msgid "Shipping Enabled"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:361
#: includes/admin/views/html-admin-page-status-report.php:383
msgid "Does your site have shipping enabled?"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:365
#: includes/admin/views/html-admin-page-status-report.php:387
msgid "Force SSL"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:366
#: includes/admin/views/html-admin-page-status-report.php:388
msgid "Does your site force a SSL Certificate for transactions?"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:371
#: includes/admin/views/html-admin-page-status-report.php:393
msgid ""
"What currency prices are listed at in the catalog and which currency "
"gateways will take payments in."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:376
#: includes/admin/views/html-admin-page-status-report.php:398
msgid "The position of the currency symbol."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:381
#: includes/admin/views/html-admin-page-status-report.php:403
msgid "The thousand separator of displayed prices."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:386
#: includes/admin/views/html-admin-page-status-report.php:408
msgid "The decimal separator of displayed prices."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:391
#: includes/admin/views/html-admin-page-status-report.php:413
msgid "The number of decimal points shown in displayed prices."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:399
#: includes/admin/views/html-admin-page-status-report.php:421
msgid "WC Pages"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:408
#: includes/admin/views/html-admin-page-status-report.php:430
msgid "The URL of your WooCommerce shop's homepage (along with the Page ID)."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:413
#: includes/admin/views/html-admin-page-status-report.php:435
msgid "The URL of your WooCommerce shop's cart (along with the page ID)."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:418
#: includes/admin/views/html-admin-page-status-report.php:440
msgid "The URL of your WooCommerce shop's checkout (along with the page ID)."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:423
#: includes/admin/views/html-admin-page-status-report.php:445
msgid ""
"The URL of your WooCommerce shop's “My Account” Page (along with the page "
"ID)."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:444
#: includes/admin/views/html-admin-page-status-report.php:466
msgid "Page not set"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:454
#: includes/admin/views/html-admin-page-status-report.php:476
msgid "Page does not exist"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:459
#: includes/admin/views/html-admin-page-status-report.php:481
msgid "Page does not contain the shortcode: %s"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:477
#: includes/admin/views/html-admin-page-status-report.php:499
msgid "Taxonomies"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:477
#: includes/admin/views/html-admin-page-status-report.php:499
msgid ""
"A list of taxonomy terms that can be used in regard to order/product "
"statuses."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:482
#: includes/admin/views/html-admin-page-status-report.php:504
msgid "Product Types"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:498
#: includes/admin/views/html-admin-page-status-report.php:520
msgid "Theme"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:531
#: includes/admin/views/html-admin-page-status-report.php:553
msgid "The name of the current active theme."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:535
#: includes/admin/views/html-admin-page-status-report.php:557
msgid "Version"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:536
#: includes/admin/views/html-admin-page-status-report.php:558
msgid "The installed version of the current active theme."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:541
#: includes/admin/views/html-admin-page-status-report.php:563
msgid "is available"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:546
#: includes/admin/views/html-admin-page-status-report.php:568
msgid "Author URL"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:547
#: includes/admin/views/html-admin-page-status-report.php:569
msgid "The theme developers URL."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:551
#: includes/admin/views/html-admin-page-status-report.php:573
msgid "Child Theme"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:552
#: includes/admin/views/html-admin-page-status-report.php:574
msgid "Displays whether or not the current theme is a child theme."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:554
#: includes/admin/views/html-admin-page-status-report.php:576
msgid ""
"If you're modifying WooCommerce or a parent theme you didn't build "
"personally we recommend using a child theme. See: <a href=\"%s\" "
"target=\"_blank\">How to create a child theme</a>"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:562
#: includes/admin/views/html-admin-page-status-report.php:584
msgid "Parent Theme Name"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:563
#: includes/admin/views/html-admin-page-status-report.php:585
msgid "The name of the parent theme."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:567
#: includes/admin/views/html-admin-page-status-report.php:589
msgid "Parent Theme Version"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:568
#: includes/admin/views/html-admin-page-status-report.php:590
msgid "The installed version of the parent theme."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:572
#: includes/admin/views/html-admin-page-status-report.php:594
msgid "Parent Theme Author URL"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:573
#: includes/admin/views/html-admin-page-status-report.php:595
msgid "The parent theme developers URL."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:578
#: includes/admin/views/html-admin-page-status-report.php:600
msgid "WooCommerce Support"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:579
#: includes/admin/views/html-admin-page-status-report.php:601
msgid ""
"Displays whether or not the current active theme declares WooCommerce "
"support."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:582
#: includes/admin/views/html-admin-page-status-report.php:604
msgid "Not Declared"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:593
#: includes/admin/views/html-admin-page-status-report.php:615
msgid "Templates"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:593
#: includes/admin/views/html-admin-page-status-report.php:615
msgid ""
"This section shows any files that are overriding the default WooCommerce "
"template pages."
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:630
#: includes/admin/views/html-admin-page-status-report.php:652
msgid ""
"<code>%s</code> version <strong style=\"color:red\">%s</strong> is out of "
"date. The core version is %s"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:642
#: includes/admin/views/html-admin-page-status-report.php:651
#: includes/admin/views/html-admin-page-status-report.php:664
#: includes/admin/views/html-admin-page-status-report.php:673
msgid "Overrides"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:663
#: includes/admin/views/html-admin-page-status-report.php:685
msgid "Learn how to update outdated templates"
msgstr ""
@ -5982,8 +6002,8 @@ msgstr ""
#: includes/admin/views/html-notice-frontend-colors.php:20
msgid ""
"<strong>The Frontend Styles options is deprecated</strong> &#8211; If you "
"want to continue editing the colors of your store is recommended that you "
"<strong>The Frontend Style options are deprecated</strong> &#8211; If you "
"want to continue editing the colors of your store we recommended that you "
"install the replacement WooCommerce Colors plugin from WordPress.org."
msgstr ""
@ -6013,8 +6033,8 @@ msgid ""
"files.</strong> If you notice an issue on your site, this could be the "
"reason. Please contact your theme developer for further assistance. You can "
"review the System Status report for full details or <a "
"href=\"http://docs.woothemes.com/document/template-structure/\">learn more "
"about WooCommerce Template Structure here</a>."
"href=\"http://docs.woothemes.com/document/template-structure/\" "
"target=\"_blank\">learn more about WooCommerce Template Structure here</a>."
msgstr ""
#: includes/admin/views/html-notice-theme-support.php:13
@ -6287,37 +6307,37 @@ msgctxt "Settings group label"
msgid "Checkout"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:322
#: includes/admin/views/html-admin-page-status-report.php:344
msgctxt "Version info"
msgid "%s is available"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:334
#: includes/admin/views/html-admin-page-status-report.php:356
msgctxt "by author"
msgid "by %s"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:405
#: includes/admin/views/html-admin-page-status-report.php:427
msgctxt "Page setting"
msgid "Shop Base"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:410
#: includes/admin/views/html-admin-page-status-report.php:432
msgctxt "Page setting"
msgid "Cart"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:415
#: includes/admin/views/html-admin-page-status-report.php:437
msgctxt "Page setting"
msgid "Checkout"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:420
#: includes/admin/views/html-admin-page-status-report.php:442
msgctxt "Page setting"
msgid "My Account"
msgstr ""
#: includes/admin/views/html-admin-page-status-report.php:434
#: includes/admin/views/html-admin-page-status-report.php:456
msgctxt "WC Pages links in the System Status"
msgid "Edit %s page"
msgstr ""

View File

@ -2,9 +2,9 @@
# This file is distributed under the same license as the WooCommerce package.
msgid ""
msgstr ""
"Project-Id-Version: WooCommerce 2.3.3 Frontend\n"
"Project-Id-Version: WooCommerce 2.3.4 Frontend\n"
"Report-Msgid-Bugs-To: https://github.com/woothemes/woocommerce/issues\n"
"POT-Creation-Date: 2015-02-12 16:44:40+00:00\n"
"POT-Creation-Date: 2015-02-17 16:43:18+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@ -4666,7 +4666,7 @@ msgstr ""
#: includes/abstracts/abstract-wc-integration.php:29
#: includes/abstracts/abstract-wc-settings-api.php:77
#: includes/class-wc-install.php:642 includes/emails/class-wc-email.php:681
#: includes/class-wc-install.php:644 includes/emails/class-wc-email.php:700
msgid "Settings"
msgstr ""
@ -4680,8 +4680,8 @@ msgid "&nbsp;<small>%svia %s</small>"
msgstr ""
#: includes/abstracts/abstract-wc-order.php:1656
#: includes/abstracts/abstract-wc-product.php:964
#: includes/abstracts/abstract-wc-product.php:970
#: includes/abstracts/abstract-wc-product.php:966
#: includes/abstracts/abstract-wc-product.php:972
#: includes/class-wc-cart.php:1527 includes/class-wc-product-variable.php:322
#: includes/class-wc-product-variation.php:318
msgid "Free!"
@ -4757,65 +4757,65 @@ msgstr ""
msgid "CVC"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:531
#: includes/abstracts/abstract-wc-product.php:533
#: includes/class-wc-product-simple.php:50
#: includes/class-wc-product-variation.php:198
msgid "Add to cart"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:540
#: includes/abstracts/abstract-wc-product.php:542
msgid "Read more"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:621
#: includes/abstracts/abstract-wc-product.php:632
#: includes/abstracts/abstract-wc-product.php:654
#: includes/abstracts/abstract-wc-product.php:623
#: includes/abstracts/abstract-wc-product.php:634
#: includes/abstracts/abstract-wc-product.php:656
#: includes/class-wc-ajax.php:658 includes/class-wc-product-variation.php:530
#: includes/class-wc-product-variation.php:540
#: includes/class-wc-product-variation.php:556
msgid "In stock"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:626
#: includes/abstracts/abstract-wc-product.php:628
#: includes/class-wc-product-variation.php:534
msgid "Only %s left in stock"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:629
#: includes/abstracts/abstract-wc-product.php:640
#: includes/abstracts/abstract-wc-product.php:631
#: includes/abstracts/abstract-wc-product.php:642
#: includes/class-wc-product-variation.php:537
#: includes/class-wc-product-variation.php:547
msgid "(can be backordered)"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:637
#: includes/abstracts/abstract-wc-product.php:639
#: includes/class-wc-product-variation.php:544
msgid "%s in stock"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:649
#: includes/abstracts/abstract-wc-product.php:651
#: includes/class-wc-product-variation.php:553 templates/cart/cart.php:74
msgid "Available on backorder"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:659
#: includes/abstracts/abstract-wc-product.php:665
#: includes/abstracts/abstract-wc-product.php:661
#: includes/abstracts/abstract-wc-product.php:667
#: includes/class-wc-ajax.php:659 includes/class-wc-product-variation.php:559
#: includes/class-wc-product-variation.php:563
msgid "Out of stock"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:1105
#: includes/abstracts/abstract-wc-product.php:1107
#: templates/single-product/rating.php:27
msgid "Rated %s out of 5"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:1107
#: includes/abstracts/abstract-wc-product.php:1109
#: templates/single-product/review.php:30
msgid "out of 5"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:1485
#: includes/abstracts/abstract-wc-product.php:1502
msgid "%s &ndash; %s"
msgstr ""
@ -5226,7 +5226,7 @@ msgstr ""
msgid "Invalid product SKU"
msgstr ""
#: includes/api/class-wc-api-reports.php:481
#: includes/api/class-wc-api-reports.php:320
#: includes/api/v1/class-wc-api-reports.php:471
msgid "You do not have permission to read this report"
msgstr ""
@ -5390,7 +5390,7 @@ msgid ""
msgstr ""
#: includes/class-wc-ajax.php:1247 includes/class-wc-ajax.php:1248
#: includes/class-wc-ajax.php:1890
#: includes/class-wc-ajax.php:1929
msgid "Item #%s stock increased from %s to %s."
msgstr ""
@ -5418,7 +5418,7 @@ msgstr ""
msgid "Invalid refund amount"
msgstr ""
#: includes/class-wc-ajax.php:1928
#: includes/class-wc-ajax.php:1914
msgid "Refund failed"
msgstr ""
@ -5430,19 +5430,19 @@ msgstr ""
msgid "Products tagged &ldquo;%s&rdquo;"
msgstr ""
#: includes/class-wc-breadcrumb.php:258
#: includes/class-wc-breadcrumb.php:257
msgid "Posts tagged &ldquo;%s&rdquo;"
msgstr ""
#: includes/class-wc-breadcrumb.php:283
#: includes/class-wc-breadcrumb.php:282
msgid "Author: %s"
msgstr ""
#: includes/class-wc-breadcrumb.php:318
#: includes/class-wc-breadcrumb.php:317
msgid "Search results for &ldquo;%s&rdquo;"
msgstr ""
#: includes/class-wc-breadcrumb.php:327
#: includes/class-wc-breadcrumb.php:326
msgid "Page %d"
msgstr ""
@ -5728,77 +5728,77 @@ msgstr ""
msgid "Phone"
msgstr ""
#: includes/class-wc-coupon.php:676
#: includes/class-wc-coupon.php:678
msgid "Coupon code applied successfully."
msgstr ""
#: includes/class-wc-coupon.php:679
#: includes/class-wc-coupon.php:681
msgid "Coupon code removed successfully."
msgstr ""
#: includes/class-wc-coupon.php:697
#: includes/class-wc-coupon.php:699
msgid "Coupon is not valid."
msgstr ""
#: includes/class-wc-coupon.php:700 includes/class-wc-coupon.php:785
#: includes/class-wc-coupon.php:702 includes/class-wc-coupon.php:787
msgid "Coupon does not exist!"
msgstr ""
#: includes/class-wc-coupon.php:703
#: includes/class-wc-coupon.php:705
msgid ""
"Sorry, it seems the coupon \"%s\" is invalid - it has now been removed from "
"your order."
msgstr ""
#: includes/class-wc-coupon.php:706
#: includes/class-wc-coupon.php:708
msgid ""
"Sorry, it seems the coupon \"%s\" is not yours - it has now been removed "
"from your order."
msgstr ""
#: includes/class-wc-coupon.php:709
#: includes/class-wc-coupon.php:711
msgid "Coupon code already applied!"
msgstr ""
#: includes/class-wc-coupon.php:712
#: includes/class-wc-coupon.php:714
msgid ""
"Sorry, coupon \"%s\" has already been applied and cannot be used in "
"conjunction with other coupons."
msgstr ""
#: includes/class-wc-coupon.php:715
#: includes/class-wc-coupon.php:717
msgid "Coupon usage limit has been reached."
msgstr ""
#: includes/class-wc-coupon.php:718
#: includes/class-wc-coupon.php:720
msgid "This coupon has expired."
msgstr ""
#: includes/class-wc-coupon.php:721
#: includes/class-wc-coupon.php:723
msgid "The minimum spend for this coupon is %s."
msgstr ""
#: includes/class-wc-coupon.php:724
#: includes/class-wc-coupon.php:726
msgid "The maximum spend for this coupon is %s."
msgstr ""
#: includes/class-wc-coupon.php:727
#: includes/class-wc-coupon.php:729
msgid "Sorry, this coupon is not applicable to your cart contents."
msgstr ""
#: includes/class-wc-coupon.php:740
#: includes/class-wc-coupon.php:742
msgid "Sorry, this coupon is not applicable to the products: %s."
msgstr ""
#: includes/class-wc-coupon.php:762
#: includes/class-wc-coupon.php:764
msgid "Sorry, this coupon is not applicable to the categories: %s."
msgstr ""
#: includes/class-wc-coupon.php:765
#: includes/class-wc-coupon.php:767
msgid "Sorry, this coupon is not valid for sale items."
msgstr ""
#: includes/class-wc-coupon.php:788
#: includes/class-wc-coupon.php:790
msgid "Please enter a coupon code."
msgstr ""
@ -5807,7 +5807,7 @@ msgid "Invalid download link."
msgstr ""
#: includes/class-wc-download-handler.php:98
#: includes/class-wc-form-handler.php:559
#: includes/class-wc-form-handler.php:557
#: includes/shortcodes/class-wc-shortcode-checkout.php:166
#: includes/shortcodes/class-wc-shortcode-my-account.php:111
msgid "Invalid order."
@ -5930,7 +5930,7 @@ msgid "Please re-enter your password."
msgstr ""
#: includes/class-wc-form-handler.php:203
#: includes/class-wc-form-handler.php:858
#: includes/class-wc-form-handler.php:856
msgid "Passwords do not match."
msgstr ""
@ -5942,82 +5942,86 @@ msgstr ""
msgid "Payment method added."
msgstr ""
#: includes/class-wc-form-handler.php:391
#: includes/class-wc-form-handler.php:388
msgid "%s removed. %sUndo?%s"
msgstr ""
#: includes/class-wc-form-handler.php:436
#: includes/class-wc-form-handler.php:388
msgid "Item"
msgstr ""
#: includes/class-wc-form-handler.php:434
msgid "You can only have 1 %s in your cart."
msgstr ""
#: includes/class-wc-form-handler.php:460
#: includes/class-wc-form-handler.php:458
msgid "Cart updated."
msgstr ""
#: includes/class-wc-form-handler.php:526
#: includes/class-wc-form-handler.php:524
msgid "The cart has been filled with the items from your previous order."
msgstr ""
#: includes/class-wc-form-handler.php:549
#: includes/class-wc-form-handler.php:547
msgid "Order cancelled by customer."
msgstr ""
#: includes/class-wc-form-handler.php:552
#: includes/class-wc-form-handler.php:550
msgid "Your order was cancelled."
msgstr ""
#: includes/class-wc-form-handler.php:557
#: includes/class-wc-form-handler.php:555
msgid ""
"Your order can no longer be cancelled. Please contact us if you need "
"assistance."
msgstr ""
#: includes/class-wc-form-handler.php:589
#: includes/class-wc-form-handler.php:587
msgid "Sorry, this product is unavailable."
msgstr ""
#: includes/class-wc-form-handler.php:603
#: includes/class-wc-form-handler.php:663
#: includes/class-wc-form-handler.php:601
#: includes/class-wc-form-handler.php:661
msgid "Please choose product options&hellip;"
msgstr ""
#: includes/class-wc-form-handler.php:697
#: includes/class-wc-form-handler.php:695
msgid "Please choose the quantity of items you wish to add to your cart&hellip;"
msgstr ""
#: includes/class-wc-form-handler.php:704
#: includes/class-wc-form-handler.php:702
msgid "Please choose a product to add to your cart&hellip;"
msgstr ""
#: includes/class-wc-form-handler.php:768
#: includes/class-wc-form-handler.php:772
#: includes/class-wc-form-handler.php:776
#: includes/class-wc-form-handler.php:785
#: includes/class-wc-form-handler.php:914
#: includes/class-wc-form-handler.php:766
#: includes/class-wc-form-handler.php:770
#: includes/class-wc-form-handler.php:774
#: includes/class-wc-form-handler.php:783
#: includes/class-wc-form-handler.php:912
msgid "Error"
msgstr ""
#: includes/class-wc-form-handler.php:772
#: includes/class-wc-form-handler.php:770
msgid "Username is required."
msgstr ""
#: includes/class-wc-form-handler.php:776
#: includes/class-wc-form-handler.php:774
msgid "Password is required."
msgstr ""
#: includes/class-wc-form-handler.php:785
#: includes/class-wc-form-handler.php:783
msgid "A user could not be found with this email address."
msgstr ""
#: includes/class-wc-form-handler.php:810
#: includes/class-wc-form-handler.php:808
msgid "You are now logged in as <strong>%s</strong>"
msgstr ""
#: includes/class-wc-form-handler.php:854
#: includes/class-wc-form-handler.php:852
msgid "Please enter your password."
msgstr ""
#: includes/class-wc-form-handler.php:897
#: includes/class-wc-form-handler.php:895
msgid "Anti-spam field was filled in."
msgstr ""
@ -6044,39 +6048,39 @@ msgstr ""
msgid "Select an option&hellip;"
msgstr ""
#: includes/class-wc-install.php:415
#: includes/class-wc-install.php:417
msgid "Customer"
msgstr ""
#: includes/class-wc-install.php:422
#: includes/class-wc-install.php:424
msgid "Shop Manager"
msgstr ""
#: includes/class-wc-install.php:642
#: includes/class-wc-install.php:644
msgid "View WooCommerce Settings"
msgstr ""
#: includes/class-wc-install.php:658
#: includes/class-wc-install.php:660
msgid "View WooCommerce Documentation"
msgstr ""
#: includes/class-wc-install.php:658
#: includes/class-wc-install.php:660
msgid "Docs"
msgstr ""
#: includes/class-wc-install.php:659
#: includes/class-wc-install.php:661
msgid "View WooCommerce API Docs"
msgstr ""
#: includes/class-wc-install.php:659
#: includes/class-wc-install.php:661
msgid "API Docs"
msgstr ""
#: includes/class-wc-install.php:660
#: includes/class-wc-install.php:662
msgid "Visit Premium Customer Support Forum"
msgstr ""
#: includes/class-wc-install.php:660
#: includes/class-wc-install.php:662
msgid "Premium Support"
msgstr ""
@ -6588,7 +6592,7 @@ msgstr ""
#: includes/emails/class-wc-email-cancelled-order.php:117
#: includes/emails/class-wc-email-customer-completed-order.php:143
#: includes/emails/class-wc-email-new-order.php:123
#: includes/emails/class-wc-email.php:461
#: includes/emails/class-wc-email.php:466
#: includes/gateways/bacs/class-wc-gateway-bacs.php:74
#: includes/gateways/cheque/class-wc-gateway-cheque.php:54
#: includes/gateways/paypal/includes/settings-paypal.php:12
@ -6602,7 +6606,7 @@ msgstr ""
#: includes/emails/class-wc-email-cancelled-order.php:119
#: includes/emails/class-wc-email-customer-completed-order.php:145
#: includes/emails/class-wc-email-new-order.php:125
#: includes/emails/class-wc-email.php:463
#: includes/emails/class-wc-email.php:468
msgid "Enable this email notification"
msgstr ""
@ -6648,7 +6652,7 @@ msgstr ""
#: includes/emails/class-wc-email-customer-completed-order.php:177
#: includes/emails/class-wc-email-customer-invoice.php:179
#: includes/emails/class-wc-email-new-order.php:150
#: includes/emails/class-wc-email.php:481
#: includes/emails/class-wc-email.php:486
msgid "Email type"
msgstr ""
@ -6656,32 +6660,8 @@ msgstr ""
#: includes/emails/class-wc-email-customer-completed-order.php:179
#: includes/emails/class-wc-email-customer-invoice.php:181
#: includes/emails/class-wc-email-new-order.php:152
#: includes/emails/class-wc-email.php:483
msgid "Choose which format of email to send."
msgstr ""
#: includes/emails/class-wc-email-cancelled-order.php:150
#: includes/emails/class-wc-email-customer-completed-order.php:183
#: includes/emails/class-wc-email-customer-invoice.php:185
#: includes/emails/class-wc-email-new-order.php:156
#: includes/emails/class-wc-email.php:487
msgid "Plain text"
msgstr ""
#: includes/emails/class-wc-email-cancelled-order.php:151
#: includes/emails/class-wc-email-customer-completed-order.php:184
#: includes/emails/class-wc-email-customer-invoice.php:186
#: includes/emails/class-wc-email-new-order.php:157
#: includes/emails/class-wc-email.php:488
msgid "HTML"
msgstr ""
#: includes/emails/class-wc-email-cancelled-order.php:152
#: includes/emails/class-wc-email-customer-completed-order.php:185
#: includes/emails/class-wc-email-customer-invoice.php:187
#: includes/emails/class-wc-email-new-order.php:158
#: includes/emails/class-wc-email.php:489
msgid "Multipart"
msgid "Choose which format of email to send."
msgstr ""
#: includes/emails/class-wc-email-customer-completed-order.php:28
@ -6718,8 +6698,8 @@ msgstr ""
#: includes/emails/class-wc-email-customer-invoice.php:160
#: includes/emails/class-wc-email-customer-invoice.php:167
#: includes/emails/class-wc-email-customer-invoice.php:174
#: includes/emails/class-wc-email.php:469
#: includes/emails/class-wc-email.php:476
#: includes/emails/class-wc-email.php:474
#: includes/emails/class-wc-email.php:481
msgid "Defaults to <code>%s</code>"
msgstr ""
@ -6758,12 +6738,12 @@ msgid "Order {order_number} details"
msgstr ""
#: includes/emails/class-wc-email-customer-invoice.php:151
#: includes/emails/class-wc-email.php:467
#: includes/emails/class-wc-email.php:472
msgid "Email subject"
msgstr ""
#: includes/emails/class-wc-email-customer-invoice.php:158
#: includes/emails/class-wc-email.php:474
#: includes/emails/class-wc-email.php:479
msgid "Email heading"
msgstr ""
@ -6861,60 +6841,72 @@ msgstr ""
msgid "[{site_title}] New customer order ({order_number}) - {order_date}"
msgstr ""
#: includes/emails/class-wc-email.php:526
#: includes/emails/class-wc-email.php:550
#: includes/emails/class-wc-email.php:503
msgid "Plain text"
msgstr ""
#: includes/emails/class-wc-email.php:507
msgid "HTML"
msgstr ""
#: includes/emails/class-wc-email.php:508
msgid "Multipart"
msgstr ""
#: includes/emails/class-wc-email.php:545
#: includes/emails/class-wc-email.php:569
msgid "Could not write to template file."
msgstr ""
#: includes/emails/class-wc-email.php:616
#: includes/emails/class-wc-email.php:635
msgid "Template file copied to theme."
msgstr ""
#: includes/emails/class-wc-email.php:645
#: includes/emails/class-wc-email.php:664
msgid "Template file deleted from theme."
msgstr ""
#: includes/emails/class-wc-email.php:711
#: includes/emails/class-wc-email.php:730
msgid "HTML template"
msgstr ""
#: includes/emails/class-wc-email.php:712
#: includes/emails/class-wc-email.php:731
msgid "Plain text template"
msgstr ""
#: includes/emails/class-wc-email.php:737
#: includes/emails/class-wc-email.php:756
msgid "Delete template file"
msgstr ""
#: includes/emails/class-wc-email.php:740
#: includes/emails/class-wc-email.php:759
msgid ""
"This template has been overridden by your theme and can be found in: "
"<code>%s</code>."
msgstr ""
#: includes/emails/class-wc-email.php:753
#: includes/emails/class-wc-email.php:772
msgid "Copy file to theme"
msgstr ""
#: includes/emails/class-wc-email.php:756
#: includes/emails/class-wc-email.php:775
msgid ""
"To override and edit this email template copy <code>%s</code> to your theme "
"folder: <code>%s</code>."
msgstr ""
#: includes/emails/class-wc-email.php:765
#: includes/emails/class-wc-email.php:784
msgid "File was not found."
msgstr ""
#: includes/emails/class-wc-email.php:790
#: includes/emails/class-wc-email.php:809
msgid "View template"
msgstr ""
#: includes/emails/class-wc-email.php:791
#: includes/emails/class-wc-email.php:810
msgid "Hide template"
msgstr ""
#: includes/emails/class-wc-email.php:802
#: includes/emails/class-wc-email.php:821
msgid "Are you sure you want to delete this template file?"
msgstr ""
@ -7188,15 +7180,15 @@ msgstr ""
msgid "What is PayPal?"
msgstr ""
#: includes/gateways/paypal/class-wc-gateway-paypal.php:192
#: includes/gateways/paypal/class-wc-gateway-paypal.php:194
msgid "Gateway Disabled"
msgstr ""
#: includes/gateways/paypal/class-wc-gateway-paypal.php:192
#: includes/gateways/paypal/class-wc-gateway-paypal.php:194
msgid "PayPal does not support your store currency."
msgstr ""
#: includes/gateways/paypal/class-wc-gateway-paypal.php:280
#: includes/gateways/paypal/class-wc-gateway-paypal.php:282
msgid "Refunded %s - Refund ID: %s"
msgstr ""
@ -8176,199 +8168,199 @@ msgstr ""
msgid "Free"
msgstr ""
#: includes/wc-core-functions.php:75
#: includes/wc-core-functions.php:76
msgid "Order &ndash; %s"
msgstr ""
#: includes/wc-core-functions.php:80
#: includes/wc-core-functions.php:81
msgid "Invalid order status"
msgstr ""
#: includes/wc-core-functions.php:123
#: includes/wc-core-functions.php:124
msgid "Invalid order ID"
msgstr ""
#: includes/wc-core-functions.php:253
#: includes/wc-core-functions.php:254
msgid "United Arab Emirates Dirham"
msgstr ""
#: includes/wc-core-functions.php:254
#: includes/wc-core-functions.php:255
msgid "Australian Dollars"
msgstr ""
#: includes/wc-core-functions.php:255
#: includes/wc-core-functions.php:256
msgid "Bangladeshi Taka"
msgstr ""
#: includes/wc-core-functions.php:256
#: includes/wc-core-functions.php:257
msgid "Brazilian Real"
msgstr ""
#: includes/wc-core-functions.php:257
#: includes/wc-core-functions.php:258
msgid "Bulgarian Lev"
msgstr ""
#: includes/wc-core-functions.php:258
#: includes/wc-core-functions.php:259
msgid "Canadian Dollars"
msgstr ""
#: includes/wc-core-functions.php:259
#: includes/wc-core-functions.php:260
msgid "Chilean Peso"
msgstr ""
#: includes/wc-core-functions.php:260
#: includes/wc-core-functions.php:261
msgid "Chinese Yuan"
msgstr ""
#: includes/wc-core-functions.php:261
#: includes/wc-core-functions.php:262
msgid "Colombian Peso"
msgstr ""
#: includes/wc-core-functions.php:262
#: includes/wc-core-functions.php:263
msgid "Czech Koruna"
msgstr ""
#: includes/wc-core-functions.php:263
#: includes/wc-core-functions.php:264
msgid "Danish Krone"
msgstr ""
#: includes/wc-core-functions.php:264
#: includes/wc-core-functions.php:265
msgid "Dominican Peso"
msgstr ""
#: includes/wc-core-functions.php:265
#: includes/wc-core-functions.php:266
msgid "Euros"
msgstr ""
#: includes/wc-core-functions.php:266
#: includes/wc-core-functions.php:267
msgid "Hong Kong Dollar"
msgstr ""
#: includes/wc-core-functions.php:267
#: includes/wc-core-functions.php:268
msgid "Croatia kuna"
msgstr ""
#: includes/wc-core-functions.php:268
#: includes/wc-core-functions.php:269
msgid "Hungarian Forint"
msgstr ""
#: includes/wc-core-functions.php:269
#: includes/wc-core-functions.php:270
msgid "Icelandic krona"
msgstr ""
#: includes/wc-core-functions.php:270
#: includes/wc-core-functions.php:271
msgid "Indonesia Rupiah"
msgstr ""
#: includes/wc-core-functions.php:271
#: includes/wc-core-functions.php:272
msgid "Indian Rupee"
msgstr ""
#: includes/wc-core-functions.php:272
#: includes/wc-core-functions.php:273
msgid "Nepali Rupee"
msgstr ""
#: includes/wc-core-functions.php:273
#: includes/wc-core-functions.php:274
msgid "Israeli Shekel"
msgstr ""
#: includes/wc-core-functions.php:274
#: includes/wc-core-functions.php:275
msgid "Japanese Yen"
msgstr ""
#: includes/wc-core-functions.php:275
#: includes/wc-core-functions.php:276
msgid "Lao Kip"
msgstr ""
#: includes/wc-core-functions.php:276
#: includes/wc-core-functions.php:277
msgid "South Korean Won"
msgstr ""
#: includes/wc-core-functions.php:277
#: includes/wc-core-functions.php:278
msgid "Malaysian Ringgits"
msgstr ""
#: includes/wc-core-functions.php:278
#: includes/wc-core-functions.php:279
msgid "Mexican Peso"
msgstr ""
#: includes/wc-core-functions.php:279
#: includes/wc-core-functions.php:280
msgid "Nigerian Naira"
msgstr ""
#: includes/wc-core-functions.php:280
#: includes/wc-core-functions.php:281
msgid "Norwegian Krone"
msgstr ""
#: includes/wc-core-functions.php:281
#: includes/wc-core-functions.php:282
msgid "New Zealand Dollar"
msgstr ""
#: includes/wc-core-functions.php:282
#: includes/wc-core-functions.php:283
msgid "Paraguayan Guaraní"
msgstr ""
#: includes/wc-core-functions.php:283
#: includes/wc-core-functions.php:284
msgid "Philippine Pesos"
msgstr ""
#: includes/wc-core-functions.php:284
#: includes/wc-core-functions.php:285
msgid "Polish Zloty"
msgstr ""
#: includes/wc-core-functions.php:285
#: includes/wc-core-functions.php:286
msgid "Pounds Sterling"
msgstr ""
#: includes/wc-core-functions.php:286
#: includes/wc-core-functions.php:287
msgid "Romanian Leu"
msgstr ""
#: includes/wc-core-functions.php:287
#: includes/wc-core-functions.php:288
msgid "Russian Ruble"
msgstr ""
#: includes/wc-core-functions.php:288
#: includes/wc-core-functions.php:289
msgid "Singapore Dollar"
msgstr ""
#: includes/wc-core-functions.php:289
#: includes/wc-core-functions.php:290
msgid "South African rand"
msgstr ""
#: includes/wc-core-functions.php:290
#: includes/wc-core-functions.php:291
msgid "Swedish Krona"
msgstr ""
#: includes/wc-core-functions.php:291
#: includes/wc-core-functions.php:292
msgid "Swiss Franc"
msgstr ""
#: includes/wc-core-functions.php:292
#: includes/wc-core-functions.php:293
msgid "Taiwan New Dollars"
msgstr ""
#: includes/wc-core-functions.php:293
#: includes/wc-core-functions.php:294
msgid "Thai Baht"
msgstr ""
#: includes/wc-core-functions.php:294
#: includes/wc-core-functions.php:295
msgid "Turkish Lira"
msgstr ""
#: includes/wc-core-functions.php:295
#: includes/wc-core-functions.php:296
msgid "Ukrainian Hryvnia"
msgstr ""
#: includes/wc-core-functions.php:296
#: includes/wc-core-functions.php:297
msgid "US Dollars"
msgstr ""
#: includes/wc-core-functions.php:297
#: includes/wc-core-functions.php:298
msgid "Vietnamese Dong"
msgstr ""
#: includes/wc-core-functions.php:298
#: includes/wc-core-functions.php:299
msgid "Egyptian Pound"
msgstr ""
@ -8406,11 +8398,11 @@ msgstr ""
msgid "This function should not be called before woocommerce_init."
msgstr ""
#: includes/wc-order-functions.php:502
#: includes/wc-order-functions.php:503
msgid "Unpaid order cancelled - time limit reached."
msgstr ""
#: includes/wc-order-functions.php:598
#: includes/wc-order-functions.php:599
msgid "Refund &ndash; %s"
msgstr ""
@ -9712,7 +9704,7 @@ msgctxt "US state of Georgia"
msgid "Georgia"
msgstr ""
#: includes/abstracts/abstract-wc-product.php:986
#: includes/abstracts/abstract-wc-product.php:988
msgctxt "min_price"
msgid "From:"
msgstr ""
@ -9812,42 +9804,42 @@ msgctxt "enhanced select"
msgid "Searching&hellip;"
msgstr ""
#: includes/class-wc-install.php:189
#: includes/class-wc-install.php:191
msgctxt "Page slug"
msgid "shop"
msgstr ""
#: includes/class-wc-install.php:194
#: includes/class-wc-install.php:196
msgctxt "Page slug"
msgid "cart"
msgstr ""
#: includes/class-wc-install.php:199
#: includes/class-wc-install.php:201
msgctxt "Page slug"
msgid "checkout"
msgstr ""
#: includes/class-wc-install.php:204
#: includes/class-wc-install.php:206
msgctxt "Page slug"
msgid "my-account"
msgstr ""
#: includes/class-wc-install.php:190
#: includes/class-wc-install.php:192
msgctxt "Page title"
msgid "Shop"
msgstr ""
#: includes/class-wc-install.php:195
#: includes/class-wc-install.php:197
msgctxt "Page title"
msgid "Cart"
msgstr ""
#: includes/class-wc-install.php:200
#: includes/class-wc-install.php:202
msgctxt "Page title"
msgid "Checkout"
msgstr ""
#: includes/class-wc-install.php:205
#: includes/class-wc-install.php:207
msgctxt "Page title"
msgid "My Account"
msgstr ""
@ -9901,7 +9893,7 @@ msgstr ""
#: includes/class-wc-post-types.php:227
#: includes/updates/woocommerce-update-2.0.php:55
#: includes/wc-core-functions.php:591 includes/wc-core-functions.php:626
#: includes/wc-core-functions.php:606 includes/wc-core-functions.php:641
msgctxt "slug"
msgid "product"
msgstr ""
@ -9974,17 +9966,17 @@ msgctxt "Tax status"
msgid "None"
msgstr ""
#: includes/wc-core-functions.php:75 includes/wc-order-functions.php:598
#: includes/wc-core-functions.php:76 includes/wc-order-functions.php:599
msgctxt "Order date parsed by strftime"
msgid "%b %d, %Y @ %I:%M %p"
msgstr ""
#: includes/wc-page-functions.php:93
#: includes/wc-page-functions.php:105
msgctxt "edit-address-slug"
msgid "billing"
msgstr ""
#: includes/wc-page-functions.php:94
#: includes/wc-page-functions.php:106
msgctxt "edit-address-slug"
msgid "shipping"
msgstr ""

View File

@ -1889,7 +1889,7 @@ abstract class WC_Abstract_Order {
*/
public function get_checkout_payment_url( $on_checkout = false ) {
$pay_url = wc_get_endpoint_url( 'order-pay', $this->id, get_permalink( wc_get_page_id( 'checkout' ) ) );
$pay_url = wc_get_endpoint_url( 'order-pay', $this->id, wc_get_page_permalink( 'checkout' ) );
if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
$pay_url = str_replace( 'http:', 'https:', $pay_url );
@ -1912,7 +1912,7 @@ abstract class WC_Abstract_Order {
*/
public function get_checkout_order_received_url() {
$order_received_url = wc_get_endpoint_url( 'order-received', $this->id, get_permalink( wc_get_page_id( 'checkout' ) ) );
$order_received_url = wc_get_endpoint_url( 'order-received', $this->id, wc_get_page_permalink( 'checkout' ) );
if ( 'yes' == get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) {
$order_received_url = str_replace( 'http:', 'https:', $order_received_url );
@ -1932,7 +1932,7 @@ abstract class WC_Abstract_Order {
* @return string
*/
public function get_cancel_order_url( $redirect = '' ) {
$cancel_endpoint = get_permalink( wc_get_page_id( 'cart' ) );
$cancel_endpoint = wc_get_page_permalink( 'cart' );
if ( ! $cancel_endpoint ) {
$cancel_endpoint = home_url();
}
@ -1951,7 +1951,7 @@ abstract class WC_Abstract_Order {
*/
public function get_view_order_url() {
$view_order_url = wc_get_endpoint_url( 'view-order', $this->id, get_permalink( wc_get_page_id( 'myaccount' ) ) );
$view_order_url = wc_get_endpoint_url( 'view-order', $this->id, wc_get_page_permalink( 'myaccount' ) );
return apply_filters( 'woocommerce_get_view_order_url', $view_order_url, $this );
}

View File

@ -95,7 +95,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API {
if ( $order ) {
$return_url = $order->get_checkout_order_received_url();
} else {
$return_url = wc_get_endpoint_url( 'order-received', '', get_permalink( wc_get_page_id( 'checkout' ) ) );
$return_url = wc_get_endpoint_url( 'order-received', '', wc_get_page_permalink( 'checkout' ) );
}
if ( is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes' ) {

View File

@ -243,6 +243,7 @@ class WC_Product {
// Clear caches
wp_cache_delete( $this->id, 'post_meta' );
unset( $this->stock );
// Stock status
$this->check_stock_status();
@ -292,6 +293,7 @@ class WC_Product {
}
if ( update_post_meta( $this->id, '_stock_status', $status ) ) {
$this->stock_status = $status;
do_action( 'woocommerce_product_set_stock_status', $this->id, $status );
}
}
@ -1235,6 +1237,8 @@ class WC_Product {
public function get_related( $limit = 5 ) {
global $wpdb;
$limit = absint( $limit );
// Related products are found from category and tag
$tags_array = array(0);
$cats_array = array(0);
@ -1296,11 +1300,24 @@ class WC_Product {
$query['where'] .= " AND p.ID NOT IN ( " . implode( ',', $exclude_ids ) . " ) )";
}
$query['orderby'] = " ORDER BY RAND()";
$query['limits'] = " LIMIT " . absint( $limit ) . " ";
$query = apply_filters( 'woocommerce_product_related_posts_query', $query, $this->id );
// How many rows total?
$max_related_posts_transient_name = 'wc_max_related_' . $this->id . WC_Cache_Helper::get_transient_version( 'product' );
if ( false === ( $max_related_posts = get_transient( $max_related_posts_transient_name ) ) ) {
$max_related_posts_query = $query;
$max_related_posts_query['fields'] = "SELECT COUNT(DISTINCT ID) FROM {$wpdb->posts} p";
$max_related_posts = absint( $wpdb->get_var( implode( ' ', apply_filters( 'woocommerce_product_max_related_posts_query', $max_related_posts_query, $this->id ) ) ) );
set_transient( $max_related_posts_transient_name, $max_related_posts, YEAR_IN_SECONDS );
}
// Generate limit
$offset = absint( rand( 0, $max_related_posts - $limit ) );
$query['limits'] = " LIMIT {$offset}, {$limit} ";
// Get the posts
$related_posts = $wpdb->get_col( implode( ' ', apply_filters( 'woocommerce_product_related_posts_query', $query, $this->id ) ) );
$related_posts = $wpdb->get_col( implode( ' ', $query ) );
return $related_posts;
}

View File

@ -53,9 +53,10 @@ class WC_Admin_Dashboard {
// Sales
$query = array();
$query['fields'] = "SELECT SUM( postmeta.meta_value ) FROM {$wpdb->posts} as posts";
$query['join'] = "INNER JOIN {$wpdb->postmeta} AS postmeta ON posts.ID = postmeta.post_id ";
$query['where'] = "WHERE posts.post_type IN ( '" . implode( "','", wc_get_order_types( 'sales-reports' ) ) . "' ) ";
$query['where'] .= "AND posts.post_status IN ( 'wc-" . implode( "','wc-", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold', 'refunded' ) ) ) . "' ) ";
$query['join'] = "INNER JOIN {$wpdb->postmeta} AS postmeta ON posts.ID = postmeta.post_id LEFT JOIN {$wpdb->posts} AS parent ON posts.post_parent = parent.ID";
$query['where'] = "WHERE posts.post_type IN ( '" . implode( "','", array_merge( wc_get_order_types( 'sales-reports' ), array( 'shop_order_refund' ) ) ) . "' ) ";
$query['where'] .= "AND posts.post_status IN ( 'wc-" . implode( "','wc-", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "' ) ";
$query['where'] .= "AND ( parent.post_status IN ( 'wc-" . implode( "','wc-", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "' ) OR parent.ID IS NULL ) ";
$query['where'] .= "AND postmeta.meta_key = '_order_total' ";
$query['where'] .= "AND posts.post_date >= '" . date( 'Y-m-01', current_time( 'timestamp' ) ) . "' ";
$query['where'] .= "AND posts.post_date <= '" . date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ) . "' ";

View File

@ -133,14 +133,6 @@ class WC_Admin_Duplicate_Product {
$suffix = ' ' . __( '(Copy)', 'woocommerce' );
}
$new_post_type = $post->post_type;
$post_content = str_replace( "'", "''", $post->post_content );
$post_content_filtered = str_replace( "'", "''", $post->post_content_filtered );
$post_excerpt = str_replace( "'", "''", $post->post_excerpt );
$post_title = str_replace( "'", "''", $post->post_title ) . $suffix;
$comment_status = str_replace( "'", "''", $post->comment_status );
$ping_status = str_replace( "'", "''", $post->ping_status );
// Insert the new template in the post table
$wpdb->insert(
$wpdb->posts,
@ -148,14 +140,14 @@ class WC_Admin_Duplicate_Product {
'post_author' => $new_post_author->ID,
'post_date' => $new_post_date,
'post_date_gmt' => $new_post_date_gmt,
'post_content' => $post_content,
'post_content_filtered' => $post_content_filtered,
'post_title' => $post_title,
'post_excerpt' => $post_excerpt,
'post_content' => $post->post_content,
'post_content_filtered' => $post->post_content_filtered,
'post_title' => $post->post_title . $suffix,
'post_excerpt' => $post->post_excerpt,
'post_status' => $post_status,
'post_type' => $new_post_type,
'comment_status' => $comment_status,
'ping_status' => $ping_status,
'post_type' => $post->post_type,
'comment_status' => $post->comment_status,
'ping_status' => $post->ping_status,
'post_password' => $post->post_password,
'to_ping' => $post->to_ping,
'pinged' => $post->pinged,
@ -225,7 +217,7 @@ class WC_Admin_Duplicate_Product {
*/
private function duplicate_post_taxonomies( $id, $new_id, $post_type ) {
$taxonomies = get_object_taxonomies( $post_type ); //array("category", "post_tag");
$taxonomies = get_object_taxonomies( $post_type );
foreach ( $taxonomies as $taxonomy ) {

View File

@ -253,7 +253,7 @@ class WC_Admin_Menus {
</label>
<input type="hidden" class="menu-item-type" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="custom" />
<input type="hidden" class="menu-item-title" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]" value="<?php echo esc_html( $key ); ?>" />
<input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="<?php echo esc_url( wc_get_endpoint_url( $key, '', get_permalink( wc_get_page_id( 'myaccount' ) ) ) ); ?>" />
<input type="hidden" class="menu-item-url" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]" value="<?php echo esc_url( wc_get_endpoint_url( $key, '', wc_get_page_permalink( 'myaccount' ) ) ); ?>" />
<input type="hidden" class="menu-item-classes" name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-classes]" />
</li>
<?php

View File

@ -435,7 +435,7 @@ class WC_Admin_Welcome {
return;
}
if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'woocommerce.php' ) ) ) {
if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'wc-about' ) ) {
return;
}

View File

@ -99,7 +99,7 @@ class WC_Admin {
$prevent_access = apply_filters( 'woocommerce_prevent_admin_access', $prevent_access );
if ( $prevent_access ) {
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
exit;
}
}
@ -148,9 +148,21 @@ class WC_Admin {
*/
public function admin_footer_text( $footer_text ) {
$current_screen = get_current_screen();
$wc_pages = wc_get_screen_ids();
// Set only wc pages
$wc_pages = array_flip( $wc_pages );
unset( $wc_pages['profile'] );
unset( $wc_pages['user-edit'] );
$wc_pages = array_flip( $wc_pages );
// Add the dashboard pages
$wc_pages[] = 'dashboard_page_wc-about';
$wc_pages[] = 'dashboard_page_wc-credits';
$wc_pages[] = 'dashboard_page_wc-translators';
// Check to make sure we're on a WooCommerce admin page
if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, wc_get_screen_ids() ) ) ) {
if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, $wc_pages ) ) ) {
// Change the footer text
$footer_text = sprintf( __( 'If you like <strong>WooCommerce</strong> please leave us a <a href="%1$s" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating on <a href="%1$s" target="_blank">WordPress.org</a>. A huge thank you from WooThemes in advance!', 'woocommerce' ), 'https://wordpress.org/support/view/plugin-reviews/woocommerce?filter=5#postform' );
}

View File

@ -106,13 +106,13 @@ class WC_Tax_Rate_Importer extends WP_Importer {
$loop = 0;
if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
if ( ( $handle = fopen( $file, "r" ) ) !== false ) {
$header = fgetcsv( $handle, 0, $this->delimiter );
if ( 10 === sizeof( $header ) ) {
while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== FALSE ) {
while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== false ) {
list( $country, $state, $postcode, $city, $rate, $name, $priority, $compound, $shipping, $class ) = $row;

View File

@ -421,9 +421,10 @@ class WC_Meta_Box_Product_Data {
// Output All Set Attributes
if ( ! empty( $attributes ) ) {
$attribute_keys = array_keys( $attributes );
$attribute_keys = array_keys( $attributes );
$attribute_total = sizeof( $attribute_keys );
for ( $i = 0; $i < sizeof( $attribute_keys ); $i ++ ) {
for ( $i = 0; $i < $attribute_total; $i ++ ) {
$attribute = $attributes[ $attribute_keys[ $i ] ];
$position = empty( $attribute['position'] ) ? 0 : absint( $attribute['position'] );
$taxonomy = '';
@ -1223,7 +1224,7 @@ class WC_Meta_Box_Product_Data {
if ( isset( $_POST['_wc_file_urls'] ) ) {
$file_names = isset( $_POST['_wc_file_names'] ) ? array_map( 'wc_clean', $_POST['_wc_file_names'] ) : array();
$file_urls = isset( $_POST['_wc_file_urls'] ) ? array_map( 'wc_clean', $_POST['_wc_file_urls'] ) : array();
$file_urls = isset( $_POST['_wc_file_urls'] ) ? array_map( 'esc_url_raw', $_POST['_wc_file_urls'] ) : array();
$file_url_size = sizeof( $file_urls );
for ( $i = 0; $i < $file_url_size; $i ++ ) {

View File

@ -83,20 +83,11 @@ if ( ! defined( 'ABSPATH' ) ) {
// Get attribute data
if ( taxonomy_exists( wc_sanitize_taxonomy_name( $meta['meta_key'] ) ) ) {
$term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$attribute_name = str_replace( 'pa_', '', wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$attribute = $wpdb->get_var(
$wpdb->prepare( "
SELECT attribute_label
FROM {$wpdb->prefix}woocommerce_attribute_taxonomies
WHERE attribute_name = %s;
",
$attribute_name
)
);
$meta['meta_key'] = ( ! is_wp_error( $attribute ) && $attribute ) ? $attribute : $attribute_name;
$meta['meta_value'] = ( isset( $term->name ) ) ? $term->name : $meta['meta_value'];
$term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_key'] = wc_attribute_label( wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
$meta['meta_value'] = isset( $term->name ) ? $term->name : $meta['meta_value'];
} else {
$meta['meta_key'] = apply_filters( 'woocommerce_attribute_label', $meta['meta_key'], $meta['meta_key'] );
}
echo '<tr><th>' . wp_kses_post( rawurldecode( $meta['meta_key'] ) ) . ':</th><td>' . wp_kses_post( wpautop( make_clickable( rawurldecode( $meta['meta_value'] ) ) ) ) . '</td></tr>';

View File

@ -161,7 +161,7 @@ class WC_Admin_Report {
if ( ! empty( $parent_order_status ) ) {
$query['where'] .= "
AND parent.post_status IN ( 'wc-" . implode( "','wc-", $parent_order_status ) . "')
AND ( parent.post_status IN ( 'wc-" . implode( "','wc-", $parent_order_status ) . "') OR parent.ID IS NULL )
";
}

View File

@ -10,67 +10,26 @@
class WC_Report_Sales_By_Date extends WC_Admin_Report {
public $chart_colours = array();
private $average_sales = 0;
private $report_data;
/**
* Get the legend for the main chart sidebar
* Get report data
* @return array
*/
public function get_chart_legend() {
$legend = array();
public function get_report_data() {
if ( empty( $this->report_data ) ) {
$this->query_report_data();
}
return $this->report_data;
}
$total_orders = absint( $this->get_order_report_data( array(
'data' => array(
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
),
'query_type' => 'get_var',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) ) );
/**
* Get all data needed for this report and store in the class
*/
private function query_report_data() {
$this->report_data = new stdClass;
$total_items = absint( $this->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
),
'query_type' => 'get_var',
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'filter_range' => true,
) ) );
$total_coupons = $this->get_order_report_data( array(
'data' => array(
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'coupon',
'operator' => '='
)
),
'query_type' => 'get_var',
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'filter_range' => true,
) );
$order_totals = $this->get_order_report_data( array(
$this->report_data->orders = (array) $this->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
@ -91,69 +50,245 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
)
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'filter_range' => true
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array_merge( array( 'shop_order_refund' ), wc_get_order_types( 'sales-reports' ) ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$partial_refunds = $this->get_order_report_data( array(
$this->report_data->order_counts = (array) $this->get_order_report_data( array(
'data' => array(
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'count',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold' )
) );
$this->report_data->coupons = (array) $this->get_order_report_data( array(
'data' => array(
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_item_name'
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'coupon',
'operator' => '='
)
),
'group_by' => $this->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$this->report_data->order_items = (array) $this->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$this->report_data->refunded_order_items = (array) $this->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'refunded' ),
) );
$this->report_data->partial_refunds = (array) $this->get_order_report_data( array(
'data' => array(
'_refund_amount' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_refund'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
)
),
'query_type' => 'get_var',
'order_types' => array( 'shop_order_refund' ),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => false,
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$full_refunds = $this->get_order_report_data( array(
foreach( $this->report_data->partial_refunds as $key => $value ) {
$this->report_data->partial_refunds[ $key ]->order_item_count = $this->report_data->partial_refunds[ $key ]->order_item_count * -1;
}
$this->report_data->order_items = array_merge( $this->report_data->order_items, $this->report_data->partial_refunds );
$this->report_data->total_order_refunds = array_sum( (array) absint( $this->get_order_report_data( array(
'data' => array(
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
),
'query_type' => 'get_var',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'refunded' ),
) ) ) );
$this->report_data->full_refunds = (array) $this->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_refund'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'query_type' => 'get_var',
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'refunded' ),
'filter_range' => true
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => array( 'refunded' )
) );
$total_sales = $order_totals->total_sales;
$total_shipping = $order_totals->total_shipping;
$total_tax = $order_totals->total_tax;
$total_shipping_tax = $order_totals->total_shipping_tax;
$net_sales = $order_totals->total_sales - $total_shipping - $total_tax - $total_shipping_tax;
$total_refunds = $partial_refunds + $full_refunds;
$this->average_sales = $total_sales / ( $this->chart_interval + 1 );
$this->report_data->refunds = array_merge( $this->report_data->partial_refunds, $this->report_data->full_refunds );
$this->report_data->total_sales = wc_format_decimal( array_sum( wp_list_pluck( $this->report_data->orders, 'total_sales' ) ), 2 );
$this->report_data->total_tax = wc_format_decimal( array_sum( wp_list_pluck( $this->report_data->orders, 'total_tax' ) ), 2 );
$this->report_data->total_shipping = wc_format_decimal( array_sum( wp_list_pluck( $this->report_data->orders, 'total_shipping' ) ), 2 );
$this->report_data->total_shipping_tax = wc_format_decimal( array_sum( wp_list_pluck( $this->report_data->orders, 'total_shipping_tax' ) ), 2 );
$this->report_data->total_refunds = wc_format_decimal( array_sum( wp_list_pluck( $this->report_data->partial_refunds, 'total_refund' ) ) + array_sum( wp_list_pluck( $this->report_data->full_refunds, 'total_refund' ) ), 2 );
$this->report_data->total_coupons = number_format( array_sum( wp_list_pluck( $this->report_data->coupons, 'discount_amount' ) ), 2 );
$this->report_data->total_orders = absint( array_sum( wp_list_pluck( $this->report_data->order_counts, 'count' ) ) );
$this->report_data->total_partial_refunds = array_sum( wp_list_pluck( $this->report_data->partial_refunds, 'order_item_count' ) ) * -1;
$this->report_data->total_item_refunds = array_sum( wp_list_pluck( $this->report_data->refunded_order_items, 'order_item_count' ) ) * -1;
$this->report_data->total_items = absint( array_sum( wp_list_pluck( $this->report_data->order_items, 'order_item_count' ) ) * -1 );
$this->report_data->average_sales = wc_format_decimal( $this->report_data->total_sales / ( $this->chart_interval + 1 ), 2 );
$this->report_data->net_sales = wc_format_decimal( $this->report_data->total_sales - $this->report_data->total_shipping - $this->report_data->total_tax - $this->report_data->total_shipping_tax, 2 );
}
/**
* Get the legend for the main chart sidebar
* @return array
*/
public function get_chart_legend() {
$legend = array();
$data = $this->get_report_data();
switch ( $this->chart_groupby ) {
case 'day' :
$average_sales_title = sprintf( __( '%s average daily sales', 'woocommerce' ), '<strong>' . wc_price( $this->average_sales ) . '</strong>' );
$average_sales_title = sprintf( __( '%s average daily sales', 'woocommerce' ), '<strong>' . wc_price( $data->average_sales ) . '</strong>' );
break;
case 'month' :
default :
$average_sales_title = sprintf( __( '%s average monthly sales', 'woocommerce' ), '<strong>' . wc_price( $this->average_sales ) . '</strong>' );
$average_sales_title = sprintf( __( '%s average monthly sales', 'woocommerce' ), '<strong>' . wc_price( $data->average_sales ) . '</strong>' );
break;
}
$legend[] = array(
'title' => sprintf( __( '%s gross sales in this period', 'woocommerce' ), '<strong>' . wc_price( $total_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals, including shipping and taxes. This does not include refunds.', 'woocommerce' ),
'title' => sprintf( __( '%s gross sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->total_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and including shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 6
);
$legend[] = array(
'title' => sprintf( __( '%s net sales in this period', 'woocommerce' ), '<strong>' . wc_price( $net_sales ) . '</strong>' ),
'placeholder' => __( 'This is the net sales figure excluding shipping and taxes. This does not include refunds.', 'woocommerce' ),
'title' => sprintf( __( '%s net sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->net_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and excluding shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['net_sales_amount'],
'highlight_series' => 7
);
@ -163,27 +298,29 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'highlight_series' => 2
);
$legend[] = array(
'title' => sprintf( __( '%s orders placed', 'woocommerce' ), '<strong>' . $total_orders . '</strong>' ),
'title' => sprintf( __( '%s orders placed', 'woocommerce' ), '<strong>' . ( $data->total_order_refunds + $data->total_orders !== $data->total_orders ? '<del>' . ( $data->total_order_refunds + $data->total_orders ) . '</del> ' : '' ) . $data->total_orders . '</strong>' ),
'color' => $this->chart_colours['order_count'],
'highlight_series' => 1
);
$legend[] = array(
'title' => sprintf( __( '%s items purchased', 'woocommerce' ), '<strong>' . $total_items . '</strong>' ),
'title' => sprintf( __( '%s items purchased', 'woocommerce' ), '<strong>' . ( $data->total_item_refunds + $data->total_partial_refunds > 0 ? '<del>' . ( $data->total_item_refunds + $data->total_partial_refunds + $data->total_items ) . '</del> ' : '' ) . $data->total_items . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0
);
$legend[] = array(
'title' => sprintf( __( '%s charged for shipping', 'woocommerce' ), '<strong>' . wc_price( $total_shipping ) . '</strong>' ),
'title' => sprintf( __( '%s charged for shipping', 'woocommerce' ), '<strong>' . wc_price( $data->total_shipping ) . '</strong>' ),
'color' => $this->chart_colours['shipping_amount'],
'highlight_series' => 5
);
$legend[] = array(
'title' => sprintf( __( '%s in refunds', 'woocommerce' ), '<strong>' . wc_price( $total_refunds ) . '</strong>' ),
'title' => sprintf( __( '%s in refunds', 'woocommerce' ), '<strong>' . wc_price( $data->total_refunds ) . '</strong>' ),
'color' => $this->chart_colours['refund_amount'],
'highlight_series' => 4
);
$legend[] = array(
'title' => sprintf( __( '%s worth of coupons used', 'woocommerce' ), '<strong>' . wc_price( $total_coupons ) . '</strong>' ),
'title' => sprintf( __( '%s worth of coupons used', 'woocommerce' ), '<strong>' . wc_price( $data->total_coupons ) . '</strong>' ),
'color' => $this->chart_colours['coupon_amount'],
'highlight_series' => 3
);
@ -195,7 +332,6 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
* Output the report
*/
public function output_report() {
$ranges = array(
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
@ -229,7 +365,6 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
* Output an export link
*/
public function get_export_button() {
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : '7day';
?>
<a
@ -254,164 +389,15 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
public function get_main_chart() {
global $wp_locale;
// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date
$orders = (array) $this->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
// Order items
$order_items = (array) $this->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
// Get discount amounts in range
$coupons = (array) $this->get_order_report_data( array(
'data' => array(
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_item_name'
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'coupon',
'operator' => '='
)
),
'group_by' => $this->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
$partial_refunds = (array) $this->get_order_report_data( array(
'data' => array(
'_refund_amount' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_refund'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => false,
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$full_refunds = (array) $this->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_refund'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => array( 'refunded' ),
) );
$refunds = array_merge( $partial_refunds, $full_refunds );
// Prepare data for report
$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );
$order_item_counts = $this->prepare_chart_data( $order_items, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby );
$order_amounts = $this->prepare_chart_data( $orders, 'post_date', 'total_sales', $this->chart_interval, $this->start_date, $this->chart_groupby );
$coupon_amounts = $this->prepare_chart_data( $coupons, 'post_date', 'discount_amount', $this->chart_interval, $this->start_date, $this->chart_groupby );
$shipping_amounts = $this->prepare_chart_data( $orders, 'post_date', 'total_shipping', $this->chart_interval, $this->start_date, $this->chart_groupby );
$refund_amounts = $this->prepare_chart_data( $refunds, 'post_date', 'total_refund', $this->chart_interval, $this->start_date, $this->chart_groupby );
$shipping_tax_amounts = $this->prepare_chart_data( $orders, 'post_date', 'total_shipping_tax', $this->chart_interval, $this->start_date, $this->chart_groupby );
$tax_amounts = $this->prepare_chart_data( $orders, 'post_date', 'total_tax', $this->chart_interval, $this->start_date, $this->chart_groupby );
$order_counts = $this->prepare_chart_data( $this->report_data->order_counts, 'post_date', 'count', $this->chart_interval, $this->start_date, $this->chart_groupby );
$order_item_counts = $this->prepare_chart_data( $this->report_data->order_items, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby );
$order_amounts = $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_sales', $this->chart_interval, $this->start_date, $this->chart_groupby );
$coupon_amounts = $this->prepare_chart_data( $this->report_data->coupons, 'post_date', 'discount_amount', $this->chart_interval, $this->start_date, $this->chart_groupby );
$shipping_amounts = $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_shipping', $this->chart_interval, $this->start_date, $this->chart_groupby );
$refund_amounts = $this->prepare_chart_data( $this->report_data->refunds, 'post_date', 'total_refund', $this->chart_interval, $this->start_date, $this->chart_groupby );
$shipping_tax_amounts = $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_shipping_tax', $this->chart_interval, $this->start_date, $this->chart_groupby );
$tax_amounts = $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_tax', $this->chart_interval, $this->start_date, $this->chart_groupby );
$net_order_amounts = array();
@ -460,7 +446,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
},
{
label: "<?php echo esc_js( __( 'Average sales amount', 'woocommerce' ) ) ?>",
data: [ [ <?php echo min( array_keys( $order_amounts ) ); ?>, <?php echo $this->average_sales; ?> ], [ <?php echo max( array_keys( $order_amounts ) ); ?>, <?php echo $this->average_sales; ?> ] ],
data: [ [ <?php echo min( array_keys( $order_amounts ) ); ?>, <?php echo $this->report_data->average_sales; ?> ], [ <?php echo max( array_keys( $order_amounts ) ); ?>, <?php echo $this->report_data->average_sales; ?> ] ],
yaxis: 2,
color: '<?php echo $this->chart_colours['average']; ?>',
points: { show: false },

View File

@ -17,11 +17,10 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
* Constructor
*/
public function __construct() {
if ( isset( $_GET['product_ids'] ) && is_array( $_GET['product_ids'] ) ) {
$this->product_ids = array_map( 'absint', $_GET['product_ids'] );
$this->product_ids = array_filter( array_map( 'absint', $_GET['product_ids'] ) );
} elseif ( isset( $_GET['product_ids'] ) ) {
$this->product_ids = array( absint( $_GET['product_ids'] ) );
$this->product_ids = array_filter( array( absint( $_GET['product_ids'] ) ) );
}
}

View File

@ -67,61 +67,83 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
public function get_main_chart() {
global $wpdb;
$tax_rows = $this->get_order_report_data( array(
'data' => array(
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'tax_rate'
),
'tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'tax_amount'
),
'shipping_tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'shipping_tax_amount'
),
'rate_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'rate_id'
),
'order_id' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_id'
)
$query_data = array(
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'tax_rate'
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'tax',
'operator' => '='
),
array(
'key' => 'order_item_name',
'value' => '',
'operator' => '!='
)
'tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'tax_amount'
),
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'shipping_tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'shipping_tax_amount'
),
'rate_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'rate_id'
),
'ID' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_id'
),
);
$query_where = array(
array(
'key' => 'order_item_type',
'value' => 'tax',
'operator' => '='
),
array(
'key' => 'order_item_name',
'value' => '',
'operator' => '!='
)
);
$tax_rows_orders = $this->get_order_report_data( array(
'data' => $query_data,
'where' => $query_where,
'order_by' => 'posts.post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array_merge( wc_get_order_types( 'sales-reports' ), array( 'shop_order_refund' ) ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
) );
// Merge
$tax_rows = array();
foreach ( $tax_rows_orders as $tax_row ) {
$key = $tax_row->rate_id;
$tax_rows[ $key ] = isset( $tax_rows[ $key ] ) ? $tax_rows[ $key ] : (object) array( 'tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_orders' => 0 );
if ( 'shop_order_refund' !== get_post_type( $tax_row->post_id ) ) {
$tax_rows[ $key ]->total_orders += 1;
}
$tax_rows[ $key ]->tax_rate = $tax_row->tax_rate;
$tax_rows[ $key ]->tax_amount += wc_round_tax_total( $tax_row->tax_amount );
$tax_rows[ $key ]->shipping_tax_amount += wc_round_tax_total( $tax_row->shipping_tax_amount );
}
?>
<table class="widefat">
<thead>
<tr>
<th><?php _e( 'Tax', 'woocommerce' ); ?></th>
<th><?php _e( 'Rate', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Number of orders', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Number of Orders', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Tax Amount', 'woocommerce' ); ?> <a class="tips" data-tip="<?php esc_attr_e( 'This is the sum of the "Tax Rows" tax amount within your orders.', 'woocommerce' ); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Shipping Tax Amount', 'woocommerce' ); ?> <a class="tips" data-tip="<?php esc_attr_e( 'This is the sum of the "Tax Rows" shipping tax amount within your orders.', 'woocommerce' ); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Total Tax', 'woocommerce' ); ?> <a class="tips" data-tip="<?php esc_attr_e( 'This is the total tax for the rate (shipping tax + product tax).', 'woocommerce' ); ?>" href="#">[?]</a></th>
@ -130,28 +152,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
<?php if ( $tax_rows ) : ?>
<tbody>
<?php
$grouped_tax_tows = array();
foreach ( $tax_rows as $tax_row ) {
if ( ! isset( $grouped_tax_tows[ $tax_row->rate_id ] ) ) {
$grouped_tax_tows[ $tax_row->rate_id ] = (object) array(
'tax_rate' => $tax_row->tax_rate,
'total_orders' => 0,
'tax_amount' => 0,
'shipping_tax_amount' => 0
);
}
if ( 'shop_order' === get_post_type( $tax_row->order_id ) ) {
$grouped_tax_tows[ $tax_row->rate_id ]->total_orders ++;
}
$grouped_tax_tows[ $tax_row->rate_id ]->tax_amount += wc_round_tax_total( $tax_row->tax_amount );
$grouped_tax_tows[ $tax_row->rate_id ]->shipping_tax_amount += wc_round_tax_total( $tax_row->shipping_tax_amount );
}
foreach ( $grouped_tax_tows as $rate_id => $tax_row ) {
foreach ( $tax_rows as $rate_id => $tax_row ) {
$rate = $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %d;", $rate_id ) );
?>
<tr>

View File

@ -65,53 +65,87 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
* @return string
*/
public function get_main_chart() {
$tax_rows = $this->get_order_report_data( array(
'data' => array(
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax_amount'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax_amount'
),
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
$query_data = array(
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax_amount'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax_amount'
),
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
);
$tax_rows_orders = $this->get_order_report_data( array(
'data' => $query_data,
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold' )
) );
$tax_rows_partial_refunds = $this->get_order_report_data( array(
'data' => $query_data,
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array( 'shop_order_refund' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
) );
// Merge
$tax_rows = array();
foreach ( $tax_rows_orders as $tax_row ) {
$key = date( $this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ] = isset( $tax_rows[ $key ] ) ? $tax_rows[ $key ] : (object) array( 'tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0 );
$tax_rows[ $key ]->tax_amount += $tax_row->tax_amount;
$tax_rows[ $key ]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[ $key ]->total_sales += $tax_row->total_sales;
$tax_rows[ $key ]->total_shipping += $tax_row->total_shipping;
$tax_rows[ $key ]->total_orders += $tax_row->total_orders;
}
foreach ( $tax_rows_partial_refunds as $tax_row ) {
$key = date( $this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime( $tax_row->post_date ) );
$tax_rows[ $key ] = isset( $tax_rows[ $key ] ) ? $tax_rows[ $key ] : (object) array( 'tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0 );
$tax_rows[ $key ]->tax_amount += $tax_row->tax_amount;
$tax_rows[ $key ]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[ $key ]->total_sales += $tax_row->total_sales;
$tax_rows[ $key ]->total_shipping += $tax_row->total_shipping;
}
?>
<table class="widefat">
<thead>
<tr>
<th><?php _e( 'Period', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Orders/refunds', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Number of Orders', 'woocommerce' ); ?></th>
<th class="total_row"><?php _e( 'Total Sales', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e("This is the sum of the 'Order Total' field within your orders.", 'woocommerce'); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Total Shipping', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e("This is the sum of the 'Shipping Total' field within your orders.", 'woocommerce'); ?>" href="#">[?]</a></th>
<th class="total_row"><?php _e( 'Total Tax', 'woocommerce' ); ?> <a class="tips" data-tip="<?php esc_attr_e( 'This is the total tax for the rate (shipping tax + product tax).', 'woocommerce' ); ?>" href="#">[?]</a></th>
@ -121,16 +155,16 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
<?php if ( $tax_rows ) : ?>
<tbody>
<?php
foreach ( $tax_rows as $tax_row ) {
foreach ( $tax_rows as $date => $tax_row ) {
$gross = $tax_row->total_sales - $tax_row->total_shipping;
$total_tax = $tax_row->tax_amount + $tax_row->shipping_tax_amount;
?>
<tr>
<th scope="row"><?php
if ( $this->chart_groupby == 'month' )
echo date_i18n( 'F', strtotime( $tax_row->post_date ) );
echo date_i18n( 'F', strtotime( $date . '01' ) );
else
echo date_i18n( get_option( 'date_format' ), strtotime( $tax_row->post_date ) );
echo date_i18n( get_option( 'date_format' ), strtotime( $date ) );
?></th>
<td class="total_row"><?php echo $tax_row->total_orders; ?></td>
<td class="total_row"><?php echo wc_price( $gross ); ?></td>

View File

@ -63,7 +63,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
* @return array
*/
public function get_settings() {
$settings = apply_filters('woocommerce_email_settings', array(
$settings = apply_filters( 'woocommerce_email_settings', array(
array( 'type' => 'sectionend', 'id' => 'email_recipient_options' ),
@ -75,7 +75,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'id' => 'woocommerce_email_from_name',
'type' => 'text',
'css' => 'min-width:300px;',
'default' => esc_attr(get_bloginfo('title')),
'default' => esc_attr( get_bloginfo( 'name', 'display' ) ),
'autoload' => false
),
@ -88,17 +88,17 @@ class WC_Settings_Emails extends WC_Settings_Page {
'multiple' => 'multiple'
),
'css' => 'min-width:300px;',
'default' => get_option('admin_email'),
'default' => get_option( 'admin_email' ),
'autoload' => false
),
array( 'type' => 'sectionend', 'id' => 'email_options' ),
array( 'title' => __( 'Email Template', 'woocommerce' ), 'type' => 'title', 'desc' => sprintf(__( 'This section lets you customise the WooCommerce emails. <a href="%s" target="_blank">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommerce/emails/</code>.', 'woocommerce' ), wp_nonce_url(admin_url('?preview_woocommerce_mail=true'), 'preview-mail')), 'id' => 'email_template_options' ),
array( 'title' => __( 'Email Template', 'woocommerce' ), 'type' => 'title', 'desc' => sprintf(__( 'This section lets you customise the WooCommerce emails. <a href="%s" target="_blank">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommerce/emails/</code>.', 'woocommerce' ), wp_nonce_url( admin_url( '?preview_woocommerce_mail=true' ), 'preview-mail' ) ), 'id' => 'email_template_options' ),
array(
'title' => __( 'Header Image', 'woocommerce' ),
'desc' => sprintf(__( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce' ), admin_url('media-new.php')),
'desc' => sprintf( __( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woocommerce' ), admin_url( 'media-new.php' ) ),
'id' => 'woocommerce_email_header_image',
'type' => 'text',
'css' => 'min-width:300px;',
@ -112,7 +112,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'id' => 'woocommerce_email_footer_text',
'css' => 'width:100%; height: 75px;',
'type' => 'textarea',
'default' => get_bloginfo('title') . ' - ' . __( 'Powered by WooCommerce', 'woocommerce' ),
'default' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by WooCommerce', 'woocommerce' ),
'autoload' => false
),

View File

@ -46,6 +46,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'title' => __( 'Default Customer Address:', 'woocommerce' ),
'id' => 'woocommerce_default_customer_address',
'desc_tip' => __( 'This option determines the customers default address (before they input their details).', 'woocommerce' ),
'desc' => sprintf( __( 'Note: If you choose to Geolocate the user address, the %sMaxMind GeoLite Database%s will be periodically downloaded and stored in your wp-content directory.', 'woocommerce' ), '<a href="http://dev.maxmind.com/geoip/legacy/geolite/">', '</a>' ),
'default' => 'geolocation',
'type' => 'select',
'class' => 'wc-enhanced-select',
@ -78,7 +79,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
array(
'title' => __( 'Additional Tax Classes', 'woocommerce' ),
'desc' => __( 'List additional tax classes below (1 per line). This is in addition to the default <code>Standard Rate</code>. Tax classes can be assigned to products.', 'woocommerce' ),
'desc_tip' => __( 'List additional tax classes below (1 per line). This is in addition to the default "Standard Rate".', 'woocommerce' ),
'id' => 'woocommerce_tax_classes',
'css' => 'width:100%; height: 65px;',
'type' => 'textarea',
@ -86,7 +87,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
),
array(
'title' => __( 'Display prices in the shop:', 'woocommerce' ),
'title' => __( 'Display Prices in the Shop:', 'woocommerce' ),
'id' => 'woocommerce_tax_display_shop',
'default' => 'excl',
'type' => 'select',
@ -98,15 +99,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
),
array(
'title' => __( 'Price display suffix:', 'woocommerce' ),
'id' => 'woocommerce_price_display_suffix',
'default' => '',
'type' => 'text',
'desc' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: <code>{price_including_tax}, {price_excluding_tax}</code>.', 'woocommerce' ),
),
array(
'title' => __( 'Display prices during cart/checkout:', 'woocommerce' ),
'title' => __( 'Display Prices During Cart and Checkout:', 'woocommerce' ),
'id' => 'woocommerce_tax_display_cart',
'default' => 'excl',
'type' => 'select',
@ -119,7 +112,16 @@ return apply_filters( 'woocommerce_tax_settings', array(
),
array(
'title' => __( 'Display tax totals:', 'woocommerce' ),
'title' => __( 'Price Display Suffix:', 'woocommerce' ),
'id' => 'woocommerce_price_display_suffix',
'default' => '',
'placeholder' => __( 'N/A', 'woocommerce' ),
'type' => 'text',
'desc_tip' => __( 'Define text to show after your product prices. This could be, for example, "inc. Vat" to explain your pricing. You can also have prices substituted here using one of the following: {price_including_tax}, {price_excluding_tax}.', 'woocommerce' ),
),
array(
'title' => __( 'Display Tax Totals:', 'woocommerce' ),
'id' => 'woocommerce_tax_total_display',
'default' => 'itemized',
'type' => 'select',

View File

@ -185,6 +185,28 @@ If enabled on your server, Suhosin may need to be configured to increase its dat
$posting['soap_client']['note'] = sprintf( __( 'Your server does not have the <a href="%s">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.', 'woocommerce' ), 'http://php.net/manual/en/class.soapclient.php' ) . '</mark>';
}
// DOMDocument
$posting['dom_document']['name'] = 'DOMDocument';
$posting['dom_document']['help'] = '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'woocommerce' ) . '">[?]</a>';
if ( class_exists( 'DOMDocument' ) ) {
$posting['dom_document']['success'] = true;
} else {
$posting['dom_document']['success'] = false;
$posting['dom_document']['note'] = sprintf( __( 'Your server does not have the <a href="%s">DOMDocument</a> class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'woocommerce' ), 'http://php.net/manual/en/class.domdocument.php' ) . '</mark>';
}
// GZIP
$posting['gzip']['name'] = 'GZip';
$posting['gzip']['help'] = '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'GZip (gzopen) is used to open the GEOIP database from MaxMind.', 'woocommerce' ) . '">[?]</a>';
if ( is_callable( 'gzopen' ) ) {
$posting['gzip']['success'] = true;
} else {
$posting['gzip']['success'] = false;
$posting['gzip']['note'] = sprintf( __( 'Your server does not support the <a href="%s">gzopen</a> function - this is required to use the GeoIP database from MaxMind. The API fallback will be used instead for geolocation.', 'woocommerce' ), 'http://php.net/manual/en/zlib.installation.php' ) . '</mark>';
}
// WP Remote Post Check
$posting['wp_remote_post']['name'] = __( 'Remote Post', 'woocommerce');
$posting['wp_remote_post']['help'] = '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'PayPal uses this method of communicating when sending back transaction information.', 'woocommerce' ) . '">[?]</a>';

View File

@ -17,7 +17,7 @@ if ( current_user_can( 'install_plugins' ) ) {
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p><?php _e( '<strong>The Frontend Styles options is deprecated</strong> &#8211; If you want to continue editing the colors of your store is recommended that you install the replacement WooCommerce Colors plugin from WordPress.org.', 'woocommerce' ); ?></p>
<p><?php _e( '<strong>The Frontend Style options are deprecated</strong> &#8211; If you want to continue editing the colors of your store we recommended that you install the replacement WooCommerce Colors plugin from WordPress.org.', 'woocommerce' ); ?></p>
<p class="submit"><a href="<?php echo esc_url( $url ); ?>" class="wc-update-now button-primary"><?php _e( 'Install the new WooCommerce Colors plugin', 'woocommerce' ); ?></a> <a class="skip button" href="<?php echo esc_url( add_query_arg( 'wc-hide-notice', 'frontend_colors' ) ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a></p>
</div>

View File

@ -10,6 +10,6 @@ if ( ! defined( 'ABSPATH' ) ) {
?>
<div id="message" class="updated woocommerce-message wc-connect">
<p><?php _e( '<strong>Your theme has bundled outdated copies of WooCommerce template files.</strong> If you notice an issue on your site, this could be the reason. Please contact your theme developer for further assistance. You can review the System Status report for full details or <a href="http://docs.woothemes.com/document/template-structure/">learn more about WooCommerce Template Structure here</a>.', 'woocommerce' ); ?></p>
<p><?php _e( '<strong>Your theme has bundled outdated copies of WooCommerce template files.</strong> If you notice an issue on your site, this could be the reason. Please contact your theme developer for further assistance. You can review the System Status report for full details or <a href="http://docs.woothemes.com/document/template-structure/" target="_blank">learn more about WooCommerce Template Structure here</a>.', 'woocommerce' ); ?></p>
<p class="submit"><a class="button-primary" href="<?php echo esc_url( admin_url( 'admin.php?page=wc-status' ) ); ?>"><?php _e( 'System Status', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo esc_url( add_query_arg( 'wc-hide-notice', 'template_files' ) ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a></p>
</div>

View File

@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p><?php printf( __( '<strong>Your theme does not declare WooCommerce support</strong> &#8211; Please read our integration guide or check out our %sStorefront%s theme which is totally free to download and designed specifically for use with WooCommerce :)', 'woocommerce' ), '<a href="' . esc_url( admin_url( 'theme-install.php?theme=storefront' ) ) . '">', '</a>' ); ?></p>
<p class="submit">
<a href="http://www.woothemes.com/storefront/?utm_source=wpadmin&utm_medium=notice&utm_campaign=Storefront" class="button-primary" target="_blank"><?php _e( 'Find out more about Storefront', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/third-party-custom-theme-compatibility/', 'theme-compatibility' ) ); ?>" class="button"><?php _e( 'Theme integration guide', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/third-party-custom-theme-compatibility/', 'theme-compatibility' ) ); ?>" class="button" target="_blank"><?php _e( 'Theme integration guide', 'woocommerce' ); ?></a>
<a class="skip button" href="<?php echo esc_url( add_query_arg( 'wc-hide-notice', 'theme_support' ) ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a>
</p>
</div>

View File

@ -34,7 +34,8 @@ function wc_get_screen_ids() {
'edit-product_cat',
'edit-product_tag',
'edit-product_shipping_class',
'profile'
'profile',
'user-edit'
);
foreach ( wc_get_order_types() as $type ) {

View File

@ -59,7 +59,6 @@ class WC_API_Reports extends WC_API_Resource {
* @return array
*/
public function get_reports() {
return array( 'reports' => array( 'sales', 'sales/top_sellers' ) );
}
@ -84,191 +83,25 @@ class WC_API_Reports extends WC_API_Resource {
// set date filtering
$this->setup_report( $filter );
// total sales, taxes, shipping, and order count
$totals = $this->report->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'order_count'
)
),
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'filter_range' => true,
) );
// total items ordered
$total_items = absint( $this->report->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
),
'query_type' => 'get_var',
'filter_range' => true,
) ) );
// total discount used
$total_discount = $this->report->get_order_report_data( array(
'data' => array(
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
),
'query_type' => 'get_var',
'filter_range' => true,
) );
// new customers
$users_query = new WP_User_Query(
array(
'fields' => array( 'user_registered' ),
'role' => 'customer',
'fields' => array( 'user_registered' ),
'role' => 'customer',
)
);
$customers = $users_query->get_results();
foreach ( $customers as $key => $customer ) {
if ( strtotime( $customer->user_registered ) < $this->report->start_date || strtotime( $customer->user_registered ) > $this->report->end_date )
if ( strtotime( $customer->user_registered ) < $this->report->start_date || strtotime( $customer->user_registered ) > $this->report->end_date ) {
unset( $customers[ $key ] );
}
}
$total_customers = count( $customers );
// get order totals grouped by period
$orders = $this->report->get_order_report_data( array(
'data' => array(
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'group_by' => $this->report->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
) );
// get order item totals grouped by period
$order_items = $this->report->get_order_report_data( array(
'data' => array(
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'line_item',
'operator' => '='
)
),
'group_by' => $this->report->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
) );
// get discount totals grouped by period
$discounts = $this->report->get_order_report_data( array(
'data' => array(
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
),
'group_by' => $this->report->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
) );
$period_totals = array();
$report_data = $this->report->get_report_data();
$period_totals = array();
// setup period totals by ensuring each period in the interval has data
for ( $i = 0; $i <= $this->report->chart_interval; $i ++ ) {
@ -285,7 +118,6 @@ class WC_API_Reports extends WC_API_Resource {
// set the customer signups for each period
$customer_count = 0;
foreach ( $customers as $customer ) {
if ( date( ( 'day' == $this->report->chart_groupby ) ? 'Y-m-d' : 'Y-m', strtotime( $customer->user_registered ) ) == $time ) {
$customer_count++;
}
@ -303,8 +135,7 @@ class WC_API_Reports extends WC_API_Resource {
}
// add total sales, total order count, total tax and total shipping for each period
foreach ( $orders as $order ) {
foreach ( $report_data->orders as $order ) {
$time = ( 'day' === $this->report->chart_groupby ) ? date( 'Y-m-d', strtotime( $order->post_date ) ) : date( 'Y-m', strtotime( $order->post_date ) );
if ( ! isset( $period_totals[ $time ] ) ) {
@ -312,14 +143,22 @@ class WC_API_Reports extends WC_API_Resource {
}
$period_totals[ $time ]['sales'] = wc_format_decimal( $order->total_sales, 2 );
$period_totals[ $time ]['orders'] = (int) $order->total_orders;
$period_totals[ $time ]['tax'] = wc_format_decimal( $order->total_tax + $order->total_shipping_tax, 2 );
$period_totals[ $time ]['shipping'] = wc_format_decimal( $order->total_shipping, 2 );
}
// add total order items for each period
foreach ( $order_items as $order_item ) {
foreach ( $report_data->order_counts as $order ) {
$time = ( 'day' === $this->report->chart_groupby ) ? date( 'Y-m-d', strtotime( $order->post_date ) ) : date( 'Y-m', strtotime( $order->post_date ) );
if ( ! isset( $period_totals[ $time ] ) ) {
continue;
}
$period_totals[ $time ]['orders'] = (int) $order->count;
}
// add total order items for each period
foreach ( $report_data->order_items as $order_item ) {
$time = ( 'day' === $this->report->chart_groupby ) ? date( 'Y-m-d', strtotime( $order_item->post_date ) ) : date( 'Y-m', strtotime( $order_item->post_date ) );
if ( ! isset( $period_totals[ $time ] ) ) {
@ -330,8 +169,7 @@ class WC_API_Reports extends WC_API_Resource {
}
// add total discount for each period
foreach ( $discounts as $discount ) {
foreach ( $report_data->coupons as $discount ) {
$time = ( 'day' === $this->report->chart_groupby ) ? date( 'Y-m-d', strtotime( $discount->post_date ) ) : date( 'Y-m', strtotime( $discount->post_date ) );
if ( ! isset( $period_totals[ $time ] ) ) {
@ -341,15 +179,15 @@ class WC_API_Reports extends WC_API_Resource {
$period_totals[ $time ]['discount'] = wc_format_decimal( $discount->discount_amount, 2 );
}
$sales_data = array(
'total_sales' => wc_format_decimal( $totals->total_sales, 2 ),
'net_sales' => wc_format_decimal( $totals->total_sales - $totals->total_shipping - $totals->total_tax - $totals->total_shipping_tax, 2 ),
'average_sales' => wc_format_decimal( $totals->total_sales / ( $this->report->chart_interval + 1 ), 2 ),
'total_orders' => (int) $totals->order_count,
'total_items' => $total_items,
'total_tax' => wc_format_decimal( $totals->total_tax + $totals->total_shipping_tax, 2 ),
'total_shipping' => wc_format_decimal( $totals->total_shipping, 2 ),
'total_discount' => is_null( $total_discount ) ? wc_format_decimal( 0.00, 2 ) : wc_format_decimal( $total_discount, 2 ),
$sales_data = array(
'total_sales' => $report_data->total_sales,
'net_sales' => $report_data->net_sales,
'average_sales' => $report_data->average_sales,
'total_orders' => $report_data->total_orders,
'total_items' => $report_data->total_items,
'total_tax' => wc_format_decimal( $report_data->total_tax + $report_data->total_shipping_tax, 2 ),
'total_shipping' => $report_data->total_shipping,
'total_discount' => $report_data->total_coupons,
'totals_grouped_by' => $this->report->chart_groupby,
'totals' => $period_totals,
'total_customers' => $total_customers,
@ -427,8 +265,9 @@ class WC_API_Reports extends WC_API_Resource {
private function setup_report( $filter ) {
include_once( WC()->plugin_path() . '/includes/admin/reports/class-wc-admin-report.php' );
include_once( WC()->plugin_path() . '/includes/admin/reports/class-wc-report-sales-by-date.php' );
$this->report = new WC_Admin_Report();
$this->report = new WC_Report_Sales_By_Date();
if ( empty( $filter['period'] ) ) {

View File

@ -1878,20 +1878,6 @@ class WC_AJAX {
}
foreach ( $line_item_qtys as $item_id => $qty ) {
$line_items[ $item_id ]['qty'] = max( $qty, 0 );
if ( $restock_refunded_items && $qty && isset( $order_items[ $item_id ] ) ) {
$order_item = $order_items[ $item_id ];
$_product = $order->get_product_from_item( $order_item );
if ( $_product && $_product->exists() && $_product->managing_stock() ) {
$old_stock = $_product->stock;
$new_quantity = $_product->increase_stock( $qty );
$order->add_order_note( sprintf( __( 'Item #%s stock increased from %s to %s.', 'woocommerce' ), $order_item['product_id'], $old_stock, $new_quantity ) );
do_action( 'woocommerce_restock_refunded_item', $_product->id, $old_stock, $new_quantity, $order );
}
}
}
foreach ( $line_item_totals as $item_id => $total ) {
$line_items[ $item_id ]['refund_total'] = wc_format_decimal( $total );
@ -1930,6 +1916,23 @@ class WC_AJAX {
}
}
// restock items
foreach ( $line_item_qtys as $item_id => $qty ) {
if ( $restock_refunded_items && $qty && isset( $order_items[ $item_id ] ) ) {
$order_item = $order_items[ $item_id ];
$_product = $order->get_product_from_item( $order_item );
if ( $_product && $_product->exists() && $_product->managing_stock() ) {
$old_stock = wc_stock_amount( $_product->stock );
$new_quantity = $_product->increase_stock( $qty );
$order->add_order_note( sprintf( __( 'Item #%s stock increased from %s to %s.', 'woocommerce' ), $order_item['product_id'], $old_stock, $new_quantity ) );
do_action( 'woocommerce_restock_refunded_item', $_product->id, $old_stock, $new_quantity, $order );
}
}
}
if ( $refund_amount == $max_refund ) {
$order->update_status( 'refunded' );
$response_data['status'] = 'fully_refunded';

View File

@ -80,7 +80,7 @@ class WC_Autoloader {
$path = $this->include_path . 'admin/';
}
if ( ! $this->load_file( $path . $file ) && strpos( $class, 'wc_' ) === 0 ) {
if ( empty( $path ) || ( ! $this->load_file( $path . $file ) && strpos( $class, 'wc_' ) === 0 ) ) {
$this->load_file( $this->include_path . $file );
}
}

View File

@ -62,10 +62,10 @@ class WC_Breadcrumb {
'is_404',
'is_attachment',
'is_single',
'is_page',
'is_product_category',
'is_product_tag',
'is_shop',
'is_page',
'is_post_type_archive',
'is_category',
'is_tag',
@ -214,6 +214,10 @@ class WC_Breadcrumb {
* Shop breadcrumb
*/
private function add_crumbs_shop() {
if ( get_option( 'page_on_front' ) == wc_get_page_id( 'shop' ) ) {
return;
}
$_name = wc_get_page_id( 'shop' ) ? get_the_title( wc_get_page_id( 'shop' ) ) : '';
if ( ! $_name ) {
@ -221,7 +225,6 @@ class WC_Breadcrumb {
$_name = $product_post_type->labels->singular_name;
}
$this->prepend_shop_page();
$this->add_crumb( $_name, get_post_type_archive_link( 'product' ) );
}

View File

@ -755,13 +755,11 @@ class WC_Coupon {
$cat = get_term( $cat_id, 'product_cat' );
$categories[] = $cat->name;
}
}
}
}
$err = sprintf( __( 'Sorry, this coupon is not applicable to the categories: %s.', 'woocommerce' ), implode( ', ', $categories ) );
$err = sprintf( __( 'Sorry, this coupon is not applicable to the categories: %s.', 'woocommerce' ), implode( ', ', array_unique( $categories ) ) );
break;
case self::E_WC_COUPON_NOT_VALID_SALE_ITEMS:
$err = __( 'Sorry, this coupon is not valid for sale items.', 'woocommerce' );

View File

@ -51,20 +51,41 @@ class WC_Customer {
if ( empty( $this->_data ) ) {
// Defaults
$this->_data = array(
'postcode' => '',
'city' => '',
'address' => '',
'address_2' => '',
'shipping_postcode' => '',
'shipping_city' => '',
'shipping_address' => '',
'shipping_address_2' => '',
'is_vat_exempt' => false,
'calculated_shipping' => false
'postcode' => '',
'city' => '',
'address' => '',
'address_2' => '',
'state' => '',
'country' => '',
'shipping_postcode' => '',
'shipping_city' => '',
'shipping_address' => '',
'shipping_address_2' => '',
'shipping_state' => '',
'shipping_country' => '',
'is_vat_exempt' => false,
'calculated_shipping' => false
);
$this->_data['country'] = $this->_data['shipping_country'] = $this->get_default_country();
$this->_data['state'] = $this->_data['shipping_state'] = $this->get_default_state();
if ( is_user_logged_in() ) {
foreach ( $this->_data as $key => $value ) {
$meta_value = get_user_meta( get_current_user_id(), ( false === strstr( $key, 'shipping_' ) ? 'billing_' : '' ) . $key, true );
$this->_data[ $key ] = $meta_value ? $meta_value : $this->_data[ $key ];
}
}
if ( empty( $this->_data['country'] ) ) {
$this->_data['country'] = $this->get_default_country();
}
if ( empty( $this->_data['shipping_country'] ) ) {
$this->_data['shipping_country'] = $this->get_default_country();
}
if ( empty( $this->_data['state'] ) ) {
$this->_data['state'] = $this->get_default_state();
}
if ( empty( $this->_data['shipping_state'] ) ) {
$this->_data['shipping_state'] = $this->get_default_state();
}
}
// When leaving or ending page load, store data

View File

@ -130,10 +130,10 @@ class WC_Download_Handler {
if ( $download_data->user_id && 'yes' === get_option( 'woocommerce_downloads_require_login' ) ) {
if ( ! is_user_logged_in() ) {
if ( wc_get_page_id( 'myaccount' ) ) {
wp_safe_redirect( add_query_arg( 'wc_error', urlencode( __( 'You must be logged in to download files.', 'woocommerce' ) ), get_permalink( wc_get_page_id( 'myaccount' ) ) ) );
wp_safe_redirect( add_query_arg( 'wc_error', urlencode( __( 'You must be logged in to download files.', 'woocommerce' ) ), wc_get_page_permalink( 'myaccount' ) ) );
exit;
} else {
self::download_error( __( 'You must be logged in to download files.', 'woocommerce' ) . ' <a href="' . esc_url( wp_login_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) ) . '" class="wc-forward">' . __( 'Login', 'woocommerce' ) . '</a>', __( 'Log in to Download Files', 'woocommerce' ), 403 );
self::download_error( __( 'You must be logged in to download files.', 'woocommerce' ) . ' <a href="' . esc_url( wp_login_url( wc_get_page_permalink( 'myaccount' ) ) ) . '" class="wc-forward">' . __( 'Login', 'woocommerce' ) . '</a>', __( 'Log in to Download Files', 'woocommerce' ), 403 );
}
} elseif ( ! current_user_can( 'download_file', $download_data ) ) {
self::download_error( __( 'This is not your download link.', 'woocommerce' ), '', 403 );

View File

@ -131,7 +131,7 @@ class WC_Emails {
$this->emails = apply_filters( 'woocommerce_email_classes', $this->emails );
// include css inliner
if ( ! class_exists( 'Emogrifier' ) ) {
if ( ! class_exists( 'Emogrifier' ) && class_exists( 'DOMDocument' ) ) {
include_once( 'libraries/class-emogrifier.php' );
}
}

View File

@ -130,7 +130,7 @@ class WC_Form_Handler {
do_action( 'woocommerce_customer_save_address', $user_id, $load_address );
wp_safe_redirect( get_permalink( wc_get_page_id('myaccount') ) );
wp_safe_redirect( wc_get_page_permalink( 'myaccount') );
exit;
}
}
@ -226,7 +226,7 @@ class WC_Form_Handler {
do_action( 'woocommerce_save_account_details', $user->ID );
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
exit;
}
}
@ -238,7 +238,7 @@ class WC_Form_Handler {
if ( isset( $_POST['woocommerce_checkout_place_order'] ) || isset( $_POST['woocommerce_checkout_update_totals'] ) ) {
if ( sizeof( WC()->cart->get_cart() ) == 0 ) {
wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
wp_redirect( wc_get_page_permalink( 'cart' ) );
exit;
}
@ -372,32 +372,30 @@ class WC_Form_Handler {
// Remove Coupon Codes
elseif ( isset( $_GET['remove_coupon'] ) ) {
WC()->cart->remove_coupon( wc_clean( $_GET['remove_coupon'] ) );
}
// Remove from cart
elseif ( ! empty( $_GET['remove_item'] ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'woocommerce-cart' ) ) {
$cart_item_key = sanitize_text_field( $_GET['remove_item'] );
$cart_item_key = $_GET['remove_item'];
$cart_item = WC()->cart->get_cart_item( $cart_item_key );
$product = wc_get_product( $cart_item['product_id'] );
if ( $cart_item = WC()->cart->get_cart_item( $cart_item_key ) ) {
WC()->cart->remove_cart_item( $cart_item_key );
WC()->cart->remove_cart_item( $cart_item_key );
$product = wc_get_product( $cart_item['product_id'] );
$undo = WC()->cart->get_undo_url( $cart_item_key );
$undo = WC()->cart->get_undo_url( $cart_item_key );
wc_add_notice( sprintf( __( '%s removed. %sUndo?%s', 'woocommerce' ), $product ? $product->get_title() : __( 'Item', 'woocommerce' ), '<a href="' . esc_url( $undo ) . '">', '</a>' ) );
}
wc_add_notice( sprintf( __( '%s removed. %sUndo?%s', 'woocommerce' ), $product->get_title(), '<a href="' . $undo . '">', '</a>' ) );
$referer = wp_get_referer() ? remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), add_query_arg( 'removed_item', '1', wp_get_referer() ) ) : WC()->cart->get_cart_url();
wp_safe_redirect( $referer );
exit;
}
// Undo Cart Item
elseif ( ! empty( $_GET['undo_item'] ) && isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'woocommerce-cart' ) ) {
$cart_item_key = $_GET['undo_item'];
$cart_item_key = sanitize_text_field( $_GET['undo_item'] );
WC()->cart->restore_cart_item( $cart_item_key );
@ -803,7 +801,7 @@ class WC_Form_Handler {
} elseif ( wp_get_referer() ) {
$redirect = wp_get_referer();
} else {
$redirect = get_permalink( wc_get_page_id( 'myaccount' ) );
$redirect = wc_get_page_permalink( 'myaccount' );
}
// Feedback
@ -907,7 +905,7 @@ class WC_Form_Handler {
wc_set_customer_auth_cookie( $new_customer );
}
wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() : get_permalink( wc_get_page_id( 'myaccount' ) ) ) );
wp_safe_redirect( apply_filters( 'woocommerce_registration_redirect', wp_get_referer() ? wp_get_referer() : wc_get_page_permalink( 'myaccount' ) ) );
exit;
} catch ( Exception $e ) {

View File

@ -252,7 +252,7 @@ class WC_Frontend_Scripts {
return array(
'ajax_url' => WC()->ajax_url(),
'i18n_view_cart' => esc_attr__( 'View Cart', 'woocommerce' ),
'cart_url' => get_permalink( wc_get_page_id( 'cart' ) ),
'cart_url' => wc_get_page_permalink( 'cart' ),
'is_cart' => is_cart(),
'cart_redirect_after_add' => get_option( 'woocommerce_cart_redirect_after_add' )
);

View File

@ -4,7 +4,7 @@
*
* Handles geolocation and updating the geolocation database.
*
* This product uses GeoLite2 data created by MaxMind, available from http://www.maxmind.com
* This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com.
*
* @author WooThemes
* @category Admin
@ -38,7 +38,6 @@ class WC_Geolocation {
private static $geoip_apis = array(
'freegeoip' => 'https://freegeoip.net/json/%s',
'telize' => 'http://www.telize.com/geoip/%s',
'ip-api' => 'http://ip-api.com/json/%s',
'geoip-api.meteor' => 'http://geoip-api.meteor.com/lookup/%s'
);
@ -46,8 +45,24 @@ class WC_Geolocation {
* Hook in tabs.
*/
public static function init() {
add_action( 'woocommerce_geoip_updater', array( __CLASS__, 'update_database' ) );
add_action( 'woocommerce_installed', array( __CLASS__, 'update_database' ) );
// Only download the database from MaxMind if the geolocation function is enabled, or a plugin specifically requests it
if ( 'geolocation' === get_option( 'woocommerce_default_customer_address' ) || apply_filters( 'woocommerce_geolocation_update_database_periodically', false ) ) {
add_action( 'woocommerce_geoip_updater', array( __CLASS__, 'update_database' ) );
}
add_filter( 'pre_update_option_woocommerce_default_customer_address', array( __CLASS__, 'maybe_update_database' ), 10, 2 );
}
/**
* Maybe trigger a DB update for the first time
* @param string $new_value
* @param string $old_value
* @return string
*/
public static function maybe_update_database( $new_value, $old_value ) {
if ( $new_value !== $old_value && 'geolocation' === $new_value ) {
self::update_database();
}
return $new_value;
}
/**
@ -140,10 +155,16 @@ class WC_Geolocation {
* Update geoip database. Adapted from https://wordpress.org/plugins/geoip-detect/.
*/
public static function update_database() {
$logger = new WC_Logger();
if ( ! is_callable( 'gzopen' ) ) {
$logger->add( 'geolocation', 'Server does not support gzopen' );
return;
}
require_once( ABSPATH . 'wp-admin/includes/file.php' );
$tmp_database = download_url( self::GEOLITE_DB );
$logger = new WC_Logger();
if ( ! is_wp_error( $tmp_database ) ) {
$gzhandle = @gzopen( $tmp_database, 'r' );
@ -202,10 +223,6 @@ class WC_Geolocation {
if ( ! is_wp_error( $response ) && $response['body'] ) {
switch ( $service_name ) {
case 'ip-api' :
$data = json_decode( $response['body'] );
$country_code = isset( $data->countryCode ) ? $data->countryCode : '';
break;
case 'geoip-api.meteor' :
$data = json_decode( $response['body'] );
$country_code = isset( $data->country ) ? $data->country : '';

View File

@ -124,7 +124,9 @@ class WC_Install {
delete_transient( 'wc_attribute_taxonomies' );
// Redirect to welcome screen
set_transient( '_wc_activation_redirect', 1, HOUR_IN_SECONDS );
if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) {
set_transient( '_wc_activation_redirect', 1, 30 );
}
// Trigger action
do_action( 'woocommerce_installed' );

View File

@ -26,7 +26,7 @@ class WC_Post_types {
public static function init() {
add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 5 );
add_action( 'init', array( __CLASS__, 'register_post_types' ), 5 );
add_action( 'init', array( __CLASS__, 'register_post_status' ), 10 );
add_action( 'init', array( __CLASS__, 'register_post_status' ), 9 );
add_action( 'init', array( __CLASS__, 'support_jetpack_omnisearch' ) );
}
@ -184,7 +184,7 @@ class WC_Post_types {
'new_item_name' => sprintf( __( 'New %s', 'woocommerce' ), $label )
),
'show_ui' => false,
'query_var' => false,
'query_var' => 1 === $tax->attribute_public,
'rewrite' => false,
'sort' => false,
'public' => 1 === $tax->attribute_public,

View File

@ -37,6 +37,11 @@ class WC_Tracker {
* @return void
*/
public static function send_tracking_data( $override = false ) {
// Dont trigger this on AJAX Requests
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
}
if ( ! apply_filters( 'woocommerce_tracker_send_override', $override ) ) {
// Send a maximum of once per week by default.
$last_send = self::get_last_send_time();
@ -44,28 +49,28 @@ class WC_Tracker {
return;
}
} else {
// Make sure there is at least a 10 minute delay between override sends, we dont want duplicate calls due to double clicking links.
// Make sure there is at least a 1 hour delay between override sends, we dont want duplicate calls due to double clicking links.
$last_send = self::get_last_send_time();
if ( $last_send && $last_send > strtotime( '-10 minutes' ) ) {
if ( $last_send && $last_send > strtotime( '-1 hours' ) ) {
return;
}
}
// Update time first before sending to ensure it is set
update_option( 'woocommerce_tracker_last_send', time() );
$params = self::get_tracking_data();
$response = wp_remote_post( self::$api_url, array(
'method' => 'POST',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'blocking' => false,
'headers' => array( 'user-agent' => 'WooCommerceTracker/' . md5( esc_url( home_url( '/' ) ) ) . ';' ),
'body' => json_encode( $params ),
'cookies' => array()
)
);
if ( ! is_wp_error( $response ) && '200' == wp_remote_retrieve_response_code( $response ) ) {
update_option( 'woocommerce_tracker_last_send', time() );
}
}
/**

View File

@ -1,7 +1,7 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
exit; // Exit if accessed directly
}
if ( ! class_exists( 'WC_Email_Cancelled_Order' ) ) :
@ -19,141 +19,137 @@ if ( ! class_exists( 'WC_Email_Cancelled_Order' ) ) :
*/
class WC_Email_Cancelled_Order extends WC_Email {
/**
* Constructor
*/
function __construct() {
/**
* Constructor
*/
function __construct() {
$this->id = 'cancelled_order';
$this->title = __( 'Cancelled order', 'woocommerce' );
$this->description = __( 'Cancelled order emails are sent when orders have been marked cancelled (if they were previously pending or on-hold).', 'woocommerce' );
$this->id = 'cancelled_order';
$this->title = __( 'Cancelled order', 'woocommerce' );
$this->description = __( 'Cancelled order emails are sent when orders have been marked cancelled (if they were previously pending or on-hold).', 'woocommerce' );
$this->heading = __( 'Cancelled order', 'woocommerce' );
$this->subject = __( '[{site_title}] Cancelled order ({order_number})', 'woocommerce' );
$this->heading = __( 'Cancelled order', 'woocommerce' );
$this->subject = __( '[{site_title}] Cancelled order ({order_number})', 'woocommerce' );
$this->template_html = 'emails/admin-cancelled-order.php';
$this->template_plain = 'emails/plain/admin-cancelled-order.php';
$this->template_html = 'emails/admin-cancelled-order.php';
$this->template_plain = 'emails/plain/admin-cancelled-order.php';
// Triggers for this email
add_action( 'woocommerce_order_status_pending_to_cancelled_notification', array( $this, 'trigger' ) );
add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ) );
// Triggers for this email
add_action( 'woocommerce_order_status_pending_to_cancelled_notification', array( $this, 'trigger' ) );
add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ) );
// Call parent constructor
parent::__construct();
// Call parent constructor
parent::__construct();
// Other settings
$this->recipient = $this->get_option( 'recipient' );
// Other settings
$this->recipient = $this->get_option( 'recipient' );
if ( ! $this->recipient )
$this->recipient = get_option( 'admin_email' );
}
if ( ! $this->recipient )
$this->recipient = get_option( 'admin_email' );
}
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger( $order_id ) {
/**
* trigger function.
*
* @access public
* @return void
*/
function trigger( $order_id ) {
if ( $order_id ) {
$this->object = wc_get_order( $order_id );
if ( $order_id ) {
$this->object = wc_get_order( $order_id );
$this->find['order-number'] = '{order_number}';
$this->find['order-number'] = '{order_number}';
$this->replace['order-number'] = $this->object->get_order_number();
}
$this->replace['order-number'] = $this->object->get_order_number();
}
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
return;
}
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
return;
}
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
/**
* get_content_html function.
*
* @access public
* @return string
*/
function get_content_html() {
ob_start();
wc_get_template( $this->template_html, array(
'order' => $this->object,
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => false
) );
return ob_get_clean();
}
/**
* get_content_html function.
*
* @access public
* @return string
*/
function get_content_html() {
ob_start();
wc_get_template( $this->template_html, array(
'order' => $this->object,
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => false
) );
return ob_get_clean();
}
/**
* get_content_plain function.
*
* @access public
* @return string
*/
function get_content_plain() {
ob_start();
wc_get_template( $this->template_plain, array(
'order' => $this->object,
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => true
) );
return ob_get_clean();
}
/**
* get_content_plain function.
*
* @access public
* @return string
*/
function get_content_plain() {
ob_start();
wc_get_template( $this->template_plain, array(
'order' => $this->object,
'email_heading' => $this->get_heading(),
'sent_to_admin' => true,
'plain_text' => true
) );
return ob_get_clean();
}
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'type' => 'checkbox',
'label' => __( 'Enable this email notification', 'woocommerce' ),
'default' => 'yes'
),
'recipient' => array(
'title' => __( 'Recipient(s)', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'woocommerce' ), esc_attr( get_option('admin_email') ) ),
'placeholder' => '',
'default' => ''
),
'subject' => array(
'title' => __( 'Subject', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'woocommerce' ), $this->subject ),
'placeholder' => '',
'default' => ''
),
'heading' => array(
'title' => __( 'Email Heading', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'woocommerce' ), $this->heading ),
'placeholder' => '',
'default' => ''
),
'email_type' => array(
'title' => __( 'Email type', 'woocommerce' ),
'type' => 'select',
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => array(
'plain' => __( 'Plain text', 'woocommerce' ),
'html' => __( 'HTML', 'woocommerce' ),
'multipart' => __( 'Multipart', 'woocommerce' ),
)
)
);
}
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'type' => 'checkbox',
'label' => __( 'Enable this email notification', 'woocommerce' ),
'default' => 'yes'
),
'recipient' => array(
'title' => __( 'Recipient(s)', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'woocommerce' ), esc_attr( get_option('admin_email') ) ),
'placeholder' => '',
'default' => ''
),
'subject' => array(
'title' => __( 'Subject', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'woocommerce' ), $this->subject ),
'placeholder' => '',
'default' => ''
),
'heading' => array(
'title' => __( 'Email Heading', 'woocommerce' ),
'type' => 'text',
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'woocommerce' ), $this->heading ),
'placeholder' => '',
'default' => ''
),
'email_type' => array(
'title' => __( 'Email type', 'woocommerce' ),
'type' => 'select',
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => $this->get_email_type_options()
)
);
}
}
endif;

View File

@ -131,14 +131,14 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
return ob_get_clean();
}
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'type' => 'checkbox',
@ -179,14 +179,10 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => array(
'plain' => __( 'Plain text', 'woocommerce' ),
'html' => __( 'HTML', 'woocommerce' ),
'multipart' => __( 'Multipart', 'woocommerce' ),
)
'options' => $this->get_email_type_options()
)
);
}
}
}
endif;

View File

@ -139,14 +139,14 @@ class WC_Email_Customer_Invoice extends WC_Email {
return ob_get_clean();
}
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
'subject' => array(
'title' => __( 'Email subject', 'woocommerce' ),
'type' => 'text',
@ -181,14 +181,10 @@ class WC_Email_Customer_Invoice extends WC_Email {
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => array(
'plain' => __( 'Plain text', 'woocommerce' ),
'html' => __( 'HTML', 'woocommerce' ),
'multipart' => __( 'Multipart', 'woocommerce' ),
)
'options' => $this->get_email_type_options()
)
);
}
}
}
endif;

View File

@ -111,14 +111,14 @@ class WC_Email_New_Order extends WC_Email {
return ob_get_clean();
}
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
/**
* Initialise Settings Form Fields
*
* @access public
* @return void
*/
function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
'type' => 'checkbox',
@ -152,14 +152,10 @@ class WC_Email_New_Order extends WC_Email {
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => array(
'plain' => __( 'Plain text', 'woocommerce' ),
'html' => __( 'HTML', 'woocommerce' ),
'multipart' => __( 'Multipart', 'woocommerce' ),
)
'options' => $this->get_email_type_options()
)
);
}
}
}
endif;

View File

@ -1,9 +1,4 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Email Class
*
@ -15,6 +10,17 @@ if ( ! defined( 'ABSPATH' ) ) {
* @author WooThemes
* @extends WC_Settings_API
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( class_exists( 'WC_Email' ) ) {
return;
}
/**
* WC_Email
*/
class WC_Email extends WC_Settings_API {
/**
@ -302,7 +308,7 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_email_type() {
return $this->email_type ? $this->email_type : 'plain';
return $this->email_type && class_exists( 'DOMDocument' ) ? $this->email_type : 'plain';
}
/**
@ -329,7 +335,9 @@ class WC_Email extends WC_Settings_API {
* @return string
*/
public function get_option( $key, $empty_value = null ) {
return apply_filters( 'woocommerce_email_get_option', __( parent::get_option( $key, $empty_value ) ), $this );
$value = parent::get_option( $key, $empty_value );
return apply_filters( 'woocommerce_email_get_option', __( $value ), $this, $value, $key, $empty_value );
}
/**
@ -378,7 +386,7 @@ class WC_Email extends WC_Settings_API {
*/
public function style_inline( $content ) {
// make sure we only inline CSS for html emails
if ( in_array( $this->get_content_type(), array( 'text/html', 'multipart/alternative' ) ) ) {
if ( in_array( $this->get_content_type(), array( 'text/html', 'multipart/alternative' ) ) && class_exists( 'DOMDocument' ) ) {
// get CSS styles
ob_start();
@ -454,8 +462,7 @@ class WC_Email extends WC_Settings_API {
/**
* Initialise Settings Form Fields - these are generic email options most will use.
*/
function init_form_fields() {
public function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => __( 'Enable/Disable', 'woocommerce' ),
@ -483,15 +490,29 @@ class WC_Email extends WC_Settings_API {
'description' => __( 'Choose which format of email to send.', 'woocommerce' ),
'default' => 'html',
'class' => 'email_type wc-enhanced-select',
'options' => array(
'plain' => __( 'Plain text', 'woocommerce' ),
'html' => __( 'HTML', 'woocommerce' ),
'multipart' => __( 'Multipart', 'woocommerce' ),
)
'options' => $this->get_email_type_options()
)
);
}
/**
* Email type options
*
* @return array
*/
public function get_email_type_options() {
$types = array(
'plain' => __( 'Plain text', 'woocommerce' )
);
if ( class_exists( 'DOMDocument' ) ) {
$types['html'] = __( 'HTML', 'woocommerce' );
$types['multipart'] = __( 'Multipart', 'woocommerce' );
}
return $types;
}
/**
* Admin Panel Options Processing
* - Saves the options to the DB
@ -515,7 +536,7 @@ class WC_Email extends WC_Settings_API {
$f = fopen( $file, 'w+' );
if ( $f !== FALSE ) {
if ( $f !== false ) {
fwrite( $f, $code );
fclose( $f );
$saved = true;
@ -539,7 +560,7 @@ class WC_Email extends WC_Settings_API {
$f = fopen( $file, 'w+' );
if ( $f !== FALSE ) {
if ( $f !== false ) {
fwrite( $f, $code );
fclose( $f );
$saved = true;

View File

@ -97,12 +97,14 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
private function get_icon_url( $country ) {
switch ( $country ) {
case 'MX' :
$link = 'https://www.paypal.com/mx/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside';
case 'ZA' :
$link = 'https://www.paypal.com/' . strtolower( $country ) . '/cgi-bin/webscr?cmd=xpt/Marketing/general/WIPaypal-outside';
break;
default :
$link = 'https://www.paypal.com/' . strtolower( $country ) . '/webapps/mpp/paypal-popup';
break;
}
return $link;
}

View File

@ -268,7 +268,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
public function process_subscription_payment( $order = '', $amount = 0 ) {
$order_items = $order->get_items();
$order_item = array_shift( $order_items );
$subscription_name = sprintf( __( '%s - Subscription for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
$subscription_name = sprintf( __( '%s - Subscription for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
if ( $amount * 100 < 50 ) {
return new WP_Error( 'simplify_error', __( 'Sorry, the minimum allowed order total is 0.50 to use this payment method.', 'woocommerce' ) );
@ -371,7 +371,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
try {
$order_items = $order->get_items();
$order_item = array_shift( $order_items );
$pre_order_name = sprintf( __( '%s - Pre-order for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
$pre_order_name = sprintf( __( '%s - Pre-order for "%s"', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() );
$customer_id = get_post_meta( $order->id, '_simplify_customer_id', true );
@ -427,7 +427,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
@ob_clean();
header( 'HTTP/1.1 200 OK' );
$redirect_url = get_permalink( wc_get_page_id( 'cart' ) );
$redirect_url = wc_get_page_permalink( 'cart' );
if ( isset( $_REQUEST['reference'] ) && isset( $_REQUEST['amount'] ) ) {
$cart_token = $_REQUEST['cardToken'];

View File

@ -207,7 +207,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
'label' => __( 'Enable Hosted Payments', 'woocommerce' ),
'type' => 'select',
'description' => sprintf( __( 'Standard will display the credit card fields on your store (SSL required). %1$s Hosted Payments will display a Simplify Commerce modal dialog on your store (if SSL) or will redirect the customer to Simplify Commerce hosted page (if not SSL). %1$s Note: Hosted Payments need a new API Key pair with the hosted payments flag selected. %2$sFor more details check the Simplify Commerce docs%3$s.', 'woocommerce' ), '<br />', '<a href="https://simplify.desk.com/customer/portal/articles/1792405-how-do-i-enable-hosted-payments" target="_blank">', '</a>' ),
'default' => 'hosted',
'default' => 'standard',
'options' => array(
'standard' => __( 'Standard', 'woocommerce' ),
'hosted' => __( 'Hosted Payments', 'woocommerce' )
@ -326,7 +326,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
$payment = Simplify_Payment::createPayment( array(
'amount' => $order->order_total * 100, // In cents
'token' => $cart_token,
'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), esc_html( get_bloginfo( 'name' ) ), $order->get_order_number() ),
'description' => sprintf( __( '%s - Order #%s', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order->get_order_number() ),
'currency' => strtoupper( get_woocommerce_currency() ),
'reference' => $order->id,
'card.addressCity' => $order->billing_city,
@ -408,7 +408,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
'sc-key' => $this->public_key,
'amount' => $order->order_total * 100,
'reference' => $order->id,
'name' => esc_html( get_bloginfo( 'name' ) ),
'name' => esc_html( get_bloginfo( 'name', 'display' ) ),
'description' => sprintf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ),
'receipt' => 'false',
'color' => $this->modal_color,
@ -463,7 +463,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
}
}
wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
wp_redirect( wc_get_page_permalink( 'cart' ) );
exit();
}

View File

@ -111,7 +111,7 @@ class Emogrifier {
*
* @var boolean
*/
public $preserveEncoding = FALSE;
public $preserveEncoding = false;
public static $_media = '';
@ -178,7 +178,7 @@ class Emogrifier {
*/
private function clearCache($key) {
$allowedCacheKeys = array(self::CACHE_KEY_CSS, self::CACHE_KEY_SELECTOR, self::CACHE_KEY_XPATH, self::CACHE_KEY_CSS_DECLARATION_BLOCK);
if (!in_array($key, $allowedCacheKeys, TRUE)) {
if (!in_array($key, $allowedCacheKeys, true)) {
throw new InvalidArgumentException('Invalid cache key: ' . $key, 1391822035);
}
@ -219,8 +219,8 @@ class Emogrifier {
* @return void
*/
public function removeUnprocessableHtmlTag($tagName) {
$key = array_search($tagName, $this->unprocessableHtmlTags, TRUE);
if ($key !== FALSE) {
$key = array_search($tagName, $this->unprocessableHtmlTags, true);
if ($key !== false) {
unset($this->unprocessableHtmlTags[$key]);
}
}
@ -249,7 +249,7 @@ class Emogrifier {
$this->purgeVisitedNodes();
$nodesWithStyleAttributes = $xpath->query('//*[@style]');
if ($nodesWithStyleAttributes !== FALSE) {
if ($nodesWithStyleAttributes !== false) {
/** @var $nodeWithStyleAttribute DOMNode */
foreach ($nodesWithStyleAttributes as $node) {
$normalizedOriginalStyle = preg_replace_callback( '/[A-z\\-]+(?=\\:)/S', array( $this, 'strtolower' ), $node->getAttribute('style') );
@ -290,7 +290,7 @@ class Emogrifier {
$selectors = explode(',', $selectorString[1]);
foreach ($selectors as $selector) {
// don't process pseudo-elements and behavioral (dynamic) pseudo-classes; ONLY allow structural pseudo-classes
if (strpos($selector, ':') !== FALSE && !preg_match('/:\\S+\\-(child|type)\\(/i', $selector)) {
if (strpos($selector, ':') !== false && !preg_match('/:\\S+\\-(child|type)\\(/i', $selector)) {
continue;
}
@ -408,7 +408,7 @@ class Emogrifier {
private function getCssFromAllStyleNodes(DOMXPath $xpath) {
$styleNodes = $xpath->query('//style');
if ($styleNodes === FALSE) {
if ($styleNodes === false) {
return '';
}
@ -448,7 +448,7 @@ class Emogrifier {
private function getOrCreateHeadElement(DOMDocument $document) {
$head = $document->getElementsByTagName('head')->item(0);
if ($head === NULL) {
if ($head === null) {
$head = $document->createElement('head');
$html = $document->getElementsByTagName('html')->item(0);
$html->insertBefore($head, $document->getElementsByTagName('body')->item(0));
@ -514,9 +514,9 @@ class Emogrifier {
private function createXmlDocument() {
$xmlDocument = new DOMDocument;
$xmlDocument->encoding = self::ENCODING;
$xmlDocument->strictErrorChecking = FALSE;
$xmlDocument->formatOutput = TRUE;
$libXmlState = libxml_use_internal_errors(TRUE);
$xmlDocument->strictErrorChecking = false;
$xmlDocument->formatOutput = true;
$libXmlState = libxml_use_internal_errors(true);
$xmlDocument->loadHTML($this->getUnifiedHtml());
libxml_clear_errors();
libxml_use_internal_errors($libXmlState);
@ -732,7 +732,7 @@ class Emogrifier {
if (in_array(strtolower($match[2]), array('even','odd'))) {
$index = strtolower($match[2]) == 'even' ? 0 : 1;
return array(self::MULTIPLIER => 2, self::INDEX => $index);
} elseif (stripos($match[2], 'n') === FALSE) {
} elseif (stripos($match[2], 'n') === false) {
// if there is a multiplier
$index = intval(str_replace(' ', '', $match[2]));
return array(self::INDEX => $index);

View File

@ -88,7 +88,7 @@ class WC_Shortcode_Checkout {
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order );
if ( ! current_user_can( 'pay_for_order', $order_id ) ) {
echo '<div class="woocommerce-error">' . __( 'Invalid order. If you have an account please log in and try again.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
echo '<div class="woocommerce-error">' . __( 'Invalid order. If you have an account please log in and try again.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
return;
}

View File

@ -108,7 +108,7 @@ class WC_Shortcode_My_Account {
$order = wc_get_order( $order_id );
if ( ! current_user_can( 'view_order', $order_id ) ) {
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ).'" class="wc-forward">'. __( 'My Account', 'woocommerce' ) .'</a>' . '</div>';
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ).'" class="wc-forward">'. __( 'My Account', 'woocommerce' ) .'</a>' . '</div>';
return;
}
@ -203,7 +203,7 @@ class WC_Shortcode_My_Account {
$args['login'] = esc_attr( $_GET['login'] );
}
} elseif ( isset( $_GET['reset'] ) ) {
wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );
wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );
}
wc_get_template( 'myaccount/form-lost-password.php', $args );
@ -244,7 +244,7 @@ class WC_Shortcode_My_Account {
return false;
}
if ( is_multisite() && ! is_user_member_of_blog( $user_data->id, get_current_blog_id() ) ) {
if ( is_multisite() && ! is_user_member_of_blog( $user_data->ID, get_current_blog_id() ) ) {
wc_add_notice( __( 'Invalid username or e-mail.', 'woocommerce' ), 'error' );
return false;
}
@ -358,7 +358,7 @@ class WC_Shortcode_My_Account {
if ( ! is_user_logged_in() ) {
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( wc_get_page_permalink( 'myaccount' ) );
exit();
} else {

View File

@ -97,7 +97,7 @@ function wc_add_to_cart_message( $product_id ) {
else :
$message = sprintf('<a href="%s" class="button wc-forward">%s</a> %s', get_permalink( wc_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $added_text );
$message = sprintf('<a href="%s" class="button wc-forward">%s</a> %s', wc_get_page_permalink( 'cart' ), __( 'View Cart', 'woocommerce' ), $added_text );
endif;

View File

@ -462,15 +462,29 @@ function wc_mail( $to, $subject, $message, $headers = "Content-Type: text/html\r
*
* Variable is filtered by woocommerce_get_image_size_{image_size}
*
* @param string $image_size
* @param mixed $image_size
* @return array
*/
function wc_get_image_size( $image_size ) {
if ( in_array( $image_size, array( 'shop_thumbnail', 'shop_catalog', 'shop_single' ) ) ) {
if ( is_array( $image_size ) ) {
$width = isset( $image_size[0] ) ? $image_size[0] : '300';
$height = isset( $image_size[1] ) ? $image_size[1] : '300';
$crop = isset( $image_size[2] ) ? $image_size[2] : 1;
$size = array(
'width' => $width,
'height' => $height,
'crop' => $crop
);
$image_size = $width . '_' . $height;
} elseif ( in_array( $image_size, array( 'shop_thumbnail', 'shop_catalog', 'shop_single' ) ) ) {
$size = get_option( $image_size . '_image_size', array() );
$size['width'] = isset( $size['width'] ) ? $size['width'] : '300';
$size['height'] = isset( $size['height'] ) ? $size['height'] : '300';
$size['crop'] = isset( $size['crop'] ) ? $size['crop'] : 0;
} else {
$size = array(
'width' => '300',

View File

@ -227,16 +227,17 @@ function wc_register_order_type( $type, $args = array() ) {
* @param string $download_id file identifier
* @param int $product_id product identifier
* @param WC_Order $order the order
* @param int $qty purchased
* @return int|bool insert id or false on failure
*/
function wc_downloadable_file_permission( $download_id, $product_id, $order ) {
function wc_downloadable_file_permission( $download_id, $product_id, $order, $qty = 1 ) {
global $wpdb;
$user_email = sanitize_email( $order->billing_email );
$limit = trim( get_post_meta( $product_id, '_download_limit', true ) );
$expiry = trim( get_post_meta( $product_id, '_download_expiry', true ) );
$limit = empty( $limit ) ? '' : absint( $limit );
$limit = empty( $limit ) ? '' : absint( $limit ) * $qty;
// Default value is NULL in the table schema
$expiry = empty( $expiry ) ? null : absint( $expiry );
@ -312,7 +313,7 @@ function wc_downloadable_product_permissions( $order_id ) {
$downloads = $_product->get_files();
foreach ( array_keys( $downloads ) as $download_id ) {
wc_downloadable_file_permission( $download_id, $item['variation_id'] > 0 ? $item['variation_id'] : $item['product_id'], $order );
wc_downloadable_file_permission( $download_id, $item['variation_id'] > 0 ? $item['variation_id'] : $item['product_id'], $order, $item['qty'] );
}
}
}

View File

@ -50,6 +50,18 @@ function wc_get_page_id( $page ) {
return $page ? absint( $page ) : -1;
}
/**
* Retrieve page permalink
*
* @param string $page
* @return string
*/
function wc_get_page_permalink( $page ) {
$permalink = get_permalink( wc_get_page_id( $page ) );
return apply_filters( 'woocommerce_get_' . $page . '_page_permalink', $permalink );
}
/**
* Get endpoint URL
*
@ -112,7 +124,7 @@ function wc_edit_address_i18n( $id, $flip = false ) {
* @return string
*/
function wc_lostpassword_url() {
return wc_get_endpoint_url( 'lost-password', '', get_permalink( wc_get_page_id( 'myaccount' ) ) );
return wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) );
}
add_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 0 );
@ -123,7 +135,7 @@ add_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 0 );
* @return string
*/
function wc_customer_edit_account_url() {
$edit_account_url = wc_get_endpoint_url( 'edit-account', '', get_permalink( wc_get_page_id( 'myaccount' ) ) );
$edit_account_url = wc_get_endpoint_url( 'edit-account', '', wc_get_page_permalink( 'myaccount' ) );
return apply_filters( 'woocommerce_customer_edit_account_url', $edit_account_url );
}

View File

@ -30,13 +30,13 @@ function wc_template_redirect() {
// When on the checkout with an empty cart, redirect to cart page
elseif ( is_page( wc_get_page_id( 'checkout' ) ) && sizeof( WC()->cart->get_cart() ) == 0 && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) {
wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
wp_redirect( wc_get_page_permalink( 'cart' ) );
exit;
}
// Logout
elseif ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&amp;', '&', wp_logout_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) ) );
wp_redirect( str_replace( '&amp;', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) );
exit;
}
@ -1198,7 +1198,7 @@ if ( ! function_exists( 'woocommerce_breadcrumb' ) ) {
*/
function woocommerce_breadcrumb( $args = array() ) {
$args = wp_parse_args( $args, apply_filters( 'woocommerce_breadcrumb_defaults', array(
'delimiter' => ' &#47; ',
'delimiter' => '&nbsp;&#47;&nbsp;',
'wrap_before' => '<nav class="woocommerce-breadcrumb" ' . ( is_single() ? 'itemprop="breadcrumb"' : '' ) . '>',
'wrap_after' => '</nav>',
'before' => '',

View File

@ -388,10 +388,8 @@ function wc_get_customer_available_downloads( $customer_id ) {
$results = $wpdb->get_results( $wpdb->prepare( "
SELECT permissions.*
FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions as permissions
LEFT JOIN {$wpdb->posts} as posts ON permissions.order_id = posts.ID
WHERE user_id = %d
AND permissions.order_id > 0
AND posts.post_status IN ( '" . implode( "','", array_keys( wc_get_order_statuses() ) ) . "' )
AND
(
permissions.downloads_remaining > 0
@ -416,6 +414,11 @@ function wc_get_customer_available_downloads( $customer_id ) {
$_product = null;
}
// Make sure the order exists for this download
if ( ! $order ) {
continue;
}
// Downloads permitted?
if ( ! $order->is_download_permitted() ) {
continue;

View File

@ -1,6 +1,6 @@
WooCommerce
WooCommerce - eCommerce for WordPress
Copyright 2011 by the contributors
Copyright 2015 by the contributors
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,22 +23,12 @@ permission notices:
http://jigowatt.com - http://jigoshop.com
Jigoshop is released under the GPL
Jigoshop Commercial Edition
NOTICE OF LICENSE
This source file is subject to the Jigoshop Commercial Edition License that is available at: http://jigoshop.com/license/commercial-edition If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to info@jigoshop.com so we can send you a copy immediately.
DISCLAIMER
Do not edit or add directly to this file if you wish to upgrade Jigoshop to newer versions in the future. If you wish to customise Jigoshop core for your needs, please use our GitHub repository to publish essential changes for consideration.
@package Jigoshop
@copyright Copyright © 2011 Jigowatt Ltd. (http://jigowatt.co.uk)
@license http://jigoshop.com/license/commercial-edition
and
WooThemes
WooCommerce - eCommerce for WordPress
WooCommerce is Copyright (c) 2015 WooThemes
WooCommerce is released under the GPL

View File

@ -2,9 +2,9 @@
Contributors: woothemes, mikejolley, jameskoster, claudiosanches, barrykooij
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, affiliate, store, sales, sell, shop, shopping, cart, checkout, configurable, variable, widgets, reports, download, downloadable, digital, inventory, stock, reports, shipping, tax
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@woothemes.com&item_name=Donation+for+WooCommerce
Requires at least: 3.8
Requires at least: 4.0
Tested up to: 4.1
Stable tag: 2.3.3
Stable tag: 2.3.4
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -138,10 +138,36 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
* Tweak - Improve category coupon message.
* Tweak - Don't download GeoIP Database until geolocation option is enabled in settings.
= 2.3.4 - 17/02/2015 =
* Fix - limit_usage_to_x_items option in coupons.
* Fix - Run coupon codes through html_entity_decode.
* Fix - Tax by code report for refunds.
* Fix - Auto-generation of slug when adding new attribute.
* Fix - Prevented errors when `DOMDocument` is not found (used for your HTML/Multipart emails).
* Fix - Load WC css on user edit screen.
* Fix - DB error when showing reports by product without selecting a product.
* Fix - Stock status when updating out of stock product.
* Fix - Fix place order button text on init.
* Fix - When duplicating products, handle entities.
* Fix - Double shop page in breadcrumb and white space issues.
* Fix - When purchasing multiple downloadable products (same item), multiply download limit by qty purchased.
* Fix - Added checks for gzopen to prevent activation errors.
* Tweak - Added DOMDocument item in the System Status as a requirement.
* Tweak - Simplify default mode should be 'standard'.
* Tweak - Set attribte 'query_var' true when public.
* Tweak - Use wc_get_page_permalink() to get page permalinks.
* Tweak - Register shop_order post statuses earlier to ensure statuses are registered for cron.
* Tweak - Improvements to refund handling in Taxes by code/date, and sales by date reports. Gross/net excludes refunds.
* Tweak - Share data between Sales by Date report and API.
* Tweak - Related posts - replace ORDER BY RAND() with random offset.
* Tweak - Run item meta label through wc_attribute_label() in admin order page.
* Tweak - Run File URLs through esc_url_raw instead of wc_clean to preserve spaces.
* Tweak - Small timeout on checkout update action to prevent several triggering at once.
* Tweak - Restock items AFTER refund, not before.
* Tweak - If logged in, populate customer data from user meta.
= 2.3.3 - 12/02/2015 =
* Fix - Potential notice with preg_match wildcard search, if used incorrectly.
@ -1246,5 +1272,5 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Upgrade Notice ==
= 2.3.3 =
= 2.3.4 =
2.3.0 is a major update so it is important that you make backups, test extensions and your theme prior to updating, and ensure extensions are 2.3 compatible. Developers should catch up with [develop.woothemes.com](http://develop.woothemes.com/) to see what has been happening in core.

View File

@ -19,4 +19,4 @@ wc_print_notices();
<?php do_action( 'woocommerce_cart_is_empty' ); ?>
<p class="return-to-shop"><a class="button wc-backward" href="<?php echo apply_filters( 'woocommerce_return_to_shop_redirect', get_permalink( wc_get_page_id( 'shop' ) ) ); ?>"><?php _e( 'Return To Shop', 'woocommerce' ) ?></a></p>
<p class="return-to-shop"><a class="button wc-backward" href="<?php echo apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ); ?>"><?php _e( 'Return To Shop', 'woocommerce' ) ?></a></p>

View File

@ -24,7 +24,7 @@ wc_print_notice( $info_message, 'notice' );
woocommerce_login_form(
array(
'message' => __( 'If you have shopped with us before, please enter your details in the boxes below. If you are a new customer please proceed to the Billing &amp; Shipping section.', 'woocommerce' ),
'redirect' => get_permalink( wc_get_page_id( 'checkout' ) ),
'redirect' => wc_get_page_permalink( 'checkout' ),
'hidden' => true
)
);

View File

@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) ) : ?>
<p class="form-row terms">
<label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'woocommerce' ), esc_url( get_permalink( wc_get_page_id( 'terms' ) ) ) ); ?></label>
<label for="terms" class="checkbox"><?php printf( __( 'I&rsquo;ve read and accept the <a href="%s" target="_blank">terms &amp; conditions</a>', 'woocommerce' ), esc_url( wc_get_page_permalink( 'terms' ) ) ); ?></label>
<input type="checkbox" class="input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); ?> id="terms" />
</p>
<?php endif; ?>

View File

@ -27,7 +27,7 @@ if ( $order ) : ?>
<p>
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
<?php if ( is_user_logged_in() ) : ?>
<a href="<?php echo esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>" class="button pay"><?php _e( 'My Account', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My Account', 'woocommerce' ); ?></a>
<?php endif; ?>
</p>

View File

@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php if ( $order->has_status( 'pending' ) ) : ?>
<p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', 'woocommerce' ) . '</a>' ); ?></p>
<p><?php printf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name', 'display' ), '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . __( 'pay', 'woocommerce' ) . '</a>' ); ?></p>
<?php endif; ?>

View File

@ -23,6 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php endif; ?>
<p><?php printf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?></p>
<p><?php printf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), wc_get_page_permalink( 'myaccount' ) ); ?></p>
<?php do_action( 'woocommerce_email_footer' ); ?>

View File

@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<p><?php _e( 'If this was a mistake, just ignore this email and nothing will happen.', 'woocommerce' ); ?></p>
<p><?php _e( 'To reset your password, visit the following address:', 'woocommerce' ); ?></p>
<p>
<a href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', get_permalink( wc_get_page_id( 'myaccount' ) ) ) ) ); ?>">
<a href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ); ?>">
<?php _e( 'Click here to reset your password', 'woocommerce' ); ?></a>
</p>
<p></p>

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo get_bloginfo( 'name' ); ?></title>
<title><?php echo get_bloginfo( 'name', 'display' ); ?></title>
</head>
<body <?php echo is_rtl() ? 'rightmargin' : 'leftmargin'; ?>="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<div id="wrapper">
@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div id="template_header_image">
<?php
if ( $img = get_option( 'woocommerce_email_header_image' ) ) {
echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>';
echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name', 'display' ) . '" /></p>';
}
?>
</div>

View File

@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
echo $email_heading . "\n\n";
if ( $order->has_status( 'pending' ) )
echo sprintf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name' ), $order->get_checkout_payment_url() ) . "\n\n";
echo sprintf( __( 'An order has been created for you on %s. To pay for this order please use the following link: %s', 'woocommerce' ), get_bloginfo( 'name', 'display' ), $order->get_checkout_payment_url() ) . "\n\n";
echo "****************************************************\n\n";

View File

@ -18,7 +18,7 @@ echo sprintf( __( "Thanks for creating an account on %s. Your username is <stron
if ( get_option( 'woocommerce_registration_generate_password' ) === 'yes' && $password_generated )
echo sprintf( __( "Your password is <strong>%s</strong>.", 'woocommerce' ), $user_pass ) . "\n\n";
echo sprintf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), get_permalink( wc_get_page_id( 'myaccount' ) ) ) . "\n\n";
echo sprintf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), wc_get_page_permalink( 'myaccount' ) ) . "\n\n";
echo "\n****************************************************\n\n";

View File

@ -19,7 +19,7 @@ echo sprintf( __( 'Username: %s', 'woocommerce' ), $user_login ) . "\r\n\r\n";
echo __( 'If this was a mistake, just ignore this email and nothing will happen.', 'woocommerce' ) . "\r\n\r\n";
echo __( 'To reset your password, visit the following address:', 'woocommerce' ) . "\r\n\r\n";
echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => $user_login ), wc_get_endpoint_url( 'lost-password', '', get_permalink( wc_get_page_id( 'myaccount' ) ) ) ) ) . "\r\n";
echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => $user_login ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ) . "\r\n";
echo "\n****************************************************\n\n";

View File

@ -11,30 +11,29 @@
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<?php if ( $breadcrumb ) : ?>
if ( $breadcrumb ) {
<?php echo $wrap_before; ?>
echo $wrap_before;
<?php foreach ( $breadcrumb as $key => $crumb ) : ?>
foreach ( $breadcrumb as $key => $crumb ) {
<?php echo $before; ?>
echo $before;
<?php if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>'; ?>
<?php else : ?>
<?php echo esc_html( $crumb[0] ); ?>
<?php endif; ?>
if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) {
echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>';
} else {
echo esc_html( $crumb[0] );
}
<?php echo $after; ?>
echo $after;
<?php if ( sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo $delimiter; ?>
<?php endif; ?>
if ( sizeof( $breadcrumb ) !== $key + 1 ) {
echo $delimiter;
}
<?php endforeach; ?>
}
<?php echo $wrap_after; ?>
echo $wrap_after;
<?php endif; ?>
}

View File

@ -18,7 +18,7 @@ wc_print_notices(); ?>
printf(
__( 'Hello <strong>%1$s</strong> (not %1$s? <a href="%2$s">Sign out</a>).', 'woocommerce' ) . ' ',
$current_user->display_name,
wc_get_endpoint_url( 'customer-logout', '', get_permalink( wc_get_page_id( 'myaccount' ) ) )
wc_get_endpoint_url( 'customer-logout', '', wc_get_page_permalink( 'myaccount' ) )
);
printf( __( 'From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">edit your password and account details</a>.', 'woocommerce' ),

View File

@ -71,7 +71,7 @@ if ( $customer_orders ) : ?>
if ( in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) {
$actions['cancel'] = array(
'url' => $order->get_cancel_order_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ),
'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ),
'name' => __( 'Cancel', 'woocommerce' )
);
}

View File

@ -3,7 +3,7 @@
* Plugin Name: WooCommerce
* Plugin URI: http://www.woothemes.com/woocommerce/
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
* Version: 2.3.3
* Version: 2.3.4
* Author: WooThemes
* Author URI: http://woothemes.com
* Requires at least: 4.0
@ -33,7 +33,7 @@ final class WooCommerce {
/**
* @var string
*/
public $version = '2.3.3';
public $version = '2.3.4';
/**
* @var WooCommerce The single instance of the class