Skip to content

Commit 79b630b

Browse files
Merge pull request #9540 from magento-gl/spartans_pr_30012025
Spartans pr 30012025
2 parents fee5d2e + a1cbfba commit 79b630b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

app/code/Magento/Paypal/view/frontend/web/js/view/paylater.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ define([
4747
* @returns {*}
4848
*/
4949
initialize: function () {
50-
let buyerCountry = customerData.get('paypal-buyer-country');
50+
let customer = customerData.get('customer'),
51+
buyerCountry = customerData.get('paypal-buyer-country');
5152

5253
this.buyerCountry = buyerCountry().code;
54+
55+
if (customer().firstname && !this.buyerCountry) {
56+
customerData.reload(['paypal-buyer-country'], false);
57+
this.buyerCountry = customerData.get('paypal-buyer-country')().code;
58+
}
59+
5360
this._super()
5461
.observe(['amount']);
5562

app/code/Magento/Sales/Model/ResourceModel/SalesOrderStatusChangeHistory.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Sales\Model\Order;
12-
use Magento\Sales\Model\OrderRepository;
1312

1413
/**
1514
* Sales order status change history resource model.
@@ -28,11 +27,9 @@ class SalesOrderStatusChangeHistory
2827

2928
/**
3029
* @param ResourceConnection $resourceConnection
31-
* @param OrderRepository $orderRepository
3230
*/
3331
public function __construct(
3432
private readonly ResourceConnection $resourceConnection,
35-
private readonly OrderRepository $orderRepository,
3633
) {
3734
}
3835

@@ -47,7 +44,7 @@ public function getLatestStatus(int $orderId): ?array
4744
$connection = $this->resourceConnection->getConnection();
4845
return $connection->fetchRow(
4946
$connection->select()->from(
50-
$connection->getTableName(self::TABLE_NAME),
47+
$this->resourceConnection->getTableName(self::TABLE_NAME),
5148
['status', 'created_at']
5249
)->where(
5350
'order_id = ?',
@@ -70,7 +67,7 @@ public function insert(Order $order): void
7067

7168
$connection = $this->resourceConnection->getConnection();
7269
$connection->insert(
73-
$connection->getTableName(self::TABLE_NAME),
70+
$this->resourceConnection->getTableName(self::TABLE_NAME),
7471
[
7572
'order_id' => (int)$order->getId(),
7673
'status' => $order->getStatus()
@@ -89,7 +86,7 @@ private function isOrderExists(int $orderId): bool
8986
$connection = $this->resourceConnection->getConnection();
9087
$entityId = $connection->fetchOne(
9188
$connection->select()->from(
92-
$connection->getTableName(self::ORDER_TABLE_NAME),
89+
$this->resourceConnection->getTableName(self::ORDER_TABLE_NAME),
9390
['entity_id']
9491
)->where(
9592
'entity_id = ?',

0 commit comments

Comments
 (0)