Add setter for description and delivery_time

This commit is contained in:
Thomas Roberts 2024-07-17 16:02:09 +01:00
parent e648edf38f
commit 081b1f9a33
No known key found for this signature in database
GPG Key ID: 0262BEBCBE336365
1 changed files with 20 additions and 0 deletions

View File

@ -166,6 +166,26 @@ class WC_Shipping_Rate {
$this->data['taxes'] = ! empty( $taxes ) && is_array( $taxes ) ? $taxes : array(); $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. * Get ID for the rate. This is usually a combination of the method and instance IDs.
* *