@php
$dimsUnit = !empty($product->dimensions_unit) ? $product->dimensions_unit : 'cm';
$packageType = !empty($product->package_type) ? $product->package_type : 'Box';
$dimsText = '';
if (!empty($product->length) || !empty($product->width) || !empty($product->height)) {
$lenText = is_numeric($product->length) ? number_format((float) $product->length, 2, '.', '') : ($product->length ?: '0.00');
$widText = is_numeric($product->width) ? number_format((float) $product->width, 2, '.', '') : ($product->width ?: '0.00');
$heiText = is_numeric($product->height) ? number_format((float) $product->height, 2, '.', '') : ($product->height ?: '0.00');
$dimsText = strtolower($packageType) . ' - ' . $lenText . ' × ' . $widText . ' × ' . $heiText . ' ' . $dimsUnit;
}
$shippingCost1 = (float) ($product->shipping_cost ?? 0);
$shippingCost2 = (float) ($product->shipping_cost_2 ?? 0);
$shippingCost3 = (float) ($product->shipping_cost_3 ?? 0);
$hasShippingCost1 = $product->shipping_cost_free;
$hasShippingCost2 = $product->shipping_cost_2_free;
$hasShippingCost3 = $product->shipping_cost_3_free;
@endphp