Searching products...
Closeup Toothpaste Menthol Fresh 38g
★★★★★ 4.8/5 Product Details

Closeup Toothpaste Menthol Fresh 38g

Secure Product Information
DP ৳49.00 MRP ৳50.00 Save ৳1.00
Option:Default
PV 0.1
Discount 2%
Availability In Stock
Delivery Bangladesh
65%
Seller Score
Product 4/5
★★★★☆
Level 4/5
★★★★☆
Service 4/5
★★★★☆
Delivery 3/5
★★★☆☆
Product Name Closeup Toothpaste Menthol Fresh 38g
MRP ৳ 50.00
DP ৳ 49.00
Discount ৳ 1.00
PV 0.1
Availability In Stock

Closeup Toothpaste Menthol Fresh 38g

Seller information is not available for this product.
Similar Products
Random products from the same category
Closeup Toothpaste Menthol Fresh 38g
My Cart 0 Items

Your Order

Increase or decrease quantity, remove items and submit your order.
public function cartDeliveryPreview(Request $request) { $districtId = (int) $request->district_id; /* |-------------------------------------------------------------------------- | IF DISTRICT NOT SELECTED -> USER SAVED DISTRICT |-------------------------------------------------------------------------- */ if( $districtId <= 0 && Auth::check() ){ $districtId = (int) Auth::user()->district_id; } /* |-------------------------------------------------------------------------- | CART ITEMS |-------------------------------------------------------------------------- */ $cartItems = $request->input( 'items', [] ); if( !is_array($cartItems) || count($cartItems) == 0 ){ return response()->json([ 'status' => true, 'delivery_total' => 0, 'vendors' => [] ]); } /* |-------------------------------------------------------------------------- | GROUP WEIGHT BY VENDOR STORE |-------------------------------------------------------------------------- */ $vendorGroups = []; foreach($cartItems as $cartItem){ $productId = (int) ( $cartItem['product_id'] ?? 0 ); $qty = max( 1, (int) ( $cartItem['qty'] ?? 1 ) ); if($productId <= 0){ continue; } /* |-------------------------------------------------------------------------- | PRODUCT |-------------------------------------------------------------------------- */ $product = DB::table('tbl_product') ->where( 'product_ID', $productId ) ->where( 'status', 1 ) ->first(); if(!$product){ continue; } /* |-------------------------------------------------------------------------- | WEIGHT |-------------------------------------------------------------------------- */ $unitWeight = (float) ( $product->weight ?? 0 ); if($unitWeight <= 0){ $unitWeight = 1; } $totalItemWeight = $unitWeight * $qty; /* |-------------------------------------------------------------------------- | VENDOR STORE |-------------------------------------------------------------------------- */ $storeId = (int) ( $product->vendor_stor_id ?? 0 ); /* |-------------------------------------------------------------------------- | DEFAULT / COMPANY PRODUCT |-------------------------------------------------------------------------- */ if($storeId <= 0){ $groupKey = 'default'; if( !isset( $vendorGroups[$groupKey] ) ){ $vendorGroups[$groupKey] = [ 'store_id' => 0, 'store_name' => 'Company Products', 'vendor_district_id' => null, 'weight' => 0 ]; } $vendorGroups[$groupKey]['weight'] += $totalItemWeight; continue; } /* |-------------------------------------------------------------------------- | GET STORE |-------------------------------------------------------------------------- */ $store = DB::table('vendor_stores') ->where( 'id', $storeId ) ->first(); $vendorDistrictId = $store ? (int) $store->district_id : null; $storeName = $store ? ( $store->store_name ?? 'Vendor Store' ) : 'Vendor Store'; $groupKey = 'store_' . $storeId; if( !isset( $vendorGroups[$groupKey] ) ){ $vendorGroups[$groupKey] = [ 'store_id' => $storeId, 'store_name' => $storeName, 'vendor_district_id' => $vendorDistrictId, 'weight' => 0 ]; } $vendorGroups[$groupKey]['weight'] += $totalItemWeight; } /* |-------------------------------------------------------------------------- | CALCULATE DELIVERY |-------------------------------------------------------------------------- */ $deliveryTotal = 0; $vendors = []; foreach( $vendorGroups as $group ){ $delivery = $this->calculateVendorDeliveryCharge( $group['weight'], $districtId, $group['vendor_district_id'] ); $deliveryTotal += $delivery['delivery_charge']; $vendors[] = [ 'store_id' => $group['store_id'], 'store_name' => $group['store_name'], 'weight' => $delivery['weight'], 'same_district' => $delivery['same_district'], 'first_kg_rate' => $delivery['first_kg_rate'], 'extra_kg' => $delivery['extra_kg'], 'extra_charge' => $delivery['extra_charge'], 'delivery_charge' => $delivery['delivery_charge'] ]; } return response()->json([ 'status' => true, 'district_id' => $districtId, 'delivery_total' => $deliveryTotal, 'vendors' => $vendors ]); }