Skip to content

Commit

Permalink
Fix Truemoney on short code checkout not show up
Browse files Browse the repository at this point in the history
  • Loading branch information
Narum11 committed Jan 15, 2025
1 parent 7ef0118 commit eab1ddd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-omise-capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public static function isFromCheckoutPage()
return false;
}

if (wp_doing_ajax() && $_GET['wc-ajax'] == 'update_order_review') {
return true;
}

$endpoints = ['checkout', 'batch', 'cart', 'cart/select-shipping-rate'];

foreach($endpoints as $endpoint) {
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/includes/class-omise-capabilities-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public function test_ajax_call_to_store_api_calls_omise_capability_api($request,
}
Brain\Monkey\Functions\expect('home_url')
->andReturn('/');
Brain\Monkey\Functions\expect('wp_doing_ajax')
->andReturn(false);

$_SERVER['REQUEST_URI'] = '/';
if ($server_request_uri) {
Expand Down

0 comments on commit eab1ddd

Please sign in to comment.