additional forms

This commit is contained in:
franknstayn
2020-02-07 01:10:31 +08:00
parent 55f135f66c
commit a5dab36a14
4 changed files with 111 additions and 2 deletions

View File

@@ -464,6 +464,38 @@ class TeamStoreController extends Controller {
'Quantity' => 1 'Quantity' => 1
); );
} }
}elseif($product_form == "jersey-and-shorts-quantity-form"){
$order_shorts_size = $post['order_shorts_size'];
$order_jersey_size = $post['order_jersey_size'];
$quantity = $post['quantity'];
foreach($order_jersey_size as $key => $val){
if($order_jersey_size[$key] != "none" || $order_shorts_size[$key] != "none"){
if($order_jersey_size[$key] == "none" || $order_shorts_size[$key] == "none"){
$final_price = $ProductPrice / 2;
}else{
$final_price = $ProductPrice;
}
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => $quantity[$key]
);
}
}
} }
$i = $m->insertToCart($items); $i = $m->insertToCart($items);
@@ -488,6 +520,7 @@ class TeamStoreController extends Controller {
$items = $m->myCart($cartKey); $items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey); $getSubtotal = $m->getSubtotal($cartKey);
$items_group = $m->myCartGroup($cartKey); $items_group = $m->myCartGroup($cartKey);
var_dump($items_group);
$grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey); $grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey);
if($grouped_item){ if($grouped_item){
$defId = $grouped_item[0]->StoreId; $defId = $grouped_item[0]->StoreId;

View File

@@ -474,7 +474,13 @@
<th>Size</th> <th>Size</th>
<th>Price</th> <th>Price</th>
<th>Quantity</th> <th>Quantity</th>
<th></th> </tr>
@elseif($item->FormUsed=="jersey-and-shorts-quantity-form")
<tr>
<th>Jersey Size</th>
<th>Shorts Size</th>
<th>Price</th>
<th>Quantity</th>
</tr> </tr>
@else @else
@@ -545,6 +551,13 @@
<td>{{ $sub_item->Price }}</td> <td>{{ $sub_item->Price }}</td>
<td>{{ $sub_item->Quantity }}</td> <td>{{ $sub_item->Quantity }}</td>
</tr> </tr>
@elseif($item->FormUsed=="jersey-and-shorts-quantity-form")
<tr>
<td>{{ $sub_item->JerseySize }}</td>
<td>{{ $sub_item->ShortsSize }}</td>
<td>{{ $sub_item->Price }}</td>
<td>{{ $sub_item->Quantity }}</td>
</tr>
@else @else
@endif @endif

View File

@@ -180,11 +180,18 @@
<th>Quantity</th> <th>Quantity</th>
<th></th> <th></th>
</tr> </tr>
@elseif($item->FormUsed=="jersey-and-shorts-quantity-form")
<tr>
<th>Jersey Size</th>
<th>Shorts Size</th>
<th>Price</th>
<th>Quantity</th>
<th></th>
</tr>
@else @else
@endif @endif
@foreach($row as $sub_item) @foreach($row as $sub_item)
@if($sub_item->ProductId == $item->ProductId) @if($sub_item->ProductId == $item->ProductId)
@@ -252,6 +259,15 @@
<td>{{ $sub_item->Quantity }}</td> <td>{{ $sub_item->Quantity }}</td>
<td><a class="btn btn-xs btn-link pull-right" href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><span class="glyphicon glyphicon-remove"></span></a></td> <td><a class="btn btn-xs btn-link pull-right" href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
@elseif($item->FormUsed=="jersey-and-shorts-quantity-form")
<tr>
<td>{{ $sub_item->JerseySize}}</td>
<td>{{ $sub_item->ShortsSize}}</td>
<td>{{ $sub_item->Price . ' ' . $store_array[0]->StoreCurrency }}</td>
<td>{{ $sub_item->Quantity }}</td>
<td><a class="btn btn-xs btn-link pull-right" href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
@else @else
@endif @endif

View File

@@ -0,0 +1,47 @@
<div class="panel-design-details" id="orderListPanel">
<table class="table" id="tableRow" style="font-size:12px;">
<thead>
<tr>
<th class="col-md-4">Jersey Size</th>
<th class="col-md-4">Shorts Size</th>
<th class="col-md-4">Quantity</th>
<th class="text-center"></th>
</tr>
</thead>
<tbody id="orderTableBody">
<tr class="table-tr-0">
<td>
<select class="form-control input-sm order-size roster-input" name="order_jersey_size[]" data-row-number="1">
<option value="none">none</option>
@foreach($sizes_array as $size)
<option value="{{ $size->Size }}">{{ $size->Size }}</option>
@endforeach
</select>
</td>
<td>
<select class="form-control input-sm order-size roster-input" name="order_shorts_size[]" data-row-number="1">
<option value="none">none</option>
@foreach($sizes_array as $size)
<option value="{{ $size->Size }}">{{ $size->Size }}</option>
@endforeach
</select>
</td>
<td>
<select class="form-control input-sm roster-input" name="quantity[]">
@for($i = 1; $i <= 50; $i++)
<option value="{{ $i }}">{{ $i }}</option>
@endfor
</select>
</td>
<td id="action-column" class="text-center" style="padding: 4px !important; border-top: none">
<span class="tr-remove-btn">
<button type="button" id="addNewRow" class="btn btn-success btn-sm btn-roster-action" data-toggle="tooltip" title="Add Another"><i class="fa fa-plus" aria-hidden="true"></i></button>
</span>
</td>
</tr>
</tbody>
</table>
<div id="addnew-btn-tbl-row">
</div>
</div>