@extends('layouts.app') @section('contents') {{-- @dd($product->productColors->first()->productSizes->get('id')) --}}
MarketSpace

Some quick example text to build on the card title and make up the bulk of the card's content.

{{-- --}}
@csrf {{--

Order No : #5355619

Completed
--}}

{{ $product->style }} {{ $product->mill_name . ' - ' . $product->short_description }}

{{--

Vendors

--}}
    @foreach($productColors as $key => $colors) @php $colorValue = [ 'alpha' => '--', 'sanmar' => '--', 'ssactive' => '--' ]; foreach($colors as $colorKey => $color){ if($colorKey=='alpha'){ $colorValue['alpha'] = $color->color_code; } if($colorKey=='ssactive'){ $colorValue['ssactive'] = $color->color_code; } if($colorKey=='sanmar'){ $colorValue['sanmar'] = $color->id; } } $color_codes = implode("_",$colorValue); @endphp
  • first ? 'checked' : ''}} id="color-code-{{ $color_codes }}" value="{{ $color_codes }}">
  • @endforeach
@php // $selected_color = $productColors[key($colors)]; $product_sizes = $productSizes; @endphp
@foreach($product_sizes as $product_size) @endforeach
A
Size
{{ $product_size }}
@php $titles = []; $processed_inventory = []; $all_inventory = $sanmarProducts->transform(function($item){ return Arr::except($item, ['id','style','inventory_key','piece_weight','dozen_price','case_price','case_size','size_index','MSRP','created_at','updated_at','size','unique_key','gtin','color_id']); }); $inventories = array_map('array_filter', $all_inventory->toArray()); foreach($inventories as $inventory){ $titles=array_merge($titles,array_keys($inventory)); } $titles=array_unique($titles,SORT_REGULAR); $price_index = array_search ('piece_price', $titles); $price = array_splice($titles, $price_index, 1); array_splice($titles, 0, 0, $price); foreach($inventories as $key=> $inventory){ foreach($titles as $table_title){ $processed_inventory[$key][$table_title] = isset($inventory[$table_title]) ? $inventory[$table_title]:'0'; } } @endphp
@foreach($titles as $table_title) @endforeach @foreach($processed_inventory as $inventory) @php $total = 0; @endphp @foreach($inventory as $key => $warehouse) @php if($key!='piece_price'){ $total = $total + $warehouse; } @endphp @endforeach @endforeach
SanMar
{{ $table_title=='piece_price' ? 'Price' : $table_title }}TOTAL
{{ $key=="piece_price" ? number_format($warehouse,2) : $warehouse }}{{$total}}
@php $titles = []; $processed_inventory = []; $all_inventory = $alphaProducts->transform(function($item){ return Arr::except($item, ['id','vendor_id','item_no','style','size_code','size','gtin','sort_order','dozen_price','case_price','retail_price','case_qty','created_at','updated_at','color_code']); }); $inventories = array_map('array_filter', $all_inventory->toArray()); foreach($inventories as $inventory){ $titles=array_merge($titles,array_keys($inventory)); } $titles=array_unique($titles,SORT_REGULAR); $price_index = array_search ('piece_price', $titles); $price = array_splice($titles, $price_index, 1); array_splice($titles, 0, 0, $price); foreach($inventories as $key=> $inventory){ foreach($titles as $table_title){ $processed_inventory[$key][$table_title] = isset($inventory[$table_title]) ? $inventory[$table_title]:'0'; } } @endphp
@foreach($titles as $table_title) @endforeach @foreach($processed_inventory as $inventory) @php $total = 0; @endphp @foreach($inventory as $key => $warehouse) @php if($key!='piece_price'){ $total = $total + $warehouse; } @endphp @endforeach @endforeach
Alpha Broder
{{ $table_title=='piece_price' ? 'Price' : $table_title }}TOTAL
{{ $key=="piece_price" ? number_format($warehouse,2) : $warehouse }}{{$total}}
@php $titles = []; $processed_inventory = []; $all_inventory = $ssactiveProducts->transform(function($item){ return Arr::except($item, ['id','vendor_id','item_no','style','size_code','size','gtin','sort_order','dozen_price','case_price','retail_price','case_qty','created_at','updated_at','color_code']); }); $inventories = array_map('array_filter', $all_inventory->toArray()); foreach($inventories as $inventory){ $titles=array_merge($titles,array_keys($inventory)); } $titles=array_unique($titles,SORT_REGULAR); $price_index = array_search ('piece_price', $titles); $price = array_splice($titles, $price_index, 1); array_splice($titles, 0, 0, $price); foreach($inventories as $key=> $inventory){ foreach($titles as $table_title ){ $processed_inventory[$key][$table_title ] = isset($inventory[$table_title ]) ? $inventory[$table_title ]:'0'; } } @endphp
@foreach($titles as $table_title ) @endforeach @foreach($processed_inventory as $inventory) @php $total = 0; @endphp @foreach($inventory as $key => $warehouse) @php if($key!='piece_price'){ $total = $total + $warehouse; } @endphp @endforeach @endforeach
S & S Active
{{ $table_title =='piece_price' ? 'Price' : $table_title }}TOTAL
{{ $key=="piece_price" ? number_format($warehouse,2) : $warehouse }}{{$total}}
@endsection @push('script') @endpush