Merge branch 'master' into fix/reintroduce-virtual-coupons
This commit is contained in:
commit
519e81ef59
|
@ -8,13 +8,13 @@
|
|||
* Tweak - Define arg and return data types, added extra descriptions, and correctly cast IDs in the Rest API.
|
||||
* Tweak - Handle custom error data in WC_REST_Exception.
|
||||
* Tweak - Display conflicted product ID when using a duplicate SKU via the API.
|
||||
* Localisation - Add Finnish defaults to the installer.
|
||||
* Localization - Add Finnish defaults to the installer.
|
||||
|
||||
= 2.6.13 - 2017-01-18 =
|
||||
* Fix - Demo store banner styling in 2017.
|
||||
* Fix - Removed default instructions from COD, BACS and Cheque gateways so displayed messages can be unset.
|
||||
* Fix - Removed default instructions from COD, BACS and Check gateways so displayed messages can be unset.
|
||||
* Fix - Made variation options update on first load.
|
||||
* Localisation - Added Romanian locale to the installer.
|
||||
* Localization - Added Romanian locale to the installer.
|
||||
|
||||
= 2.6.12 - 2017-01-12 =
|
||||
* Fix - Make images shown up on pageload when using ajax variations.
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -281,17 +281,25 @@ a.remove {
|
|||
}
|
||||
}
|
||||
|
||||
dl.variation {
|
||||
dt {
|
||||
dl.variation, .wc-item-meta {
|
||||
list-style: none outside;
|
||||
|
||||
dt, .wc-item-meta-label {
|
||||
float: left;
|
||||
clear: both;
|
||||
margin-right: .25em;
|
||||
display: inline-block;
|
||||
list-style: none outside;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p,
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1131,30 +1131,24 @@ p.demo_store,
|
|||
}
|
||||
|
||||
td.product-name {
|
||||
dl.variation {
|
||||
margin: 0.25em 0;
|
||||
@include clearfix();
|
||||
dl.variation, .wc-item-meta {
|
||||
list-style: none outside;
|
||||
|
||||
dt,
|
||||
dd {
|
||||
display: inline-block;
|
||||
dt, .wc-item-meta-label {
|
||||
float: left;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
padding: 0 0 0.25em;
|
||||
margin: 0 4px 0 0;
|
||||
clear: left;
|
||||
clear: both;
|
||||
margin-right: .25em;
|
||||
display: inline-block;
|
||||
list-style: none outside;
|
||||
}
|
||||
|
||||
dd {
|
||||
padding: 0 0 0.25em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
p,
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1407,9 +1401,9 @@ p.demo_store,
|
|||
/**
|
||||
* Order page
|
||||
*/
|
||||
.order_details {
|
||||
ul.order_details {
|
||||
@include clearfix();
|
||||
margin: 0 0 1.5em;
|
||||
margin: 0 0 3em;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
|
@ -1437,6 +1431,10 @@ p.demo_store,
|
|||
}
|
||||
}
|
||||
|
||||
.wc-bacs-bank-details-account-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layered nav widget
|
||||
*/
|
||||
|
|
|
@ -258,7 +258,7 @@ jQuery( function ( $ ) {
|
|||
|
||||
// Load videos when help button is clicked.
|
||||
$( '#contextual-help-link' ).on( 'click', function() {
|
||||
var frame = $( '#tab-panel-woocommerce_101_tab iframe' );
|
||||
var frame = $( '#tab-panel-woocommerce_guided_tour_tab iframe' );
|
||||
|
||||
frame.attr( 'src', frame.data( 'src' ) );
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Pakistan's states
|
||||
*
|
||||
* @author WooCommerce
|
||||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.7.0
|
||||
*/
|
||||
global $states;
|
||||
|
||||
$states['PK'] = array(
|
||||
'JK' => __( 'Azad Kashmir', 'woocommerce' ),
|
||||
'BA' => __( 'Balochistan', 'woocommerce' ),
|
||||
'TA' => __( 'FATA', 'woocommerce' ),
|
||||
'GB' => __( 'Gilgit Baltistan', 'woocommerce' ),
|
||||
'IS' => __( 'Islamabad Capital Territory', 'woocommerce' ),
|
||||
'KP' => __( 'Khyber Pakhtunkhwa', 'woocommerce' ),
|
||||
'PB' => __( 'Punjab', 'woocommerce' ),
|
||||
'SD' => __( 'Sindh', 'woocommerce' ),
|
||||
);
|
|
@ -1475,22 +1475,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
}
|
||||
}
|
||||
|
||||
if ( $this->get_total() > 0 && $this->get_payment_method_title() ) {
|
||||
$total_rows['payment_method'] = array(
|
||||
'label' => __( 'Payment method:', 'woocommerce' ),
|
||||
'value' => $this->get_payment_method_title(),
|
||||
);
|
||||
}
|
||||
|
||||
if ( $refunds = $this->get_refunds() ) {
|
||||
foreach ( $refunds as $id => $refund ) {
|
||||
$total_rows[ 'refund_' . $id ] = array(
|
||||
'label' => $refund->get_reason() ? $refund->get_reason() : __( 'Refund', 'woocommerce' ) . ':',
|
||||
'value' => wc_price( '-' . $refund->get_amount(), array( 'currency' => $this->get_currency() ) ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$total_rows['order_total'] = array(
|
||||
'label' => __( 'Total:', 'woocommerce' ),
|
||||
'value' => $this->get_formatted_order_total( $tax_display ),
|
||||
|
|
|
@ -38,116 +38,164 @@ class WC_Admin_Help {
|
|||
|
||||
$video_map = array(
|
||||
'wc-settings' => array(
|
||||
'title' => __( 'General settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
|
||||
'title' => __( 'General Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6.jsonp?',
|
||||
),
|
||||
'wc-settings-general' => array(
|
||||
'title' => __( 'General settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
|
||||
'title' => __( 'General Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6.jsonp?',
|
||||
),
|
||||
'wc-settings-products' => array(
|
||||
'title' => __( 'Product settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true',
|
||||
'title' => __( 'Product Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf.jsonp?',
|
||||
),
|
||||
'wc-settings-products-display' => array(
|
||||
'title' => __( 'Display Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf.jsonp?time=55s&',
|
||||
),
|
||||
'wc-settings-products-inventory' => array(
|
||||
'title' => __( 'Inventory Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf.jsonp?time=2m38s&',
|
||||
),
|
||||
'wc-settings-products-downloadable' => array(
|
||||
'title' => __( 'Downloadable Products Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf.jsonp?time=3m50s&',
|
||||
),
|
||||
'wc-settings-tax' => array(
|
||||
'title' => __( 'Tax settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true',
|
||||
'title' => __( 'Tax Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh.jsonp?',
|
||||
),
|
||||
'wc-settings-tax-standard' => array(
|
||||
'title' => __( 'Tax Rate Example', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/2p903vptwa.jsonp?',
|
||||
),
|
||||
'wc-settings-tax-reduced-rate' => array(
|
||||
'title' => __( 'Tax Rate Example', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/2p903vptwa.jsonp?',
|
||||
),
|
||||
'wc-settings-tax-zero-rate' => array(
|
||||
'title' => __( 'Tax Rate Example', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/2p903vptwa.jsonp?',
|
||||
),
|
||||
'wc-settings-shipping' => array(
|
||||
'title' => __( 'Shipping zones', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p?videoFoam=true',
|
||||
'title' => __( 'Shipping Zones', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p.jsonp?',
|
||||
),
|
||||
'wc-settings-shipping-options' => array(
|
||||
'title' => __( 'Shipping options', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true',
|
||||
'title' => __( 'Shipping Options', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr.jsonp?',
|
||||
),
|
||||
'wc-settings-shipping-classes' => array(
|
||||
'title' => __( 'Shipping classes', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99?videoFoam=true',
|
||||
'title' => __( 'Shipping Classes', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout' => array(
|
||||
'title' => __( 'Checkout settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true',
|
||||
'title' => __( 'Checkout Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-bacs' => array(
|
||||
'title' => __( 'Bank transfer (BACS) payments', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek?videoFoam=true',
|
||||
'title' => __( 'Bank Transfer (BACS) Payment Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-cheque' => array(
|
||||
'title' => __( 'Check payments', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea?videoFoam=true',
|
||||
'title' => __( 'Check Payment Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-cod' => array(
|
||||
'title' => __( 'Cash on delivery', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f?videoFoam=true',
|
||||
'title' => __( 'Cash on Delivery (COD) Payment Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-paypal' => array(
|
||||
'title' => __( 'PayPal Standard', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true',
|
||||
'title' => __( 'PayPal Standard Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-paypalbraintree_cards' => array(
|
||||
'title' => __( 'PayPal by Braintree', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40?videoFoam=true',
|
||||
'title' => __( 'PayPal by Braintree Payment Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40.jsonp?',
|
||||
),
|
||||
'wc-settings-checkout-stripe' => array(
|
||||
'title' => __( 'Stripe', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de?videoFoam=true',
|
||||
),
|
||||
'wc-settings-checkout-simplify_commerce' => array(
|
||||
'title' => __( 'Simplify Commerce', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true',
|
||||
'title' => __( 'Stripe Payment Method', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de.jsonp?',
|
||||
),
|
||||
'wc-settings-account' => array(
|
||||
'title' => __( 'Account settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true',
|
||||
'title' => __( 'Account Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2.jsonp?',
|
||||
),
|
||||
'wc-settings-email' => array(
|
||||
'title' => __( 'Email settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true',
|
||||
'title' => __( 'Email Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv.jsonp?',
|
||||
),
|
||||
'wc-settings-api' => array(
|
||||
'title' => __( 'Webhook settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true',
|
||||
'title' => __( 'API Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?',
|
||||
),
|
||||
'wc-settings-api' => array(
|
||||
'title' => __( 'API Settings', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?',
|
||||
),
|
||||
'wc-settings-api-keys' => array(
|
||||
'title' => __( 'Keys & Apps', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?time=1m06s&',
|
||||
),
|
||||
'wc-settings-api-webhooks' => array(
|
||||
'title' => __( 'Webhooks', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq.jsonp?time=1m52s&',
|
||||
),
|
||||
'product' => array(
|
||||
'title' => __( 'Simple products', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true',
|
||||
'title' => __( 'Creating Products', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut.jsonp?',
|
||||
),
|
||||
'edit-product_cat' => array(
|
||||
'title' => __( 'Product categories', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
|
||||
'title' => __( 'Product Categories', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg.jsonp?time=21s&',
|
||||
),
|
||||
'edit-product_tag' => array(
|
||||
'title' => __( 'Product categories, tags, shipping classes, and attributes', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
|
||||
'title' => __( 'Product Tags', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg.jsonp??time=1m56s&',
|
||||
),
|
||||
'product_attributes' => array(
|
||||
'title' => __( 'Product categories, tags, shipping classes, and attributes', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
|
||||
'title' => __( 'Product Attributes', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg.jsonp??time=2m18s&',
|
||||
),
|
||||
'wc-status' => array(
|
||||
'title' => __( 'System status', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true',
|
||||
'title' => __( 'System Status', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi.jsonp?',
|
||||
),
|
||||
'wc-status-tools' => array(
|
||||
'title' => __( 'Tools', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi.jsonp?time=3m55s&',
|
||||
),
|
||||
'wc-reports' => array(
|
||||
'title' => __( 'Reports', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true',
|
||||
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99.jsonp?',
|
||||
),
|
||||
'wc-reports-customers' => array(
|
||||
'title' => __( 'Customer Reports', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99.jsonp?time=2m07s&',
|
||||
),
|
||||
'wc-reports-stock' => array(
|
||||
'title' => __( 'Stock Reports', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99.jsonp?time=2m41s&',
|
||||
),
|
||||
'wc-reports-taxes' => array(
|
||||
'title' => __( 'Tax Reports', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99.jsonp?time=3m14s&',
|
||||
),
|
||||
'edit-shop_coupon' => array(
|
||||
'title' => __( 'Coupons', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
|
||||
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit.jsonp?',
|
||||
),
|
||||
'shop_coupon' => array(
|
||||
'title' => __( 'Coupons', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
|
||||
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit.jsonp?',
|
||||
),
|
||||
'edit-shop_order' => array(
|
||||
'title' => __( 'Managing orders', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
|
||||
'title' => __( 'Managing Orders', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee.jsonp?',
|
||||
),
|
||||
'shop_order' => array(
|
||||
'title' => __( 'Managing orders', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
|
||||
'title' => __( 'Managing Orders', 'woocommerce' ),
|
||||
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee.jsonp?',
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -168,11 +216,15 @@ class WC_Admin_Help {
|
|||
|
||||
if ( isset( $video_map[ $video_key ] ) ) {
|
||||
$screen->add_help_tab( array(
|
||||
'id' => 'woocommerce_101_tab',
|
||||
'title' => __( 'WooCommerce 101', 'woocommerce' ),
|
||||
'id' => 'woocommerce_guided_tour_tab',
|
||||
'title' => __( 'Guided Tour', 'woocommerce' ),
|
||||
'content' =>
|
||||
'<h2><a href="https://docs.woocommerce.com/document/woocommerce-101-video-series/?utm_source=helptab&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin">' . __( 'WooCommerce 101', 'woocommerce' ) . '</a> – ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
|
||||
'<iframe data-src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" src="" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>',
|
||||
'<h2><a href="https://docs.woocommerce.com/document/woocommerce-guided-tour-videos/?utm_source=helptab&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin">' . __( 'Guided Tour', 'woocommerce' ) . '</a> – ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
|
||||
'<div class="wistia_responsive_padding" style="padding:56.25% 0 0 0;position:relative;">
|
||||
<div class="wistia_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;">
|
||||
<iframe src="' . esc_url( $video_map[ $video_key ]['url'] ) . 'seo=false&videoFoam=true" title="Wistia video player" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="100%" height="100%"></iframe>
|
||||
</div></div>
|
||||
<script src="//fast.wistia.net/assets/external/E-v1.js" async></script>',
|
||||
) );
|
||||
}
|
||||
|
||||
|
@ -182,7 +234,7 @@ class WC_Admin_Help {
|
|||
'content' =>
|
||||
'<h2>' . __( 'Help & Support', 'woocommerce' ) . '</h2>' .
|
||||
'<p>' . sprintf(
|
||||
__( 'Should you need help understanding, using, or extending WooCommerce, <a href="%s">splease read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.' , 'woocommerce' ),
|
||||
__( 'Should you need help understanding, using, or extending WooCommerce, <a href="%s">please read our documentation</a>. You will find all kinds of resources including snippets, tutorials and much more.' , 'woocommerce' ),
|
||||
'https://docs.woocommerce.com/documentation/plugins/woocommerce/?utm_source=helptab&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin'
|
||||
) . '</p>' .
|
||||
'<p>' . sprintf(
|
||||
|
|
|
@ -192,7 +192,7 @@ class WC_Admin_Permalink_Settings {
|
|||
}
|
||||
|
||||
// This is an invalid base structure and breaks pages.
|
||||
if ( '/%product_cat%' === $product_base ) {
|
||||
if ( '/%product_cat%/' === trailingslashit( $product_base ) ) {
|
||||
$product_base = '/' . _x( 'product', 'slug', 'woocommerce' ) . $product_base;
|
||||
}
|
||||
} elseif ( empty( $product_base ) ) {
|
||||
|
|
|
@ -768,7 +768,7 @@ class WC_Admin_Setup_Wizard {
|
|||
<div class="wc-setup-next-steps-last">
|
||||
<h2><?php _e( 'Learn more', 'woocommerce' ); ?></h2>
|
||||
<ul>
|
||||
<li class="video-walkthrough"><a href="https://docs.woocommerce.com/document/woocommerce-101-video-series/?utm_source=setupwizard&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin"><?php _e( 'Watch the WC 101 video walkthroughs', 'woocommerce' ); ?></a></li>
|
||||
<li class="video-walkthrough"><a href="https://docs.woocommerce.com/document/woocommerce-guided-tour-videos/?utm_source=setupwizard&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin"><?php _e( 'Watch the Guided Tour videos', 'woocommerce' ); ?></a></li>
|
||||
<li class="newsletter"><a href="https://woocommerce.com/woocommerce-onboarding-email/?utm_source=setupwizard&utm_medium=product&utm_content=newsletter&utm_campaign=woocommerceplugin"><?php _e( 'Get eCommerce advice in your inbox', 'woocommerce' ); ?></a></li>
|
||||
<li class="learn-more"><a href="https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin"><?php _e( 'Learn more about getting started', 'woocommerce' ); ?></a></li>
|
||||
</ul>
|
||||
|
|
|
@ -22,11 +22,11 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<thead>
|
||||
<tr>
|
||||
<th width="8%"><a href="https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes" target="_blank"><?php _e( 'Country code', 'woocommerce' ); ?></a> <?php echo wc_help_tip( __( 'A 2 digit country code, e.g. US. Leave blank to apply to all.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'State code', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'A 2 digit state code, e.g. AL. Leave blank to apply to all.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'State code', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'A 2 digit state code, e.g. AL. Leave blank to apply to all.', 'woocommerce' ) ); ?></th>
|
||||
<th><?php _e( 'Postcode / ZIP', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Postcode for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all areas. Wildcards (*) and ranges for numeric postcodes (e.g. 12345...12350) can also be used.', 'woocommerce' ) ); ?></th>
|
||||
<th><?php _e( 'City', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Cities for this rule. Semi-colon (;) separate multiple values. Leave blank to apply to all cities.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Rate %', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter a tax rate (percentage) to 4 decimal places.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Tax name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter a name for this tax rate.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Tax name', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter a name for this tax rate.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Priority', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose a priority for this tax rate. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Compound', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates.', 'woocommerce' ) ); ?></th>
|
||||
<th width="8%"><?php _e( 'Shipping', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Choose whether or not this tax rate also gets applied to shipping.', 'woocommerce' ) ); ?></th>
|
||||
|
|
|
@ -477,7 +477,7 @@ class WC_Cart {
|
|||
*/
|
||||
if ( ! $product->is_in_stock() ) {
|
||||
/* translators: %s: product name */
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, "%s" is not in stock. Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $product->get_name() ) );
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, "%s" is not in stock. Please edit your cart and try again. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name() ) );
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
@ -490,7 +490,7 @@ class WC_Cart {
|
|||
*/
|
||||
if ( ! $product->has_enough_stock( $product_qty_in_cart[ $product->get_stock_managed_by_id() ] ) ) {
|
||||
/* translators: 1: product name 2: quantity in stock */
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s in stock). Please edit your cart and try again. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
|
||||
return $error;
|
||||
}
|
||||
|
||||
|
@ -519,7 +519,7 @@ class WC_Cart {
|
|||
|
||||
if ( $product->get_stock_quantity() < ( $held_stock + $product_qty_in_cart[ $product->get_stock_managed_by_id() ] ) ) {
|
||||
/* translators: 1: product name 2: minutes */
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order right now. Please try again in %2$d minutes or edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $product->get_name(), get_option( 'woocommerce_hold_stock_minutes' ) ) );
|
||||
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order right now. Please try again in %2$d minutes or edit your cart and try again. We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name(), get_option( 'woocommerce_hold_stock_minutes' ) ) );
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -790,7 +790,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
* @param string $city
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
public function set_billing_location( $country, $state, $postcode = '', $city = '' ) {
|
||||
public function set_billing_location( $country, $state = '', $postcode = '', $city = '' ) {
|
||||
$billing = $this->get_prop( 'billing', 'edit' );
|
||||
$billing['country'] = $country;
|
||||
$billing['state'] = $state;
|
||||
|
|
|
@ -71,11 +71,19 @@ class WC_Data_Store {
|
|||
|
||||
if ( array_key_exists( $object_type, $this->stores ) ) {
|
||||
$store = apply_filters( 'woocommerce_' . $object_type . '_data_store', $this->stores[ $object_type ] );
|
||||
if ( ! class_exists( $store ) ) {
|
||||
throw new Exception( __( 'Invalid data store.', 'woocommerce' ) );
|
||||
if ( is_object( $store ) ) {
|
||||
if ( ! class_implements( $store, WC_Object_Data_Store_Interface::class ) ) {
|
||||
throw new Exception( __( 'Invalid data store.', 'woocommerce' ) );
|
||||
}
|
||||
$this->current_class_name = get_class( $store );
|
||||
$this->instance = $store;
|
||||
} else {
|
||||
if ( ! class_exists( $store ) ) {
|
||||
throw new Exception( __( 'Invalid data store.', 'woocommerce' ) );
|
||||
}
|
||||
$this->current_class_name = $store;
|
||||
$this->instance = new $store;
|
||||
}
|
||||
$this->current_class_name = $store;
|
||||
$this->instance = new $store;
|
||||
} else {
|
||||
throw new Exception( __( 'Invalid data store.', 'woocommerce' ) );
|
||||
}
|
||||
|
|
|
@ -92,10 +92,20 @@ class WC_Emails {
|
|||
* Queue transactional email via cron so it's not sent in current request.
|
||||
*/
|
||||
public static function queue_transactional_email() {
|
||||
$args = func_get_args();
|
||||
$filter = current_filter();
|
||||
$args = func_get_args();
|
||||
|
||||
wp_schedule_single_event( time() + 10, 'woocommerce_send_queued_transactional_email', array(
|
||||
'filter' => current_filter(),
|
||||
// Remove objects and store IDs.
|
||||
if ( 0 === strpos( $filter, 'woocommerce_order_status_' ) ) {
|
||||
$args[1] = $args[1]->get_id();
|
||||
} elseif ( 'woocommerce_low_stock' === $filter || 'woocommerce_no_stock' === $filter ) {
|
||||
$args[0] = $args[0]->get_id();
|
||||
} elseif ( 'woocommerce_product_on_backorder' === $filter ) {
|
||||
$args[0]['product'] = $args[0]['product']->get_id();
|
||||
}
|
||||
|
||||
wp_schedule_single_event( time() + 5, 'woocommerce_send_queued_transactional_email', array(
|
||||
'filter' => $filter,
|
||||
'args' => $args,
|
||||
) );
|
||||
}
|
||||
|
@ -106,11 +116,21 @@ class WC_Emails {
|
|||
* @internal
|
||||
*
|
||||
* @param string $filter Filter name.
|
||||
* @param array $args Email args (default: []).
|
||||
* @param array $args Email args (default: []).
|
||||
*/
|
||||
public static function send_queued_transactional_email( $filter = '', $args = array() ) {
|
||||
if ( apply_filters( 'woocommerce_allow_send_queued_transactional_email', true, $filter, $args ) ) {
|
||||
self::instance(); // Init self so emails exist.
|
||||
|
||||
// Expand objects from IDs.
|
||||
if ( 0 === strpos( $filter, 'woocommerce_order_status_' ) ) {
|
||||
$args[1] = wc_get_order( $args[1] );
|
||||
} elseif ( 'woocommerce_low_stock' === $filter || 'woocommerce_no_stock' === $filter ) {
|
||||
$args[0] = wc_get_product( $args[0] );
|
||||
} elseif ( 'woocommerce_product_on_backorder' === $filter ) {
|
||||
$args[0]['product'] = wc_get_product( $args[0]['product'] );
|
||||
}
|
||||
|
||||
do_action_ref_array( $filter . '_notification', $args );
|
||||
}
|
||||
}
|
||||
|
@ -366,12 +386,15 @@ class WC_Emails {
|
|||
/**
|
||||
* Add customer details to email templates.
|
||||
*
|
||||
* @param mixed $order
|
||||
* @param WC_Order $order
|
||||
* @param bool $sent_to_admin (default: false)
|
||||
* @param bool $plain_text (default: false)
|
||||
* @return string
|
||||
*/
|
||||
public function customer_details( $order, $sent_to_admin = false, $plain_text = false ) {
|
||||
if ( ! is_a( $order, 'WC_Order' ) ) {
|
||||
return;
|
||||
}
|
||||
$fields = array();
|
||||
|
||||
if ( $order->get_customer_note() ) {
|
||||
|
@ -386,14 +409,14 @@ class WC_Emails {
|
|||
'label' => __( 'Email address', 'woocommerce' ),
|
||||
'value' => wptexturize( $order->get_billing_email() ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $order->get_billing_phone() ) {
|
||||
if ( $order->get_billing_phone() ) {
|
||||
$fields['billing_phone'] = array(
|
||||
'label' => __( 'Phone', 'woocommerce' ),
|
||||
'value' => wptexturize( $order->get_billing_phone() ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$fields = array_filter( apply_filters( 'woocommerce_email_customer_details_fields', $fields, $sent_to_admin, $order ), array( $this, 'customer_detail_field_is_valid' ) );
|
||||
|
||||
|
@ -408,6 +431,9 @@ class WC_Emails {
|
|||
* Get the email addresses.
|
||||
*/
|
||||
public function email_addresses( $order, $sent_to_admin = false, $plain_text = false ) {
|
||||
if ( ! is_a( $order, 'WC_Order' ) ) {
|
||||
return;
|
||||
}
|
||||
if ( $plain_text ) {
|
||||
wc_get_template( 'emails/plain/email-addresses.php', array( 'order' => $order ) );
|
||||
} else {
|
||||
|
|
|
@ -110,27 +110,11 @@ class WC_Order extends WC_Abstract_Order {
|
|||
}
|
||||
|
||||
if ( $this->has_status( apply_filters( 'woocommerce_valid_order_statuses_for_payment_complete', array( 'on-hold', 'pending', 'failed', 'cancelled' ), $this ) ) ) {
|
||||
$order_needs_processing = false;
|
||||
|
||||
if ( sizeof( $this->get_items() ) > 0 ) {
|
||||
foreach ( $this->get_items() as $item ) {
|
||||
if ( $item->is_type( 'line_item' ) && ( $product = $item->get_product() ) ) {
|
||||
$virtual_downloadable_item = $product->is_downloadable() && $product->is_virtual();
|
||||
|
||||
if ( apply_filters( 'woocommerce_order_item_needs_processing', ! $virtual_downloadable_item, $product, $this->get_id() ) ) {
|
||||
$order_needs_processing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $transaction_id ) ) {
|
||||
$this->set_transaction_id( $transaction_id );
|
||||
}
|
||||
|
||||
$this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $order_needs_processing ? 'processing' : 'completed', $this->get_id() ) );
|
||||
$this->set_date_paid( current_time( 'timestamp' ) );
|
||||
$this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id() ) );
|
||||
$this->maybe_set_date_paid();
|
||||
$this->save();
|
||||
|
||||
do_action( 'woocommerce_payment_complete', $this->get_id() );
|
||||
|
@ -248,22 +232,45 @@ class WC_Order extends WC_Abstract_Order {
|
|||
'manual' => (bool) $manual_update,
|
||||
);
|
||||
|
||||
if ( 'pending' === $result['from'] && ! $manual_update ) {
|
||||
$this->set_date_paid( current_time( 'timestamp' ) );
|
||||
}
|
||||
|
||||
if ( ! $this->get_date_paid() && 'pending' === $result['from'] ) {
|
||||
$this->set_date_paid( current_time( 'timestamp' ) );
|
||||
}
|
||||
|
||||
if ( 'completed' === $result['to'] ) {
|
||||
$this->set_date_completed( current_time( 'timestamp' ) );
|
||||
}
|
||||
$this->maybe_set_date_paid();
|
||||
$this->maybe_set_date_completed();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe set date paid.
|
||||
*
|
||||
* Sets the date paid variable when transitioning to the payment complete
|
||||
* order status. This is either processing or completed.
|
||||
* Date paid is set once in this manner - only when it is not already set.
|
||||
* This ensures the data exists even if a gateway does not use the
|
||||
* `payment_complete` method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*/
|
||||
protected function maybe_set_date_paid() {
|
||||
$payment_complete_status = apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id() );
|
||||
|
||||
if ( ! $this->get_date_paid( 'edit' ) && $this->has_status( $payment_complete_status ) ) {
|
||||
$this->set_date_paid( current_time( 'timestamp' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe set date completed.
|
||||
*
|
||||
* Sets the date completed variable when transitioning to completed status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*/
|
||||
protected function maybe_set_date_completed() {
|
||||
if ( $this->has_status( 'completed' ) ) {
|
||||
$this->set_date_completed( current_time( 'timestamp' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates status of order immediately. Order must exist.
|
||||
* @uses WC_Order::set_status()
|
||||
|
@ -1270,6 +1277,34 @@ class WC_Order extends WC_Abstract_Order {
|
|||
return apply_filters( 'woocommerce_order_needs_payment', ( $this->has_status( $valid_order_statuses ) && $this->get_total() > 0 ), $this, $valid_order_statuses );
|
||||
}
|
||||
|
||||
/**
|
||||
* See if the order needs processing before it can be completed.
|
||||
*
|
||||
* Orders which only contain virtual, downloadable items do not need admin
|
||||
* intervention.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @return bool
|
||||
*/
|
||||
protected function needs_processing() {
|
||||
$needs_processing = false;
|
||||
|
||||
if ( sizeof( $this->get_items() ) > 0 ) {
|
||||
foreach ( $this->get_items() as $item ) {
|
||||
if ( $item->is_type( 'line_item' ) && ( $product = $item->get_product() ) ) {
|
||||
$virtual_downloadable_item = $product->is_downloadable() && $product->is_virtual();
|
||||
|
||||
if ( apply_filters( 'woocommerce_order_item_needs_processing', ! $virtual_downloadable_item, $product, $this->get_id() ) ) {
|
||||
$needs_processing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $needs_processing;
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| URLs and Endpoints
|
||||
|
@ -1685,4 +1720,35 @@ class WC_Order extends WC_Abstract_Order {
|
|||
public function get_remaining_refund_items() {
|
||||
return absint( $this->get_item_count() - $this->get_item_count_refunded() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get totals for display on pages and in emails.
|
||||
*
|
||||
* @param mixed $tax_display
|
||||
* @return array
|
||||
*/
|
||||
public function get_order_item_totals( $tax_display = '' ) {
|
||||
$total_rows = parent::get_order_item_totals( $tax_display );
|
||||
$total_row = array_pop( $total_rows );
|
||||
|
||||
if ( $this->get_total() > 0 && $this->get_payment_method_title() ) {
|
||||
$total_rows['payment_method'] = array(
|
||||
'label' => __( 'Payment method:', 'woocommerce' ),
|
||||
'value' => $this->get_payment_method_title(),
|
||||
);
|
||||
}
|
||||
|
||||
if ( $refunds = $this->get_refunds() ) {
|
||||
foreach ( $refunds as $id => $refund ) {
|
||||
$total_rows[ 'refund_' . $id ] = array(
|
||||
'label' => $refund->get_reason() ? $refund->get_reason() : __( 'Refund', 'woocommerce' ) . ':',
|
||||
'value' => wc_price( '-' . $refund->get_amount(), array( 'currency' => $this->get_currency() ) ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$total_rows['order_total'] = $total_row;
|
||||
|
||||
return apply_filters( 'woocommerce_get_order_item_totals', $total_rows, $this );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -328,7 +328,7 @@ class WC_Structured_Data {
|
|||
* @param bool $plain_text Plain text email (default: false).
|
||||
*/
|
||||
public function generate_order_data( $order, $sent_to_admin = false, $plain_text = false ) {
|
||||
if ( $plain_text ) {
|
||||
if ( $plain_text || ! is_a( $order, 'WC_Order' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
class WC_Validation {
|
||||
|
||||
/**
|
||||
* Validates an email using wordpress native is_email function.
|
||||
* Validates an email using WordPress native is_email function.
|
||||
*
|
||||
* @param string email address
|
||||
* @param string $email Email address to validate.
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_email( $email ) {
|
||||
|
@ -28,7 +28,7 @@ class WC_Validation {
|
|||
/**
|
||||
* Validates a phone number using a regular expression.
|
||||
*
|
||||
* @param string phone number
|
||||
* @param string $phone Phone number to validate.
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_phone( $phone ) {
|
||||
|
@ -42,8 +42,8 @@ class WC_Validation {
|
|||
/**
|
||||
* Checks for a valid postcode.
|
||||
*
|
||||
* @param string postcode
|
||||
* @param string country
|
||||
* @param string $postcode Postcode to validate.
|
||||
* @param string $country Country to validate the postcode for.
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_postcode( $postcode, $country ) {
|
||||
|
@ -154,9 +154,9 @@ class WC_Validation {
|
|||
/**
|
||||
* Format the postcode according to the country and length of the postcode.
|
||||
*
|
||||
* @param string postcode
|
||||
* @param string country
|
||||
* @return string formatted postcode
|
||||
* @param string $postcode Postcode to format.
|
||||
* @param string $country Country to format the postcode for.
|
||||
* @return string Formatted postcode.
|
||||
*/
|
||||
public static function format_postcode( $postcode, $country ) {
|
||||
return wc_format_postcode( $postcode, $country );
|
||||
|
@ -165,8 +165,7 @@ class WC_Validation {
|
|||
/**
|
||||
* format_phone function.
|
||||
*
|
||||
* @access public
|
||||
* @param mixed $tel
|
||||
* @param mixed $tel Phone number to format.
|
||||
* @return string
|
||||
*/
|
||||
public static function format_phone( $tel ) {
|
||||
|
|
|
@ -333,17 +333,21 @@ EOT;
|
|||
* @return string
|
||||
*/
|
||||
private function get_filled_route( $args = array() ) {
|
||||
$parent_id_matched = false;
|
||||
$route = $this->route;
|
||||
$supported_id_matched = false;
|
||||
$route = $this->route;
|
||||
|
||||
foreach ( $this->get_supported_ids() as $id_name => $id_desc ) {
|
||||
if ( strpos( $route, '<' . $id_name . '>' ) !== false && ! empty( $args ) ) {
|
||||
$route = str_replace( '(?P<' . $id_name . '>[\d]+)', $args[0], $route );
|
||||
$parent_id_matched = true;
|
||||
$route = str_replace( '(?P<' . $id_name . '>[\d]+)', $args[0], $route );
|
||||
$supported_id_matched = true;
|
||||
}
|
||||
}
|
||||
|
||||
$route = str_replace( array( '(?P<id>[\d]+)', '(?P<id>[\w-]+)' ), ( $parent_id_matched && ! empty( $args[1] ) ? $args[1] : $args[0] ), $route );
|
||||
if ( ! empty( $args ) ) {
|
||||
$id_replacement = $supported_id_matched && ! empty( $args[1] ) ? $args[1] : $args[0];
|
||||
$route = str_replace( array( '(?P<id>[\d]+)', '(?P<id>[\w-]+)' ), $id_replacement, $route );
|
||||
}
|
||||
|
||||
return rtrim( $route );
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,12 @@ class WC_CLI_Runner {
|
|||
'reports/top_sellers',
|
||||
);
|
||||
|
||||
/**
|
||||
* The version of the REST API we should target to
|
||||
* generate commands.
|
||||
*/
|
||||
private static $target_rest_version = 'v2';
|
||||
|
||||
/**
|
||||
* Register's all endpoints as commands once WP and WC have all loaded.
|
||||
*/
|
||||
|
@ -48,10 +54,11 @@ class WC_CLI_Runner {
|
|||
|
||||
// Loop through all of our endpoints and register any valid WC endpoints.
|
||||
foreach ( $response_data['routes'] as $route => $route_data ) {
|
||||
// Only register WC endpoints
|
||||
if ( substr( $route, 0, 4 ) !== '/wc/' ) {
|
||||
// Only register endpoints for WC and our target version.
|
||||
if ( '/wc/' . self::$target_rest_version !== substr( $route, 0, 4 + strlen( self::$target_rest_version ) ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only register endpoints with schemas
|
||||
if ( empty( $route_data['schema']['title'] ) ) {
|
||||
WP_CLI::debug( sprintf( __( 'No schema title found for %s, skipping REST command registration.', 'woocommerce' ), $route ), 'wc' );
|
||||
|
|
|
@ -96,6 +96,18 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
|
|||
$this->read_order_data( $order, $post_object );
|
||||
$order->read_meta_data();
|
||||
$order->set_object_read( true );
|
||||
|
||||
/**
|
||||
* In older versions, discounts may have been stored differently.
|
||||
* Update them now so if the object is saved, the correct values are
|
||||
* stored.
|
||||
* @todo When/if meta is flattened, handle this in the migration script.
|
||||
*/
|
||||
if ( ! $order->get_version( 'edit' ) || version_compare( $order->get_version( 'edit' ), '2.3.7', '<' ) ) {
|
||||
if ( $order->get_prices_include_tax( 'edit' ) ) {
|
||||
$order->set_discount_total( (double) get_post_meta( $order->get_id(), '_cart_discount', true ) - (double) get_post_meta( $order->get_id(), '_cart_discount_tax', true ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -223,9 +235,13 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
|
|||
|
||||
$props_to_update = $this->get_props_to_update( $order, $meta_key_to_props );
|
||||
foreach ( $props_to_update as $meta_key => $prop ) {
|
||||
$value = $order->{"get_$prop"}( 'edit' );
|
||||
$updated = update_post_meta( $order->get_id(), $meta_key, $value );
|
||||
if ( $updated ) {
|
||||
$value = $order->{"get_$prop"}( 'edit' );
|
||||
|
||||
if ( 'prices_include_tax' === $prop ) {
|
||||
$value = $value ? 'yes' : 'no';
|
||||
}
|
||||
|
||||
if ( update_post_meta( $order->get_id(), $meta_key, $value ) ) {
|
||||
$updated_props[] = $prop;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ class WC_Product_Variable_Data_Store_CPT extends WC_Product_Data_Store_CPT imple
|
|||
WHERE post_type = 'product_variation'
|
||||
AND post_parent = %d
|
||||
",
|
||||
$previous_name,
|
||||
$previous_name ? $previous_name : __( 'Auto Draft' ),
|
||||
$new_name,
|
||||
$product->get_id()
|
||||
) );
|
||||
|
@ -394,7 +394,7 @@ class WC_Product_Variable_Data_Store_CPT extends WC_Product_Data_Store_CPT imple
|
|||
'post_parent' => $product_id,
|
||||
'post_type' => 'product_variation',
|
||||
'fields' => 'ids',
|
||||
'post_status' => 'any',
|
||||
'post_status' => array( 'any', 'trash', 'auto-draft' ),
|
||||
'numberposts' => -1,
|
||||
) ) );
|
||||
|
||||
|
|
|
@ -70,12 +70,10 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
|
|||
$product->set_attributes( wc_get_product_variation_attributes( $product->get_id() ) );
|
||||
|
||||
/**
|
||||
* Clean up old variation titles.
|
||||
* The "Product #" text is intentionally not wrapped in translation functions for a faster comparision. It was not inserted as a translated string:
|
||||
* https://github.com/woocommerce/woocommerce/blob/5fc88694d211e2e176bded16d7fb95cf6285249e/includes/class-wc-ajax.php#L776
|
||||
* If a variation title is not in sync with the parent e.g. saved prior to 2.7, or if the parent title has changed, detect here and update.
|
||||
*/
|
||||
if ( __( 'Variation #', 'woocommerce' ) === substr( $post_object->post_title, 0, 11 ) || ( 'Product #' . $product->get_parent_id() . ' Variation' ) === $post_object->post_title ) {
|
||||
$new_title = $this->generate_product_title( $product );
|
||||
if ( version_compare( get_post_meta( $product->get_id(), '_product_version', true ), '2.7', '<' ) && 0 !== strpos( $post_object->post_title, get_post_field( 'post_title', $product->get_parent_id() ) ) ) {
|
||||
$new_title = $this->generate_product_title( $product );
|
||||
$product->set_name( $new_title );
|
||||
wp_update_post( array(
|
||||
'ID' => $product->get_id(),
|
||||
|
@ -198,9 +196,9 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
|
|||
}
|
||||
|
||||
$include_attribute_names = apply_filters( 'woocommerce_product_variation_title_include_attribute_names', $include_attribute_names, $product );
|
||||
$title_base_text = get_post_field( 'post_title', $product->get_parent_id() );
|
||||
$title_attributes_text = wc_get_formatted_variation( $product, true, $include_attribute_names );
|
||||
$separator = ! empty( $title_attributes_text ) ? ' – ' : '';
|
||||
$title_base_text = get_post_field( 'post_title', $product->get_parent_id() );
|
||||
$title_attributes_text = wc_get_formatted_variation( $product, true, $include_attribute_names );
|
||||
$separator = ! empty( $title_attributes_text ) ? ' – ' : '';
|
||||
|
||||
return apply_filters( 'woocommerce_product_variation_title',
|
||||
$title_base_text . $separator . $title_attributes_text,
|
||||
|
|
|
@ -279,20 +279,24 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
|||
$bacs_accounts = apply_filters( 'woocommerce_bacs_accounts', $this->account_details );
|
||||
|
||||
if ( ! empty( $bacs_accounts ) ) {
|
||||
echo '<h2 class="wc-bacs-bank-details-heading">' . __( 'Our bank details', 'woocommerce' ) . '</h2>' . PHP_EOL;
|
||||
$account_html = '';
|
||||
$has_details = false;
|
||||
|
||||
foreach ( $bacs_accounts as $bacs_account ) {
|
||||
|
||||
$bacs_account = (object) $bacs_account;
|
||||
|
||||
if ( $bacs_account->account_name || $bacs_account->bank_name ) {
|
||||
echo '<h3>' . wp_unslash( implode( ' - ', array_filter( array( $bacs_account->account_name, $bacs_account->bank_name ) ) ) ) . '</h3>' . PHP_EOL;
|
||||
if ( $bacs_account->account_name ) {
|
||||
$account_html .= '<h3 class="wc-bacs-bank-details-account-name">' . wp_kses_post( wp_unslash( $bacs_account->account_name ) ) . ':</h3>' . PHP_EOL;
|
||||
}
|
||||
|
||||
echo '<ul class="wc-bacs-bank-details order_details bacs_details">' . PHP_EOL;
|
||||
$account_html .= '<ul class="wc-bacs-bank-details order_details bacs_details">' . PHP_EOL;
|
||||
|
||||
// BACS account fields shown on the thanks page and in emails
|
||||
$account_fields = apply_filters( 'woocommerce_bacs_account_fields', array(
|
||||
'bank_name' => array(
|
||||
'label' => __( 'Bank', 'woocommerce' ),
|
||||
'value' => $bacs_account->bank_name,
|
||||
),
|
||||
'account_number' => array(
|
||||
'label' => __( 'Account number', 'woocommerce' ),
|
||||
'value' => $bacs_account->account_number,
|
||||
|
@ -313,11 +317,16 @@ class WC_Gateway_BACS extends WC_Payment_Gateway {
|
|||
|
||||
foreach ( $account_fields as $field_key => $field ) {
|
||||
if ( ! empty( $field['value'] ) ) {
|
||||
echo '<li class="' . esc_attr( $field_key ) . '">' . esc_attr( $field['label'] ) . ': <strong>' . wptexturize( $field['value'] ) . '</strong></li>' . PHP_EOL;
|
||||
$account_html .= '<li class="' . esc_attr( $field_key ) . '">' . wp_kses_post( $field['label'] ) . ': <strong>' . wp_kses_post( wptexturize( $field['value'] ) ) . '</strong></li>' . PHP_EOL;
|
||||
$has_details = true;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
$account_html .= '</ul>';
|
||||
}
|
||||
|
||||
if ( $has_details ) {
|
||||
echo '<section class="woocommerce-bacs-bank-details"><h2 class="wc-bacs-bank-details-heading">' . __( 'Our bank details', 'woocommerce' ) . '</h2>' . PHP_EOL . $account_html . '</section>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,13 @@ abstract class WC_Abstract_Legacy_Product extends WC_Data {
|
|||
'variation_data',
|
||||
'variation_has_stock',
|
||||
'variation_shipping_class_id',
|
||||
'variation_has_sku',
|
||||
'variation_has_length',
|
||||
'variation_has_width',
|
||||
'variation_has_height',
|
||||
'variation_has_weight',
|
||||
'variation_has_tax_class',
|
||||
'variation_has_downloadable_files',
|
||||
) );
|
||||
}
|
||||
return in_array( $key, array_merge( $valid, array_keys( $this->data ) ) ) || metadata_exists( 'post', $this->get_id(), '_' . $key ) || metadata_exists( 'post', $this->get_parent_id(), '_' . $key );
|
||||
|
@ -127,6 +134,15 @@ abstract class WC_Abstract_Legacy_Product extends WC_Data {
|
|||
case 'variation_shipping_class_id' :
|
||||
$value = $this->is_type( 'variation' ) ? $this->get_shipping_class_id() : '';
|
||||
break;
|
||||
case 'variation_has_sku' :
|
||||
case 'variation_has_length' :
|
||||
case 'variation_has_width' :
|
||||
case 'variation_has_height' :
|
||||
case 'variation_has_weight' :
|
||||
case 'variation_has_tax_class' :
|
||||
case 'variation_has_downloadable_files' :
|
||||
$value = true; // These were deprecated in 2.2 and simply returned true in 2.6.x.
|
||||
break;
|
||||
default :
|
||||
if ( in_array( $key, array_keys( $this->data ) ) ) {
|
||||
$value = $this->{"get_$key"}();
|
||||
|
|
|
@ -161,7 +161,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
|
|||
|
||||
== Changelog ==
|
||||
|
||||
= 2.7.0 - 20XX-XX-XX =
|
||||
= 2.7.0 - 2017-03-14 =
|
||||
* New gallery on single product pages with better mobile support, using PhotoSwipe and Zoom. Declare support with add_theme_support() - wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider
|
||||
* Made the store notice dismissible on the frontend.
|
||||
* Variable products no longer show striked out prices in combination with ranges for clarity when on sale.
|
||||
|
@ -219,7 +219,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
|
|||
* Localization - Improved RTL support.
|
||||
* Localization - Added a language independent permalink setting function.
|
||||
* Localization - Added inline comments for placeholder strings.
|
||||
* Localization - Added Nigerian Provinces to i18n/state.
|
||||
* Localization - Added Nigerian and Pakistan Provinces to i18n/state.
|
||||
* Localization - US and Poland postcode validation.
|
||||
|
||||
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce/master/CHANGELOG.txt).
|
||||
|
@ -227,4 +227,4 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
|
|||
== Upgrade Notice ==
|
||||
|
||||
= 2.7 =
|
||||
2.7 is a major update. It is important that you make backups and ensure themes and extensions are 2.7 compatible before upgrading..
|
||||
2.7 is a major update. It is important that you make backups and ensure themes and extensions are 2.7 compatible before upgrading.
|
||||
|
|
|
@ -44,9 +44,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
|
||||
</div>
|
||||
<div class="woocommerce-account-fields">
|
||||
<?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?>
|
||||
|
||||
<?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?>
|
||||
<div class="woocommerce-account-fields">
|
||||
<?php if ( ! $checkout->is_registration_required() ) : ?>
|
||||
|
||||
<p class="form-row form-row-wide create-account">
|
||||
|
@ -57,23 +56,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>
|
||||
<?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?>
|
||||
|
||||
<?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?>
|
||||
<div class="create-account">
|
||||
|
||||
<div class="create-account">
|
||||
<?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?>
|
||||
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?>
|
||||
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
|
||||
<?php endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
|
||||
</div>
|
||||
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Plugin Name: WooCommerce
|
||||
* Plugin URI: https://woocommerce.com/
|
||||
* Description: An e-commerce toolkit that helps you sell anything. Beautifully.
|
||||
* Version: 2.7.0-beta-4
|
||||
* Version: 2.7.0-RC1
|
||||
* Author: Automattic
|
||||
* Author URI: https://woocommerce.com
|
||||
* Requires at least: 4.4
|
||||
|
|
Loading…
Reference in New Issue