commit
1c369e41e0
|
@ -91,7 +91,7 @@ abstract class WC_Data {
|
||||||
protected $cache_group = '';
|
protected $cache_group = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores additonal meta data.
|
* Stores additional meta data.
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @var array
|
* @var array
|
||||||
|
@ -168,7 +168,7 @@ abstract class WC_Data {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save should create or update based on object existance.
|
* Save should create or update based on object existence.
|
||||||
*
|
*
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
* @return int
|
* @return int
|
||||||
|
|
|
@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Rest Controler Class
|
* Abstract Rest Controller Class
|
||||||
*
|
*
|
||||||
* @author WooThemes
|
* @author WooThemes
|
||||||
* @category API
|
* @category API
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Abstract Rest CRUD Controler Class
|
* Abstract Rest CRUD Controller Class
|
||||||
*
|
*
|
||||||
* @author Automattic
|
* @author Automattic
|
||||||
* @category API
|
* @category API
|
||||||
|
|
|
@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Rest Posts Controler Class
|
* Abstract Rest Posts Controller Class
|
||||||
*
|
*
|
||||||
* @author WooThemes
|
* @author WooThemes
|
||||||
* @category API
|
* @category API
|
||||||
|
|
|
@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract Rest Terms Controler Class
|
* Abstract Rest Terms Controller Class
|
||||||
*
|
*
|
||||||
* @author WooThemes
|
* @author WooThemes
|
||||||
* @category API
|
* @category API
|
||||||
|
|
|
@ -618,7 +618,7 @@ class WC_Admin_Settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to get the formated description and tip HTML for a
|
* Helper function to get the formatted description and tip HTML for a
|
||||||
* given form field. Plugins can call this when implementing their own custom
|
* given form field. Plugins can call this when implementing their own custom
|
||||||
* settings types.
|
* settings types.
|
||||||
*
|
*
|
||||||
|
|
|
@ -105,14 +105,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
|
||||||
$total_coupons = absint( $this->get_order_report_data( $total_coupons_query ) );
|
$total_coupons = absint( $this->get_order_report_data( $total_coupons_query ) );
|
||||||
|
|
||||||
$legend[] = array(
|
$legend[] = array(
|
||||||
/* translators: %s: discount ammount */
|
/* translators: %s: discount amount */
|
||||||
'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '<strong>' . wc_price( $total_discount ) . '</strong>' ),
|
'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '<strong>' . wc_price( $total_discount ) . '</strong>' ),
|
||||||
'color' => $this->chart_colours['discount_amount'],
|
'color' => $this->chart_colours['discount_amount'],
|
||||||
'highlight_series' => 1,
|
'highlight_series' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
$legend[] = array(
|
$legend[] = array(
|
||||||
/* translators: %s: coupons ammount */
|
/* translators: %s: coupons amount */
|
||||||
'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '<strong>' . $total_coupons . '</strong>' ),
|
'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '<strong>' . $total_coupons . '</strong>' ),
|
||||||
'color' => $this->chart_colours['coupon_count'],
|
'color' => $this->chart_colours['coupon_count'],
|
||||||
'highlight_series' => 0,
|
'highlight_series' => 0,
|
||||||
|
|
|
@ -37,7 +37,7 @@ class WC_Report_Customers extends WC_Admin_Report {
|
||||||
$legend = array();
|
$legend = array();
|
||||||
|
|
||||||
$legend[] = array(
|
$legend[] = array(
|
||||||
/* translators: %s: signups ammount */
|
/* translators: %s: signups amount */
|
||||||
'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '<strong>' . sizeof( $this->customers ) . '</strong>' ),
|
'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '<strong>' . sizeof( $this->customers ) . '</strong>' ),
|
||||||
'color' => $this->chart_colours['signups'],
|
'color' => $this->chart_colours['signups'],
|
||||||
'highlight_series' => 2,
|
'highlight_series' => 2,
|
||||||
|
|
|
@ -309,7 +309,7 @@ class WC_Order extends WC_Abstract_Order {
|
||||||
$transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $this->status_transition['to'] ) );
|
$transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $this->status_transition['to'] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note the transition occured
|
// Note the transition occurred
|
||||||
$this->add_order_note( trim( $this->status_transition['note'] . ' ' . $transition_note ), 0, $this->status_transition['manual'] );
|
$this->add_order_note( trim( $this->status_transition['note'] . ' ' . $transition_note ), 0, $this->status_transition['manual'] );
|
||||||
|
|
||||||
// This has ran, so reset status transition variable
|
// This has ran, so reset status transition variable
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* WooCommerce Tracker
|
* WooCommerce Tracker
|
||||||
*
|
*
|
||||||
* The WooCommerce tracker class adds functionality to track WooCommerce usage based on if the customer opted in.
|
* The WooCommerce tracker class adds functionality to track WooCommerce usage based on if the customer opted in.
|
||||||
* No personal infomation is tracked, only general WooCommerce settings, general product, order and user counts and admin email for discount code.
|
* No personal information is tracked, only general WooCommerce settings, general product, order and user counts and admin email for discount code.
|
||||||
*
|
*
|
||||||
* @class WC_Tracker
|
* @class WC_Tracker
|
||||||
* @version 2.3.0
|
* @version 2.3.0
|
||||||
|
@ -37,7 +37,7 @@ class WC_Tracker {
|
||||||
* @param boolean $override
|
* @param boolean $override
|
||||||
*/
|
*/
|
||||||
public static function send_tracking_data( $override = false ) {
|
public static function send_tracking_data( $override = false ) {
|
||||||
// Dont trigger this on AJAX Requests
|
// Don't trigger this on AJAX Requests
|
||||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ class WC_Tracker {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Make sure there is at least a 1 hour 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 don't want duplicate calls due to double clicking links.
|
||||||
$last_send = self::get_last_send_time();
|
$last_send = self::get_last_send_time();
|
||||||
if ( $last_send && $last_send > strtotime( '-1 hours' ) ) {
|
if ( $last_send && $last_send > strtotime( '-1 hours' ) ) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1128,7 +1128,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
|
||||||
'order' => $args['order'],
|
'order' => $args['order'],
|
||||||
'tax_query' => array(),
|
'tax_query' => array(),
|
||||||
);
|
);
|
||||||
// Do not load unneccessary post data if the user only wants IDs.
|
// Do not load unnecessary post data if the user only wants IDs.
|
||||||
if ( 'ids' === $args['return'] ) {
|
if ( 'ids' === $args['return'] ) {
|
||||||
$wp_query_args['fields'] = 'ids';
|
$wp_query_args['fields'] = 'ids';
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,7 +283,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a reveral.
|
* Handle a reversal.
|
||||||
* @param WC_Order $order
|
* @param WC_Order $order
|
||||||
* @param array $posted
|
* @param array $posted
|
||||||
*/
|
*/
|
||||||
|
@ -297,7 +297,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a cancelled reveral.
|
* Handle a cancelled reversal.
|
||||||
* @param WC_Order $order
|
* @param WC_Order $order
|
||||||
* @param array $posted
|
* @param array $posted
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -339,7 +339,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Actualy saves a customer token to the database.
|
* Actually saves a customer token to the database.
|
||||||
*
|
*
|
||||||
* @param WC_Payment_Token $customer_token Payment Token
|
* @param WC_Payment_Token $customer_token Payment Token
|
||||||
* @param string $cart_token CC Token
|
* @param string $cart_token CC Token
|
||||||
|
|
|
@ -208,7 +208,7 @@ if ( ! class_exists( 'WC_Eval_Math', false ) ) {
|
||||||
} elseif ( in_array( $op, $ops ) and ! $expecting_op ) {
|
} elseif ( in_array( $op, $ops ) and ! $expecting_op ) {
|
||||||
return self::trigger( "unexpected operator '$op'" );
|
return self::trigger( "unexpected operator '$op'" );
|
||||||
} else { // I don't even want to know what you did to get here
|
} else { // I don't even want to know what you did to get here
|
||||||
return self::trigger( "an unexpected error occured" );
|
return self::trigger( "an unexpected error occurred" );
|
||||||
}
|
}
|
||||||
if ( strlen( $expr ) == $index ) {
|
if ( strlen( $expr ) == $index ) {
|
||||||
if ( in_array( $op, $ops ) ) { // did we end with an operator? bad.
|
if ( in_array( $op, $ops ) ) { // did we end with an operator? bad.
|
||||||
|
|
|
@ -78,7 +78,7 @@ class WC_Log_Handler_File extends WC_Log_Handler {
|
||||||
*
|
*
|
||||||
* @type string $source Optional. Determines log file to write to. Default 'log'.
|
* @type string $source Optional. Determines log file to write to. Default 'log'.
|
||||||
* @type bool $_legacy Optional. Default false. True to use outdated log format
|
* @type bool $_legacy Optional. Default false. True to use outdated log format
|
||||||
* orignally used in deprecated WC_Logger::add calls.
|
* originally used in deprecated WC_Logger::add calls.
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* @return bool False if value was not handled and true if value was handled.
|
* @return bool False if value was not handled and true if value was handled.
|
||||||
|
|
|
@ -273,7 +273,7 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
|
||||||
*
|
*
|
||||||
* @deprecated 2.4.0
|
* @deprecated 2.4.0
|
||||||
*
|
*
|
||||||
* Additonal rates defined like this:
|
* Additional rates defined like this:
|
||||||
* Option Name | Additional Cost [+- Percents%] | Per Cost Type (order, class, or item).
|
* Option Name | Additional Cost [+- Percents%] | Per Cost Type (order, class, or item).
|
||||||
*/
|
*/
|
||||||
public function calculate_extra_shipping( $method, $rate ) {
|
public function calculate_extra_shipping( $method, $rate ) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ function wc_get_coupon_code_by_id( $id ) {
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param string $code
|
* @param string $code
|
||||||
* @param int $exclude Used to exclude an ID from the check if you're checking existance.
|
* @param int $exclude Used to exclude an ID from the check if you're checking existence.
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function wc_get_coupon_id_by_code( $code, $exclude = 0 ) {
|
function wc_get_coupon_id_by_code( $code, $exclude = 0 ) {
|
||||||
|
|
|
@ -166,7 +166,7 @@ function wc_get_order_id_by_order_key( $order_key ) {
|
||||||
/**
|
/**
|
||||||
* Get all registered order types.
|
* Get all registered order types.
|
||||||
*
|
*
|
||||||
* $for optionally define what you are getting order types for so only relevent types are returned.
|
* $for optionally define what you are getting order types for so only relevant types are returned.
|
||||||
*
|
*
|
||||||
* e.g. for 'order-meta-boxes', 'order-count'
|
* e.g. for 'order-meta-boxes', 'order-count'
|
||||||
*
|
*
|
||||||
|
|
|
@ -75,7 +75,7 @@ class WC_Widget_Product_Tag_Cloud extends WC_Widget {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retuns topic count text.
|
* Returns topic count text.
|
||||||
*
|
*
|
||||||
* @since 2.6.0
|
* @since 2.6.0
|
||||||
* @param int $count
|
* @param int $count
|
||||||
|
|
|
@ -91,7 +91,7 @@ class WC_Widget_Rating_Filter extends WC_Widget {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count products after other filters have occured by adjusting the main query.
|
* Count products after other filters have occurred by adjusting the main query.
|
||||||
* @param int $rating
|
* @param int $rating
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -264,7 +264,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a particualr gateway's settings so we can correctly test API output.
|
* Loads a particular gateway's settings so we can correctly test API output.
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param string $gateway_class Name of WC_Payment_Gateway class.
|
* @param string $gateway_class Name of WC_Payment_Gateway class.
|
||||||
|
|
|
@ -180,7 +180,7 @@ class Products_API extends WC_REST_Unit_Test_Case {
|
||||||
$this->assertContains( 'Dr1Bczxq4q', $data['images'][0]['src'] );
|
$this->assertContains( 'Dr1Bczxq4q', $data['images'][0]['src'] );
|
||||||
$this->assertContains( 'test upload image', $data['images'][0]['alt'] );
|
$this->assertContains( 'test upload image', $data['images'][0]['alt'] );
|
||||||
|
|
||||||
// test variable product (varations are tested in product-variations.php)
|
// test variable product (variations are tested in product-variations.php)
|
||||||
$product = WC_Helper_Product::create_variation_product();
|
$product = WC_Helper_Product::create_variation_product();
|
||||||
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/products/' . $product->get_id() ) );
|
$response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/products/' . $product->get_id() ) );
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
|
|
Loading…
Reference in New Issue