@php $information = \App\Models\Information::first(); $charges = \App\Models\DeliveryCharge::whereNotNull('status')->get(); $sslActive = $information->ssl_active ?? 0; $sslTermsActive = $information->ssl_terms_active ?? 0; $globalSetting = DB::table('delivery_charges')->first(); $isWeightBased = $globalSetting && $globalSetting->charge_type == 'weight_based'; $headerBg = $ln_pg->theme_primary_col ?? '#0a6624'; $primaryColor = $headerBg; $btnBg = $ln_pg->btn_bg_color ?? '#900b0b'; $contactBg = '#1877f2'; $bodyBg = '#f5f6f8'; $productId = $product->id ?? 0; $productName = $product->name ?? 'Product'; $phoneNumber = $ln_pg->phone ?? '01XXX-XXXXXX'; $waNumberClean = preg_replace('/\D+/', '', $phoneNumber); $defaultPrice = ($product && $product->after_discount > 0) ? $product->after_discount : ($product->sell_price ?? 0); if(!empty($ln_pg->new_price)) { $defaultPrice = $ln_pg->new_price; } $variations = collect(); if($product){ try{ $product->loadMissing(['variations.size','variations.color', 'variations.stocks']); $variations = $product->variations ?? collect(); }catch(\Throwable $e){ $variations = $product->variations ?? collect(); } } $pixelId = setting('fb_pixel_id') ?? null; @endphp @if(!empty($pixelId)) @endif