ordering store item add
Adding new feature in store owner page. *ordering item
This commit is contained in:
@@ -108,12 +108,9 @@ class PaypalController extends Controller {
|
||||
$order_items = array();
|
||||
$updated_items = $m->myCart($cartKey);
|
||||
$updated_getSubtotal = $m->getSubtotal($cartKey);
|
||||
var_dump($updated_items);
|
||||
|
||||
// $order_subtotal = $updated_getSubtotal[0]->Subtotal;
|
||||
$order_grandtotal = $updated_getSubtotal[0]->Subtotal;
|
||||
var_dump($order_grandtotal);
|
||||
// $tax_value = 0.10;
|
||||
|
||||
if($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78){
|
||||
$tax_value = 0;
|
||||
@@ -122,8 +119,6 @@ class PaypalController extends Controller {
|
||||
}
|
||||
|
||||
$tax = $order_grandtotal * $tax_value;
|
||||
|
||||
var_dump($tax);
|
||||
|
||||
foreach($updated_items as $key => $item){
|
||||
|
||||
@@ -141,13 +136,9 @@ class PaypalController extends Controller {
|
||||
|
||||
$item_list = PayPal::ItemList();
|
||||
$item_list->setItems($order_items);
|
||||
var_dump($order_grandtotal);
|
||||
$amount_details = PayPal::Details();
|
||||
$amount_details->setSubtotal($order_grandtotal);
|
||||
$amount_details->setTax($tax);
|
||||
|
||||
|
||||
var_dump($item_list->items);
|
||||
|
||||
$amount = PayPal::Amount();
|
||||
$amount->setCurrency($store_array[0]->StoreCurrency);
|
||||
|
||||
@@ -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