Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bdsumon4u committed Sep 6, 2024
1 parent d53a41e commit 9442f60
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Livewire/EditOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ public function updatedOrderDataShippingArea($value)
$shipping_cost = setting('delivery_charge')->{$this->order->data['shipping_area'] == 'Inside Dhaka' ? 'inside_dhaka' : 'outside_dhaka'} ?? config('services.shipping.' . $this->order->data['shipping_area'], 0);
} else {
$shipping_cost = collect($this->selectedProducts)->sum(function ($item) {
$default = setting('delivery_charge')->{$this->order->data['shipping_area'] == 'Inside Dhaka' ? 'inside_dhaka' : 'outside_dhaka'} ?? config('services.shipping.' . $this->order->data['shipping_area'], 0);
if ($this->order->data['shipping_area'] == 'Inside Dhaka') {
return $item['shipping_inside'] * (setting('show_option')->quantitywise_delivery_charge ? $item['quantity'] : 1);
return ($item['shipping_inside'] ?? $default) * (setting('show_option')->quantitywise_delivery_charge ? $item['quantity'] : 1);
} else {
return $item['shipping_outside'] * (setting('show_option')->quantitywise_delivery_charge ? $item['quantity'] : 1);
return ($item['shipping_outside'] ?? $default) * (setting('show_option')->quantitywise_delivery_charge ? $item['quantity'] : 1);
}
});
}
Expand Down

0 comments on commit 9442f60

Please sign in to comment.