Add getters for description and delivery time
This commit is contained in:
parent
c83c0ecbfd
commit
e706f65e76
|
@ -256,6 +256,42 @@ class WC_Shipping_Rate {
|
|||
return apply_filters( 'woocommerce_get_shipping_tax', count( $this->taxes ) > 0 && ! WC()->customer->get_is_vat_exempt() ? (float) array_sum( $this->taxes ) : 0.0, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rate description.
|
||||
*
|
||||
* @since 9.2.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
/**
|
||||
* Filter the shipping rate description.
|
||||
*
|
||||
* @since 9.2.0
|
||||
*
|
||||
* @param string $description The current description.
|
||||
* @param WC_Shipping_Rate $this The shipping rate.
|
||||
*/
|
||||
return apply_filters( 'woocommerce_shipping_rate_description', $this->data['description'], $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rate delivery time.
|
||||
*
|
||||
* @since 9.2.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_delivery_time() {
|
||||
/**
|
||||
* Filter the shipping rate delivery time.
|
||||
*
|
||||
* @since 9.2.0
|
||||
*
|
||||
* @param string $delivery_time The current description.
|
||||
* @param WC_Shipping_Rate $this The shipping rate.
|
||||
*/
|
||||
return apply_filters( 'woocommerce_shipping_rate_delivery_time', $this->data['delivery_time'], $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add some meta data for this rate.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue