add shipping to order, methods to calculate, little refactoring
This commit is contained in:
@@ -5,6 +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\Offers;
|
||||
use App\Repositories\Shop\Orders;
|
||||
@@ -63,15 +64,9 @@ class BasketController extends Controller
|
||||
return ShopCart::count();
|
||||
}
|
||||
|
||||
public function getBasketTotal($deliveryTypeId = false)
|
||||
public function getBasketTotal($deliveryId = false, $deliveryTypeId = false)
|
||||
{
|
||||
$data = [
|
||||
'basket' => ShopCart::getSummary(),
|
||||
];
|
||||
|
||||
$weight = Baskets::getWeight();
|
||||
|
||||
$data['basket']['shipping'] = DeliveryTypes::getPrice($deliveryTypeId, $weight);
|
||||
$data['basket'] = Baskets::getBasketTotal($deliveryId, $deliveryTypeId);
|
||||
|
||||
return view('Shop.Baskets.partials.basketTotal', $data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user