Store Charge (Packing/Extra) , so the Total Store Charge (Packing/Extra) in the cart = number of items in the cart * store charge.
For now , we can only have option to change the Store charge (Packing/Extra) to be dynamic : by changing calculation of Store charge (Packing/Extra) in the OrderController.php
In the OrderController.php file , i added this code.
$resCharge = 0;
foreach ($request['order'] as $oI) {
$originalItem = Item::where('id', $oI['id'])->first();
$resCharge += ($restaurant->restaurant_charges * $oI['quantity']);
if (isset($oI['selectedaddons'])) {
foreach ($oI['selectedaddons'] as $selectedaddon) {
$addon = Addon::where('id', $selectedaddon['addon_id'])->first();
if ($addon) {
$resCharge += $restaurant->restaurant_charges * $oI['quantity'];
}
}
}
}
$newOrder->restaurant_charge = $resCharge;
What do u think @Bobelism @[deleted] @VoyagerMarketing @Kara ?