From d9bbb8f49de753408abc8e04832067bc1bf3fddc Mon Sep 17 00:00:00 2001 From: A1Gard Date: Sat, 10 Aug 2024 08:14:42 +0330 Subject: [PATCH] added meta description [seo] added twitter [x] preview --- app/Models/Clip.php | 8 ++++ app/Models/Post.php | 8 ++++ app/Models/Product.php | 24 +++++++++++ database/seeders/SettingSeeder.php | 9 +++- .../views/website/inc/website-head.blade.php | 42 +++++++++++++++---- 5 files changed, 82 insertions(+), 9 deletions(-) diff --git a/app/Models/Clip.php b/app/Models/Clip.php index 39d3dca..a2ce545 100644 --- a/app/Models/Clip.php +++ b/app/Models/Clip.php @@ -106,4 +106,12 @@ RESULT; } + public function tagsList(){ + if ($this->tags()->count() == 0){ + return getSetting('keyword'); + }else{ + return implode(',',$this->tags()->pluck('name')->toArray()); + } + } + } diff --git a/app/Models/Post.php b/app/Models/Post.php index e2b1a3a..32659b9 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -183,4 +183,12 @@ class Post extends Model implements HasMedia RESULT; } + + public function tagsList(){ + if ($this->tags()->count() == 0){ + return getSetting('keyword'); + }else{ + return implode(',',$this->tags()->pluck('name')->toArray()); + } + } } diff --git a/app/Models/Product.php b/app/Models/Product.php index 670aa6a..5700818 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -315,6 +315,21 @@ class Product extends Model implements HasMedia return number_format($price) . ' ' . config('app.currency.symbol'); } + public function oldPricePure() + { + $price = 0; + if ($this->quantities()->count() == 0) { + $price = $this->price; + } else { + $price = $this->quantities()->min('price'); + } + + if ($price == 0 || $price == '' || $price == null) { + return __("Call us!"); + } + + return $price; + } public function oldPrice() { $price = 0; @@ -410,4 +425,13 @@ RESULT; return $template; } + + + public function tagsList(){ + if ($this->tags()->count() == 0){ + return getSetting('keyword'); + }else{ + return implode(',',$this->tags()->pluck('name')->toArray()); + } + } } diff --git a/database/seeders/SettingSeeder.php b/database/seeders/SettingSeeder.php index 72ee536..ebc361b 100644 --- a/database/seeders/SettingSeeder.php +++ b/database/seeders/SettingSeeder.php @@ -119,10 +119,17 @@ class SettingSeeder extends Seeder 'type' => 'FILE', ], [ - 'title' => __("%name% sale in our shop by %price% %category.name%"), + 'title' => __("Product description template"), + 'value' => __("%name% sale in our shop by %price% %category.name%"), 'key' => 'product_description', 'type' => 'text', ], + [ + 'title' => __("Guarantee"), + 'key' => 'guarantee', + 'type' => 'text', + 'value' => '', + ], ], 'Media' => [ [ diff --git a/resources/views/website/inc/website-head.blade.php b/resources/views/website/inc/website-head.blade.php index 935dbdc..7607d86 100644 --- a/resources/views/website/inc/website-head.blade.php +++ b/resources/views/website/inc/website-head.blade.php @@ -5,6 +5,8 @@ + + @yield('title') @@ -31,34 +33,58 @@ - @endif - @if(isset($product)) + + + @elseif(isset($product)) {!! $product->markup() !!} - @endif - @if(isset($clip)) + + + + + + + + + + + + + + + + + + + @elseif(isset($clip)) {!! $clip->markup() !!} - + + + {{-- --}} {{-- --}} - @endif - @if(isset($gallery)) + @elseif(isset($gallery)) - + + + + @else + + @endif