add shipping to order, methods to calculate, little refactoring

This commit is contained in:
ludo
2023-11-15 23:20:42 +01:00
parent 216c408596
commit 174c4ca0e2
10 changed files with 117 additions and 45 deletions

View File

@@ -40,15 +40,18 @@ class OrderController extends Controller
{
if (ShopCart::count()) {
$customer = Customers::getWithAddresses();
$data = [
'customer' => $customer ? $customer->toArray() : false,
'basket' => ShopCart::getSummary(),
'basket' => Baskets::getBasketTotal(),
'deliveries' => Deliveries::getAllWithSaleChannel()->toArray(),
'sale_channel' => SaleChannels::getDefault()->toArray(),
'delivery_types' => DeliveryTypes::getAll(),
'delivery_types' => DeliveryTypes::getWithPrice(Baskets::getWeight()),
];
// dump($data);
// exit;
return view('Shop.Orders.order', $data);
} else {
return redirect()->route('home');