diff --git a/packages/Webkul/Notify/src/DataGrids/NotifyDataGrid.php b/packages/Webkul/Notify/src/DataGrids/NotifyDataGrid.php index e121c31..a3ba5b5 100644 --- a/packages/Webkul/Notify/src/DataGrids/NotifyDataGrid.php +++ b/packages/Webkul/Notify/src/DataGrids/NotifyDataGrid.php @@ -64,8 +64,6 @@ public function prepareColumns() 'filterable' => false, ]); - - $this->addColumn([ 'index' => 'customer_name', 'label' => trans('notify::app.admin.customer_name'), @@ -75,7 +73,6 @@ public function prepareColumns() 'filterable' => false, ]); - $this->addColumn([ 'index' => 'created_at', 'label' => trans('notify::app.admin.add_date'), @@ -92,9 +89,6 @@ public function prepareColumns() 'searchable' => true, 'sortable' => true, 'filterable' => false, - 'closure' => function ($value) { - return '' . trans('notify::app.admin.send_notification') . ''; - }, ]); } } \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Http/Controllers/Admin/NotifyController.php b/packages/Webkul/Notify/src/Http/Controllers/Admin/NotifyController.php index 64a53dc..1f8434c 100644 --- a/packages/Webkul/Notify/src/Http/Controllers/Admin/NotifyController.php +++ b/packages/Webkul/Notify/src/Http/Controllers/Admin/NotifyController.php @@ -59,12 +59,10 @@ public function store(Request $request) * @param \Illuminate\Http\Request $request * @return \Illuminate\View\View */ - public function updateStockStatus(Request $request) + public function send_notification() { - $notificationId = $request->notificationId; - try { - $data = $this->notifyRepository->find($notificationId); + $data = $this->notifyRepository->find(request()->input('id')); $customer = $this->customerRepository->find($data->customer_id); diff --git a/packages/Webkul/Notify/src/Http/Controllers/Shop/NotifyController.php b/packages/Webkul/Notify/src/Http/Controllers/Shop/NotifyController.php index 6af6b14..6e50c2c 100644 --- a/packages/Webkul/Notify/src/Http/Controllers/Shop/NotifyController.php +++ b/packages/Webkul/Notify/src/Http/Controllers/Shop/NotifyController.php @@ -2,7 +2,7 @@ namespace Webkul\Notify\Http\Controllers\Shop; -use Illuminate\Http\Request; +use Illuminate\Http\JsonResponse; use Webkul\Notify\Http\Controllers\Controller; use Webkul\Notify\Repository\NotifyRepository; @@ -23,11 +23,15 @@ public function __construct(protected NotifyRepository $notifyRepository) * * @return \Illuminate\View\View */ - public function store(Request $request) + public function store() :JsonResponse { $this->notifyRepository->create([ - 'product_id' => $request->product_id, - 'customer_id' => $request->customer_id, + 'product_id' => request()->input('product_id'), + 'customer_id' => request()->input('customer_id'), + ]); + + return new JsonResponse([ + 'message' => trans('notify::app.shop.message'), ]); } } \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Providers/NotifyServiceProvider.php b/packages/Webkul/Notify/src/Providers/NotifyServiceProvider.php index 6587fcf..9c31b87 100644 --- a/packages/Webkul/Notify/src/Providers/NotifyServiceProvider.php +++ b/packages/Webkul/Notify/src/Providers/NotifyServiceProvider.php @@ -19,11 +19,13 @@ class NotifyServiceProvider extends ServiceProvider public function boot() { + $this->publishes([__DIR__ . '/../Resources/views/products/view.blade.php' => ('packages/Webkul/Shop/src/Resources/views/products/view.blade.php')]); + $this->app->register(ModuleServiceProvider::class); $this->app->register(EventServiceProvider::class); - $this->loadMigrationsFrom(__DIR__ .'/../Database/Migrations'); + $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); $this->loadRoutesFrom(__DIR__ . '/../Routes/admin-routes.php'); @@ -42,7 +44,8 @@ public function boot() public function register() { $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/admin-menu.php', 'menu.admin' + dirname(__DIR__) . '/Config/admin-menu.php', + 'menu.admin' ); } } diff --git a/packages/Webkul/Notify/src/Resources/lang/ar/app.php b/packages/Webkul/Notify/src/Resources/lang/ar/app.php new file mode 100755 index 0000000..6c606b3 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/ar/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'الهوية', + 'product_name' => 'اسم المنتج', + 'customer_name' => 'اسم العميل', + 'add_date' => 'إضافة التاريخ', + 'send_notification' => 'إرسال إشعار', + ], + + 'shop' => [ + 'message' => 'سنعلمك قريباً', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/bn/app.php b/packages/Webkul/Notify/src/Resources/lang/bn/app.php new file mode 100644 index 0000000..8463dcd --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/bn/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'আইডি', + 'product_name' => 'পণ্যের নাম', + 'customer_name' => 'গ্রাহকের নাম', + 'add_date' => 'তারিখ যোগ করুন', + 'send_notification' => 'বিজ্ঞপ্তি প্রেরণ করুন', + ], + + 'shop' => [ + 'message' => 'আমরা শীঘ্রই আপনাকে জানাবো', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/de/app.php b/packages/Webkul/Notify/src/Resources/lang/de/app.php new file mode 100755 index 0000000..d66d7d9 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/de/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Produktname', + 'customer_name' => 'Kundenname', + 'add_date' => 'Datum hinzufügen', + 'send_notification' => 'Benachrichtigung senden', + ], + + 'shop' => [ + 'message' => 'Wir werden Sie bald benachrichtigen', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/en/app.php b/packages/Webkul/Notify/src/Resources/lang/en/app.php old mode 100644 new mode 100755 index ac833c6..e1aa187 --- a/packages/Webkul/Notify/src/Resources/lang/en/app.php +++ b/packages/Webkul/Notify/src/Resources/lang/en/app.php @@ -7,5 +7,9 @@ 'customer_name' => 'Customer Name', 'add_date' => 'Add Date', 'send_notification' => 'Send Notification', + ], + + 'shop' => [ + 'message' => 'We will notify you soon', ] ]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/es/app.php b/packages/Webkul/Notify/src/Resources/lang/es/app.php new file mode 100755 index 0000000..36d3eba --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/es/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Nombre del Producto', + 'customer_name' => 'Nombre del Cliente', + 'add_date' => 'Agregar Fecha', + 'send_notification' => 'Enviar Notificación', + ], + + 'shop' => [ + 'message' => 'Le notificaremos pronto', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/fa/app.php b/packages/Webkul/Notify/src/Resources/lang/fa/app.php new file mode 100755 index 0000000..5bade5e --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/fa/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'شناسه', + 'product_name' => 'نام محصول', + 'customer_name' => 'نام مشتری', + 'add_date' => 'تاریخ افزودن', + 'send_notification' => 'ارسال اطلاعیه', + ], + + 'shop' => [ + 'message' => 'به زودی به شما اطلاع خواهیم داد', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/fr/app.php b/packages/Webkul/Notify/src/Resources/lang/fr/app.php new file mode 100755 index 0000000..3f00975 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/fr/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Nom du Produit', + 'customer_name' => 'Nom du Client', + 'add_date' => 'Ajouter une Date', + 'send_notification' => 'Envoyer une Notification', + ], + + 'shop' => [ + 'message' => 'Nous vous notifierons bientôt', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/he/app.php b/packages/Webkul/Notify/src/Resources/lang/he/app.php new file mode 100755 index 0000000..6548e2c --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/he/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'מזהה', + 'product_name' => 'שם המוצר', + 'customer_name' => 'שם הלקוח', + 'add_date' => 'הוסף תאריך', + 'send_notification' => 'שלח הודעה', + ], + + 'shop' => [ + 'message' => 'נודיע לך בקרוב', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/hi_IN/app.php b/packages/Webkul/Notify/src/Resources/lang/hi_IN/app.php new file mode 100755 index 0000000..1069fff --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/hi_IN/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'आईडी', + 'product_name' => 'प्रोडक्ट नाम', + 'customer_name' => 'ग्राहक का नाम', + 'add_date' => 'तारीख जोड़ें', + 'send_notification' => 'सूचना भेजें', + ], + + 'shop' => [ + 'message' => 'हम आपको जल्दी ही सूचित करेंगे', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/it/app.php b/packages/Webkul/Notify/src/Resources/lang/it/app.php new file mode 100755 index 0000000..86c9cc2 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/it/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Nome Prodotto', + 'customer_name' => 'Nome Cliente', + 'add_date' => 'Aggiungi Data', + 'send_notification' => 'Invia Notifica', + ], + + 'shop' => [ + 'message' => 'Ti avviseremo presto', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/ja/app.php b/packages/Webkul/Notify/src/Resources/lang/ja/app.php new file mode 100755 index 0000000..42f78f5 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/ja/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => '製品名', + 'customer_name' => '顧客名', + 'add_date' => '日付を追加', + 'send_notification' => '通知を送信', + ], + + 'shop' => [ + 'message' => '近くお知らせします', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/nl/app.php b/packages/Webkul/Notify/src/Resources/lang/nl/app.php new file mode 100755 index 0000000..8044021 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/nl/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Productnaam', + 'customer_name' => 'Naam klant', + 'add_date' => 'Datum toevoegen', + 'send_notification' => 'Notificatie versturen', + ], + + 'shop' => [ + 'message' => 'We zullen u binnenkort op de hoogte stellen', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/pl/app.php b/packages/Webkul/Notify/src/Resources/lang/pl/app.php new file mode 100755 index 0000000..2f4180f --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/pl/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Nazwa Produktu', + 'customer_name' => 'Imię Klienta', + 'add_date' => 'Dodaj Datę', + 'send_notification' => 'Wyślij Powiadomienie', + ], + + 'shop' => [ + 'message' => 'Powiadomimy Cię wkrótce', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Notify/src/Resources/lang/pt_BR/app.php new file mode 100755 index 0000000..2ee8113 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/pt_BR/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => 'Nome do Produto', + 'customer_name' => 'Nome do Cliente', + 'add_date' => 'Adicionar Data', + 'send_notification' => 'Enviar Notificação', + ], + + 'shop' => [ + 'message' => 'Notificaremos você em breve', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/ru/app.php b/packages/Webkul/Notify/src/Resources/lang/ru/app.php new file mode 100755 index 0000000..96b5474 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/ru/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ИД', + 'product_name' => 'Название продукта', + 'customer_name' => 'Имя клиента', + 'add_date' => 'Добавить дату', + 'send_notification' => 'Отправить уведомление', + ], + + 'shop' => [ + 'message' => 'Мы скоро вас уведомим', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/sin/app.php b/packages/Webkul/Notify/src/Resources/lang/sin/app.php new file mode 100755 index 0000000..0854f66 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/sin/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'අංකය', + 'product_name' => 'නිෂ්පාදන නාමය', + 'customer_name' => 'සැපයුම්කරුවේ නම', + 'add_date' => 'දිනය එකතු කරන්න', + 'send_notification' => 'ස්ථාවර යවන්න', + ], + + 'shop' => [ + 'message' => 'වැඩිදුර ඔබට කියවා ඇත', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/tr/app.php b/packages/Webkul/Notify/src/Resources/lang/tr/app.php new file mode 100755 index 0000000..dd9f93f --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/tr/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'Kimlik', + 'product_name' => 'Ürün Adı', + 'customer_name' => 'Müşteri Adı', + 'add_date' => 'Tarih Ekle', + 'send_notification' => 'Bildirim Gönder', + ], + + 'shop' => [ + 'message' => 'Sizi yakında bilgilendireceğiz', + ] +]; \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/lang/uk/app.php b/packages/Webkul/Notify/src/Resources/lang/uk/app.php new file mode 100755 index 0000000..36b31d6 --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/uk/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ІД', + 'product_name' => 'Назва продукту', + 'customer_name' => 'Імя клієнта', + 'add_date' => 'Додати дату', + 'send_notification' => 'Надіслати сповіщення', + ], + + 'shop' => [ + 'message' => 'Ми сповістимо вас найближчим часом', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/lang/zh_CN/app.php b/packages/Webkul/Notify/src/Resources/lang/zh_CN/app.php new file mode 100755 index 0000000..633001a --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/lang/zh_CN/app.php @@ -0,0 +1,15 @@ + [ + 'id' => 'ID', + 'product_name' => '产品名称', + 'customer_name' => '客户名称', + 'add_date' => '添加日期', + 'send_notification' => '发送通知', + ], + + 'shop' => [ + 'message' => '我们将尽快通知您', + ] +]; diff --git a/packages/Webkul/Notify/src/Resources/views/admin/index.blade.php b/packages/Webkul/Notify/src/Resources/views/admin/index.blade.php index aab9765..07e05b7 100644 --- a/packages/Webkul/Notify/src/Resources/views/admin/index.blade.php +++ b/packages/Webkul/Notify/src/Resources/views/admin/index.blade.php @@ -1,25 +1,100 @@ - - - - - - + + + }) + + @endPushOnce \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Resources/views/products/view.blade.php b/packages/Webkul/Notify/src/Resources/views/products/view.blade.php new file mode 100644 index 0000000..a9a481c --- /dev/null +++ b/packages/Webkul/Notify/src/Resources/views/products/view.blade.php @@ -0,0 +1,571 @@ +@inject ('reviewHelper', 'Webkul\Product\Helpers\Review') +@inject ('productViewHelper', 'Webkul\Product\Helpers\View') + +@php + $avgRatings = round($reviewHelper->getAverageRating($product)); + + $percentageRatings = $reviewHelper->getPercentageRating($product); + + $customAttributeValues = $productViewHelper->getAdditionalData($product); +@endphp + + +@push('meta') + meta_description : \Illuminate\Support\Str::limit(strip_tags($product->description), 120, '') }}"/> + + + + @if (core()->getConfigData('catalog.rich_snippets.products.enable')) + + @endif + + getProductBaseImage($product); ?> + + + + + + + + + + + + + + + + + + + + +@endPush + + + + + + {{ trim($product->meta_title) != "" ? $product->meta_title : $product->name }} + + + {!! view_render_event('bagisto.shop.products.view.before', ['product' => $product]) !!} + + +
+ +
+ + + + + + + +
+ + + {!! view_render_event('bagisto.shop.products.view.description.before', ['product' => $product]) !!} + + +
+

+ {!! $product->description !!} +

+
+
+ + {!! view_render_event('bagisto.shop.products.view.description.after', ['product' => $product]) !!} + + + +
+
+ @foreach ($customAttributeValues as $customAttributeValue) +
+

+ {!! $customAttributeValue['label'] !!} +

+
+ + @if ( + $customAttributeValue['type'] == 'file' + && $customAttributeValue['value'] + ) + + + + @elseif ( + $customAttributeValue['type'] == 'image' + && $customAttributeValue['value'] + ) + + + + @else +
+

+ {!! $customAttributeValue['value'] ? $customAttributeValue['value'] : '-' !!} +

+
+ @endif + @endforeach +
+
+
+ + + + @include('shop::products.view.reviews') + +
+
+ + +
+ + + +
+

+ @lang('shop::app.products.view.description') +

+
+
+ + +

+ {!! $product->description !!} +

+
+
+ + + + +
+

+ @lang('shop::app.products.view.additional-information') +

+
+
+ + +
+

+ @foreach ($customAttributeValues as $customAttributeValue) +

+

+ {{ $customAttributeValue['label'] }} +

+
+ + @if ( + $customAttributeValue['type'] == 'file' + || $customAttributeValue['type'] == 'image' + ) + +

+ {{ $customAttributeValue['label'] }} +

+
+ @else +
+

+ {{ $customAttributeValue['value'] ?? '-' }} +

+
+ @endif + @endforeach +

+
+
+
+ + + + +
+

+ @lang('shop::app.products.view.review') +

+
+
+ + + @include('shop::products.view.reviews') + +
+
+ + + + + + + + + + {!! view_render_event('bagisto.shop.products.view.after', ['product' => $product]) !!} + + @pushOnce('scripts') + + + + @endPushOnce +
\ No newline at end of file diff --git a/packages/Webkul/Notify/src/Routes/admin-routes.php b/packages/Webkul/Notify/src/Routes/admin-routes.php index a0295c5..ece5365 100644 --- a/packages/Webkul/Notify/src/Routes/admin-routes.php +++ b/packages/Webkul/Notify/src/Routes/admin-routes.php @@ -4,9 +4,9 @@ use Webkul\Notify\Http\Controllers\Admin\NotifyController; Route::group(['middleware' => ['web', 'admin'], 'prefix' => config('app.admin_url')], function () { - Route::get('/notify', [NotifyController::class, 'index'])->name('notify.admin.index'); + Route::get('notify', [NotifyController::class, 'index'])->name('notify.admin.index'); - Route::post('/notify/store', [NotifyController::class, 'store'])->name('notify.admin.store'); + Route::post('notify/store', [NotifyController::class, 'store'])->name('notify.admin.store'); - Route::post('/notify/update-stock-status', [NotifyController::class, 'updateStockStatus'])->name('notify.admin.updateStockStatus'); + Route::post('notify/send-notification', [NotifyController::class, 'send_notification'])->name('notify.admin.send_notification'); }); \ No newline at end of file diff --git a/packages/Webkul/Notify/src/Routes/shop-routes.php b/packages/Webkul/Notify/src/Routes/shop-routes.php index ccb0a23..5789319 100644 --- a/packages/Webkul/Notify/src/Routes/shop-routes.php +++ b/packages/Webkul/Notify/src/Routes/shop-routes.php @@ -5,6 +5,6 @@ Route::group(['middleware' => ['theme', 'locale', 'currency']], function () { Route::controller(NotifyController::class)->prefix('nofity')->group(function () { - Route::post('/create', 'store')->name('shop.notify.store'); + Route::post('create', 'store')->name('shop.notify.store'); }); }); \ No newline at end of file