sku; $product = $sku->product; if($product->price_setting == 'num'){ $price = $product->getNumPricesByNum($this->product_quantity_sum); }else{ $price = $sku->price; }; $skuCode = $sku->sku; $description = $product->description; $productName = $description->name; $subTotal = $price * $this->quantity; $image = $sku->image ?: $product->image; $result = [ 'cart_id' => $this->id, 'product_id' => $this->product_id, 'sku_id' => $this->product_sku_id, 'product_sku' => $skuCode, 'name' => $productName, 'name_format' => sub_string($productName), 'image' => $image, 'image_url' => image_resize($image), 'quantity' => $this->quantity, 'selected' => $this->selected, 'price' => $price, 'price_format' => currency_format($price), 'tax_class_id' => $product->tax_class_id, 'subtotal' => $subTotal, 'subtotal_format' => currency_format($subTotal), 'variant_labels' => trim($sku->getVariantLabel()), ]; return hook_filter('resource.cart.detail', $result); } }