Fix undefined index notice on ppcp_create_order_request_body_data hook.

This commit is contained in:
Pedro Silva 2023-09-18 11:56:28 +01:00
parent 7df95e02b0
commit 4fd7619665
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -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 );
}
}