@php $information = \App\Models\Information::first(); // ✅✅ DYNAMIC COLORS & TEXTS SETUP $brandGradient = $ln_pg->theme_gradient_col ?? (optional($information)->gradient_code ?? 'linear-gradient(90deg,#0d6efd,#00276C)'); $brandSolid = $ln_pg->theme_primary_col ?? (optional($information)->primary_color ?? '#00276C'); $btnBgColor = $ln_pg->btn_bg_color ?? $brandSolid; $btnTextColor = $ln_pg->btn_text_color ?? '#ffffff'; $txtHero = $ln_pg->btn_text_hero ?: 'অর্ডার করতে ক্লিক করুন'; $txtVideo = $ln_pg->btn_text_video ?: 'অর্ডার করতে চাই'; $txtFeature = $ln_pg->btn_text_feature ?: 'অর্ডার করুন'; $txtForm = $ln_pg->btn_text_form ?: 'অর্ডার কনফার্ম করুন'; $pageTitle = $title ?? ($ln_pg->title1 ?? 'Landing Page'); $product = $ln_pg->product ?? null; $variations = collect(); if($product){ try{ $product->loadMissing(['variations.size','variations.color', 'variations.stocks', 'category']); $variations = $product->variations ?? collect(); }catch(\Throwable $e){ $variations = $product->variations ?? collect(); } } $defaultVar = $variations->first(); $defaultVarId = $defaultVar->id ?? null; $defaultBase = $defaultVar->price ?? null; $defaultDisc = $defaultVar->after_discount_price ?? null; $defaultPrice = null; if($defaultDisc !== null && $defaultDisc !== '' && (float)$defaultDisc > 0){ $defaultPrice = $defaultDisc; }elseif($defaultBase !== null && $defaultBase !== '' && (float)$defaultBase > 0){ $defaultPrice = $defaultBase; }else{ $defaultPrice = ($product && (float)($product->after_discount ?? 0) > 0) ? $product->after_discount : ($product->sell_price ?? 0); } $defaultStock = 0; if($defaultVar) { $defaultStock = $defaultVar->stocks->sum('quantity'); } elseif($product) { $defaultStock = $product->stock_quantity ?? 0; } $pixelId = setting('fb_pixel_id') ?? null; $contentCategory = $product?->category?->name ?? 'Landing Page'; $productId = $product->id ?? 0; $productName = $product->name ?? ''; $globalSetting = DB::table('delivery_charges')->first(); $isWeightBased = $globalSetting && $globalSetting->charge_type == 'weight_based'; @endphp