|
{{-- Price --}}
@if(!empty($print['price']))
{{-- @lang('lang_v1.price') --}}
{{session('currency')['symbol'] ?? ''}}
{{@num_format((float) filter_var($page_product->product_price, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION))}}
@endif
{{-- Business Name --}}
@if(!empty($print['business_name']))
{{$business_name}}
@endif
@if(!empty($print['exp_date']) && !empty($page_product->exp_date))
@lang('product.exp_date'): {{$page_product->exp_date}} @if($barcode_details->is_continuous) @endif @endif @if(!empty($print['packing_date']) && !empty($page_product->packing_date)) @lang('lang_v1.packing_date'): {{$page_product->packing_date}} @endif {{-- Product Name --}} @if(!empty($print['name'])) {{-- @if(strlen($page_product->product_title) > 25) @php $words = explode(' ', $page_product->product_title); if(strlen($page_product->product_title) > 25) { $words_show = implode(' ', array_slice($words, 0, 3)); } else { $words_show = implode(' ', array_slice($words, 0, 4)); } @endphp {{ $words_show }} @else {{$page_product->product_title}} @endif --}} @php $max_chars = 25; // Adjust based on your box/font size // Clean up the title if needed $title = $page_product->product_title; if (strlen($title) <= $max_chars) { $words_show = $title; } else { $words = explode(' ', $title); $words_show = ''; $current_length = 0; foreach ($words as $word) { if (($current_length + strlen($word) + 1) > $max_chars) break; $words_show .= $word . ' '; $current_length += strlen($word) + 1; // +1 for space } $words_show = trim($words_show); } @endphp {{ $words_show }}@if(!empty($print['lot_number']) && !empty($page_product->lot_number)) ({{$page_product->lot_number}}) @endif @endif {{-- Barcode --}} |
@if($loop->iteration % $barcode_details->stickers_in_one_row == 0)