Skip to content

Commit

Permalink
Allow filtering packaging title.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Dec 2, 2024
1 parent e3720cf commit 2092a4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Packaging.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,14 @@ public function set_dimension_unit( $unit ) {

public function get_title() {
$description = $this->get_description();

return sprintf(
$title = sprintf(
_x( '%1$s (%2$s, %3$s)', 'shipments-packaging-title', 'woocommerce-germanized-shipments' ),
$description,
$this->get_formatted_dimensions(),
wc_gzd_format_shipment_weight( wc_format_decimal( $this->get_weight(), false, true ), wc_gzd_get_packaging_weight_unit() )
);

return apply_filters( "{$this->get_hook_prefix()}title", $title, $this );
}

/**
Expand Down

0 comments on commit 2092a4c

Please sign in to comment.