ordering store item add
Adding new feature in store owner page. *ordering item
This commit is contained in:
@@ -823,7 +823,7 @@ class UserController extends Controller {
|
||||
$arrayItems = $post['item'];
|
||||
$order = 1;
|
||||
$UserModel = new UserModel;
|
||||
|
||||
|
||||
foreach ($arrayItems as $item) {
|
||||
$i = $UserModel->updateThumbnailOrdering($order, $item);
|
||||
$order++;
|
||||
@@ -835,6 +835,25 @@ class UserController extends Controller {
|
||||
));
|
||||
}
|
||||
|
||||
function saveItemOrdering(Request $request){
|
||||
$post = $request->all();
|
||||
$arrayItems = $post['order_number'];
|
||||
$order = 1;
|
||||
$UserModel = new UserModel;
|
||||
|
||||
foreach ($arrayItems as $item) {
|
||||
$i = $UserModel->updateItemOrdering($order, $item);
|
||||
$order++;
|
||||
}
|
||||
|
||||
return response()->json(array(
|
||||
'success' => true,
|
||||
'message' => 'success'
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
function storeSettingUpdate(Request $request){
|
||||
$post = $request->all();
|
||||
$UserModel = new UserModel;
|
||||
@@ -982,4 +1001,55 @@ class UserController extends Controller {
|
||||
'item' => $array_item
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
function itemStoreReArrange(){
|
||||
$thumbnails = array();
|
||||
$newUserModel = new UserModel;
|
||||
$newTeamStoreModel = new TeamStoreModel;
|
||||
|
||||
$user_role = Auth::user()->role;
|
||||
$store_id = Auth::user()->store_id;
|
||||
|
||||
$store_array = $newTeamStoreModel->selectTeamStore('Id', $store_id);
|
||||
$product_array = $newTeamStoreModel->selectTeamStoreProducts('TeamStoreId', $store_id);
|
||||
|
||||
foreach ($product_array as $p => $pr_arr) {
|
||||
|
||||
$thumbnails_array = $newTeamStoreModel->getProductThumbnails($pr_arr->Id);
|
||||
|
||||
if(!empty($thumbnails_array)){
|
||||
foreach ($thumbnails_array as $t => $thumb) {
|
||||
|
||||
if($thumb->ImageClass == 'custom'){
|
||||
$displayThumbnails = $thumb->Image;
|
||||
break;
|
||||
}
|
||||
|
||||
if($thumb->ImageClass == 'active'){
|
||||
$displayThumbnails = $thumb->Image;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$thumbnails[] = array(
|
||||
'folder' => $store_array[0]->ImageFolder,
|
||||
'product_id' => $pr_arr->Id,
|
||||
'thumb' => $displayThumbnails
|
||||
);
|
||||
|
||||
}else{
|
||||
$thumbnails[] = array(
|
||||
'folder' => $store_array[0]->ImageFolder,
|
||||
'product_id' => $pr_arr->Id,
|
||||
'thumb' => "product-image-placeholder.png"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return view('user-layouts.store_items_arrange')->with('store_array', $store_array)
|
||||
->with('product_array', $product_array)
|
||||
->with('thumbnails', $thumbnails);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user