better management of shipping and basket summary display
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Shop\PriceListsDataTable;
|
||||
use App\Datatables\Admin\Shop\PriceListsDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\PriceLists;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
@@ -14,45 +14,20 @@ class PriceListController extends Controller
|
||||
{
|
||||
public function index(PriceListsDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.PriceLists.list', $data);
|
||||
return $dataTable->render('Admin.Shop.PriceLists.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
public function modalCreate($tariffId)
|
||||
{
|
||||
$data = [];
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['price_list'] = PriceLists::get($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.edit', $data);
|
||||
}
|
||||
|
||||
public function modalCreate($tariff_id)
|
||||
{
|
||||
$data = [];
|
||||
$data['price_list']['tariff_id'] = $tariff_id;
|
||||
$data['price_list']['price_list_values'] = array_fill(0, 3, '');
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['taxes'] = Taxes::getOptions();
|
||||
$data = PriceLists::init($tariffId);
|
||||
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
public function modalEdit($id)
|
||||
{
|
||||
$data = PriceLists::init();
|
||||
$data['price_list'] = PriceLists::edit($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['taxes'] = Taxes::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
@@ -25,32 +25,22 @@ class TariffController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||
|
||||
$model = new PriceListsDataTable();
|
||||
$data['datatables']['price_lists'] = $model->html();
|
||||
$data = Tariffs::init();
|
||||
|
||||
return view('Admin.Shop.Tariffs.create', $data);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['tariff'] = Tariffs::getFull($id);
|
||||
$data['tariff'] = Tariffs::getArray($id);
|
||||
|
||||
return view('Admin.Shop.Tariffs.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Tariffs::init();
|
||||
$data['tariff'] = Tariffs::get($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||
|
||||
$model = new PriceListsDataTable();
|
||||
$data['datatables']['price_lists'] = $model->html();
|
||||
|
||||
return view('Admin.Shop.Tariffs.edit', $data);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ namespace App\Http\Controllers\Shop;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Core\User\ShopCart;
|
||||
use App\Repositories\Shop\Baskets;
|
||||
use App\Repositories\Shop\Deliveries;
|
||||
use App\Repositories\Shop\DeliveryTypes;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Repositories\Shop\Orders;
|
||||
use App\Repositories\Users;
|
||||
@@ -67,7 +66,7 @@ class BasketController extends Controller
|
||||
public function getBasketTotal($deliveryId = false, $deliveryTypeId = false)
|
||||
{
|
||||
$data['basket'] = Baskets::getBasketTotal($deliveryId, $deliveryTypeId);
|
||||
|
||||
|
||||
return view('Shop.Baskets.partials.basketTotal', $data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user