Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatible with v1.5.1 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions CHANGELOG for v1.3.x.md

This file was deleted.

46 changes: 46 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CHANGELOG for v1.5.x

#### This changelog consists the bug & security fixes and new features being included in the releases listed below.

## **v1.5.1(8th of May, 2023)** - *Release*

* [feature] compatible with bagisto v1.5.1

* [feature] Now admin can set time format for customers.

* [feature] Mail should be send to the customer with delivery time slot details

* [feature] Status - Enable/Disable column on delivery time slots

* [feature] Status - Want to delete confirmation popup required Yes/No before delete

* [bug] Colour should be same on all the radio buttons[blue colour]

* [bug] Filter not working on Delivery Order Section

* [bug] Display time format 12/24 hrs not working

* [bug] Need to alert message that delivery time slot not available for virtual/downloadable/booking product

* [bug] Unable to open the Invoice of Order in Admin Panel

* [bug] Display time format not reflected in Order [Admin Panel]

* [bug] Delivery time slots is not showing proper in mobile view [RTL Locale]


## **v1.4.5(14th of April, 2023)** - *Release*

* [feature] compatible with bagisto v1.4.5

## **v1.4.3(19th of Jul, 2022)** - *Release*

* [feature] compatible with bagisto v1.4.3

## **v1.3.3(1st of Nov, 2021)** - *Release*

* [feature] compatible with bagisto v1.3.3

## **v1.3.2(7th of Oct, 2021)** - *Release*

* [feature] compatible with bagisto v1.3.2
2 changes: 1 addition & 1 deletion publishable/assets/css/delivery-time-slot-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publishable/assets/css/delivery-time-slot.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publishable/assets/js/delivery-time-slot.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions publishable/assets/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/js/delivery-time-slot.js": "/js/delivery-time-slot.js?id=78ee7299e89ca4f07457",
"/css/delivery-time-slot.css": "/css/delivery-time-slot.css?id=a811c077b4161292ca39",
"/css/delivery-time-slot-admin.css": "/css/delivery-time-slot-admin.css?id=9cb33c58ed26f1c9fadb"
"/js/delivery-time-slot.js": "/js/delivery-time-slot.js?id=e7b2a04d0d6ab95713ee",
"/css/delivery-time-slot.css": "/css/delivery-time-slot.css?id=df4652022427096f8d91",
"/css/delivery-time-slot-admin.css": "/css/delivery-time-slot-admin.css?id=870a998d4932fc0003ee"
}
72 changes: 41 additions & 31 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,57 @@
## Introduction
### 1. Introduction:

Laravel Delivery Time Slot module will allow the admin to set the delivery day along with the delivery time slots for their orders.

Customers can choose their preferred delivery day and time for their order at the time of checkout. After the customers have completed the purchase they can see their selected day and time slot in their order history.

It packs in lots of demanding features that allows your business to scale in no time:
### 2. Features Of Laravel Delivery Time Slot

- Customers can choose their preferred day and time for delivery at the time of checkout.
- The admin can select the default allowed days.
- Admin can set the total number of days to display.
- The admin can set the minimum required time for order processing in days.
- Admin can set the error message that will be visible at the time of checkout if no slot is available.
- Admin can turn off the Laravel Delivery Time Slot from the Admin panel.
* Customers can choose their preferred day and time for delivery at the time of checkout.
* The admin can select the default allowed days.
* Admin can set the total number of days to display.
* The admin can set the minimum required time for order processing in days.
* Admin can set the error message that will be visible at the time of checkout if no slot is available.
* Admin can turn off the Laravel Delivery Time Slot from the Admin panel.

## Requirements:

- **Bagisto**: v1.3.3
### 3. Requirements:

## Installation :
- Run the following command
```
composer require bagisto/bagisto-delivery-time-slot
```
* **Bagisto**: v1.5.1

- Goto config/concord.php file and add following line under 'modules'
```php
\Webkul\DeliveryTimeSlot\Providers\ModuleServiceProvider::class
```
### 4. Installation:

- Run these commands below to complete the setup
```
composer dump-autoload
```
* Unzip the respective extension zip and then merge "packages" folder into project root directory.
* Goto config/app.php file and add following line under 'providers'

```
php artisan config:cache
php artisan migrate
php artisan route:cache
~~~
Webkul\DeliveryTimeSlot\Providers\DeliveryTimeSlotServiceProvider::class
~~~

* Goto composer.json file and add following line under 'psr-4'

~~~
"Webkul\\DeliveryTimeSlot\\": "packages/Webkul/DeliveryTimeSlot/src"
~~~

* Run these commands below to complete the setup

~~~
composer dump-autoload
~~~
~~~
php artisan optimize
```
```
~~~
~~~
php artisan migrate
~~~
~~~
php artisan route:clear
~~~

~~~
php artisan vendor:publish --force
```
-> Press the number before DeliveryTimeSlotServiceProvider and then press enter to publish all assets and configurations.

-> Press the number before "Webkul\DeliveryTimeSlot\Providers\DeliveryTimeSlotServiceProvider" and then press enter to publish all assets and configurations.
~~~

> That's it, now just execute the project on your specified domain.
30 changes: 26 additions & 4 deletions src/Config/system.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


return [
[
'key' => 'delivery_time_slot',
Expand Down Expand Up @@ -28,18 +27,41 @@
'locale_based' => true,
'channel_based' => false,
'repository' => 'Webkul\DeliveryTimeSlot\Repositories\DeliveryTimeSlotsRepository@selectDays'
], [
], [
'name' => 'total_days',
'title' => 'delivery-time-slot::app.admin.system.display-total-days',
'type' => 'text',
'validation' => 'numeric',
'validation' => 'required|numeric|between:1,7',
'locale_based' => true,
'channel_based' => false,
'info' => 'Enter number of days, e.g: 7'
],[
], [
'name' => 'display_time_format',
'title' => 'delivery-time-slot::app.admin.system.display-time-format',
'type' => 'select',
'validation' => 'required|numeric|included:12,24',
'locale_based' => true,
'channel_based' => false,
'options' => [
[
'title' => '24 Hour',
'value' => '24'
], [
'title' => '12 Hour',
'value' => '12'
],
]
], [
'name' => 'show_message',
'title' => 'delivery-time-slot::app.admin.system.show-message',
'type' => 'boolean',
'locale_based' => true,
'channel_based' => false,
], [
'name' => 'time_slot_error_message',
'title' => 'delivery-time-slot::app.admin.system.error-message',
'type' => 'textarea',
'validation' => 'max:150',
'channel_based' => true,
'locale_based' => true
]
Expand Down
77 changes: 56 additions & 21 deletions src/DataGrids/Admin/DeliveyOrdersDataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace Webkul\DeliveryTimeSlot\DataGrids\Admin;

use Webkul\Ui\DataGrid\DataGrid;
use DB;
use Webkul\Sales\Models\OrderAddress;
use Illuminate\Support\Facades\DB;

class DeliveyOrdersDataGrid extends DataGrid
{
Expand All @@ -16,14 +17,25 @@ public function prepareQueryBuilder()
$queryBuilder = DB::table('delivery_time_slots_orders')
->leftJoin('orders', 'orders.id', '=', 'delivery_time_slots_orders.order_id')
->leftJoin('delivery_time_slots', 'delivery_time_slots.id', '=', 'delivery_time_slots_orders.time_slot_id')

->leftJoin('customers', 'delivery_time_slots_orders.customer_id', '=', 'customers.id')

->select(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as customer_name'), 'delivery_time_slots_orders.delivery_date', 'delivery_time_slots_orders.order_id as delivery_order_id', 'delivery_time_slots.start_time as delivery_time_from', 'delivery_time_slots.end_time as delivery_time_to', 'delivery_time_slots_orders.id' , 'delivery_time_slots_orders.customer_id');
->leftJoin('addresses as order_address_shipping', function ($leftJoin) {
$leftJoin->on('order_address_shipping.order_id', '=', 'orders.id')
->where('order_address_shipping.address_type', OrderAddress::ADDRESS_TYPE_SHIPPING);
})
->leftJoin('addresses as order_address_billing', function ($leftJoin) {
$leftJoin->on('order_address_billing.order_id', '=', 'orders.id')
->where('order_address_billing.address_type', OrderAddress::ADDRESS_TYPE_BILLING);
})

->select(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as customer_name'), 'delivery_time_slots_orders.delivery_date', 'delivery_time_slots_orders.order_id as delivery_order_id', 'delivery_time_slots.start_time as delivery_time_from', 'delivery_time_slots.end_time as delivery_time_to', 'delivery_time_slots_orders.id' , 'delivery_time_slots_orders.customer_id')
->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to'))
->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name) as shipped_to'));

$this->addFilter('delivery_date', 'delivery_time_slots_orders.delivery_date');
$this->addFilter('delivery_order_id', 'delivery_time_slots_orders.order_id');
$this->addFilter('customer_name', DB::raw('CONCAT(customers.first_name, " ", customers.last_name)'));
$this->addFilter('billed_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name)'));
$this->addFilter('shipped_to', DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name)'));

$this->setQueryBuilder($queryBuilder);
}
Expand All @@ -36,26 +48,43 @@ public function addColumns()
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function ($data) {
if ( is_null($data->customer_name))
'filterable' => false,
'closure' => function ($data) {
if (is_null($data->customer_name)) {
return 'Guest';
else
echo '<a href="' . route('admin.customer.edit', $data->customer_id) . '">' . ucwords($data->customer_name) . '</a>';
}

return '<a href="' . route('admin.customer.edit', $data->customer_id) . '">' . ucwords($data->customer_name) . '</a>';
}
]);

$this->addColumn([
'index' => 'billed_to',
'label' => trans('admin::app.datagrid.billed-to'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);

$this->addColumn([
'index' => 'shipped_to',
'label' => trans('admin::app.datagrid.shipped-to'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);

$this->addColumn([
'index' => 'delivery_date',
'label' => trans('delivery-time-slot::app.admin.datagrid.delivery-date'),
'type' => 'datetime',
'searchable' => false,
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function ($data) {
$string = \explode(',' ,$data->delivery_date);

return "{$string[1]}, {$string[2]}";
return date('d F Y', strtotime($data->delivery_date));
}
]);

Expand All @@ -66,8 +95,8 @@ public function addColumns()
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function ($data) {
echo '<a href="' . route('admin.sales.orders.view', $data->delivery_order_id) . '">' . '#'.$data->delivery_order_id . '</a>';
'closure' => function ($data) {
return '<a href="' . route('admin.sales.orders.view', $data->delivery_order_id) . '">' . '#'.$data->delivery_order_id . '</a>';
}
]);

Expand All @@ -78,9 +107,12 @@ public function addColumns()
'sortable' => true,
'searchable' => false,
'filterable' => false,
'wrapper' => function($data) {
$deliveryTimeFrom = date("g:i a", strtotime("{$data->delivery_time_from}"));
return strtoupper($deliveryTimeFrom);
'wrapper' => function ($data) {
if (core()->getConfigData('delivery_time_slot.settings.general.display_time_format') == 12) {
return date('h:i A', strtotime($data->delivery_time_from));
}

return $data->delivery_time_from;
}
]);

Expand All @@ -91,9 +123,12 @@ public function addColumns()
'sortable' => true,
'searchable' => false,
'filterable' => false,
'wrapper' => function($data) {
$deliveryTimeTo = date("g:i a", strtotime("{$data->delivery_time_to}"));
return strtoupper($deliveryTimeTo);
'wrapper' => function ($data) {
if (core()->getConfigData('delivery_time_slot.settings.general.display_time_format') == 12) {
return date('h:i A', strtotime($data->delivery_time_to));
}

return $data->delivery_time_to;
}
]);
}
Expand Down
Loading