diff --git a/app/Models/Item.php b/app/Models/Item.php
index 2f74d37..6dc382f 100644
--- a/app/Models/Item.php
+++ b/app/Models/Item.php
@@ -17,17 +17,36 @@ class Item extends Model
return $this->belongsTo(Menu::class, 'menu_id', 'id');
}
+
public function parent()
{
- return $this->belongsTo(MenuItem::class, 'parent');
+ return $this->belongsTo(Item::class, 'parent');
}
public function children()
{
- return $this->hasMany(MenuItem::class, 'parent');
+ return $this->hasMany(Item::class, 'parent');
}
public function dest(){
return $this->morphTo('menuable','menuable_type','menuable_id');
}
+
+ public function webUrl(){
+ if ($this->kind == 'direct'){
+
+ if ( config('app.xlang.active') && app()->getLocale() != config('app.xlang.main')){
+ if ($this->meta[0] != '/'){
+
+ $welcome = \route('client.welcome');
+ return str_replace($welcome,$welcome .'/'.app()->getLocale(),$this->meta);
+ }else{
+ return '/'.app()->getLocale() . $this->meta;
+ }
+ }
+ return $this->meta;
+ }else{
+ $this->dest()->webUrl();
+ }
+ }
}
diff --git a/composer.json b/composer.json
index f6aefcb..486ef42 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "xmen/xshop",
"type": "project",
- "description": "The skeleton application for the Laravel framework.",
+ "description": "Very customizable and easy to use shopping system, open source project based on laravel",
"keywords": ["xshop", "e-shop", "laravel","laravel-shop","open-source-shop"],
"license": "GPL-3.0-or-later",
"require": {
diff --git a/config/app.php b/config/app.php
index 0610c85..1050266 100644
--- a/config/app.php
+++ b/config/app.php
@@ -16,6 +16,7 @@ return [
*/
'name' => env('APP_NAME', 'Laravel'),
+ 'version' => env('APP_VERSION', '2.0.0-alpha'),
/*
|--------------------------------------------------------------------------
diff --git a/database/seeders/MenuSeeder.php b/database/seeders/MenuSeeder.php
index eac1a48..4579e81 100644
--- a/database/seeders/MenuSeeder.php
+++ b/database/seeders/MenuSeeder.php
@@ -29,7 +29,6 @@ class MenuSeeder extends Seeder
'menuable_id' => 1,
'menuable_type' => Group::class,
'user_id' => 1,
- 'kind'=>'direct',
],
[
'title' => "Contact",
diff --git a/resources/views/segments/menu/AplMenu/AplMenu.blade.php b/resources/views/segments/menu/AplMenu/AplMenu.blade.php
index 8b24451..4fb6eae 100644
--- a/resources/views/segments/menu/AplMenu/AplMenu.blade.php
+++ b/resources/views/segments/menu/AplMenu/AplMenu.blade.php
@@ -10,7 +10,7 @@
@foreach(getMenuBySetting($data->area->name.'_'.$data->part.'_menu')->items as $item)
@if($item->meta == null)
-
+
{{$item->title}}
@switch($item->menuable_type)
@@ -73,7 +73,7 @@
@endswitch
@else
-
+
{{$item->title}}
@endif
diff --git a/resources/views/segments/menu/DeebaMenu/DeebaMenu.blade.php b/resources/views/segments/menu/DeebaMenu/DeebaMenu.blade.php
new file mode 100644
index 0000000..cf9e8ba
--- /dev/null
+++ b/resources/views/segments/menu/DeebaMenu/DeebaMenu.blade.php
@@ -0,0 +1,39 @@
+
diff --git a/resources/views/segments/menu/DeebaMenu/DeebaMenu.js b/resources/views/segments/menu/DeebaMenu/DeebaMenu.js
new file mode 100644
index 0000000..4898c5b
--- /dev/null
+++ b/resources/views/segments/menu/DeebaMenu/DeebaMenu.js
@@ -0,0 +1,14 @@
+const scrollBreakpoint = window.innerHeight * 0.7;
+window.addEventListener('scroll',function () {
+ if (window.scrollY > scrollBreakpoint){
+ document.querySelector('#DeebaMenu').classList.add('active')
+ }else{
+ document.querySelector('#DeebaMenu').classList.remove('active')
+ }
+});
+
+window.addEventListener('load',function () {
+ document.querySelector('#deeba-toggle')?.addEventListener('click',function () {
+ document.querySelector('#deeba-sided').classList.toggle('show');
+ });
+});
diff --git a/resources/views/segments/menu/DeebaMenu/DeebaMenu.json b/resources/views/segments/menu/DeebaMenu/DeebaMenu.json
new file mode 100644
index 0000000..81aadf6
--- /dev/null
+++ b/resources/views/segments/menu/DeebaMenu/DeebaMenu.json
@@ -0,0 +1,10 @@
+{
+ "name": "DeebaMenu",
+ "version": "1.0",
+ "author": "xStack",
+ "email": "xshop@xstack.ir",
+ "license": "GPL-3.0-or-later",
+ "url": "https:\/\/xstack.ir",
+ "author_url": "https:\/\/4xmen.ir",
+ "packages": []
+}
\ No newline at end of file
diff --git a/resources/views/segments/menu/DeebaMenu/DeebaMenu.php b/resources/views/segments/menu/DeebaMenu/DeebaMenu.php
new file mode 100644
index 0000000..7a30144
--- /dev/null
+++ b/resources/views/segments/menu/DeebaMenu/DeebaMenu.php
@@ -0,0 +1,31 @@
+section = 'theme';
+ $setting->key = $part->area->name . '_' . $part->part.'_menu';
+ $setting->value = Menu::first()->id;
+ $setting->type = 'MENU';
+ $setting->size = 12;
+ $setting->title = $part->area->name . ' ' . $part->part .' menu';
+ $setting->save();
+ }
+ public static function onRemove(Part $part = null)
+ {
+ Setting::where('key',$part->area->name . '_' . $part->part.'_menu')->first()?->delete();
+
+ }
+ public static function onMount(Part $part = null)
+ {
+ return $part;
+ }
+}
diff --git a/resources/views/segments/menu/DeebaMenu/DeebaMenu.scss b/resources/views/segments/menu/DeebaMenu/DeebaMenu.scss
new file mode 100644
index 0000000..de09405
--- /dev/null
+++ b/resources/views/segments/menu/DeebaMenu/DeebaMenu.scss
@@ -0,0 +1,124 @@
+#DeebaMenu {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 999;
+ width: 100%;
+ transition: 500ms;
+ background: #11111100;
+ backdrop-filter: blur(0);
+
+
+ ul {
+ display: flex;
+ justify-content: space-between;
+ list-style: none;
+ text-align: center;
+ overflow: hidden;
+
+
+ li {
+ transition: 500ms;
+ flex: 1;
+
+ a {
+ padding: 1rem;
+ display: block;
+
+ color:var(--xshop-primary);
+
+ &:hover {
+ background: var(--xshop-secondary);
+ color: var(--xshop-diff2);
+ }
+ }
+ }
+
+ }
+
+ #deeba-logo-main {
+ flex-grow: 2;
+ transition: 500ms;
+
+
+ a {
+ background: transparent;
+ }
+
+ img {
+ height: 100px;
+ }
+ }
+
+ #deeba-toggle,.fixed-center{
+ display: none;
+ }
+
+ &.active{
+
+ ul{
+ height: 3.5rem;
+ padding: 0;
+ margin: 0;
+ }
+ background: #11111133;
+ position: fixed;
+ backdrop-filter: blur(7px);
+ #deeba-logo-main img{
+ height: 1em;
+ }
+ }
+
+ #deeba-sided{
+ opacity: .9;
+ padding: 0;
+ position: fixed;
+ inset-inline-end: -300px;
+ top: 3.5rem;
+ bottom: 0;
+ overflow-y: auto;
+ height: calc(100vh - 3.5rem);
+ width: 270px;
+ z-index: 999;
+ background: var(--xshop-secondary);
+ display: block;
+
+ li{
+ display: block;
+ a{
+ color: var(--xshop-diff2);
+ transition: 300ms;
+ &:hover{
+ background: var(--xshop-primary);
+ color: var(--xshop-diff);
+ }
+ }
+
+ }
+
+ }
+}
+
+/*-1024px width*/
+@media (max-width: 1024px) {
+ #DeebaMenu{
+ li{
+ display: none;
+ }
+
+ #deeba-toggle,.fixed-center{
+ display: block;
+ cursor: pointer;
+ }
+ //.fixed-center{
+ // visibility: hidden;
+ //}
+ #deeba-logo-main{
+ display: block;
+ flex-grow: 8;
+ }
+ .show{
+ inset-inline-end: 0 !important;
+ }
+ }
+}
diff --git a/resources/views/segments/menu/DeebaMenu/screenshot.png b/resources/views/segments/menu/DeebaMenu/screenshot.png
new file mode 100644
index 0000000..9155440
Binary files /dev/null and b/resources/views/segments/menu/DeebaMenu/screenshot.png differ
diff --git a/resources/views/segments/menu/RecetMenu/RecetMenu.blade.php b/resources/views/segments/menu/RecetMenu/RecetMenu.blade.php
index 9cf8464..bdd629d 100644
--- a/resources/views/segments/menu/RecetMenu/RecetMenu.blade.php
+++ b/resources/views/segments/menu/RecetMenu/RecetMenu.blade.php
@@ -7,16 +7,9 @@
@foreach(getMenuBySetting($data->area->name.'_'.$data->part.'_menu')->items as $item)
- @if($item->meta == null)
-
+
{{$item->title}}
- @else
-
- {{$item->title}}
-
- @endif
-
@endforeach
diff --git a/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss b/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss
index 0418273..ca54426 100644
--- a/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss
+++ b/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss
@@ -23,6 +23,8 @@
border-radius: var(--xshop-border-radius);
padding: 1rem;
+ margin-bottom: 1rem;
+
h3{
font-size: 22px;
padding: 1rem 0;
diff --git a/resources/views/segments/products/LatestProducts/LatestProducts.blade.php b/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
index 6d2d9c0..e9fa2d8 100644
--- a/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
+++ b/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
@@ -5,7 +5,7 @@
@foreach(\App\Models\Product::where('status',1)->limit(4)->get() as $product)
-