product_code, 'offerId'); $offer_id_1688 = null; if ($item_from_1688) { $offerId = explode(',', $this->product_code)[0]; $offer_id_1688 = substr($offerId, strpos($offerId, ':') + 1); } return [ 'id' => $this->id, 'stockCode' => $this->product_code, 'description' => $this->product_name, 'quantity' => $this->quantity, 'unit_price' => (double) $this->price, 'total' => (double) $this->amount, 'item_from_1688' => $item_from_1688, 'offer_id_1688' => $offer_id_1688 ]; } }