Skip to content

Commit

Permalink
Merge branch 'WP-59' into 'main'
Browse files Browse the repository at this point in the history
fix: add check applicable for international orders

See merge request ecommerce_modules/cms/wordpress/wordpress!26
  • Loading branch information
DEMAxx committed Sep 11, 2024
2 parents 7d3377e + 33c68ee commit fab6159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fieldsets/GeneralOrderFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GeneralOrderFields extends FieldsetContract
{
final public function isApplicable(): bool
{
return empty(WC()->cart) || WC()->cart->needs_shipping();
return true;
}

final protected function getFields(): array
Expand Down
4 changes: 4 additions & 0 deletions src/Helpers/CheckoutHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public static function getOrderShippingMethod(WC_Order $order): WC_Order_Item_Sh

public static function restoreCheckoutFields(array $fields): array
{
if(!empty(WC()->cart) && !WC()->cart->needs_shipping()){
return $fields;
}

$checkout = WC()->checkout();

$originalFields = $checkout->get_checkout_fields('billing');
Expand Down

0 comments on commit fab6159

Please sign in to comment.