Skip to content

Commit

Permalink
Allow users to manually select non-fitting shipments while editing sh…
Browse files Browse the repository at this point in the history
…ipments.
  • Loading branch information
dennisnissle committed Feb 5, 2024
1 parent 4534d86 commit 22b0a0e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,13 @@ public function get_available_packaging() {
* @return Packaging[]
*/
public function get_selectable_packaging() {
return apply_filters( "{$this->get_hook_prefix()}selectable_packaging", $this->get_available_packaging(), $this );
$all = wc_gzd_get_packaging_list( array( 'shipping_provider' => $this->get_shipping_provider() ) );
$available = $this->get_available_packaging();

$diff = array_diff( $all, $available );
$selectable = array_merge( $available, $diff );

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

public function get_default_packaging() {
Expand Down

0 comments on commit 22b0a0e

Please sign in to comment.