{{ data_get( $review, 'text' ) }}
@php /* |-------------------------------------------------------------------------- | Theme |-------------------------------------------------------------------------- */ $theme = array_merge( [ 'primary' => '#112d5c', 'primary_dark' => '#081c3d', 'accent' => '#d9b66b', 'accent_dark' => '#b28a3e', 'accent_light' => '#f0d89e', 'secondary' => '#668c21', 'secondary_dark' => '#4e7017', 'background' => '#fffdf8', 'surface' => '#ffffff', 'text' => '#282828', 'muted' => '#6c6c6c', ], (array) ($landingPage->theme ?? []) ); /* |-------------------------------------------------------------------------- | SEO |-------------------------------------------------------------------------- */ $seo = (array) ($landingPage->seo ?? []); $metaTitle = data_get($seo, 'meta_title') ?: $landingPage->title; $metaDescription = data_get($seo, 'meta_description') ?: \Illuminate\Support\Str::limit( strip_tags( (string) ( $product->short_description ?: $product->name ) ), 160 ); /* |-------------------------------------------------------------------------- | Images |-------------------------------------------------------------------------- */ $resolveImage = function ($image) { if (! $image) { return null; } $url = data_get($image, 'url') ?: data_get($image, 'image_url'); if (filled($url)) { return $url; } $path = data_get( $image, 'image_path' ); if (blank($path)) { return null; } return \App\Models\Product::resolveMediaUrl( $path ); }; $productImages = $product ->images ->map($resolveImage) ->filter() ->values(); $mainImage = $product->image_url ?: $productImages->get(0) ?: asset( 'images/product-placeholder.png' ); $image2 = $productImages->get( 1, $mainImage ); $image3 = $productImages->get( 2, $image2 ); $promoImage = $productImages->get( 3, $image3 ); /* |-------------------------------------------------------------------------- | Variants |-------------------------------------------------------------------------- */ $variants = $product->activeVariants; $defaultVariant = $variants->firstWhere( 'is_default', true ) ?: $variants->first(); if ( $product->has_variants && $defaultVariant ) { $basePrice = (float) ( $defaultVariant->sale_price ?? $defaultVariant->regular_price ?? 0 ); $regularPrice = (float) ( $defaultVariant->regular_price ?? $basePrice ); } else { $basePrice = (float) $product->final_price; $regularPrice = (float) $product->regular_price; } /* |-------------------------------------------------------------------------- | Maximum Quantity |-------------------------------------------------------------------------- */ $maxQuantity = 100; if (! $product->pre_order_enabled) { if ( $product->has_variants && $defaultVariant && $defaultVariant->track_stock ) { $maxQuantity = max( 1, min( 100, (int) $defaultVariant->stock_quantity ) ); } elseif ( ! $product->has_variants && $product->track_stock ) { $maxQuantity = max( 1, min( 100, (int) $product->stock_quantity ) ); } } /* |-------------------------------------------------------------------------- | Sections |-------------------------------------------------------------------------- */ $enabledSections = $sections ->filter( fn ($section) => $section->is_enabled ) ->sortBy('sort_order') ->values(); $heroSection = $sections->firstWhere( 'type', 'hero' ); $benefitsSection = $sections->firstWhere( 'type', 'benefits' ); $promoSection = $sections->firstWhere( 'type', 'promo' ); $usageSection = $sections->firstWhere( 'type', 'usage' ); $reviewsSection = $sections->firstWhere( 'type', 'reviews' ); $orderSection = $sections->firstWhere( 'type', 'order' ); $footerSection = $sections->firstWhere( 'type', 'footer' ); $heroContent = (array) optional( $heroSection )->content; $benefitsContent = (array) optional( $benefitsSection )->content; $promoContent = (array) optional( $promoSection )->content; $usageContent = (array) optional( $usageSection )->content; $reviewsContent = (array) optional( $reviewsSection )->content; $orderContent = (array) optional( $orderSection )->content; $footerContent = (array) optional( $footerSection )->content; /* |-------------------------------------------------------------------------- | Custom Hero Images |-------------------------------------------------------------------------- */ $heroMainImage = data_get( $heroContent, 'main_image_url' ) ?: $mainImage; $heroSideImage1 = data_get( $heroContent, 'side_image_1_url' ) ?: $image2; $heroSideImage2 = data_get( $heroContent, 'side_image_2_url' ) ?: $image3; /* |-------------------------------------------------------------------------- | Benefit Items |-------------------------------------------------------------------------- */ $benefits = collect( data_get( $benefitsContent, 'items', [] ) ) ->filter() ->values(); while ($benefits->count() < 6) { $benefits->push( 'পণ্যের সুবিধা এখানে লিখুন' ); } /* |-------------------------------------------------------------------------- | Usage Features |-------------------------------------------------------------------------- */ $usageFeatures = collect( data_get( $usageContent, 'features', [] ) ) ->filter() ->values(); if ($usageFeatures->isEmpty()) { $usageFeatures = collect([ '১০০% অরিজিনাল', 'দ্রুত ডেলিভারি', 'ক্যাশ অন ডেলিভারি', ]); } /* |-------------------------------------------------------------------------- | Reviews |-------------------------------------------------------------------------- */ $reviews = collect( data_get( $reviewsContent, 'items', [] ) ) ->filter( fn ($review) => filled( data_get( $review, 'text' ) ) ) ->values(); /* |-------------------------------------------------------------------------- | Footer Contact |-------------------------------------------------------------------------- */ $whatsapp = preg_replace( '/\D+/', '', (string) data_get( $footerContent, 'whatsapp_number', '8801732474420' ) ); $phone = preg_replace( '/\D+/', '', (string) data_get( $footerContent, 'phone_number', $whatsapp ) ); /* |-------------------------------------------------------------------------- | Default Delivery Area |-------------------------------------------------------------------------- */ $defaultDeliveryArea = $deliveryAreas->first(); /* |-------------------------------------------------------------------------- | JS Configuration |-------------------------------------------------------------------------- */ $landingPageJsData = [ 'preview' => (bool) $previewMode, 'pageId' => (int) $landingPage->id, 'productId' => (int) $product->id, 'productName' => (string) $product->name, 'productImage' => (string) $mainImage, 'basePrice' => (float) $basePrice, 'maxQuantity' => (int) $maxQuantity, 'quoteUrl' => route( 'landing-pages.quote', $landingPage ), 'incompleteUrl' => route( 'landing-pages.incomplete', $landingPage ), 'orderUrl' => route( 'landing-pages.order', $landingPage ), 'csrf' => csrf_token(), 'successTitle' => data_get( $orderContent, 'success_title', 'অর্ডার গ্রহণ করা হয়েছে' ), 'successText' => data_get( $orderContent, 'success_text', 'ধন্যবাদ। আপনার অর্ডার সফলভাবে গ্রহণ করা হয়েছে।' ), 'variants' => $variants ->map( function ($variant) use ($product) { $price = (float) ( $variant->sale_price ?? $variant->regular_price ?? 0 ); if ( $product->pre_order_enabled || ! $variant->track_stock ) { $maximum = 100; } else { $maximum = max( 1, min( 100, (int) $variant->stock_quantity ) ); } return [ 'id' => (int) $variant->id, 'name' => (string) $variant->name, 'price' => $price, 'regular_price' => (float) $variant->regular_price, 'max_quantity' => $maximum, ]; } ) ->values() ->all(), ]; @endphp
{{ data_get( $content, 'text', 'পণ্যের নির্দেশনা অনুযায়ী ব্যবহার করুন' ) }} {{ data_get( $content, 'highlight', 'সেরা ফলাফলের জন্য নিয়মিত ব্যবহার করুন' ) }}
{{ data_get( $content, 'subheading', 'নিয়মিত ব্যবহারকারীদের কিছু অভিজ্ঞতা' ) }}
{{ data_get( $content, 'subtitle', 'অর্ডারটি সম্পন্ন করতে নিচের তথ্যগুলো পূরণ করুন' ) }}