productId = $item->getProductId(); $this->title = $item->getProduct()->getName(); $this->sku = $item->getSku(); $this->qty = $item->getQtyOrdered(); $this->price = $item->getPrice(); $this->amount = $item->getQtyOrdered() * $item->getPrice(); if ($condition = $item->getProductOptionByCode()) { $this->condition = $condition['attributes_info'][0]['value'] ?? null; } } public function jsonSerialize(): mixed { return (array) get_object_vars($this); } }