From 4fd76196652256dc55032fa90bb956303514db49 Mon Sep 17 00:00:00 2001
From: Pedro Silva
Date: Mon, 18 Sep 2023 11:56:28 +0100
Subject: [PATCH] Fix undefined index notice on
ppcp_create_order_request_body_data hook.
---
modules/ppcp-api-client/src/ApiModule.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/ppcp-api-client/src/ApiModule.php b/modules/ppcp-api-client/src/ApiModule.php
index 62e18373f..f12e69668 100644
--- a/modules/ppcp-api-client/src/ApiModule.php
+++ b/modules/ppcp-api-client/src/ApiModule.php
@@ -50,7 +50,7 @@ class ApiModule implements ModuleInterface {
foreach ( $data['purchase_units'] as $purchase_unit_index => $purchase_unit ) {
foreach ( $purchase_unit['items'] as $item_index => $item ) {
$data['purchase_units'][ $purchase_unit_index ]['items'][ $item_index ]['name'] =
- apply_filters( 'woocommerce_paypal_payments_cart_line_item_name', $item['name'], $item['cart_item_key'] );
+ apply_filters( 'woocommerce_paypal_payments_cart_line_item_name', $item['name'], $item['cart_item_key'] ?? null );
}
}