From 081b1f9a333fb4bcedbf864f140c03283d8ecfac Mon Sep 17 00:00:00 2001 From: Thomas Roberts Date: Wed, 17 Jul 2024 16:02:09 +0100 Subject: [PATCH] Add setter for description and delivery_time --- .../includes/class-wc-shipping-rate.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/woocommerce/includes/class-wc-shipping-rate.php b/plugins/woocommerce/includes/class-wc-shipping-rate.php index 7612fd32f77..484a56a1d1c 100644 --- a/plugins/woocommerce/includes/class-wc-shipping-rate.php +++ b/plugins/woocommerce/includes/class-wc-shipping-rate.php @@ -166,6 +166,26 @@ class WC_Shipping_Rate { $this->data['taxes'] = ! empty( $taxes ) && is_array( $taxes ) ? $taxes : array(); } + /** + * Set rate description. + * + * @since 9.2.0 + * @param string $description Shipping rate description. + */ + public function set_description( $description ) { + $this->data['description'] = (string) $description; + } + + /** + * Set rate delivery time. + * + * @since 9.2.0 + * @param string $delivery_time Shipping rate delivery time. + */ + public function set_delivery_time( $delivery_time ) { + $this->data['delivery_time'] = (string) $delivery_time; + } + /** * Get ID for the rate. This is usually a combination of the method and instance IDs. *