Skip to content

Commit

Permalink
Added filters to allow adjusting a shipments shipping zone.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Apr 2, 2024
1 parent bd8b4d4 commit 0b79c74
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,17 @@ public function get_shipping_zone() {
}

public function is_shipping_domestic() {
return Package::is_shipping_domestic(
$this->get_country(),
array(
'sender_country' => $this->get_sender_country(),
'sender_postcode' => $this->get_sender_postcode(),
'postcode' => $this->get_postcode(),
)
return apply_filters(
"{$this->get_general_hook_prefix()}is_shipping_domestic",
Package::is_shipping_domestic(
$this->get_country(),
array(
'sender_country' => $this->get_sender_country(),
'sender_postcode' => $this->get_sender_postcode(),
'postcode' => $this->get_postcode(),
)
),
$this
);
}

Expand All @@ -285,13 +289,17 @@ public function is_shipping_domestic() {
* @return bool
*/
public function is_shipping_inner_eu() {
if ( Package::is_shipping_inner_eu_country(
$this->get_country(),
array(
'sender_country' => $this->get_sender_country(),
'sender_postcode' => $this->get_sender_postcode(),
'postcode' => $this->get_postcode(),
)
if ( apply_filters(
"{$this->get_general_hook_prefix()}is_shipping_inner_eu",
Package::is_shipping_inner_eu_country(
$this->get_country(),
array(
'sender_country' => $this->get_sender_country(),
'sender_postcode' => $this->get_sender_postcode(),
'postcode' => $this->get_postcode(),
)
),
$this
) ) {
return true;
}
Expand Down

0 comments on commit 0b79c74

Please sign in to comment.