fix: add numeric check before converting items to integers

Prevents "Object could not be converted to int" notice when items array contains objects.
This commit is contained in:
Narek Zakarian 2025-08-14 12:43:04 +04:00
parent afd39b28df
commit 3f3c43ed2e
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -393,7 +393,7 @@ class OrderTrackingEndpoint {
'carrier_name_other' => $data['carrier_name_other'] ?? '',
);
if ( ! empty( $data['items'] ) ) {
if ( ! empty( $data['items'] ) && is_numeric( reset( $data['items'] ) ) ) {
$tracking_info['items'] = array_map( 'intval', $data['items'] );
}