rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -20,6 +20,20 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
*/
protected $fee_cost = '';
/**
* Shipping method cost.
*
* @var string
*/
public $cost;
/**
* Shipping method type.
*
* @var string
*/
public $type;
/**
* Constructor.
*

View File

@@ -36,6 +36,15 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
*/
public $requires = '';
/**
* Ignore discounts.
*
* If set, free shipping would be available based on pre-discount order amount.
*
* @var string
*/
public $ignore_discounts;
/**
* Constructor.
*
@@ -153,12 +162,11 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ), true ) ) {
$total = WC()->cart->get_displayed_subtotal();
if ( WC()->cart->display_prices_including_tax() ) {
$total = $total - WC()->cart->get_discount_tax();
}
if ( 'no' === $this->ignore_discounts ) {
$total = $total - WC()->cart->get_discount_total();
if ( WC()->cart->display_prices_including_tax() ) {
$total = $total - WC()->cart->get_discount_tax();
}
}
$total = NumberUtil::round( $total, wc_get_price_decimals() );

View File

@@ -27,6 +27,28 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method {
*/
protected $fee_cost = '';
/**
* Shipping method cost.
*
* @var string
*/
public $cost;
/**
* Shipping method type.
*
* @var string
*/
public $type;
/**
* Shipping method options.
*
* @deprecated 2.4.0
* @var string
*/
public $options;
/**
* Constructor.
*/

View File

@@ -20,6 +20,22 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class WC_Shipping_Legacy_Local_Delivery extends WC_Shipping_Local_Pickup {
/**
* Shipping method fee type.
*
* How to calculate delivery charges.
*
* @var string
*/
public $type;
/**
* Allowed post/zip codes for the shipping method.
*
* @var string
*/
public $codes;
/**
* Constructor.
*/
@@ -66,7 +82,6 @@ class WC_Shipping_Legacy_Local_Delivery extends WC_Shipping_Local_Pickup {
$this->title = $this->get_option( 'title' );
$this->type = $this->get_option( 'type' );
$this->fee = $this->get_option( 'fee' );
$this->type = $this->get_option( 'type' );
$this->codes = $this->get_option( 'codes' );
$this->availability = $this->get_option( 'availability' );
$this->countries = $this->get_option( 'countries' );

View File

@@ -20,6 +20,13 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class WC_Shipping_Legacy_Local_Pickup extends WC_Shipping_Method {
/**
* Allowed post/zip codes for the shipping method.
*
* @var string
*/
public $codes;
/**
* Constructor.
*/

View File

@@ -20,6 +20,14 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class WC_Shipping_Local_Pickup extends WC_Shipping_Method {
/**
* Shipping method cost.
*
* @var string
*/
public $cost;
/**
* Constructor.
*