Skip to content

Commit

Permalink
Added additional customs data. Added hook which fires in case label r…
Browse files Browse the repository at this point in the history
…equest errored.
  • Loading branch information
dennisnissle committed Jun 12, 2024
1 parent b642bcd commit 62a9009
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Labels/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ public function get_customs_data( $max_desc_length = 255 ) {
'gross_weight_in_g' => $item_gross_weights[ $key ],
'single_value' => $product_value,
'value' => wc_format_decimal( $product_value * $item->get_quantity(), 2 ),
'sku' => $item->get_sku(),
),
$item,
$shipment,
Expand Down
2 changes: 2 additions & 0 deletions src/ShippingProvider/Auto.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,8 @@ public function create_label( $shipment, $props = false ) {
}
}

do_action( "{$this->get_general_hook_prefix()}error_while_creating_label", $label, $result, $this );

return $result;
}
}
Expand Down

0 comments on commit 62a9009

Please sign in to comment.