Merge 'master' into cart-rule-validator-extension

This commit is contained in:
Annika Wolff 2020-05-28 13:36:13 +02:00
commit 566c65ef99
315 changed files with 16621 additions and 3315 deletions

View File

@ -1,13 +1,13 @@
APP_NAME=Bagisto
APP_ENV=local
APP_VERSION=1.1.0
APP_VERSION=1.1.2
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=
APP_TIMEZONE=Asia/Kolkata
APP_LOCALE=en
LOG_CHANNEL=stack
APP_CURRENCY=
APP_CURRENCY=USD
DB_CONNECTION=mysql
DB_HOST=127.0.0.1

View File

@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_VERSION=1.1.0
APP_VERSION=1.1.2
APP_KEY=base64:G4KY3tUsTaY9ONo1n/QyJvVLQZdJDgbIkSJswFK01HE=
APP_DEBUG=true
APP_URL=http://localhost

2
.gitignore vendored
View File

@ -25,4 +25,4 @@ yarn.lock
storage/
storage/*.key
/docker-compose-collection/
/resources/themes/velocity/*
/resources/themes/velocity/*

View File

@ -2,6 +2,209 @@
#### This changelog consists the bug & security fixes and new features being included in the releases listed below.
## **v1.1.2 (24th of March 2020)** - *Release*
* [feature] - Now customer can cancel order.
* [feature] - Auto and manual currency exchange rates update feature added.
* #797 [fixed] - Add new module
* #2453 [fixed] - Velocity theme is not loading on fresh instance
* #2691 [fixed] - Shipping and Payment methods automatically selected on Checkout oage
* #2752 [fixed] - Error when you create or update a new catalog under root
* #2793 [fixed] - Stock Check Incorrect for Configurable Items
* #2826 [fixed] - Not able to view cart icon
* #2869 [fixed] - Updating "Velocity meta data" throws QueryException
* #2871 [fixed] - Refund throws "Undefined index: shipping" error
* #2875 [fixed] - Deleting brands that have been assigned to products causes checkout error
* #2884 [fixed] - Undefined Index slot: when add to cart rental booking
* #2890 [fixed] - cart rule condition (price in cart) always set to equal or less than when select greater than/less than
* #2895 [fixed] - The type hint of view in this blade file is 'address' - there is no tag in any provider which loads view with this type hint.
* #2896 [fixed] - There are two fields with having same value of name attribute one is hidden and other is of its desired type - is this redundant code or its solving any purpose?
* #2897 [fixed] - Inventory status field should be passed through validation for boolean in its backend controller.
* #2898 [fixed] - error when viewing a category and then wanting to change the language of the page in mobile view
* #2899 [fixed] - showing the configured products as radio button
* #2900 [fixed] - getting different variant of a configurable product in front end
* #2901 [fixed] - Error when creating a category
* #2902 [fixed] - unify address tables
* #2908 [fixed] - A class is missing from the Velocity ProductRepositiry file
* #2914 [fixed] - Filter not showing on mobile, also sorting not working on mobile
* #2915 [fixed] - filters are missing on mobile view.
* #2919 [fixed] - Header Content not working on other languages
* #2925 [fixed] - exception for php version 7.4
* #2938 [fixed] - Extend Model Class
* #2939 [fixed] - get product description for API without html tags
* #2940 [fixed] - creating categories have error
* #2943 [fixed] - Scroll images is not working
* #2945 [fixed] - API product detail return empty array
* #2954 [fixed] - The merging cart function does not work when already added all items of product into customer cart
## **v1.1.0 (24th of March 2020)** - *Release*
* #797 [fixed] - Add new module
* #826 [fixed] - Impossible to create the root directory "".
* #2152 [fixed] - Product images are not showing
* #2329 [fixed] - Getting exception on frontend after updating meta data.
* #2354 [fixed] - possible integrate this payment
* #2543 [fixed] - Sliders Text should be translatable
* #2558 [fixed] - Sliders Text should be translatable
* #2619 [fixed] - Issue when category slug & product slug are same
* #2684 [fixed] - API checkout/cart returns null for guest user
* #2691 [fixed] - Shipping and Payment methods automatically selected on Checkout oage
* #2706 [fixed] - Getting exception on editing category for pt_BR locale in php 7.4
* #2708 [fixed] - Able to create booking product from back date.
* #2713 [fixed] - fix the invoice header in pdf
* #2726 [fixed] - is shop.js the vue framework ??
* #2752 [fixed] - Error when you create or update a new catalog under root
* #2763 [fixed] - error to add rental booking into cart
* #2764 [fixed] - fix UI when select back_date of booking product,the calendar icon is set on another place
* #2765 [fixed] - Email settings configuration values are not write in .env file
* #2768 [fixed] - Getting exception in cart when remove one ticket from event booking from backend
* #2769 [fixed] - Can't delete Exchange Rates data
* #2774 [fixed] - How to add new icon in bagisto admin panel?
* #2775 [fixed] - compare icon is missing in each product for default theme
* #2776 [fixed] - compare option in side bar menu at customer panel should be available
* #2778 [fixed] - Issue in customer profile dropdown.
* #2779 [fixed] - Issue on checkout page, email should ask first as in default theme.
* #2780 [fixed] - Sidebar layout issue.
* #2781 [fixed] - Mobile menu is not showing correct sub-menu
* #2784 [fixed] - One booking for many days slot time issue
* #2785 [fixed] - missing address details in checkout page
* #2786 [fixed] - Getting error message on adding product to compare product from search page.
* #2788 [fixed] - guest_checkout is missing from edit product
* #2790 [fixed] - Minicart disable when use new languages only velocity theme
* #2792 [fixed] - Weight Validation Inconsistencies
* #2793 [fixed] - Stock Check Incorrect for Configurable Items
* #2794 [fixed] - When allow backorder is enabled, display a message available for order rather than in stock.
* #2796 [fixed] - Try to create category in windows 10 getting exception
* #2801 [fixed] - Address with more than 2 lines is not added correctly to the cart_address table
* #2807 [fixed] - Illegal mix of collations
* #2808 [fixed] - Correct the spelling on registration page.
* #2810 [fixed] - UI issue on compare similar item page.
* #2811 [fixed] - how to change checkout proccess
* #2812 [fixed] - getting timezone error while setup
* #2813 [fixed] - Ui issue if there is only one product in compare page.
* #2814 [fixed] - variant product's name aren't update when select their options in Front
* #2818 [fixed] - Not able to view menu in velocity theme on storefront
* #2821 [fixed] - Address Line is Null in Emails
* #2825 [fixed] - PHP Notice:
* #2827 [fixed] - default local not changing in storefront in velocity theme
* #2828 [fixed] - currency change error on velocity theme
* #2829 [fixed] - changing home page content in velocity and npm
* #2832 [fixed] - Illegal mix of collations
* #2834 [fixed] - Layout issue in compare page in pt_BR locale
* #2837 [fixed] - subscription bar content source code is not visible in text editor
* #2840 [fixed] - Velocity theme is not available on fresh install
* #2845 [fixed] - Implement custom RegistrationController
* #2846 [fixed] - does not show next step
* #2847 [fixed] - Class 'Faker\Factory' not found
* #2849 [fixed] - Can not add my stylesheet to Velocity theme
* #2850 [fixed] - admin crash on save configration
* #2851 [fixed] - Fix date picker icon layout at dashboard
* #2856 [fixed] - Issue with Sort by functionality, when open any category it by defaults show Newest First but after changing sort by when again select newest first it shows different product.
* #2865 [fixed] - Save order taking so long time 30s
* #2866 [fixed] - ayout issue when customer save addresses form
* #2871 [fixed] - Refund throws "Undefined index: shipping" error
* #2876 [fixed] - Place order is disable at checkout when select shipping address
## **v1.1.0 (24th of March 2020)** - *Release*
* [feature] Added new booking type product.

View File

@ -97,7 +97,7 @@ http(s)://example.com/public
##### Execute these commands below, in order
~~~
1. composer create-project bagisto/bagisto
1. composer create-project bagisto/bagisto-standard
~~~
~~~

2
app/Console/Kernel.php Executable file → Normal file
View File

@ -39,4 +39,4 @@ class Kernel extends ConsoleKernel
require base_path('routes/console.php');
}
}
}

View File

@ -31,22 +31,24 @@
"laravel/helpers": "^1.1",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "3.1.18",
"nwidart/laravel-modules": "^3.2",
"prettus/l5-repository": "^2.6",
"tymon/jwt-auth": "^1.0.0"
"tymon/jwt-auth": "^1.0.0",
"barryvdh/laravel-debugbar": "^3.1",
"fzaninotto/faker": "^1.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"codeception/codeception": "4.1.1",
"codeception/module-asserts": "^1.1",
"codeception/module-filesystem": "^1.0",
"codeception/module-laravel5": "^1.0",
"codeception/module-webdriver": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"barryvdh/laravel-debugbar": "^3.1",
"fzaninotto/faker": "^1.4"
"phpunit/phpunit": "^7.0"
},
"replace": {
@ -107,7 +109,10 @@
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
"Tests\\Acceptance\\": "tests/acceptance/",
"Tests\\Functional\\": "tests/functional/",
"Tests\\Unit\\": "tests/unit/",
"Tests\\Trigger\\": "tests/trigger/"
}
},

1557
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -153,7 +153,7 @@ return [
/*
Application Version
*/
'version' => env('APP_VERSION', '1.1.0'),
'version' => env('APP_VERSION'),
/**
* Blacklisting attributes while debugging

View File

@ -30,12 +30,16 @@ return [
],
'exchange-api' => [
'default' => 'fixer',
'default' => 'exchange_rates',
'fixer' => [
'paid_account' => false,
'key' => env('fixer_api_key'),
'class' => 'Webkul\Core\Helpers\Exchange\FixerExchange'
]
],
'exchange_rates' => [
'class' => 'Webkul\Core\Helpers\Exchange\ExchangeRates'
],
],
'stripe' => [

View File

@ -25,8 +25,9 @@
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"opencollective": "^1.0.3",
"opencollective-postinstall": "^2.0.1",
"opencollective": "^1.0.3"
"vee-validate": "^3.3.0"
},
"collective": {
"type": "opencollective",

View File

@ -14,6 +14,8 @@ use Webkul\Checkout\Http\Requests\CustomerAddressForm;
use Webkul\Sales\Repositories\OrderRepository;
use Illuminate\Support\Str;
use Cart;
use Exception;
use Webkul\Shop\Http\Controllers\OnepageController;
class CheckoutController extends Controller
{
@ -197,26 +199,10 @@ class CheckoutController extends Controller
/**
* Validate order before creation
*
* @return mixed
* @throws Exception
*/
public function validateOrder()
public function validateOrder(): void
{
$cart = Cart::getCart();
if (! $cart->shipping_address) {
throw new \Exception(trans('Please check shipping address.'));
}
if (! $cart->billing_address) {
throw new \Exception(trans('Please check billing address.'));
}
if (! $cart->selected_shipping_rate) {
throw new \Exception(trans('Please specify shipping method.'));
}
if (! $cart->payment) {
throw new \Exception(trans('Please specify payment method.'));
}
app(OnepageController::class)->validateOrder();
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=c7c2ef0a298910b82304",
"/css/admin.css": "/css/admin.css?id=f2c6fe51889bca1fb79d"
"/js/admin.js": "/js/admin.js?id=2701b1627d73faa941d6",
"/css/admin.css": "/css/admin.css?id=f22618adc68fda9b42c0"
}

View File

@ -99,6 +99,12 @@ return [
'type' => 'image',
'channel_based' => true,
'validation' => 'mimes:jpeg,bmp,png,jpg',
], [
'name' => 'favicon',
'title' => 'admin::app.admin.system.favicon',
'type' => 'image',
'channel_based' => true,
'validation' => 'mimes:jpeg,bmp,png,jpg',
],
],
], [
@ -120,10 +126,63 @@ return [
'type' => 'boolean',
],
],
], [
'key' => 'catalog.products.storefront',
'name' => 'admin::app.admin.system.storefront',
'sort' => 2,
'fields' => [
[
'name' => 'mode',
'title' => 'admin::app.admin.system.default-list-mode',
'type' => 'select',
'options' => [
[
'title' => 'admin::app.admin.system.grid',
'value' => 'grid',
], [
'title' => 'admin::app.admin.system.list',
'value' => 'list',
],
],
'channel_based' => true,
], [
'name' => 'products_per_page',
'title' => 'admin::app.admin.system.products-per-page',
'type' => 'text',
'info' => 'admin::app.admin.system.comma-seperated',
'channel_based' => true,
], [
'name' => 'sort_by',
'title' => 'admin::app.admin.system.sort-by',
'type' => 'select',
'options' => [
[
'title' => 'admin::app.admin.system.from-z-a',
'value' => 'name-desc',
], [
'title' => 'admin::app.admin.system.from-a-z',
'value' => 'name-asc',
], [
'title' => 'admin::app.admin.system.newest-first',
'value' => 'created_at-desc',
], [
'title' => 'admin::app.admin.system.oldest-first',
'value' => 'created_at-asc',
], [
'title' => 'admin::app.admin.system.cheapest-first',
'value' => 'price-asc',
], [
'title' => 'admin::app.admin.system.expensive-first',
'value' => 'price-desc',
],
],
'channel_based' => true,
]
],
], [
'key' => 'catalog.products.review',
'name' => 'admin::app.admin.system.review',
'sort' => 2,
'sort' => 3,
'fields' => [
[
'name' => 'guest_review',
@ -147,10 +206,68 @@ return [
'channel_based' => true,
],
],
], [
'key' => 'catalog.rich_snippets',
'name' => 'admin::app.admin.system.rich-snippets',
'sort' => 3,
], [
'key' => 'catalog.rich_snippets.products',
'name' => 'admin::app.admin.system.products',
'sort' => 1,
'fields' => [
[
'name' => 'enable',
'title' => 'admin::app.admin.system.enable',
'type' => 'boolean',
], [
'name' => 'show_sku',
'title' => 'admin::app.admin.system.show-sku',
'type' => 'boolean',
], [
'name' => 'show_weight',
'title' => 'admin::app.admin.system.show-weight',
'type' => 'boolean',
], [
'name' => 'show_categories',
'title' => 'admin::app.admin.system.show-categories',
'type' => 'boolean',
], [
'name' => 'show_images',
'title' => 'admin::app.admin.system.show-images',
'type' => 'boolean',
], [
'name' => 'show_reviews',
'title' => 'admin::app.admin.system.show-reviews',
'type' => 'boolean',
], [
'name' => 'show_ratings',
'title' => 'admin::app.admin.system.show-ratings',
'type' => 'boolean',
], [
'name' => 'show_offers',
'title' => 'admin::app.admin.system.show-offers',
'type' => 'boolean',
],
],
], [
'key' => 'catalog.rich_snippets.categories',
'name' => 'admin::app.admin.system.categories',
'sort' => 1,
'fields' => [
[
'name' => 'enable',
'title' => 'admin::app.admin.system.enable',
'type' => 'boolean',
], [
'name' => 'show_search_input_field',
'title' => 'admin::app.admin.system.show-search-input-field',
'type' => 'boolean',
]
]
], [
'key' => 'customer',
'name' => 'admin::app.admin.system.customer',
'sort' => 3,
'sort' => 4,
], [
'key' => 'customer.settings',
'name' => 'admin::app.admin.system.settings',
@ -193,7 +310,7 @@ return [
], [
'key' => 'emails',
'name' => 'admin::app.admin.emails.email',
'sort' => 1,
'sort' => 5,
], [
'key' => 'emails.general',
'name' => 'admin::app.admin.emails.notification_label',

View File

@ -3,6 +3,7 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Customer\Models\CustomerAddress;
use Webkul\Ui\DataGrid\DataGrid;
use Webkul\Customer\Repositories\CustomerRepository;
@ -43,10 +44,11 @@ class AddressDataGrid extends DataGrid
{
$customer = $this->customerRepository->find(request('id'));
$queryBuilder = DB::table('customer_addresses as ca')
$queryBuilder = DB::table('addresses as ca')
->leftJoin('countries', 'ca.country', '=', 'countries.code')
->leftJoin('customers as c', 'ca.customer_id', '=', 'c.id')
->addSelect('ca.id as address_id', 'ca.company_name', 'ca.address1', 'ca.country', DB::raw('' . DB::getTablePrefix() . 'countries.name as country_name'), 'ca.state', 'ca.city', 'ca.postcode', 'ca.phone', 'ca.default_address')
->where('ca.address_type', CustomerAddress::ADDRESS_TYPE)
->where('c.id', $customer->id);
$queryBuilder = $queryBuilder->leftJoin('country_states', function($qb) {
@ -80,6 +82,15 @@ class AddressDataGrid extends DataGrid
'filterable' => true,
]);
$this->addColumn([
'index' => 'company_name',
'label' => trans('admin::app.customers.addresses.company-name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'address1',
'label' => trans('admin::app.customers.addresses.address-1'),

View File

@ -2,8 +2,8 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
use Illuminate\Support\Facades\DB;
class CartRuleDataGrid extends DataGrid
{
@ -11,18 +11,51 @@ class CartRuleDataGrid extends DataGrid
protected $sortOrder = 'desc';
protected $customer_group = 'all';
protected $channel = 'all';
public function __construct()
{
parent::__construct();
$this->customer_group = request()->get('customer_group') ?? 'all';
$this->channel = request()->get('channel') ?? 'all';
}
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('cart_rules')
->leftJoin('cart_rule_coupons', function($leftJoin) {
->leftJoin('cart_rule_coupons', function ($leftJoin) {
$leftJoin->on('cart_rule_coupons.cart_rule_id', '=', 'cart_rules.id')
->where('cart_rule_coupons.is_primary', 1);
->where('cart_rule_coupons.is_primary', 1);
})
->addSelect('cart_rules.id', 'name', 'cart_rule_coupons.code as coupon_code', 'status', 'starts_from', 'ends_till', 'sort_order');
->addSelect('cart_rules.id', 'name', 'cart_rule_coupons.code as coupon_code',
'status', 'starts_from', 'ends_till', 'sort_order');
$this->addFilter('id', 'cart_rules.id');
$this->addFilter('coupon_code', 'cart_rule_coupons.code');
if ($this->customer_group !== 'all') {
$queryBuilder->leftJoin(
'cart_rule_customer_groups',
'cart_rule_customer_groups.cart_rule_id',
'=',
'cart_rules.id'
);
$queryBuilder->where('cart_rule_customer_groups.customer_group_id', $this->customer_group);
}
if ($this->channel !== 'all') {
$queryBuilder->leftJoin(
'cart_rule_channels',
'cart_rule_channels.cart_rule_id',
'=',
'cart_rules.id');
$queryBuilder->where('cart_rule_channels.channel_id', $this->channel);
}
$this->setQueryBuilder($queryBuilder);
}
@ -80,7 +113,7 @@ class CartRuleDataGrid extends DataGrid
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function($value) {
'wrapper' => function ($value) {
if ($value->status == 1) {
return trans('admin::app.datagrid.active');
} else {
@ -108,11 +141,19 @@ class CartRuleDataGrid extends DataGrid
'icon' => 'icon pencil-lg-icon',
]);
$this->addAction([
'title' => trans('admin::app.datagrid.copy'),
'method' => 'GET',
'route' => 'admin.cart-rules.copy',
'icon' => 'icon note-icon',
]);
$this->addAction([
'title' => trans('admin::app.datagrid.delete'),
'method' => 'POST',
'route' => 'admin.cart-rules.delete',
'icon' => 'icon trash-icon',
]);
}
}

View File

@ -117,9 +117,9 @@ class CustomerReviewDataGrid extends DataGrid
'action' => route('admin.customer.review.massupdate'),
'method' => 'PUT',
'options' => [
'Pending' => 0,
'Approve' => 1,
'Disapprove' => 2,
trans('admin::app.customers.reviews.pending') => 0,
trans('admin::app.customers.reviews.approved') => 1,
trans('admin::app.customers.reviews.disapproved') => 2,
],
]);
}

View File

@ -3,6 +3,7 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Sales\Models\OrderAddress;
use Webkul\Ui\DataGrid\DataGrid;
class OrderDataGrid extends DataGrid
@ -14,13 +15,13 @@ class OrderDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('orders')
->leftJoin('order_address as order_address_shipping', function($leftJoin) {
->leftJoin('addresses as order_address_shipping', function($leftJoin) {
$leftJoin->on('order_address_shipping.order_id', '=', 'orders.id')
->where('order_address_shipping.address_type', 'shipping');
->where('order_address_shipping.address_type', OrderAddress::ADDRESS_TYPE_SHIPPING);
})
->leftJoin('order_address as order_address_billing', function($leftJoin) {
->leftJoin('addresses as order_address_billing', function($leftJoin) {
$leftJoin->on('order_address_billing.order_id', '=', 'orders.id')
->where('order_address_billing.address_type', 'billing');
->where('order_address_billing.address_type', OrderAddress::ADDRESS_TYPE_BILLING);
})
->addSelect('orders.id','orders.increment_id', 'orders.base_sub_total', 'orders.base_grand_total', 'orders.created_at', 'channel_name', 'status')
->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to'))

View File

@ -3,6 +3,7 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Sales\Models\OrderAddress;
use Webkul\Ui\DataGrid\DataGrid;
class OrderRefundDataGrid extends DataGrid
@ -16,9 +17,9 @@ class OrderRefundDataGrid extends DataGrid
$queryBuilder = DB::table('refunds')
->select('refunds.id', 'orders.increment_id', 'refunds.state', 'refunds.base_grand_total', 'refunds.created_at')
->leftJoin('orders', 'refunds.order_id', '=', 'orders.id')
->leftJoin('order_address as order_address_billing', function($leftJoin) {
->leftJoin('addresses as order_address_billing', function($leftJoin) {
$leftJoin->on('order_address_billing.order_id', '=', 'orders.id')
->where('order_address_billing.address_type', 'billing');
->where('order_address_billing.address_type', OrderAddress::ADDRESS_TYPE_BILLING);
})
->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to'));

View File

@ -3,6 +3,7 @@
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Sales\Models\OrderAddress;
use Webkul\Ui\DataGrid\DataGrid;
class OrderShipmentsDataGrid extends DataGrid
@ -14,9 +15,9 @@ class OrderShipmentsDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('shipments')
->leftJoin('order_address as order_address_shipping', function($leftJoin) {
->leftJoin('addresses as order_address_shipping', function($leftJoin) {
$leftJoin->on('order_address_shipping.order_id', '=', 'shipments.order_id')
->where('order_address_shipping.address_type', 'shipping');
->where('order_address_shipping.address_type', OrderAddress::ADDRESS_TYPE_SHIPPING);
})
->leftJoin('orders as ors', 'shipments.order_id', '=', 'ors.id')
->leftJoin('inventory_sources as is', 'shipments.inventory_source_id', '=', 'is.id')

View File

@ -22,7 +22,7 @@ class ProductDataGrid extends DataGrid
parent::__construct();
$this->locale = request()->get('locale') ?? 'all';
$this->channel = request()->get('channel') ?? 'all';
}
@ -119,7 +119,7 @@ class ProductDataGrid extends DataGrid
'sortable' => true,
'searchable' => false,
'filterable' => true,
'wrapper' => function($value) {
'wrapper' => function ($value) {
if ($value->status == 1) {
return trans('admin::app.datagrid.active');
} else {
@ -144,7 +144,7 @@ class ProductDataGrid extends DataGrid
'sortable' => true,
'searchable' => false,
'filterable' => false,
'wrapper' => function($value) {
'wrapper' => function ($value) {
if (is_null($value->quantity)) {
return 0;
} else {
@ -161,7 +161,7 @@ class ProductDataGrid extends DataGrid
'method' => 'GET',
'route' => 'admin.catalog.products.edit',
'icon' => 'icon pencil-lg-icon',
'condition' => function() {
'condition' => function () {
return true;
},
]);

View File

@ -11,11 +11,31 @@ class SliderDataGrid extends DataGrid
protected $sortOrder = 'desc';
protected $locale = 'all';
protected $channel = 'all';
public function __construct()
{
parent::__construct();
$this->locale = request()->get('locale') ?? 'all';
$this->channel = request()->get('channel') ?? 'all';
}
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('sliders as sl')
->addSelect('sl.id as slider_id', 'sl.title', 'ch.name')
->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id');
->addSelect('sl.id as slider_id', 'sl.title', 'sl.locale', 'ch.name', 'ch.code')
->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id');
if ($this->locale !== 'all') {
$queryBuilder->where('locale', $this->locale);
}
if ($this->channel !== 'all') {
$queryBuilder->where('ch.code', $this->channel);
}
$this->addFilter('slider_id', 'sl.id');
$this->addFilter('channel_name', 'ch.name');
@ -51,6 +71,15 @@ class SliderDataGrid extends DataGrid
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'locale',
'label' => trans('admin::app.datagrid.locale'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
}
public function prepareActions()

View File

@ -2,6 +2,7 @@
namespace Webkul\Admin\Http\Controllers\Customer;
use Illuminate\Support\Facades\Event;
use Webkul\Admin\Http\Controllers\Controller;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\CustomerGroupRepository;
@ -111,8 +112,12 @@ class CustomerController extends Controller
$data['is_verified'] = 1;
Event::dispatch('customer.registration.before');
$customer = $this->customerRepository->create($data);
Event::dispatch('customer.registration.after', $customer);
try {
$configKey = 'emails.general.notifications.emails.general.notifications.customer';
if (core()->getConfigData($configKey)) {
@ -164,7 +169,11 @@ class CustomerController extends Controller
$data['status'] = ! isset($data['status']) ? 0 : 1;
$this->customerRepository->update($data, $id);
Event::dispatch('customer.update.before');
$customer = $this->customerRepository->update($data, $id);
Event::dispatch('customer.update.after', $customer);
session()->flash('success', trans('admin::app.response.update-success', ['name' => 'Customer']));

View File

@ -2,8 +2,10 @@
namespace Webkul\Admin\Http\Controllers\Sales;
use Illuminate\Support\Facades\Event;
use Webkul\Admin\Http\Controllers\Controller;
use Webkul\Sales\Repositories\OrderRepository;
use \Webkul\Sales\Repositories\OrderCommentRepository;
class OrderController extends Controller
{
@ -21,19 +23,32 @@ class OrderController extends Controller
*/
protected $orderRepository;
/**
* OrderCommentRepository object
*
* @var \Webkul\Sales\Repositories\OrderCommentRepository
*/
protected $orderCommentRepository;
/**
* Create a new controller instance.
*
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
* @param \Webkul\Sales\Repositories\OrderCommentRepository $orderCommentRepository
* @return void
*/
public function __construct(OrderRepository $orderRepository)
public function __construct(
OrderRepository $orderRepository,
OrderCommentRepository $orderCommentRepository
)
{
$this->middleware('admin');
$this->_config = request('_config');
$this->orderRepository = $orderRepository;
$this->orderCommentRepository = $orderCommentRepository;
}
/**
@ -77,4 +92,29 @@ class OrderController extends Controller
return redirect()->back();
}
/**
* Add comment to the order
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function comment($id)
{
$data = array_merge(request()->all(), [
'order_id' => $id,
]);
$data['customer_notified'] = isset($data['customer_notified']) ? 1 : 0;
Event::dispatch('sales.order.comment.create.before', $data);
$comment = $this->orderCommentRepository->create($data);
Event::dispatch('sales.order.comment.create.after', $comment);
session()->flash('success', trans('admin::app.sales.orders.comment-added-success'));
return redirect()->back();
}
}

View File

@ -107,6 +107,10 @@ class RefundController extends Controller
$data = request()->all();
if (! $data['refund']['shipping']) {
$data['refund']['shipping'] = 0;
}
$totals = $this->refundRepository->getOrderItemsRefundSummary($data['refund']['items'], $orderId);
$maxRefundAmount = $totals['grand_total']['price'] - $order->refunds()->sum('base_adjustment_refund');

View File

@ -7,69 +7,69 @@ Route::group(['middleware' => ['web']], function () {
// Login Routes
Route::get('/login', 'Webkul\User\Http\Controllers\SessionController@create')->defaults('_config', [
'view' => 'admin::users.sessions.create'
'view' => 'admin::users.sessions.create',
])->name('admin.session.create');
//login post route to admin auth controller
Route::post('/login', 'Webkul\User\Http\Controllers\SessionController@store')->defaults('_config', [
'redirect' => 'admin.dashboard.index'
'redirect' => 'admin.dashboard.index',
])->name('admin.session.store');
// Forget Password Routes
Route::get('/forget-password', 'Webkul\User\Http\Controllers\ForgetPasswordController@create')->defaults('_config', [
'view' => 'admin::users.forget-password.create'
'view' => 'admin::users.forget-password.create',
])->name('admin.forget-password.create');
Route::post('/forget-password', 'Webkul\User\Http\Controllers\ForgetPasswordController@store')->name('admin.forget-password.store');
// Reset Password Routes
Route::get('/reset-password/{token}', 'Webkul\User\Http\Controllers\ResetPasswordController@create')->defaults('_config', [
'view' => 'admin::users.reset-password.create'
'view' => 'admin::users.reset-password.create',
])->name('admin.reset-password.create');
Route::post('/reset-password', 'Webkul\User\Http\Controllers\ResetPasswordController@store')->defaults('_config', [
'redirect' => 'admin.dashboard.index'
'redirect' => 'admin.dashboard.index',
])->name('admin.reset-password.store');
// Admin Routes
Route::group(['middleware' => ['admin']], function () {
Route::get('/logout', 'Webkul\User\Http\Controllers\SessionController@destroy')->defaults('_config', [
'redirect' => 'admin.session.create'
'redirect' => 'admin.session.create',
])->name('admin.session.destroy');
// Dashboard Route
Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->defaults('_config', [
'view' => 'admin::dashboard.index'
'view' => 'admin::dashboard.index',
])->name('admin.dashboard.index');
//Customer Management Routes
Route::get('customers', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config', [
'view' => 'admin::customers.index'
'view' => 'admin::customers.index',
])->name('admin.customer.index');
Route::get('customers/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@create')->defaults('_config',[
'view' => 'admin::customers.create'
Route::get('customers/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@create')->defaults('_config', [
'view' => 'admin::customers.create',
])->name('admin.customer.create');
Route::post('customers/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@store')->defaults('_config',[
'redirect' => 'admin.customer.index'
Route::post('customers/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@store')->defaults('_config', [
'redirect' => 'admin.customer.index',
])->name('admin.customer.store');
Route::get('customers/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@edit')->defaults('_config',[
'view' => 'admin::customers.edit'
Route::get('customers/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@edit')->defaults('_config', [
'view' => 'admin::customers.edit',
])->name('admin.customer.edit');
Route::get('customers/note/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@createNote')->defaults('_config',[
'view' => 'admin::customers.note'
Route::get('customers/note/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@createNote')->defaults('_config', [
'view' => 'admin::customers.note',
])->name('admin.customer.note.create');
Route::put('customers/note/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@storeNote')->defaults('_config',[
'redirect' => 'admin.customer.index'
Route::put('customers/note/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@storeNote')->defaults('_config', [
'redirect' => 'admin.customer.index',
])->name('admin.customer.note.store');
Route::put('customers/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@update')->defaults('_config', [
'redirect' => 'admin.customer.index'
'redirect' => 'admin.customer.index',
])->name('admin.customer.update');
Route::post('customers/delete/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@destroy')->name('admin.customer.delete');
@ -78,95 +78,95 @@ Route::group(['middleware' => ['web']], function () {
Route::post('customers/masssupdate', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@massUpdate')->name('admin.customer.mass-update');
Route::get('reviews', 'Webkul\Product\Http\Controllers\ReviewController@index')->defaults('_config',[
'view' => 'admin::customers.reviews.index'
Route::get('reviews', 'Webkul\Product\Http\Controllers\ReviewController@index')->defaults('_config', [
'view' => 'admin::customers.reviews.index',
])->name('admin.customer.review.index');
//Customer's addresses routes
Route::get('customers/{id}/addresses', 'Webkul\Admin\Http\Controllers\Customer\AddressController@index')->defaults('_config', [
'view' => 'admin::customers.addresses.index'
'view' => 'admin::customers.addresses.index',
])->name('admin.customer.addresses.index');
Route::get('customers/{id}/addresses/create', 'Webkul\Admin\Http\Controllers\Customer\AddressController@create')->defaults('_config',[
'view' => 'admin::customers.addresses.create'
Route::get('customers/{id}/addresses/create', 'Webkul\Admin\Http\Controllers\Customer\AddressController@create')->defaults('_config', [
'view' => 'admin::customers.addresses.create',
])->name('admin.customer.addresses.create');
Route::post('customers/{id}/addresses/create', 'Webkul\Admin\Http\Controllers\Customer\AddressController@store')->defaults('_config',[
'redirect' => 'admin.customer.addresses.index'
Route::post('customers/{id}/addresses/create', 'Webkul\Admin\Http\Controllers\Customer\AddressController@store')->defaults('_config', [
'redirect' => 'admin.customer.addresses.index',
])->name('admin.customer.addresses.store');
Route::get('customers/addresses/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\AddressController@edit')->defaults('_config',[
'view' => 'admin::customers.addresses.edit'
Route::get('customers/addresses/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\AddressController@edit')->defaults('_config', [
'view' => 'admin::customers.addresses.edit',
])->name('admin.customer.addresses.edit');
Route::put('customers/addresses/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\AddressController@update')->defaults('_config', [
'redirect' => 'admin.customer.addresses.index'
'redirect' => 'admin.customer.addresses.index',
])->name('admin.customer.addresses.update');
Route::post('customers/addresses/delete/{id}', 'Webkul\Admin\Http\Controllers\Customer\AddressController@destroy')->defaults('_config', [
'redirect' => 'admin.customer.addresses.index'
'redirect' => 'admin.customer.addresses.index',
])->name('admin.customer.addresses.delete');
//mass destroy
Route::post('customers/{id}/addresses', 'Webkul\Admin\Http\Controllers\Customer\AddressController@massDestroy')->defaults('_config', [
'redirect' => 'admin.customer.addresses.index'
'redirect' => 'admin.customer.addresses.index',
])->name('admin.customer.addresses.massdelete');
// Configuration routes
Route::get('configuration/{slug?}/{slug2?}', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [
'view' => 'admin::configuration.index'
'view' => 'admin::configuration.index',
])->name('admin.configuration.index');
Route::post('configuration/{slug?}/{slug2?}', 'Webkul\Admin\Http\Controllers\ConfigurationController@store')->defaults('_config', [
'redirect' => 'admin.configuration.index'
'redirect' => 'admin.configuration.index',
])->name('admin.configuration.index.store');
Route::get('configuration/{slug?}/{slug2?}/{path}', 'Webkul\Admin\Http\Controllers\ConfigurationController@download')->defaults('_config', [
'redirect' => 'admin.configuration.index'
'redirect' => 'admin.configuration.index',
])->name('admin.configuration.download');
// Reviews Routes
Route::get('reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@edit')->defaults('_config',[
'view' => 'admin::customers.reviews.edit'
Route::get('reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@edit')->defaults('_config', [
'view' => 'admin::customers.reviews.edit',
])->name('admin.customer.review.edit');
Route::put('reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@update')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
'redirect' => 'admin.customer.review.index',
])->name('admin.customer.review.update');
Route::post('reviews/delete/{id}', 'Webkul\Product\Http\Controllers\ReviewController@destroy')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
'redirect' => 'admin.customer.review.index',
])->name('admin.customer.review.delete');
//mass destroy
Route::post('reviews/massdestroy', 'Webkul\Product\Http\Controllers\ReviewController@massDestroy')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
'redirect' => 'admin.customer.review.index',
])->name('admin.customer.review.massdelete');
//mass update
Route::post('reviews/massupdate', 'Webkul\Product\Http\Controllers\ReviewController@massUpdate')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
'redirect' => 'admin.customer.review.index',
])->name('admin.customer.review.massupdate');
// Customer Groups Routes
Route::get('groups', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@index')->defaults('_config',[
'view' => 'admin::customers.groups.index'
Route::get('groups', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@index')->defaults('_config', [
'view' => 'admin::customers.groups.index',
])->name('admin.groups.index');
Route::get('groups/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@create')->defaults('_config',[
'view' => 'admin::customers.groups.create'
Route::get('groups/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@create')->defaults('_config', [
'view' => 'admin::customers.groups.create',
])->name('admin.groups.create');
Route::post('groups/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@store')->defaults('_config',[
'redirect' => 'admin.groups.index'
Route::post('groups/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@store')->defaults('_config', [
'redirect' => 'admin.groups.index',
])->name('admin.groups.store');
Route::get('groups/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@edit')->defaults('_config',[
'view' => 'admin::customers.groups.edit'
Route::get('groups/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@edit')->defaults('_config', [
'view' => 'admin::customers.groups.edit',
])->name('admin.groups.edit');
Route::put('groups/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@update')->defaults('_config',[
'redirect' => 'admin.groups.index'
Route::put('groups/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@update')->defaults('_config', [
'redirect' => 'admin.groups.index',
])->name('admin.groups.update');
Route::post('groups/delete/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerGroupController@destroy')->name('admin.groups.delete');
@ -176,77 +176,79 @@ Route::group(['middleware' => ['web']], function () {
Route::prefix('sales')->group(function () {
// Sales Order Routes
Route::get('/orders', 'Webkul\Admin\Http\Controllers\Sales\OrderController@index')->defaults('_config', [
'view' => 'admin::sales.orders.index'
'view' => 'admin::sales.orders.index',
])->name('admin.sales.orders.index');
Route::get('/orders/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\OrderController@view')->defaults('_config', [
'view' => 'admin::sales.orders.view'
'view' => 'admin::sales.orders.view',
])->name('admin.sales.orders.view');
Route::get('/orders/cancel/{id}', 'Webkul\Admin\Http\Controllers\Sales\OrderController@cancel')->defaults('_config', [
'view' => 'admin::sales.orders.cancel'
'view' => 'admin::sales.orders.cancel',
])->name('admin.sales.orders.cancel');
Route::post('/orders/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\OrderController@comment')->name('admin.sales.orders.comment');
// Sales Invoices Routes
Route::get('/invoices', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@index')->defaults('_config', [
'view' => 'admin::sales.invoices.index'
'view' => 'admin::sales.invoices.index',
])->name('admin.sales.invoices.index');
Route::get('/invoices/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@create')->defaults('_config', [
'view' => 'admin::sales.invoices.create'
'view' => 'admin::sales.invoices.create',
])->name('admin.sales.invoices.create');
Route::post('/invoices/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@store')->defaults('_config', [
'redirect' => 'admin.sales.orders.view'
'redirect' => 'admin.sales.orders.view',
])->name('admin.sales.invoices.store');
Route::get('/invoices/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@view')->defaults('_config', [
'view' => 'admin::sales.invoices.view'
'view' => 'admin::sales.invoices.view',
])->name('admin.sales.invoices.view');
Route::get('/invoices/print/{id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@print')->defaults('_config', [
'view' => 'admin::sales.invoices.print'
'view' => 'admin::sales.invoices.print',
])->name('admin.sales.invoices.print');
// Sales Shipments Routes
Route::get('/shipments', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@index')->defaults('_config', [
'view' => 'admin::sales.shipments.index'
'view' => 'admin::sales.shipments.index',
])->name('admin.sales.shipments.index');
Route::get('/shipments/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@create')->defaults('_config', [
'view' => 'admin::sales.shipments.create'
'view' => 'admin::sales.shipments.create',
])->name('admin.sales.shipments.create');
Route::post('/shipments/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@store')->defaults('_config', [
'redirect' => 'admin.sales.orders.view'
'redirect' => 'admin.sales.orders.view',
])->name('admin.sales.shipments.store');
Route::get('/shipments/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@view')->defaults('_config', [
'view' => 'admin::sales.shipments.view'
'view' => 'admin::sales.shipments.view',
])->name('admin.sales.shipments.view');
// Sales Redunds Routes
Route::get('/refunds', 'Webkul\Admin\Http\Controllers\Sales\RefundController@index')->defaults('_config', [
'view' => 'admin::sales.refunds.index'
'view' => 'admin::sales.refunds.index',
])->name('admin.sales.refunds.index');
Route::get('/refunds/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\RefundController@create')->defaults('_config', [
'view' => 'admin::sales.refunds.create'
'view' => 'admin::sales.refunds.create',
])->name('admin.sales.refunds.create');
Route::post('/refunds/create/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\RefundController@store')->defaults('_config', [
'redirect' => 'admin.sales.orders.view'
'redirect' => 'admin.sales.orders.view',
])->name('admin.sales.refunds.store');
Route::post('/refunds/update-qty/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\RefundController@updateQty')->defaults('_config', [
'redirect' => 'admin.sales.orders.view'
'redirect' => 'admin.sales.orders.view',
])->name('admin.sales.refunds.update_qty');
Route::get('/refunds/view/{id}', 'Webkul\Admin\Http\Controllers\Sales\RefundController@view')->defaults('_config', [
'view' => 'admin::sales.refunds.view'
'view' => 'admin::sales.refunds.view',
])->name('admin.sales.refunds.view');
});
@ -256,23 +258,23 @@ Route::group(['middleware' => ['web']], function () {
// Catalog Product Routes
Route::get('/products', 'Webkul\Product\Http\Controllers\ProductController@index')->defaults('_config', [
'view' => 'admin::catalog.products.index'
'view' => 'admin::catalog.products.index',
])->name('admin.catalog.products.index');
Route::get('/products/create', 'Webkul\Product\Http\Controllers\ProductController@create')->defaults('_config', [
'view' => 'admin::catalog.products.create'
'view' => 'admin::catalog.products.create',
])->name('admin.catalog.products.create');
Route::post('/products/create', 'Webkul\Product\Http\Controllers\ProductController@store')->defaults('_config', [
'redirect' => 'admin.catalog.products.edit'
'redirect' => 'admin.catalog.products.edit',
])->name('admin.catalog.products.store');
Route::get('/products/edit/{id}', 'Webkul\Product\Http\Controllers\ProductController@edit')->defaults('_config', [
'view' => 'admin::catalog.products.edit'
'view' => 'admin::catalog.products.edit',
])->name('admin.catalog.products.edit');
Route::put('/products/edit/{id}', 'Webkul\Product\Http\Controllers\ProductController@update')->defaults('_config', [
'redirect' => 'admin.catalog.products.index'
'redirect' => 'admin.catalog.products.index',
])->name('admin.catalog.products.update');
Route::post('/products/upload-file/{id}', 'Webkul\Product\Http\Controllers\ProductController@uploadLink')->name('admin.catalog.products.upload_link');
@ -287,44 +289,44 @@ Route::group(['middleware' => ['web']], function () {
//product massdelete
Route::post('products/massdelete', 'Webkul\Product\Http\Controllers\ProductController@massDestroy')->defaults('_config', [
'redirect' => 'admin.catalog.products.index'
'redirect' => 'admin.catalog.products.index',
])->name('admin.catalog.products.massdelete');
//product massupdate
Route::post('products/massupdate', 'Webkul\Product\Http\Controllers\ProductController@massUpdate')->defaults('_config', [
'redirect' => 'admin.catalog.products.index'
'redirect' => 'admin.catalog.products.index',
])->name('admin.catalog.products.massupdate');
//product search for linked products
Route::get('products/search', 'Webkul\Product\Http\Controllers\ProductController@productLinkSearch')->defaults('_config', [
'view' => 'admin::catalog.products.edit'
'view' => 'admin::catalog.products.edit',
])->name('admin.catalog.products.productlinksearch');
Route::get('products/search-simple-products', 'Webkul\Product\Http\Controllers\ProductController@searchSimpleProducts')->name('admin.catalog.products.search_simple_product');
Route::get('/products/{id}/{attribute_id}', 'Webkul\Product\Http\Controllers\ProductController@download')->defaults('_config', [
'view' => 'admin.catalog.products.edit'
'view' => 'admin.catalog.products.edit',
])->name('admin.catalog.products.file.download');
// Catalog Category Routes
Route::get('/categories', 'Webkul\Category\Http\Controllers\CategoryController@index')->defaults('_config', [
'view' => 'admin::catalog.categories.index'
'view' => 'admin::catalog.categories.index',
])->name('admin.catalog.categories.index');
Route::get('/categories/create', 'Webkul\Category\Http\Controllers\CategoryController@create')->defaults('_config', [
'view' => 'admin::catalog.categories.create'
'view' => 'admin::catalog.categories.create',
])->name('admin.catalog.categories.create');
Route::post('/categories/create', 'Webkul\Category\Http\Controllers\CategoryController@store')->defaults('_config', [
'redirect' => 'admin.catalog.categories.index'
'redirect' => 'admin.catalog.categories.index',
])->name('admin.catalog.categories.store');
Route::get('/categories/edit/{id}', 'Webkul\Category\Http\Controllers\CategoryController@edit')->defaults('_config', [
'view' => 'admin::catalog.categories.edit'
'view' => 'admin::catalog.categories.edit',
])->name('admin.catalog.categories.edit');
Route::put('/categories/edit/{id}', 'Webkul\Category\Http\Controllers\CategoryController@update')->defaults('_config', [
'redirect' => 'admin.catalog.categories.index'
'redirect' => 'admin.catalog.categories.index',
])->name('admin.catalog.categories.update');
Route::post('/categories/delete/{id}', 'Webkul\Category\Http\Controllers\CategoryController@destroy')->name('admin.catalog.categories.delete');
@ -332,23 +334,23 @@ Route::group(['middleware' => ['web']], function () {
// Catalog Attribute Routes
Route::get('/attributes', 'Webkul\Attribute\Http\Controllers\AttributeController@index')->defaults('_config', [
'view' => 'admin::catalog.attributes.index'
'view' => 'admin::catalog.attributes.index',
])->name('admin.catalog.attributes.index');
Route::get('/attributes/create', 'Webkul\Attribute\Http\Controllers\AttributeController@create')->defaults('_config', [
'view' => 'admin::catalog.attributes.create'
'view' => 'admin::catalog.attributes.create',
])->name('admin.catalog.attributes.create');
Route::post('/attributes/create', 'Webkul\Attribute\Http\Controllers\AttributeController@store')->defaults('_config', [
'redirect' => 'admin.catalog.attributes.index'
'redirect' => 'admin.catalog.attributes.index',
])->name('admin.catalog.attributes.store');
Route::get('/attributes/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@edit')->defaults('_config', [
'view' => 'admin::catalog.attributes.edit'
'view' => 'admin::catalog.attributes.edit',
])->name('admin.catalog.attributes.edit');
Route::put('/attributes/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@update')->defaults('_config', [
'redirect' => 'admin.catalog.attributes.index'
'redirect' => 'admin.catalog.attributes.index',
])->name('admin.catalog.attributes.update');
Route::post('/attributes/delete/{id}', 'Webkul\Attribute\Http\Controllers\AttributeController@destroy')->name('admin.catalog.attributes.delete');
@ -357,23 +359,23 @@ Route::group(['middleware' => ['web']], function () {
// Catalog Family Routes
Route::get('/families', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@index')->defaults('_config', [
'view' => 'admin::catalog.families.index'
'view' => 'admin::catalog.families.index',
])->name('admin.catalog.families.index');
Route::get('/families/create', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@create')->defaults('_config', [
'view' => 'admin::catalog.families.create'
'view' => 'admin::catalog.families.create',
])->name('admin.catalog.families.create');
Route::post('/families/create', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@store')->defaults('_config', [
'redirect' => 'admin.catalog.families.index'
'redirect' => 'admin.catalog.families.index',
])->name('admin.catalog.families.store');
Route::get('/families/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@edit')->defaults('_config', [
'view' => 'admin::catalog.families.edit'
'view' => 'admin::catalog.families.edit',
])->name('admin.catalog.families.edit');
Route::put('/families/edit/{id}', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@update')->defaults('_config', [
'redirect' => 'admin.catalog.families.index'
'redirect' => 'admin.catalog.families.index',
])->name('admin.catalog.families.update');
Route::post('/families/delete/{id}', 'Webkul\Attribute\Http\Controllers\AttributeFamilyController@destroy')->name('admin.catalog.families.delete');
@ -382,59 +384,59 @@ Route::group(['middleware' => ['web']], function () {
// User Routes
//datagrid for backend users
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
'view' => 'admin::users.users.index'
'view' => 'admin::users.users.index',
])->name('admin.users.index');
//create backend user get
Route::get('/users/create', 'Webkul\User\Http\Controllers\UserController@create')->defaults('_config', [
'view' => 'admin::users.users.create'
'view' => 'admin::users.users.create',
])->name('admin.users.create');
//create backend user post
Route::post('/users/create', 'Webkul\User\Http\Controllers\UserController@store')->defaults('_config', [
'redirect' => 'admin.users.index'
'redirect' => 'admin.users.index',
])->name('admin.users.store');
//delete backend user view
Route::get('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@edit')->defaults('_config', [
'view' => 'admin::users.users.edit'
'view' => 'admin::users.users.edit',
])->name('admin.users.edit');
//edit backend user submit
Route::put('/users/edit/{id}', 'Webkul\User\Http\Controllers\UserController@update')->defaults('_config', [
'redirect' => 'admin.users.index'
'redirect' => 'admin.users.index',
])->name('admin.users.update');
//delete backend user
Route::post('/users/delete/{id}', 'Webkul\User\Http\Controllers\UserController@destroy')->name('admin.users.delete');
Route::get('/users/confirm/{id}', 'Webkul\User\Http\Controllers\UserController@confirm')->defaults('_config', [
'view' => 'admin::customers.confirm-password'
'view' => 'admin::customers.confirm-password',
])->name('super.users.confirm');
Route::post('/users/confirm/{id}', 'Webkul\User\Http\Controllers\UserController@destroySelf')->defaults('_config', [
'redirect' => 'admin.users.index'
'redirect' => 'admin.users.index',
])->name('admin.users.destroy');
// User Role Routes
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
'view' => 'admin::users.roles.index'
'view' => 'admin::users.roles.index',
])->name('admin.roles.index');
Route::get('/roles/create', 'Webkul\User\Http\Controllers\RoleController@create')->defaults('_config', [
'view' => 'admin::users.roles.create'
'view' => 'admin::users.roles.create',
])->name('admin.roles.create');
Route::post('/roles/create', 'Webkul\User\Http\Controllers\RoleController@store')->defaults('_config', [
'redirect' => 'admin.roles.index'
'redirect' => 'admin.roles.index',
])->name('admin.roles.store');
Route::get('/roles/edit/{id}', 'Webkul\User\Http\Controllers\RoleController@edit')->defaults('_config', [
'view' => 'admin::users.roles.edit'
'view' => 'admin::users.roles.edit',
])->name('admin.roles.edit');
Route::put('/roles/edit/{id}', 'Webkul\User\Http\Controllers\RoleController@update')->defaults('_config', [
'redirect' => 'admin.roles.index'
'redirect' => 'admin.roles.index',
])->name('admin.roles.update');
Route::post('/roles/delete/{id}', 'Webkul\User\Http\Controllers\RoleController@destroy')->name('admin.roles.delete');
@ -442,23 +444,23 @@ Route::group(['middleware' => ['web']], function () {
// Locale Routes
Route::get('/locales', 'Webkul\Core\Http\Controllers\LocaleController@index')->defaults('_config', [
'view' => 'admin::settings.locales.index'
'view' => 'admin::settings.locales.index',
])->name('admin.locales.index');
Route::get('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@create')->defaults('_config', [
'view' => 'admin::settings.locales.create'
'view' => 'admin::settings.locales.create',
])->name('admin.locales.create');
Route::post('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@store')->defaults('_config', [
'redirect' => 'admin.locales.index'
'redirect' => 'admin.locales.index',
])->name('admin.locales.store');
Route::get('/locales/edit/{id}', 'Webkul\Core\Http\Controllers\LocaleController@edit')->defaults('_config', [
'view' => 'admin::settings.locales.edit'
'view' => 'admin::settings.locales.edit',
])->name('admin.locales.edit');
Route::put('/locales/edit/{id}', 'Webkul\Core\Http\Controllers\LocaleController@update')->defaults('_config', [
'redirect' => 'admin.locales.index'
'redirect' => 'admin.locales.index',
])->name('admin.locales.update');
Route::post('/locales/delete/{id}', 'Webkul\Core\Http\Controllers\LocaleController@destroy')->name('admin.locales.delete');
@ -466,23 +468,23 @@ Route::group(['middleware' => ['web']], function () {
// Currency Routes
Route::get('/currencies', 'Webkul\Core\Http\Controllers\CurrencyController@index')->defaults('_config', [
'view' => 'admin::settings.currencies.index'
'view' => 'admin::settings.currencies.index',
])->name('admin.currencies.index');
Route::get('/currencies/create', 'Webkul\Core\Http\Controllers\CurrencyController@create')->defaults('_config', [
'view' => 'admin::settings.currencies.create'
'view' => 'admin::settings.currencies.create',
])->name('admin.currencies.create');
Route::post('/currencies/create', 'Webkul\Core\Http\Controllers\CurrencyController@store')->defaults('_config', [
'redirect' => 'admin.currencies.index'
'redirect' => 'admin.currencies.index',
])->name('admin.currencies.store');
Route::get('/currencies/edit/{id}', 'Webkul\Core\Http\Controllers\CurrencyController@edit')->defaults('_config', [
'view' => 'admin::settings.currencies.edit'
'view' => 'admin::settings.currencies.edit',
])->name('admin.currencies.edit');
Route::put('/currencies/edit/{id}', 'Webkul\Core\Http\Controllers\CurrencyController@update')->defaults('_config', [
'redirect' => 'admin.currencies.index'
'redirect' => 'admin.currencies.index',
])->name('admin.currencies.update');
Route::post('/currencies/delete/{id}', 'Webkul\Core\Http\Controllers\CurrencyController@destroy')->name('admin.currencies.delete');
@ -492,25 +494,25 @@ Route::group(['middleware' => ['web']], function () {
// Exchange Rates Routes
Route::get('/exchange_rates', 'Webkul\Core\Http\Controllers\ExchangeRateController@index')->defaults('_config', [
'view' => 'admin::settings.exchange_rates.index'
'view' => 'admin::settings.exchange_rates.index',
])->name('admin.exchange_rates.index');
Route::get('/exchange_rates/create', 'Webkul\Core\Http\Controllers\ExchangeRateController@create')->defaults('_config', [
'view' => 'admin::settings.exchange_rates.create'
'view' => 'admin::settings.exchange_rates.create',
])->name('admin.exchange_rates.create');
Route::post('/exchange_rates/create', 'Webkul\Core\Http\Controllers\ExchangeRateController@store')->defaults('_config', [
'redirect' => 'admin.exchange_rates.index'
'redirect' => 'admin.exchange_rates.index',
])->name('admin.exchange_rates.store');
Route::get('/exchange_rates/edit/{id}', 'Webkul\Core\Http\Controllers\ExchangeRateController@edit')->defaults('_config', [
'view' => 'admin::settings.exchange_rates.edit'
'view' => 'admin::settings.exchange_rates.edit',
])->name('admin.exchange_rates.edit');
Route::get('/exchange_rates/update-rates/{service}', 'Webkul\Core\Http\Controllers\ExchangeRateController@updateRates')->name('admin.exchange_rates.update-rates');
Route::get('/exchange_rates/update-rates', 'Webkul\Core\Http\Controllers\ExchangeRateController@updateRates')->name('admin.exchange_rates.update_rates');
Route::put('/exchange_rates/edit/{id}', 'Webkul\Core\Http\Controllers\ExchangeRateController@update')->defaults('_config', [
'redirect' => 'admin.exchange_rates.index'
'redirect' => 'admin.exchange_rates.index',
])->name('admin.exchange_rates.update');
Route::post('/exchange_rates/delete/{id}', 'Webkul\Core\Http\Controllers\ExchangeRateController@destroy')->name('admin.exchange_rates.delete');
@ -518,46 +520,46 @@ Route::group(['middleware' => ['web']], function () {
// Inventory Source Routes
Route::get('/inventory_sources', 'Webkul\Inventory\Http\Controllers\InventorySourceController@index')->defaults('_config', [
'view' => 'admin::settings.inventory_sources.index'
'view' => 'admin::settings.inventory_sources.index',
])->name('admin.inventory_sources.index');
Route::get('/inventory_sources/create', 'Webkul\Inventory\Http\Controllers\InventorySourceController@create')->defaults('_config', [
'view' => 'admin::settings.inventory_sources.create'
'view' => 'admin::settings.inventory_sources.create',
])->name('admin.inventory_sources.create');
Route::post('/inventory_sources/create', 'Webkul\Inventory\Http\Controllers\InventorySourceController@store')->defaults('_config', [
'redirect' => 'admin.inventory_sources.index'
'redirect' => 'admin.inventory_sources.index',
])->name('admin.inventory_sources.store');
Route::get('/inventory_sources/edit/{id}', 'Webkul\Inventory\Http\Controllers\InventorySourceController@edit')->defaults('_config', [
'view' => 'admin::settings.inventory_sources.edit'
'view' => 'admin::settings.inventory_sources.edit',
])->name('admin.inventory_sources.edit');
Route::put('/inventory_sources/edit/{id}', 'Webkul\Inventory\Http\Controllers\InventorySourceController@update')->defaults('_config', [
'redirect' => 'admin.inventory_sources.index'
'redirect' => 'admin.inventory_sources.index',
])->name('admin.inventory_sources.update');
Route::post('/inventory_sources/delete/{id}', 'Webkul\Inventory\Http\Controllers\InventorySourceController@destroy')->name('admin.inventory_sources.delete');
// Channel Routes
Route::get('/channels', 'Webkul\Core\Http\Controllers\ChannelController@index')->defaults('_config', [
'view' => 'admin::settings.channels.index'
'view' => 'admin::settings.channels.index',
])->name('admin.channels.index');
Route::get('/channels/create', 'Webkul\Core\Http\Controllers\ChannelController@create')->defaults('_config', [
'view' => 'admin::settings.channels.create'
'view' => 'admin::settings.channels.create',
])->name('admin.channels.create');
Route::post('/channels/create', 'Webkul\Core\Http\Controllers\ChannelController@store')->defaults('_config', [
'redirect' => 'admin.channels.index'
'redirect' => 'admin.channels.index',
])->name('admin.channels.store');
Route::get('/channels/edit/{id}', 'Webkul\Core\Http\Controllers\ChannelController@edit')->defaults('_config', [
'view' => 'admin::settings.channels.edit'
'view' => 'admin::settings.channels.edit',
])->name('admin.channels.edit');
Route::put('/channels/edit/{id}', 'Webkul\Core\Http\Controllers\ChannelController@update')->defaults('_config', [
'redirect' => 'admin.channels.index'
'redirect' => 'admin.channels.index',
])->name('admin.channels.update');
Route::post('/channels/delete/{id}', 'Webkul\Core\Http\Controllers\ChannelController@destroy')->name('admin.channels.delete');
@ -565,51 +567,51 @@ Route::group(['middleware' => ['web']], function () {
// Admin Profile route
Route::get('/account', 'Webkul\User\Http\Controllers\AccountController@edit')->defaults('_config', [
'view' => 'admin::account.edit'
'view' => 'admin::account.edit',
])->name('admin.account.edit');
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
// Admin Store Front Settings Route
Route::get('/subscribers','Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config',[
'view' => 'admin::customers.subscribers.index'
Route::get('/subscribers', 'Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config', [
'view' => 'admin::customers.subscribers.index',
])->name('admin.customers.subscribers.index');
//destroy a newsletter subscription item
Route::post('subscribers/delete/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@destroy')->name('admin.customers.subscribers.delete');
Route::get('subscribers/edit/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@edit')->defaults('_config', [
'view' => 'admin::customers.subscribers.edit'
'view' => 'admin::customers.subscribers.edit',
])->name('admin.customers.subscribers.edit');
Route::put('subscribers/update/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@update')->defaults('_config', [
'redirect' => 'admin.customers.subscribers.index'
'redirect' => 'admin.customers.subscribers.index',
])->name('admin.customers.subscribers.update');
//slider index
Route::get('/slider','Webkul\Core\Http\Controllers\SliderController@index')->defaults('_config',[
'view' => 'admin::settings.sliders.index'
Route::get('/slider', 'Webkul\Core\Http\Controllers\SliderController@index')->defaults('_config', [
'view' => 'admin::settings.sliders.index',
])->name('admin.sliders.index');
//slider create show
Route::get('slider/create','Webkul\Core\Http\Controllers\SliderController@create')->defaults('_config',[
'view' => 'admin::settings.sliders.create'
Route::get('slider/create', 'Webkul\Core\Http\Controllers\SliderController@create')->defaults('_config', [
'view' => 'admin::settings.sliders.create',
])->name('admin.sliders.create');
//slider create show
Route::post('slider/create','Webkul\Core\Http\Controllers\SliderController@store')->defaults('_config',[
'redirect' => 'admin.sliders.index'
Route::post('slider/create', 'Webkul\Core\Http\Controllers\SliderController@store')->defaults('_config', [
'redirect' => 'admin.sliders.index',
])->name('admin.sliders.store');
//slider edit show
Route::get('slider/edit/{id}','Webkul\Core\Http\Controllers\SliderController@edit')->defaults('_config',[
'view' => 'admin::settings.sliders.edit'
Route::get('slider/edit/{id}', 'Webkul\Core\Http\Controllers\SliderController@edit')->defaults('_config', [
'view' => 'admin::settings.sliders.edit',
])->name('admin.sliders.edit');
//slider edit update
Route::post('slider/edit/{id}','Webkul\Core\Http\Controllers\SliderController@update')->defaults('_config',[
'redirect' => 'admin.sliders.index'
Route::post('slider/edit/{id}', 'Webkul\Core\Http\Controllers\SliderController@update')->defaults('_config', [
'redirect' => 'admin.sliders.index',
])->name('admin.sliders.update');
//destroy a slider item
@ -617,25 +619,25 @@ Route::group(['middleware' => ['web']], function () {
//tax routes
Route::get('/tax-categories', 'Webkul\Tax\Http\Controllers\TaxController@index')->defaults('_config', [
'view' => 'admin::tax.tax-categories.index'
'view' => 'admin::tax.tax-categories.index',
])->name('admin.tax-categories.index');
// tax category routes
Route::get('/tax-categories/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@show')->defaults('_config', [
'view' => 'admin::tax.tax-categories.create'
'view' => 'admin::tax.tax-categories.create',
])->name('admin.tax-categories.show');
Route::post('/tax-categories/create', 'Webkul\Tax\Http\Controllers\TaxCategoryController@create')->defaults('_config', [
'redirect' => 'admin.tax-categories.index'
'redirect' => 'admin.tax-categories.index',
])->name('admin.tax-categories.create');
Route::get('/tax-categories/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@edit')->defaults('_config', [
'view' => 'admin::tax.tax-categories.edit'
'view' => 'admin::tax.tax-categories.edit',
])->name('admin.tax-categories.edit');
Route::put('/tax-categories/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@update')->defaults('_config', [
'redirect' => 'admin.tax-categories.index'
'redirect' => 'admin.tax-categories.index',
])->name('admin.tax-categories.update');
Route::post('/tax-categories/delete/{id}', 'Webkul\Tax\Http\Controllers\TaxCategoryController@destroy')->name('admin.tax-categories.delete');
@ -644,29 +646,29 @@ Route::group(['middleware' => ['web']], function () {
//tax rate
Route::get('tax-rates', 'Webkul\Tax\Http\Controllers\TaxRateController@index')->defaults('_config', [
'view' => 'admin::tax.tax-rates.index'
'view' => 'admin::tax.tax-rates.index',
])->name('admin.tax-rates.index');
Route::get('tax-rates/create', 'Webkul\Tax\Http\Controllers\TaxRateController@show')->defaults('_config', [
'view' => 'admin::tax.tax-rates.create'
'view' => 'admin::tax.tax-rates.create',
])->name('admin.tax-rates.show');
Route::post('tax-rates/create', 'Webkul\Tax\Http\Controllers\TaxRateController@create')->defaults('_config', [
'redirect' => 'admin.tax-rates.index'
'redirect' => 'admin.tax-rates.index',
])->name('admin.tax-rates.create');
Route::get('tax-rates/edit/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@edit')->defaults('_config', [
'view' => 'admin::tax.tax-rates.edit'
'view' => 'admin::tax.tax-rates.edit',
])->name('admin.tax-rates.store');
Route::put('tax-rates/update/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@update')->defaults('_config', [
'redirect' => 'admin.tax-rates.index'
'redirect' => 'admin.tax-rates.index',
])->name('admin.tax-rates.update');
Route::post('/tax-rates/delete/{id}', 'Webkul\Tax\Http\Controllers\TaxRateController@destroy')->name('admin.tax-rates.delete');
Route::post('/tax-rates/import', 'Webkul\Tax\Http\Controllers\TaxRateController@import')->defaults('_config', [
'redirect' => 'admin.tax-rates.index'
'redirect' => 'admin.tax-rates.index',
])->name('admin.tax-rates.import');
//tax rate ends
@ -675,23 +677,27 @@ Route::group(['middleware' => ['web']], function () {
Route::prefix('promotions')->group(function () {
Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.index'
'view' => 'admin::promotions.cart-rules.index',
])->name('admin.cart-rules.index');
Route::get('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@create')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.create'
'view' => 'admin::promotions.cart-rules.create',
])->name('admin.cart-rules.create');
Route::post('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@store')->defaults('_config', [
'redirect' => 'admin.cart-rules.index'
'redirect' => 'admin.cart-rules.index',
])->name('admin.cart-rules.store');
Route::get('cart-rules/copy/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@copy')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.edit',
])->name('admin.cart-rules.copy');
Route::get('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@edit')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.edit'
'view' => 'admin::promotions.cart-rules.edit',
])->name('admin.cart-rules.edit');
Route::post('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@update')->defaults('_config', [
'redirect' => 'admin.cart-rules.index'
'redirect' => 'admin.cart-rules.index',
])->name('admin.cart-rules.update');
Route::post('cart-rules/delete/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@destroy')->name('admin.cart-rules.delete');
@ -703,23 +709,23 @@ Route::group(['middleware' => ['web']], function () {
//Catalog rules
Route::get('catalog-rules', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@index')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.index'
'view' => 'admin::promotions.catalog-rules.index',
])->name('admin.catalog-rules.index');
Route::get('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@create')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.create'
'view' => 'admin::promotions.catalog-rules.create',
])->name('admin.catalog-rules.create');
Route::post('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@store')->defaults('_config', [
'redirect' => 'admin.catalog-rules.index'
'redirect' => 'admin.catalog-rules.index',
])->name('admin.catalog-rules.store');
Route::get('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.edit'
'view' => 'admin::promotions.catalog-rules.edit',
])->name('admin.catalog-rules.edit');
Route::post('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@update')->defaults('_config', [
'redirect' => 'admin.catalog-rules.index'
'redirect' => 'admin.catalog-rules.index',
])->name('admin.catalog-rules.update');
Route::post('catalog-rules/delete/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rules.delete');
@ -727,32 +733,32 @@ Route::group(['middleware' => ['web']], function () {
Route::prefix('cms')->group(function () {
Route::get('/', 'Webkul\CMS\Http\Controllers\Admin\PageController@index')->defaults('_config', [
'view' => 'admin::cms.index'
'view' => 'admin::cms.index',
])->name('admin.cms.index');
Route::get('create', 'Webkul\CMS\Http\Controllers\Admin\PageController@create')->defaults('_config', [
'view' => 'admin::cms.create'
'view' => 'admin::cms.create',
])->name('admin.cms.create');
Route::post('create', 'Webkul\CMS\Http\Controllers\Admin\PageController@store')->defaults('_config', [
'redirect' => 'admin.cms.index'
'redirect' => 'admin.cms.index',
])->name('admin.cms.store');
Route::get('edit/{id}', 'Webkul\CMS\Http\Controllers\Admin\PageController@edit')->defaults('_config', [
'view' => 'admin::cms.edit'
'view' => 'admin::cms.edit',
])->name('admin.cms.edit');
Route::post('edit/{id}', 'Webkul\CMS\Http\Controllers\Admin\PageController@update')->defaults('_config', [
'redirect' => 'admin.cms.index'
'redirect' => 'admin.cms.index',
])->name('admin.cms.update');
Route::post('/delete/{id}', 'Webkul\CMS\Http\Controllers\Admin\PageController@delete')->defaults('_config', [
'redirect' => 'admin.cms.index'
'redirect' => 'admin.cms.index',
])->name('admin.cms.delete');
Route::post('/massdelete', 'Webkul\CMS\Http\Controllers\Admin\PageController@massDelete')->defaults('_config', [
'redirect' => 'admin.cms.index'
'redirect' => 'admin.cms.index',
])->name('admin.cms.mass-delete');
// Route::post('/delete/{id}', 'Webkul\CMS\Http\Controllers\Admin\PageController@delete')->defaults('_config', [

View File

@ -10,6 +10,7 @@ use Webkul\Admin\Mail\NewShipmentNotification;
use Webkul\Admin\Mail\NewInventorySourceNotification;
use Webkul\Admin\Mail\CancelOrderNotification;
use Webkul\Admin\Mail\NewRefundNotification;
use Webkul\Admin\Mail\OrderCommentNotification;
class Order
{
@ -124,4 +125,21 @@ class Order
report($e);
}
}
/**
* @param \Webkul\Sales\Contracts\OrderComment $comment
* @return void
*/
public function sendOrderCommentMail($comment)
{
if (! $comment->customer_notified) {
return;
}
try {
Mail::queue(new OrderCommentNotification($comment));
} catch (\Exception $e) {
report($e);
}
}
}

View File

@ -0,0 +1,44 @@
<?php
namespace Webkul\Admin\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class OrderCommentNotification extends Mailable
{
use Queueable, SerializesModels;
/**
* The order comment instance.
*
* @var \Webkul\Sales\Contracts\OrderComment $comment
*/
public $comment;
/**
* Create a new message instance.
*
* @param \Webkul\Sales\Contracts\OrderComment $comment
* @return void
*/
public function __construct($comment)
{
$this->comment = $comment;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
->to($this->comment->order->customer_email, $this->comment->order->customer_full_name)
->subject(trans('shop::app.mail.order.comment.subject'))
->view('shop::emails.sales.new-order-comment');
}
}

View File

@ -3,9 +3,6 @@
namespace Webkul\Admin\Providers;
use Illuminate\Support\ServiceProvider;
use Webkul\Admin\Providers\EventServiceProvider;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Webkul\Admin\Exceptions\Handler;
use Webkul\Core\Tree;
class AdminServiceProvider extends ServiceProvider
@ -32,11 +29,6 @@ class AdminServiceProvider extends ServiceProvider
$this->registerACL();
$this->app->register(EventServiceProvider::class);
$this->app->bind(
ExceptionHandler::class,
Handler::class
);
}
/**
@ -96,7 +88,7 @@ class AdminServiceProvider extends ServiceProvider
view()->composer(['admin::users.roles.create', 'admin::users.roles.edit'], function ($view) {
$view->with('acl', $this->createACL());
});
view()->composer(['admin::catalog.products.create'], function ($view) {
$items = array();

View File

@ -23,5 +23,7 @@ class EventServiceProvider extends ServiceProvider
Event::listen('sales.order.cancel.after','Webkul\Admin\Listeners\Order@sendCancelOrderMail');
Event::listen('sales.refund.save.after','Webkul\Admin\Listeners\Order@sendNewRefundMail');
Event::listen('sales.order.comment.create.after','Webkul\Admin\Listeners\Order@sendOrderCommentMail');
}
}

View File

@ -1,5 +1,7 @@
import Vue from 'vue';
import VeeValidate from 'vee-validate';
import VeeValidate, { Validator } from 'vee-validate';
import de from 'vee-validate/dist/locale/de';
import ar from 'vee-validate/dist/locale/ar';
import './bootstrap';
@ -7,6 +9,10 @@ window.Vue = Vue;
window.VeeValidate = VeeValidate;
Vue.use(VeeValidate, {
dictionary: {
ar: ar,
de: de,
},
events: 'input|change|blur',
});
Vue.prototype.$http = axios
@ -30,6 +36,8 @@ $(document).ready(function () {
mounted() {
this.addServerErrors();
this.addFlashMessages();
this.$validator.localize(document.documentElement.lang);
},
methods: {
@ -90,7 +98,7 @@ $(document).ready(function () {
if (typeof flashMessages == 'undefined') {
return;
};
const flashes = this.$refs.flashes;
flashMessages.forEach(function(flash) {

View File

@ -3,6 +3,17 @@
margin-bottom: 0 !important;
padding-bottom: 15px;
border-bottom: 1px solid $border-color;
.control-group {
span {
width: 100%;
}
&.date::after {
margin-top: -13px;
left: 100%;
}
}
}
.page-content {

View File

@ -66,6 +66,14 @@ body {
cursor: pointer;
position: relative;
.app-version {
padding: 10px 20px 0px 20px;
margin-bottom: -10px;
display: block;
cursor: default;
color: #a2a2a2;
}
.dropdown-list {
top: 63px;
right: 0px !important;

View File

@ -48,8 +48,33 @@
}
}
.summary-comment-container {
.comment-container {
margin-top: 20px;
float: left;
.comment-list {
margin-top: 40px;
li {
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
p {
margin: 0;
margin-top: 5px;
color: #8e8e8e;
}
}
}
}
}
.sale-summary {
margin-top: 2%;
margin-top: 20px;
height: 130px;
float: right;

View File

@ -41,6 +41,7 @@ return [
],
'layouts' => [
'app-version' => 'Version : :version',
'my-account' => 'حسابي',
'logout' => 'خروج',
'visit-shop' => 'قم بزيارة المتجر',
@ -369,7 +370,11 @@ return [
'total-due' => 'المجموع المستحق',
'cancel-confirm-msg' => 'هل أنت متأكد من أنك تريد إلغاء هذا الطلب ؟',
'refunds' => 'المبالغ المستردة',
'refunded' => 'تم رد الأموال'
'refunded' => 'تم رد الأموال',
'comment-added-success' => 'Comment addded successfully.',
'comment' => 'Comment',
'submit-comment' => 'Submit Comment',
'notify-customer' => 'Notify Customer',
],
'invoices' => [
@ -408,6 +413,7 @@ return [
'add-title' => 'أنشئ شحنة',
'save-btn-title' => 'احفظ الشحنة',
'qty-ordered' => 'أمر qty',
'qty-invoiced' => 'Qty Invoiced',
'qty-to-ship' => 'من كيوتي إلى السفينة',
'available-sources' => 'المصادر المتاحة',
'source' => 'المصدر',
@ -727,7 +733,7 @@ return [
'target_currency' => 'العملة المستهدفة',
'rate' => 'معدل',
'exchange-class-not-found' => ':service لم يتم العثور على فئة سعر الصرف آسيف',
'update-rates' => ':service تحديث الأسعار باستخدام ',
'update-rates' => 'الأسعار',
'create-success' => 'تم إنشاء سعر الصرف بنجاح',
'update-success' => 'تم تحديث سعر الصرف بنجاح',
'delete-success' => 'تم حذف سعر الصرف بنجاح',
@ -1303,7 +1309,35 @@ return [
'all-channels' => 'الكل',
'all-locales' => 'الكل',
'invoice-slip-design' => 'Invoice Slip Design',
'logo' => 'logo'
'logo' => 'Logo',
'storefront' => 'Storefront',
'default-list-mode' => 'Default List Mode',
'grid' => 'Grid',
'list' => 'List',
'products-per-page' => 'Products Per Page',
'sort-by' => 'Sort By',
'from-z-a' => 'From Z-A',
'from-a-z' => 'From A-Z',
'newest-first' => 'Newest First',
'oldest-first' => 'Oldest First',
'cheapest-first' => 'Cheapest First',
'expensive-first' => 'Expensive First',
'comma-seperated' => 'Comma Seperated',
'favicon' => 'Favicon',
'seo' => 'SEO',
'rich-snippets' => 'Rich Snippets',
'products' => 'Products',
'enable' => 'Enable',
'show-weight' => 'Show Weight',
'show-categories' => 'Show Categories',
'show-images' => 'Show Images',
'show-reviews' => 'Show Reviews',
'show-ratings' => 'Show Ratings',
'show-offers' => 'Show Offers',
'show-sku' => 'Show SKU',
'categories' => 'Categories',
'show-sku' => 'Show SKU',
'show-search-input-field' => 'Show Search Input Field'
]
]
];

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@ return [
],
'layouts' => [
'app-version' => 'Version : :version',
'my-account' => 'My Account',
'logout' => 'Logout',
'visit-shop' => 'Visit Shop',
@ -150,6 +151,7 @@ return [
'code' => 'Code',
'admin-name' => 'Name',
'name' => 'Name',
'copy' => 'Copy',
'direction' => 'Direction',
'fullname' => 'Full Name',
'type' => 'Type',
@ -370,7 +372,13 @@ return [
'total-due' => 'Total Due',
'cancel-confirm-msg' => 'Are you sure you want to cancel this order ?',
'refund-btn-title' => 'Refund',
'refunds' => 'Refunds'
'refunds' => 'Refunds',
'comment-added-success' => 'Comment addded successfully.',
'comment' => 'Comment',
'submit-comment' => 'Submit Comment',
'notify-customer' => 'Notify Customer',
'customer-notified' => ':date | Customer <b>Notified</b>',
'customer-not-notified' => ':date | Customer <b>Not Notified</b>'
],
'invoices' => [
@ -409,6 +417,7 @@ return [
'add-title' => 'Create Shipment',
'save-btn-title' => 'Save Shipment',
'qty-ordered' => 'Qty Ordered',
'qty-invoiced' => 'Qty Invoiced',
'qty-to-ship' => 'Qty to Ship',
'available-sources' => 'Available Sources',
'source' => 'Source',
@ -728,7 +737,7 @@ return [
'target_currency' => 'Target Currency',
'rate' => 'Rate',
'exchange-class-not-found' => ':service exchange rate class not found',
'update-rates' => 'Update rates using :service',
'update-rates' => 'Update Rates',
'create-success' => 'Exchange Rate created successfully.',
'update-success' => 'Exchange Rate updated successfully.',
'delete-success' => 'Exchange Rate deleted successfully.',
@ -893,6 +902,7 @@ return [
'address-list' => 'Address\'s List',
'order-list' => 'Order\'s List',
'address-id' => 'Address ID',
'company-name' => 'Company Name',
'address-1' => 'Address 1',
'city' => 'City',
'state-name' => 'State',
@ -1306,10 +1316,39 @@ return [
'order-number-suffix' => 'Order Number Suffix',
'default' => 'Default',
'sandbox' => 'Sandbox',
'all-channels' => 'All',
'all-locales' => 'All',
'all-channels' => 'All Channels',
'all-locales' => 'All Locales',
'all-customer-groups' => 'All Customer groups',
'invoice-slip-design' => 'Invoice Slip Design',
'logo' => 'logo'
'logo' => 'Logo',
'storefront' => 'Storefront',
'default-list-mode' => 'Default List Mode',
'grid' => 'Grid',
'list' => 'List',
'products-per-page' => 'Products Per Page',
'sort-by' => 'Sort By',
'from-z-a' => 'From Z-A',
'from-a-z' => 'From A-Z',
'newest-first' => 'Newest First',
'oldest-first' => 'Oldest First',
'cheapest-first' => 'Cheapest First',
'expensive-first' => 'Expensive First',
'comma-seperated' => 'Comma Seperated',
'favicon' => 'Favicon',
'seo' => 'SEO',
'rich-snippets' => 'Rich Snippets',
'products' => 'Products',
'enable' => 'Enable',
'show-weight' => 'Show Weight',
'show-categories' => 'Show Categories',
'show-images' => 'Show Images',
'show-reviews' => 'Show Reviews',
'show-ratings' => 'Show Ratings',
'show-offers' => 'Show Offers',
'show-sku' => 'Show SKU',
'categories' => 'Categories',
'show-sku' => 'Show SKU',
'show-search-input-field' => 'Show Search Input Field'
]
]
];

View File

@ -42,6 +42,7 @@ return [
],
'layouts' => [
'app-version' => 'Version : :version',
'account' => 'حساب',
'my-account' => 'پروفایل من',
'logout' => 'خروج',
@ -370,7 +371,11 @@ return [
'cancel-confirm-msg' => 'مطمئن هستید که می خواهید این سفارش را لغو کنید ؟',
'refunds' => 'بازپرداخت',
'refund-btn-title' => 'بازپرداخت',
'refunded' => 'بازپرداخت'
'refunded' => 'بازپرداخت',
'comment-added-success' => 'Comment addded successfully.',
'comment' => 'Comment',
'submit-comment' => 'Submit Comment',
'notify-customer' => 'Notify Customer',
],
'invoices' => [
@ -409,6 +414,7 @@ return [
'add-title' => 'ایجاد حمل و نقل',
'save-btn-title' => 'ذخیره حمل و نقل',
'qty-ordered' => 'سفارش داده شده',
'qty-invoiced' => 'Qty Invoiced',
'qty-to-ship' => 'مقدار به کشتی',
'available-sources' => 'منابع موجود',
'source' => 'منابع',
@ -728,7 +734,7 @@ return [
'target_currency' => 'هدف ارز',
'rate' => 'نرخ',
'exchange-class-not-found' => 'کلاس نرخ ارز :service یافت نشد',
'update-rates' => ' به روز کنید :service نرخ ها را با استفاده از',
'update-rates' => 'نرخ ها را به روز کنید',
'create-success' => 'نرخ ارز با موفقیت ایجاد شد.',
'update-success' => 'نرخ ارز با موفقیت به روز شد.',
'delete-success' => 'نرخ ارز با موفقیت حذف شد.',
@ -1310,7 +1316,35 @@ return [
'all-locales' => 'همه',
'sandbox' => 'Sandbox',
'invoice-slip-design' => 'Invoice Slip Design',
'logo' => 'logo'
'logo' => 'Logo',
'storefront' => 'Storefront',
'default-list-mode' => 'Default List Mode',
'grid' => 'Grid',
'list' => 'List',
'products-per-page' => 'Products Per Page',
'sort-by' => 'Sort By',
'from-z-a' => 'From Z-A',
'from-a-z' => 'From A-Z',
'newest-first' => 'Newest First',
'oldest-first' => 'Oldest First',
'cheapest-first' => 'Cheapest First',
'expensive-first' => 'Expensive First',
'comma-seperated' => 'Comma Seperated',
'favicon' => 'Favicon',
'seo' => 'SEO',
'rich-snippets' => 'Rich Snippets',
'products' => 'Products',
'enable' => 'Enable',
'show-weight' => 'Show Weight',
'show-categories' => 'Show Categories',
'show-images' => 'Show Images',
'show-reviews' => 'Show Reviews',
'show-ratings' => 'Show Ratings',
'show-offers' => 'Show Offers',
'show-sku' => 'Show SKU',
'categories' => 'Categories',
'show-sku' => 'Show SKU',
'show-search-input-field' => 'Show Search Input Field'
]
]
];

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@ return [
],
'layouts' => [
'app-version' => 'Version : :version',
'my-account' => 'Mijn Profiel',
'logout' => 'Afmelden',
'visit-shop' => 'Winkel Bezoeken',
@ -370,7 +371,11 @@ return [
'total-due' => 'Total Due',
'cancel-confirm-msg' => 'Weet u zeker dat u deze bestelling wilt annuleren ?',
'refund-btn-title' => 'Terugbetaling',
'refunds' => 'Terugbetalingen'
'refunds' => 'Terugbetalingen',
'comment-added-success' => 'Comment addded successfully.',
'comment' => 'Comment',
'submit-comment' => 'Submit Comment',
'notify-customer' => 'Notify Customer',
],
'invoices' => [
@ -409,6 +414,7 @@ return [
'add-title' => 'Zending maken',
'save-btn-title' => 'Zending opslaan',
'qty-ordered' => 'Besteld aantal',
'qty-invoiced' => 'Qty Invoiced',
'qty-to-ship' => 'Te verzenden',
'available-sources' => 'Beschikbare bronnen',
'source' => 'Bron',
@ -728,7 +734,7 @@ return [
'target_currency' => 'Valuta doel',
'rate' => 'Tarief',
'exchange-class-not-found' => ':service wisselkoersklasse niet gevonden',
'update-rates' => 'Tarieven bijwerken met :service',
'update-rates' => 'Tarieven bijwerken',
'create-success' => 'Wisselkoers succesvol aangemaakt.',
'update-success' => 'Wisselkoers succesvol bijgewerkt.',
'delete-success' => 'Wisselkoers succesvol verwijderd.',
@ -1309,7 +1315,35 @@ return [
'all-channels' => 'Alles',
'all-locales' => 'Alles',
'invoice-slip-design' => 'Invoice Slip Design',
'logo' => 'logo'
'logo' => 'Logo',
'storefront' => 'Storefront',
'default-list-mode' => 'Default List Mode',
'grid' => 'Grid',
'list' => 'List',
'products-per-page' => 'Products Per Page',
'sort-by' => 'Sort By',
'from-z-a' => 'From Z-A',
'from-a-z' => 'From A-Z',
'newest-first' => 'Newest First',
'oldest-first' => 'Oldest First',
'cheapest-first' => 'Cheapest First',
'expensive-first' => 'Expensive First',
'comma-seperated' => 'Comma Seperated',
'favicon' => 'Favicon',
'seo' => 'SEO',
'rich-snippets' => 'Rich Snippets',
'products' => 'Products',
'enable' => 'Enable',
'show-weight' => 'Show Weight',
'show-categories' => 'Show Categories',
'show-images' => 'Show Images',
'show-reviews' => 'Show Reviews',
'show-ratings' => 'Show Ratings',
'show-offers' => 'Show Offers',
'show-sku' => 'Show SKU',
'categories' => 'Categories',
'show-sku' => 'Show SKU',
'show-search-input-field' => 'Show Search Input Field'
]
]
];

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,7 @@ return [
],
'layouts' => [
'app-version' => 'Version : :version',
'my-account' => 'Minha Conta',
'logout' => 'Sair',
'visit-shop' => 'Visitar Loja',
@ -370,7 +371,11 @@ return [
'total-due' => 'Total Devido',
'cancel-confirm-msg' => 'Tem certeza que deseja cancelar esse pedido ?',
'refunds' => 'Refunds',
'refunded' => 'Refunded'
'refunded' => 'Refunded',
'comment-added-success' => 'Comment addded successfully.',
'comment' => 'Comment',
'submit-comment' => 'Submit Comment',
'notify-customer' => 'Notify Customer',
],
'invoices' => [
@ -409,6 +414,7 @@ return [
'add-title' => 'Criar Entrega',
'save-btn-title' => 'Salvar Entrega',
'qty-ordered' => 'Qtd pedido',
'qty-invoiced' => 'Qty Invoiced',
'qty-to-ship' => 'Qty para enviar',
'available-sources' => 'Fontes Disponíveis',
'source' => 'Fonte',
@ -728,6 +734,7 @@ return [
'target_currency' => 'Moeda Alvo',
'rate' => 'Taxa',
'exchange-class-not-found' => ':service de taxa de câmbio de serviço não encontrada',
'update-rates' => 'Atualizar Tarifas',
'rate' => 'Taxa',
'create-success' => 'Taxa de Câmbio criada com sucesso.',
'update-success' => 'Taxa de Câmbio atualizada com sucesso.',
@ -1242,14 +1249,14 @@ return [
'system' => [
'catalog' => 'Catálogo',
'products' => 'Produtos',
'guest-checkout' => 'Saída do hóspede',
'allow-guest-checkout' => 'Permitir saída do hóspede',
'guest-checkout' => 'Compras sem cadastro?',
'allow-guest-checkout' => 'Permitir compra para clientes sem cadastros?',
'allow-guest-checkout-hint' => 'Dica: se ativada, esta opção pode ser configurada para cada produto especificamente.',
'review' => 'Reveja',
'allow-guest-review' => 'Permitir comentário de convidado',
'review' => 'Avaliações',
'allow-guest-review' => 'Permitir comentários sem cadastro?',
'inventory' => 'Inventário',
'stock-options' => 'Opções de ações',
'allow-backorders' => 'Permitir Pedidos por Admin',
'allow-backorders' => 'Permitir Pedidos pelo Admin',
'customer' => 'Cliente',
'settings' => 'Definições',
'address' => 'Endereço',
@ -1312,7 +1319,35 @@ return [
'all-locales' => 'Todos',
'sandbox' => 'Sandbox',
'invoice-slip-design' => 'Design da Nota do Pedido',
'logo' => 'logo'
'logo' => 'Logo',
'storefront' => 'Storefront',
'default-list-mode' => 'Default List Mode',
'grid' => 'Grid',
'list' => 'List',
'products-per-page' => 'Products Per Page',
'sort-by' => 'Sort By',
'from-z-a' => 'From Z-A',
'from-a-z' => 'From A-Z',
'newest-first' => 'Newest First',
'oldest-first' => 'Oldest First',
'cheapest-first' => 'Cheapest First',
'expensive-first' => 'Expensive First',
'comma-seperated' => 'Comma Seperated',
'favicon' => 'Favicon',
'seo' => 'SEO',
'rich-snippets' => 'Rich Snippets',
'products' => 'Products',
'enable' => 'Enable',
'show-weight' => 'Show Weight',
'show-categories' => 'Show Categories',
'show-images' => 'Show Images',
'show-reviews' => 'Show Reviews',
'show-ratings' => 'Show Ratings',
'show-offers' => 'Show Offers',
'show-sku' => 'Show SKU',
'categories' => 'Categories',
'show-sku' => 'Show SKU',
'show-search-input-field' => 'Show Search Input Field'
]
]
];

View File

@ -429,22 +429,22 @@
this.optionRowCount++;
var row = {
'id': '{{ $option->id }}',
'admin_name': '{{ $option->admin_name }}',
'sort_order': '{{ $option->sort_order }}',
'swatch_value': '{{ $option->swatch_value }}',
'swatch_value_url': '{{ $option->swatch_value_url }}',
'id': @json($option->id),
'admin_name': @json($option->admin_name),
'sort_order': @json($option->sort_order),
'swatch_value': @json($option->swatch_value),
'swatch_value_url': @json($option->swatch_value_url),
'notRequired': ''
};
@if (empty($option->label))
this.isNullOptionChecked = true;
this.idNullOption = '{{ $option->id }}';
this.idNullOption = @json($option->id);
row['notRequired'] = true;
@endif
@foreach (app('Webkul\Core\Repositories\LocaleRepository')->all() as $locale)
row['{{ $locale->code }}'] = "{{ $option->translate($locale->code)['label'] ?? '' }}";
row['{{ $locale->code }}'] = @json($option->translate($locale->code)['label'] ?? '');
@endforeach
this.optionRows.push(row);

View File

@ -13,7 +13,7 @@
<div class="page-action">
<a href="{{ route('admin.catalog.attributes.create') }}" class="btn btn-lg btn-primary">
{{ __('Add Attribute') }}
{{ __('admin::app.catalog.attributes.add-title') }}
</a>
</div>
</div>
@ -28,4 +28,4 @@
{!! view_render_event('bagisto.admin.catalog.attributes.list.after') !!}
</div>
@stop
@stop

View File

@ -20,7 +20,7 @@
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.save') }} {{ __('admin::app.category') }}
{{ __('admin::app.catalog.categories.save-btn-title') }}
</button>
</div>
</div>

View File

@ -8,7 +8,7 @@
<div class="control-group {!! $errors->has('images.*') ? 'has-error' : '' !!}">
<label>{{ __('admin::app.catalog.categories.image') }}</label>
<image-wrapper :button-label="'{{ __('admin::app.catalog.products.add-image-btn-title') }}'" input-name="images" :images='@json($product->images)'></image-wrapper>
<product-image></product-image>
<span class="control-error" v-if="{!! $errors->has('images.*') !!}">
@php $count=1 @endphp
@ -23,4 +23,171 @@
</div>
</accordian>
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.images.after', ['product' => $product]) !!}
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.images.after', ['product' => $product]) !!}
@push('scripts')
@parent
<script type="text/x-template" id="product-image-template">
<div>
<div class="image-wrapper">
<product-image-item
v-for='(image, index) in items'
:key='image.id'
:image="image"
@onRemoveImage="removeImage($event)"
@onImageSelected="imageSelected($event)"
></product-image-item>
</div>
<label class="btn btn-lg btn-primary" style="display: inline-block; width: auto" @click="createFileType">
{{ __('admin::app.catalog.products.add-image-btn-title') }}
</label>
</div>
</script>
<script type="text/x-template" id="product-image-item-template">
<label class="image-item" v-bind:class="{ 'has-image': imageData.length > 0 }">
<input type="hidden" :name="'images[' + image.id + ']'" v-if="! new_image"/>
<input type="file" v-validate="'mimes:image/*'" accept="image/*" :name="'images[]'" ref="imageInput" :id="_uid" @change="addImageView($event)" multiple="multiple"/>
<img class="preview" :src="imageData" v-if="imageData.length > 0">
<label class="remove-image" @click="removeImage()">Remove Image</label>
</label>
</script>
<script>
Vue.component('product-image', {
template: '#product-image-template',
data: function() {
return {
images: @json($product->images),
imageCount: 0,
items: []
}
},
computed: {
finalInputName: function() {
return 'images[' + this.image.id + ']';
}
},
created: function() {
var this_this = this;
this.images.forEach(function(image) {
this_this.items.push(image)
this_this.imageCount++;
});
},
methods: {
createFileType: function() {
var this_this = this;
this.imageCount++;
this.items.push({'id': 'image_' + this.imageCount});
},
removeImage (image) {
let index = this.items.indexOf(image)
Vue.delete(this.items, index);
},
imageSelected: function(event) {
var this_this = this;
Array.from(event.files).forEach(function(image, index) {
if (index) {
this_this.imageCount++;
this_this.items.push({'id': 'image_' + this_this.imageCount, file: image});
}
});
}
}
});
Vue.component('product-image-item', {
template: '#product-image-item-template',
props: {
image: {
type: Object,
required: false,
default: null
},
},
data: function() {
return {
imageData: '',
new_image: 0
}
},
mounted () {
if (this.image.id && this.image.url) {
this.imageData = this.image.url;
} else if (this.image.id && this.image.file) {
this.readFile(this.image.file);
}
},
computed: {
finalInputName: function() {
return this.inputName + '[' + this.image.id + ']';
}
},
methods: {
addImageView: function() {
var imageInput = this.$refs.imageInput;
if (imageInput.files && imageInput.files[0]) {
if (imageInput.files[0].type.includes('image/')) {
this.readFile(imageInput.files[0])
if (imageInput.files.length > 1) {
this.$emit('onImageSelected', imageInput)
}
} else {
imageInput.value = "";
alert('Only images (.jpeg, .jpg, .png, ..) are allowed.');
}
}
},
readFile: function(image) {
var reader = new FileReader();
reader.onload = (e) => {
this.imageData = e.target.result;
}
reader.readAsDataURL(image);
this.new_image = 1;
},
removeImage: function() {
this.$emit('onRemoveImage', this.image)
}
}
});
</script>
@endpush

View File

@ -148,14 +148,14 @@
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[price]') ? 'has-error' : '']">
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;" step="any"/>
<input type="number" v-validate="'required'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;" step="any"/>
<span class="control-error" v-if="errors.has(variantInputName + '[price]')">@{{ errors.first(variantInputName + '[price]') }}</span>
</div>
</td>
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[weight]') ? 'has-error' : '']">
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;" step="any"/>
<input type="number" v-validate="'required'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;" step="any"/>
<span class="control-error" v-if="errors.has(variantInputName + '[weight]')">@{{ errors.first(variantInputName + '[weight]') }}</span>
</div>
</td>

View File

@ -19,7 +19,6 @@
</option>
@foreach (core()->getAllChannels() as $channelModel)
<option
value="{{ $channelModel->code }}" {{ (isset($channel) && ($channelModel->code) == $channel) ? 'selected' : '' }}>
{{ $channelModel->name }}
@ -90,6 +89,6 @@
window.location.href = url.href;
}
</script>
@endpush

View File

@ -1,4 +1,4 @@
@extends('address::admin.layouts.content')
@extends('admin::layouts.content')
@section('page_title')
{{ __('address::app.admin.addresses.title-orders', ['customer_name' => $customer->first_name . ' ' . $customer->last_name]) }}

View File

@ -31,24 +31,32 @@
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.customers.create.before') !!}
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required">{{ __('admin::app.customers.customers.first_name') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.firstname') }}&quot;">
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.first_name.after') !!}
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required">{{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.last_name.after') !!}
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email" class="required">{{ __('shop::app.customer.signup-form.email') }}</label>
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{ old('email') }}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.email.after') !!}
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="gender" class="required">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
@ -60,18 +68,24 @@
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.gender.after') !!}
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" v-validate="" value="{{ old('date_of_birth') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.date_of_birth.after') !!}
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ old('phone') }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
{!! view_render_event('bagisto.admin.customers.create.phone.after') !!}
<div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>
<select class="control" name="customer_group_id">
@ -80,6 +94,8 @@
@endforeach
</select>
</div>
{!! view_render_event('bagisto.admin.customers.create.after') !!}
</div>
</div>
</form>

View File

@ -36,6 +36,8 @@
<accordian :title="'{{ __('admin::app.account.general') }}'" :active="true">
<div slot="body">
{!! view_render_event('bagisto.admin.customer.edit.form.before', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name" class="required"> {{ __('admin::app.customers.customers.first_name') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{old('first_name') ?:$customer->first_name}}"
@ -43,18 +45,24 @@
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.first_name.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name" class="required"> {{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{old('last_name') ?:$customer->last_name}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.lastname') }}&quot;">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.last_name.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email" class="required"> {{ __('admin::app.customers.customers.email') }}</label>
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{old('email') ?:$customer->email}}" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.email') }}&quot;">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.email.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="gender" class="required">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" value="{{ $customer->gender }}" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.customers.gender') }}&quot;">
@ -66,6 +74,8 @@
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.gender.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="status" class="required">{{ __('admin::app.customers.customers.status') }}</label>
@ -77,18 +87,24 @@
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.status.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" value="{{ old('date_of_birth') ?:$customer->date_of_birth }}" v-validate="" data-vv-as="&quot;{{ __('admin::app.customers.customers.date_of_birth') }}&quot;">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.date_of_birth.after', ['customer' => $customer]) !!}
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ $customer->phone }}" data-vv-as="&quot;{{ __('admin::app.customers.customers.phone') }}&quot;">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
{!! view_render_event('bagisto.admin.customer.edit.phone.after', ['customer' => $customer]) !!}
<div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>

View File

@ -7,8 +7,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="icon" sizes="16x16" href="{{ asset('vendor/webkul/ui/assets/images/favicon.ico') }}" />
@if ($favicon = core()->getConfigData('general.design.admin_logo.favicon'))
<link rel="icon" sizes="16x16" href="{{ \Illuminate\Support\Facades\Storage::url($favicon) }}" />
@else
<link rel="icon" sizes="16x16" href="{{ asset('vendor/webkul/ui/assets/images/favicon.ico') }}" />
@endif
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">

View File

@ -6,7 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="icon" sizes="16x16" href="{{ asset('vendor/webkul/ui/assets/images/favicon.ico') }}" />
@if ($favicon = core()->getConfigData('general.design.admin_logo.favicon'))
<link rel="icon" sizes="16x16" href="{{ \Illuminate\Support\Facades\Storage::url($favicon) }}" />
@else
<link rel="icon" sizes="16x16" href="{{ asset('vendor/webkul/ui/assets/images/favicon.ico') }}" />
@endif
<link rel="stylesheet" href="{{ asset('vendor/webkul/ui/assets/css/ui.css') }}">
<link rel="stylesheet" href="{{ asset('vendor/webkul/admin/assets/css/admin.css') }}">

View File

@ -31,17 +31,19 @@
</div>
<div class="dropdown-list bottom-right">
<span class="app-version">{{ __('admin::app.layouts.app-version', ['version' => 'v' . config('app.version')]) }}</span>
<div class="dropdown-container">
<label>Account</label>
<ul>
<li>
<a href="{{ route('shop.home.index') }}" target="_blank">{{ trans('admin::app.layouts.visit-shop') }}</a>
<a href="{{ route('shop.home.index') }}" target="_blank">{{ __('admin::app.layouts.visit-shop') }}</a>
</li>
<li>
<a href="{{ route('admin.account.edit') }}">{{ trans('admin::app.layouts.my-account') }}</a>
<a href="{{ route('admin.account.edit') }}">{{ __('admin::app.layouts.my-account') }}</a>
</li>
<li>
<a href="{{ route('admin.session.destroy') }}">{{ trans('admin::app.layouts.logout') }}</a>
<a href="{{ route('admin.session.destroy') }}">{{ __('admin::app.layouts.logout') }}</a>
</li>
</ul>
</div>

View File

@ -447,10 +447,10 @@
'operator': '<=',
'label': '{{ __('admin::app.promotions.cart-rules.equals-or-less-than') }}'
}, {
'operator': '<=',
'operator': '>',
'label': '{{ __('admin::app.promotions.cart-rules.greater-than') }}'
}, {
'operator': '<=',
'operator': '<',
'label': '{{ __('admin::app.promotions.cart-rules.less-than') }}'
}],
'decimal': [{

View File

@ -1,3 +1,8 @@
<?php
/** @var array $selectedOptionIds */
/** @var \Webkul\CartRule\Models\CartRule $cartRule */
?>
@extends('admin::layouts.content')
@section('page_title')
@ -535,10 +540,10 @@
'operator': '<=',
'label': '{{ __('admin::app.promotions.cart-rules.equals-or-less-than') }}'
}, {
'operator': '<=',
'operator': '>',
'label': '{{ __('admin::app.promotions.cart-rules.greater-than') }}'
}, {
'operator': '<=',
'operator': '<',
'label': '{{ __('admin::app.promotions.cart-rules.less-than') }}'
}],
'decimal': [{

View File

@ -5,14 +5,81 @@
@stop
@section('content')
<div class="content">
<?php $customer_group = request()->get('customer_group') ?: null; ?>
<?php $channel = request()->get('channel') ?: null; ?>
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.promotions.cart-rules.title') }}</h1>
<div class="control-group">
<select class="control" id="channel-switcher" name="channel"
onchange="reloadPage('channel', this.value)">
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-channels') }}
</option>
@foreach (core()->getAllChannels() as $channelModel)
<option
value="{{ $channelModel->id }}" {{ (isset($channel) && ($channelModel->id) == $channel) ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<select class="control" id="customer-group-switcher" name="customer_group"
onchange="reloadPage('customer_group', this.value)">
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-customer-groups') }}
</option>
@foreach (core()->getAllCustomerGroups() as $customerGroupModel)
<option
value="{{ $customerGroupModel->id }}" {{ (isset($customerGroupModel) && ($customerGroupModel->id) == $customer_group) ? 'selected' : '' }}>
{{ $customerGroupModel->name }}
</option>
@endforeach
</select>
</div>
</div>
<div class="page-action">
<div class="control-group">
<select class="control" id="channel-switcher" name="channel" onchange="reloadPage('channel', this.value)" >
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-channels') }}
</option>
@foreach (core()->getAllChannels() as $channelModel)
<option
value="{{ $channelModel->id }}" {{ (isset($channel) && ($channelModel->id) == $channel) ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<select class="control" id="customer-group-switcher" name="customer_group" onchange="reloadPage('customer_group', this.value)" >
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-customer-groups') }}
</option>
@foreach (core()->getAllCustomerGroups() as $customerGroupModel)
<option
value="{{ $customerGroupModel->id }}" {{ (isset($customerGroupModel) && ($customerGroupModel->id) == $customer_group) ? 'selected' : '' }}>
{{ $customerGroupModel->name }}
</option>
@endforeach
</select>
</div>
<a href="{{ route('admin.cart-rules.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.promotions.cart-rules.add-title') }}
</a>
@ -24,4 +91,15 @@
{!! $cartRuleGrid->render() !!}
</div>
</div>
@endsection
@endsection
@push('scripts')
<script>
function reloadPage(getVar, getVal) {
let url = new URL(window.location.href);
url.searchParams.set(getVar, getVal);
window.location.href = url.href;
}
</script>
@endpush

View File

@ -1,6 +1,7 @@
{{ $address->name }}</br>
{{ $address->company_name ?? '' }}</br>
<b>{{ $address->name }}</b></br>
{{ $address->address1 }}</br>
{{ $address->city }}</br>
{{ $address->state }}</br>
{{ core()->country_name($address->country) }} {{ $address->postcode }}</br></br>
{{ __('shop::app.checkout.onepage.contact') }} : {{ $address->phone }}
{{ __('shop::app.checkout.onepage.contact') }} : {{ $address->phone }}

View File

@ -87,9 +87,11 @@
<div class="container">
<div class="header">
<div class="image">
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.orderSettings.invoice_slip_design.logo')) }}"/>
</div>
@if (core()->getConfigData('sales.orderSettings.invoice_slip_design.logo'))
<div class="image">
<img class="logo" src="{{ Storage::url(core()->getConfigData('sales.orderSettings.invoice_slip_design.logo')) }}"/>
</div>
@endif
<div class="address">
<p>
<b> {{ core()->getConfigData('sales.orderSettings.invoice_slip_design.address') }} </b>
@ -128,6 +130,7 @@
<tbody>
<tr>
<td>
<p>{{ $invoice->order->billing_address->company_name ?? '' }}</p>
<p>{{ $invoice->order->billing_address->name }}</p>
<p>{{ $invoice->order->billing_address->address1 }}</p>
<p>{{ $invoice->order->billing_address->city }}</p>
@ -138,6 +141,7 @@
@if ($invoice->order->shipping_address)
<td>
<p>{{ $invoice->order->shipping_address->company_name ?? '' }}</p>
<p>{{ $invoice->order->shipping_address->name }}</p>
<p>{{ $invoice->order->shipping_address->address1 }}</p>
<p>{{ $invoice->order->shipping_address->city }}</p>

View File

@ -12,16 +12,24 @@
<div class="page-header">
<div class="page-title">
<h1>
{!! view_render_event('sales.invoice.title.before', ['order' => $order]) !!}
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }}
{!! view_render_event('sales.invoice.title.after', ['order' => $order]) !!}
</h1>
</div>
<div class="page-action">
{!! view_render_event('sales.invoice.page_action.before', ['order' => $order]) !!}
<a href="{{ route('admin.sales.invoices.print', $invoice->id) }}" class="btn btn-lg btn-primary">
{{ __('admin::app.sales.invoices.print') }}
</a>
{!! view_render_event('sales.invoice.page_action.after', ['order' => $order]) !!}
</div>
</div>
@ -47,6 +55,8 @@
</span>
</div>
{!! view_render_event('sales.invoice.increment_id.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.order-date') }}
@ -57,6 +67,8 @@
</span>
</div>
{!! view_render_event('sales.invoice.created_at.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.order-status') }}
@ -67,6 +79,8 @@
</span>
</div>
{!! view_render_event('sales.invoice.status_label.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.channel') }}
@ -76,6 +90,8 @@
{{ $order->channel_name }}
</span>
</div>
{!! view_render_event('sales.invoice.channel_name.after', ['order' => $order]) !!}
</div>
</div>
@ -95,6 +111,8 @@
</span>
</div>
{!! view_render_event('sales.invoice.customer_name.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.email') }}
@ -104,6 +122,8 @@
{{ $invoice->address->email }}
</span>
</div>
{!! view_render_event('sales.invoice.customer_email.after', ['order' => $order]) !!}
</div>
</div>
@ -119,9 +139,9 @@
</div>
<div class="section-content">
@include ('admin::sales.address', ['address' => $order->billing_address])
{!! view_render_event('sales.invoice.billing_address.after', ['order' => $order]) !!}
</div>
</div>
@ -132,9 +152,9 @@
</div>
<div class="section-content">
@include ('admin::sales.address', ['address' => $order->shipping_address])
{!! view_render_event('sales.invoice.shipping_address.after', ['order' => $order]) !!}
</div>
</div>
@endif
@ -170,6 +190,8 @@
{{ $order->order_currency_code }}
</span>
</div>
{!! view_render_event('sales.invoice.payment-method.after', ['order' => $order]) !!}
</div>
</div>
@ -199,6 +221,8 @@
{{ core()->formatBasePrice($order->base_shipping_amount) }}
</span>
</div>
{!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!}
</div>
</div>
@endif
@ -236,7 +260,7 @@
@if (isset($item->additional['attributes']))
<div class="item-options">
@foreach ($item->additional['attributes'] as $attribute)
<b>{{ $attribute['attribute_name'] }} : </b>{{ $attribute['option_label'] }}</br>
@endforeach

View File

@ -12,13 +12,19 @@
<div class="page-title">
<h1>
{!! view_render_event('sales.order.title.before', ['order' => $order]) !!}
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.sales.orders.view-title', ['order_id' => $order->increment_id]) }}
{!! view_render_event('sales.order.title.after', ['order' => $order]) !!}
</h1>
</div>
<div class="page-action">
{!! view_render_event('sales.order.page_action.before', ['order' => $order]) !!}
@if ($order->canCancel())
<a href="{{ route('admin.sales.orders.cancel', $order->id) }}" class="btn btn-lg btn-primary" v-alert:message="'{{ __('admin::app.sales.orders.cancel-confirm-msg') }}'">
{{ __('admin::app.sales.orders.cancel-btn-title') }}
@ -42,6 +48,8 @@
{{ __('admin::app.sales.orders.shipment-btn-title') }}
</a>
@endif
{!! view_render_event('sales.order.page_action.after', ['order' => $order]) !!}
</div>
</div>
@ -72,6 +80,8 @@
</span>
</div>
{!! view_render_event('sales.order.created_at.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.order-status') }}
@ -82,6 +92,8 @@
</span>
</div>
{!! view_render_event('sales.order.status_label.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.channel') }}
@ -91,6 +103,8 @@
{{ $order->channel_name }}
</span>
</div>
{!! view_render_event('sales.order.channel_name.after', ['order' => $order]) !!}
</div>
</div>
@ -110,6 +124,8 @@
</span>
</div>
{!! view_render_event('sales.order.customer_full_name.after', ['order' => $order]) !!}
<div class="row">
<span class="title">
{{ __('admin::app.sales.orders.email') }}
@ -120,6 +136,8 @@
</span>
</div>
{!! view_render_event('sales.order.customer_email.after', ['order' => $order]) !!}
@if (! is_null($order->customer))
<div class="row">
<span class="title">
@ -131,6 +149,8 @@
</span>
</div>
@endif
{!! view_render_event('sales.order.customer_group.after', ['order' => $order]) !!}
</div>
</div>
@ -146,9 +166,9 @@
</div>
<div class="section-content">
@include ('admin::sales.address', ['address' => $order->billing_address])
{!! view_render_event('sales.order.billing_address.after', ['order' => $order]) !!}
</div>
</div>
@ -159,9 +179,9 @@
</div>
<div class="section-content">
@include ('admin::sales.address', ['address' => $order->shipping_address])
{!! view_render_event('sales.order.shipping_address.after', ['order' => $order]) !!}
</div>
</div>
@endif
@ -197,6 +217,8 @@
{{ $order->order_currency_code }}
</span>
</div>
{!! view_render_event('sales.order.payment-method.after', ['order' => $order]) !!}
</div>
</div>
@ -226,6 +248,8 @@
{{ core()->formatBasePrice($order->base_shipping_amount) }}
</span>
</div>
{!! view_render_event('sales.order.shipping-method.after', ['order' => $order]) !!}
</div>
</div>
@endif
@ -315,66 +339,107 @@
</table>
</div>
<table class="sale-summary">
<tr>
<td>{{ __('admin::app.sales.orders.subtotal') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_sub_total) }}</td>
</tr>
<div class="summary-comment-container">
<div class="comment-container">
<form action="{{ route('admin.sales.orders.comment', $order->id) }}" method="post" @submit.prevent="onSubmit">
@csrf()
@if ($order->haveStockableItems())
<div class="control-group" :class="[errors.has('comment') ? 'has-error' : '']">
<label for="comment" class="required">{{ __('admin::app.sales.orders.comment') }}</label>
<textarea v-validate="'required'" class="control" id="comment" name="comment" data-vv-as="&quot;{{ __('admin::app.sales.orders.comment') }}&quot;"></textarea>
<span class="control-error" v-if="errors.has('comment')">@{{ errors.first('comment') }}</span>
</div>
<div class="control-group">
<span class="checkbox">
<input type="checkbox" name="customer_notified" id="customer-notified" name="checkbox[]">
<label class="checkbox-view" for="customer-notified"></label>
{{ __('admin::app.sales.orders.notify-customer') }}
</span>
</div>
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.sales.orders.submit-comment') }}
</button>
</form>
<ul class="comment-list">
@foreach ($order->comments()->orderBy('id', 'desc')->get() as $comment)
<li>
<span class="comment-info">
@if ($comment->customer_notified)
{!! __('admin::app.sales.orders.customer-notified', ['date' => $comment->created_at]) !!}
@else
{!! __('admin::app.sales.orders.customer-not-notified', ['date' => $comment->created_at]) !!}
@endif
</span>
<p>{{ $comment->comment }}</p>
</li>
@endforeach
</ul>
</div>
<table class="sale-summary">
<tr>
<td>{{ __('admin::app.sales.orders.shipping-handling') }}</td>
<td>{{ __('admin::app.sales.orders.subtotal') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_shipping_amount) }}</td>
<td>{{ core()->formatBasePrice($order->base_sub_total) }}</td>
</tr>
@endif
@if ($order->base_discount_amount > 0)
<tr>
<td>
{{ __('admin::app.sales.orders.discount') }}
@if ($order->haveStockableItems())
<tr>
<td>{{ __('admin::app.sales.orders.shipping-handling') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_shipping_amount) }}</td>
</tr>
@endif
@if ($order->coupon_code)
({{ $order->coupon_code }})
@endif
</td>
@if ($order->base_discount_amount > 0)
<tr>
<td>
{{ __('admin::app.sales.orders.discount') }}
@if ($order->coupon_code)
({{ $order->coupon_code }})
@endif
</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_discount_amount) }}</td>
</tr>
@endif
<tr class="border">
<td>{{ __('admin::app.sales.orders.tax') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_discount_amount) }}</td>
<td>{{ core()->formatBasePrice($order->base_tax_amount) }}</td>
</tr>
@endif
<tr class="border">
<td>{{ __('admin::app.sales.orders.tax') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_tax_amount) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.grand-total') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.grand-total') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-paid') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total_invoiced) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-paid') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total_invoiced) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-refunded') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total_refunded) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-due') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_total_due) }}</td>
</tr>
</table>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-refunded') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_grand_total_refunded) }}</td>
</tr>
<tr class="bold">
<td>{{ __('admin::app.sales.orders.total-due') }}</td>
<td>-</td>
<td>{{ core()->formatBasePrice($order->base_total_due) }}</td>
</tr>
</table>
</div>
</div>
</accordian>

View File

@ -263,6 +263,7 @@
<th>{{ __('admin::app.sales.orders.SKU') }}</th>
<th>{{ __('admin::app.sales.orders.product-name') }}</th>
<th>{{ __('admin::app.sales.shipments.qty-ordered') }}</th>
<th>{{ __('admin::app.sales.shipments.qty-invoiced') }}</th>
<th>{{ __('admin::app.sales.shipments.qty-to-ship') }}</th>
<th>{{ __('admin::app.sales.shipments.available-sources') }}</th>
</tr>
@ -288,6 +289,7 @@
@endif
</td>
<td>{{ $item->qty_ordered }}</td>
<td>{{ $item->qty_invoiced }}</td>
<td>{{ $item->qty_to_ship }}</td>
<td>
@ -324,8 +326,8 @@
<div class="control-group" :class="[errors.has('{{ $inputName }}') ? 'has-error' : '']">
<input type="text" v-validate="'required|numeric|min_value:0|max_value:{{$sourceQty}}'" class="control" id="{{ $inputName }}" name="{{ $inputName }}" value="0" data-vv-as="&quot;{{ __('admin::app.sales.shipments.qty-to-ship') }}&quot;" :disabled="source != '{{ $inventorySource->id }}'"/>
<input type="text" v-validate="'required|numeric|min_value:0|max_value:{{$sourceQty}}'" class="control" id="{{ $inputName }}" name="{{ $inputName }}" value="{{ $item->qty_invoiced }}" data-vv-as="&quot;{{ __('admin::app.sales.shipments.qty-to-ship') }}&quot;" :disabled="source != '{{ $inventorySource->id }}'"/>
<span class="control-error" v-if="errors.has('{{ $inputName }}')">
@verbatim
{{ errors.first('<?php echo $inputName; ?>') }}

View File

@ -56,7 +56,7 @@
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']">
<select v-validate="'required'" class="control" name="target_currency" data-vv-as="&quot;{{ __('admin::app.settings.exchange_rates.target_currency') }}&quot;">
@foreach ($currencies as $currency)
@if (is_null($currency->CurrencyExchangeRate))
@if (is_null($currency->exchange_rate))
<option value="{{ $currency->id }}">{{ $currency->name }}</option>
@endif
@endforeach

View File

@ -12,25 +12,20 @@
</div>
<div class="page-action">
<a href="{{ route('admin.exchange_rates.update_rates') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.settings.exchange_rates.update-rates') }}
</a>
<a href="{{ route('admin.exchange_rates.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.settings.exchange_rates.add-title') }}
</a>
@php
$defaultService = config('services.exchange-api.default');
@endphp
{{-- <a href="{{ route('admin.exchange_rates.update-rates', $defaultService) }}" class="btn btn-lg btn-primary">
{{ __('admin::app.settings.exchange_rates.update-rates', [
'service' => $defaultService
]) }}
</a> --}}
</div>
</div>
<div class="page-content">
@inject('exchange_rates','Webkul\Admin\DataGrids\ExchangeRatesDataGrid')
{!! $exchange_rates->render() !!}
{!! app('Webkul\Admin\DataGrids\ExchangeRatesDataGrid')->render() !!}
</div>
</div>
@stop

View File

@ -6,7 +6,12 @@
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.sliders.create') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<form
method="POST"
@submit.prevent="onSubmit"
enctype="multipart/form-data"
action="{{ route('admin.sliders.create') }}">
<div class="page-header">
<div class="page-title">
<h1>
@ -29,6 +34,20 @@
{!! view_render_event('bagisto.admin.settings.slider.create.before') !!}
<div class="control-group" :class="[errors.has('locale') ? 'has-error' : '']">
<label for="locale">{{ __('admin::app.datagrid.locale') }}</label>
<select class="control" id="locale" name="locale" data-vv-as="&quot;{{ __('admin::app.datagrid.locale') }}&quot;" value="" v-validate="'required'">
@foreach (core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group" :class="[errors.has('title') ? 'has-error' : '']">
<label for="title" class="required">{{ __('admin::app.settings.sliders.name') }}</label>
<input type="text" class="control" name="title" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.settings.sliders.name') }}&quot;">

View File

@ -6,6 +6,8 @@
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
<form method="POST" action="{{ route('admin.sliders.update', $slider->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
@ -13,6 +15,11 @@
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.settings.sliders.edit-title') }}
@if ($slider->locale)
<span class="locale">[{{ $slider->locale }}]</span>
@endif
</h1>
</div>

View File

@ -6,11 +6,49 @@
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: null; ?>
<?php $channel = request()->get('channel') ?: null; ?>
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.settings.sliders.title') }}</h1>
<div class="control-group">
<select class="control" id="channel-switcher" name="channel" onchange="reloadPage('channel', this.value)" >
<option value="all" {{ ! isset($channel) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-channels') }}
</option>
@foreach (core()->getAllChannels() as $channelModel)
<option
value="{{ $channelModel->code }}" {{ (isset($channel) && ($channelModel->code) == $channel) ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<select class="control" id="locale-switcher" name="locale" onchange="reloadPage('locale', this.value)" >
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
{{ __('admin::app.admin.system.all-locales') }}
</option>
@foreach (core()->getAllLocales() as $localeModel)
<option
value="{{ $localeModel->code }}" {{ (isset($locale) && ($localeModel->code) == $locale) ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@endforeach
</select>
</div>
</div>
<div class="page-action">
@ -25,4 +63,18 @@
{!! $sliders->render() !!}
</div>
</div>
@stop
@stop
@push('scripts')
<script>
function reloadPage(getVar, getVal) {
let url = new URL(window.location.href);
url.searchParams.set(getVar, getVal);
window.location.href = url.href;
}
</script>
@endpush

View File

@ -26,22 +26,6 @@
<div class="form-container">
@csrf()
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.configuration.tax-categories.select-channel') }}</label>
<select class="control" name="channel_id">
@foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->id }}">
{{ $channelModel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel')">@{{ errors.first('channel') }}</span>
</div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.configuration.tax-categories.code') }}</label>
@ -67,7 +51,7 @@
</div>
<?php $selectedOptions = old('taxrates') ?: [] ?>
<div class="control-group" :class="[errors.has('taxrates[]') ? 'has-error' : '']">
<label for="taxrates" class="required">{{ __('admin::app.configuration.tax-categories.select-taxrates') }}</label>

View File

@ -27,22 +27,6 @@
<div class="form-container">
@csrf()
@method('PUT')
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.settings.tax-categories.select-channel') }}</label>
<select class="control" name="channel_id">
@foreach (core()->getAllChannels() as $channelModel)
<option @if ($taxCategory->channel_id == $channelModel->id) selected @endif value="{{ $channelModel->id }}">
{{ $channelModel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel')">@{{ errors.first('channel') }}</span>
</div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.settings.tax-categories.code') }}</label>

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/css/default-booking.css": "/css/default-booking.css?id=3607d6ec4cb93857b42c",
"/css/default-booking.css": "/css/default-booking.css?id=ab5abfabd8e0f6df6466",
"/css/velocity-booking.css": "/css/velocity-booking.css?id=fb0d5b9e37ed77d662d1"
}

View File

@ -62,8 +62,10 @@ class DefaultSlot extends Booking
{
$slots = [];
$dayOfWeek = $requestedDate->dayOfWeek;
foreach ($bookingProductSlot->slots as $timeDuration) {
if ($requestedDate->dayOfWeek != $timeDuration['from_day']) {
if ($dayOfWeek != $timeDuration['from_day']) {
continue;
}

View File

@ -4,6 +4,7 @@ namespace Webkul\BookingProduct\Helpers;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
use Webkul\Checkout\Facades\Cart;
class EventTicket extends Booking
{
@ -124,6 +125,12 @@ class EventTicket extends Booking
$ticket = $bookingProduct->event_tickets()->find($item->additional['booking']['ticket_id']);
if (! $ticket) {
Cart::removeItem($item->id);
return true;
}
$price += $ticket->price;
if ($price == $item->base_price) {

View File

@ -104,7 +104,7 @@ class RentalSlot extends Booking
{
$bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $data['product_id']);
$rentingType = $products[0]['additional']['booking']['renting_type'] ?? $bookingProduct->rental_slot->renting_type;
$rentingType = $data['additional']['booking']['renting_type'] ?? $bookingProduct->rental_slot->renting_type;
if ($rentingType == 'daily') {
$from = Carbon::createFromTimeString($data['additional']['booking']['date_from'] . ' 00:00:01')->getTimestamp();

View File

@ -2,8 +2,10 @@
namespace Webkul\BookingProduct\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Webkul\Theme\ViewRenderEventManager;
class EventServiceProvider extends ServiceProvider
{
@ -14,8 +16,10 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
Event::listen('bagisto.shop.products.view.short_description.after', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('bookingproduct::shop.products.view.booking');
Event::listen('bagisto.shop.products.view.short_description.after', static function(ViewRenderEventManager $viewRenderEventManager) {
if (View::exists('bookingproduct::shop.' . core()->getCurrentChannel()->theme . '.products.view.booking')) {
$viewRenderEventManager->addTemplate('bookingproduct::shop.' . core()->getCurrentChannel()->theme . '.products.view.booking');
}
});
Event::listen('checkout.order.save.after', 'Webkul\BookingProduct\Listeners\Order@afterPlaceOrder');

View File

@ -130,9 +130,8 @@
padding-right: 5px;
&::after {
position: absolute;
top: 14px;
right: 10px;
top: 16px;
left: 100%;
}
}

View File

@ -0,0 +1,125 @@
<?php
return [
'admin' => [
'catalog' => [
'products' => [
'booking' => 'Informazioni Prenotazione',
'booking-type' => 'Prenotazione Tipo',
'default' => 'Default',
'appointment-booking' => 'Prenotazione Appuntamento',
'event-booking' => 'Prenotazione Evento',
'rental-booking' => 'Prenotazione Noleggio',
'table-booking' => 'Prenotazione Tavolo',
'slot-duration' => 'Durata Slot (Min)',
'break-time' => 'Break Time b/w Slots (Mins)',
'available-every-week' => 'Disponibiità Ogni Settimana',
'yes' => 'Sì',
'no' => 'No',
'available-from' => 'Disponibile Da',
'available-to' => 'Disponibile Fino A',
'same-slot-all-days' => 'Stesso Slot tutti i giorni',
'slot-has-quantity' => 'Slot ha quantità',
'slots' => 'Slot',
'from' => 'Da',
'to' => 'A',
'qty' => 'Qtà',
'add-slot' => 'Aggiungi Slot',
'sunday' => 'Domenica',
'monday' => 'Lunedì',
'tuesday' => 'Martedì',
'wednesday' => 'Mercoledì',
'thursday' => 'Giovedì',
'friday' => 'Venerdì',
'saturday' => 'Sabato',
'renting-type' => 'Tipo di noleggio',
'daily' => 'Base Giornaliera',
'hourly' => 'Base Oraria',
'daily-hourly' => 'Entrambe (Base Giornaliera e Oraria)',
'daily-price' => 'Prezzo al giorno',
'hourly-price' => 'Prezzo all\'ora',
'location' => 'Location',
'show-location' => 'Mostra Location',
'event-start-date' => 'Data Inizio Evento',
'event-end-date' => 'Data Fine Evento',
'tickets' => 'Biglietti',
'add-ticket' => 'Aggungi Biglietto',
'name' => 'Nome',
'price' => 'Prezzo',
'quantity' => 'Quantità',
'description' => 'Descrizione',
'charged-per' => 'Charged Per',
'guest' => 'Ospite',
'table' => 'Tavolo',
'prevent-scheduling-before' => 'Previeni Scheduling Prima',
'guest-limit' => 'Limite Ospiti per Tavolo',
'guest-capacity' => 'Capacità Ospiti',
'type' => 'Tipo',
'many-bookings-for-one-day' => 'Diverse prenotazioni di un giorno',
'one-booking-for-many-days' => 'Una prenotazione per diversi giorni',
'day' => 'Giorno',
'status' => 'Stato',
'open' => 'Aperto',
'close' => 'Chiuso'
]
]
],
'shop' => [
'products' => [
'location' => 'Location',
'contact' => 'Contatto',
'email' => 'Email',
'slot-duration' => 'Durata Slot',
'slot-duration-in-minutes' => ':minutes Minuti',
'today-availability' => 'Disponibilità odierna',
'slots-for-all-days' => 'Mostra per tutti i giorni',
'sunday' => 'Domenica',
'monday' => 'Lunedì',
'tuesday' => 'Martedì',
'wednesday' => 'Mercoledì',
'thursday' => 'Giovedì',
'friday' => 'Venerdì',
'saturday' => 'Sabato',
'closed' => 'Chiuso',
'book-an-appointment' => 'Prenota un Appuntamento',
'date' => 'Data',
'slot' => 'Slot',
'rent-an-item' => 'Noleggia un Articolo',
'choose-rent-option' => 'Scegli una opzione di noleggio',
'daily-basis' => 'Base Giornaliera',
'hourly-basis' => 'Base Oraria',
'select-time-slot'=> 'Seleziona slot di tempo',
'select-slot' => 'Seleziona Slot',
'select-date' => 'Seleziona data',
'select-rent-time' => 'Seleziona Periodo di Noleggio',
'from' => 'Da',
'to' => 'A',
'book-a-table' => 'Prenota un Tavolo',
'special-notes' => 'Richieste/Note Speciali',
'event-on' => 'Evento del',
'book-your-ticket' => 'Prenota il tuo Biglietto',
'per-ticket-price' => ':price per Biglietto',
'number-of-tickets' => 'Numero di Biglietti',
'total-tickets' => 'Totale Biglietti',
'base-price' => 'Prezzo Base',
'total-price' => 'Prezzo Totale',
'base-price-info' => '(Questo si applicherà ad ogni tipo di biglietto per ciascuna quantità)'
],
'cart' => [
'renting_type' => 'Tipo Noleggio',
'daily' => 'Giornaliero',
'hourly' => 'Orario',
'event-ticket' => 'Biglietto Evento',
'event-from' => 'Evento dal',
'event-till' => 'Evento al',
'rent-type' => 'Tipo Noleggio',
'rent-from' => 'Noleggio Da',
'rent-till' => 'Noleggio A',
'booking-from' => 'Prenotazione Da',
'booking-till' => 'Prenotazione A',
'special-note' => 'Richieste/Note Speciali',
]
]
];

View File

@ -1,3 +1,25 @@
@section('css')
<style>
.slot-list .control-group.date::after {
margin-top: -13px;
left: 100%;
}
.has-control-group .control-group {
width: 50%;
float: left;
}
.has-control-group .control-group:first-child {
padding-right: 10px;
}
.has-control-group .control-group:last-child {
padding-left: 10px;
}
</style>
@stop
{!! view_render_event('bagisto.admin.catalog.product.edit_form_accordian.booking.before', ['product' => $product]) !!}
<accordian :title="'{{ __('bookingproduct::app.admin.catalog.products.booking') }}'" :active="true">

View File

@ -157,7 +157,7 @@
<script type="text/x-template" id="default-slot-item-template">
<tr>
<td class="has-control-group">
<div class="control-group date" :class="[errors.has(controlName + '[from_day]') ? 'has-error' : '']">
<div class="control-group" :class="[errors.has(controlName + '[from_day]') ? 'has-error' : '']">
<select v-validate="'required'" :name="controlName + '[from_day]'" v-model="slotItem.from_day" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.day') }}&quot;">
<option v-for="(day, index) in $parent.days" :value="index">@{{ day }}</option>
</select>
@ -177,7 +177,7 @@
</td>
<td class="has-control-group">
<div class="control-group date" :class="[errors.has(controlName + '[to_day]') ? 'has-error' : '']">
<div class="control-group" :class="[errors.has(controlName + '[to_day]') ? 'has-error' : '']">
<select v-validate="'required'" :name="controlName + '[to_day]'" v-model="slotItem.to_day" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.day') }}&quot;">
<option v-for="(day, index) in $parent.days" :value="index">@{{ day }}</option>
</select>

View File

@ -12,6 +12,7 @@ use Webkul\Product\Helpers\ProductImage;
use Webkul\BookingProduct\Repositories\BookingProductRepository;
use Webkul\BookingProduct\Helpers\Booking as BookingHelper;
use Webkul\Product\Type\Virtual;
use Carbon\Carbon;
class Booking extends Virtual
{
@ -168,6 +169,10 @@ class Booking extends Virtual
$bookingProduct = $this->getBookingProduct($data['product_id']);
if ($bookingProduct->type == 'event') {
if (Carbon::now() > $bookingProduct->available_from && Carbon::now() > $bookingProduct->available_to) {
return trans('shop::app.checkout.cart.event.expired');
}
$filtered = Arr::where($data['booking']['qty'], function ($qty, $key) {
return $qty != 0;
});

View File

@ -5,7 +5,7 @@ namespace Webkul\CMS\Repositories;
use Illuminate\Support\Facades\Event;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Webkul\Core\Eloquent\Repository;
use Webkul\CMS\Models\CmsPageTranslation;
use Webkul\CMS\Models\CmsPageTranslationProxy;
class CmsRepository extends Repository
{
@ -76,7 +76,7 @@ class CmsRepository extends Repository
*/
public function isUrlKeyUnique($id, $urlKey)
{
$exists = CmsPageTranslation::where('cms_page_id', '<>', $id)
$exists = CmsPageTranslationProxy::modelClass()::where('cms_page_id', '<>', $id)
->where('url_key', $urlKey)
->limit(1)
->select(\DB::raw(1))

View File

@ -124,7 +124,9 @@ class CartRule
$this->processFreeShippingDiscount($cart);
$this->validateCouponCode();
if (! $this->checkCouponCode()) {
cart()->removeCouponCode();
}
}
/**
@ -134,11 +136,14 @@ class CartRule
*/
public function getCartRules()
{
static $cartRules;
if ($cartRules) {
return $cartRules;
$staticCartRules = new class() {
public static $cartRules;
public static $cartID;
};
if ($staticCartRules::$cartID === cart()->getCart()->id && $staticCartRules::$cartRules) {
return $staticCartRules::$cartRules;
}
$staticCartRules::$cartID = cart()->getCart()->id;
$customerGroupId = null;
@ -166,6 +171,7 @@ class CartRule
->orderBy('sort_order', 'asc');
})->findWhere(['status' => 1]);
$staticCartRules::$cartRules = $cartRules;
return $cartRules;
}
@ -246,6 +252,10 @@ class CartRule
continue;
}
if ($rule->coupon_code) {
$item->coupon_code = $rule->coupon_code;
}
$quantity = $rule->discount_quantity ? min($item->quantity, $rule->discount_quantity) : $item->quantity;
$discountAmount = $baseDiscountAmount = 0;
@ -254,9 +264,9 @@ class CartRule
case 'by_percent':
$rulePercent = min(100, $rule->discount_amount);
$discountAmount = ($quantity * $item->price - $item->discount_amount) * ($rulePercent / 100);
$discountAmount = ($quantity * $item->price + $item->tax_amount - $item->discount_amount) * ($rulePercent / 100);
$baseDiscountAmount = ($quantity * $item->base_price - $item->base_discount_amount) * ($rulePercent / 100);
$baseDiscountAmount = ($quantity * $item->base_price + $item->base_tax_amount - $item->base_discount_amount) * ($rulePercent / 100);
if (! $rule->discount_quantity || $rule->discount_quantity > $quantity) {
$discountPercent = min(100, $item->discount_percent + $rulePercent);
@ -316,8 +326,14 @@ class CartRule
break;
}
$item->discount_amount = min($item->discount_amount + $discountAmount, $item->price * $quantity + $item->tax_amount);
$item->base_discount_amount = min($item->base_discount_amount + $baseDiscountAmount, $item->base_price * $quantity + $item->base_tax_amount);
$item->discount_amount = min(
$item->discount_amount + $discountAmount,
$item->price * $quantity + $item->tax_amount
);
$item->base_discount_amount = min(
$item->base_discount_amount + $baseDiscountAmount,
$item->base_price * $quantity + $item->base_tax_amount
);
$appliedRuleIds[$rule->id] = $rule->id;
@ -502,23 +518,26 @@ class CartRule
}
/**
* Check if coupon code is valid or not, if not remove from cart
* Check if coupon code is applied or not
*
* @return void
* @return bool
*/
public function validateCouponCode()
public function checkCouponCode(): bool
{
$cart = Cart::getCart();
$cart = cart()->getCart();
if (! $cart->coupon_code) {
return;
return true;
}
$coupon = $this->cartRuleCouponRepository->findOneByField('code', $cart->coupon_code);
if (! $coupon || ! in_array($coupon->cart_rule_id, explode(',', $cart->applied_cart_rule_ids))) {
Cart::removeCouponCode();
$coupons = $this->cartRuleCouponRepository->where(['code' => $cart->coupon_code])->get();
foreach ($coupons as $coupon) {
if (in_array($coupon->cart_rule_id, explode(',', $cart->applied_cart_rule_ids))) {
return true;
}
}
return false;
}
/**

View File

@ -2,6 +2,7 @@
namespace Webkul\CartRule\Http\Controllers;
use Illuminate\View\View;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Event;
use Webkul\CartRule\Repositories\CartRuleRepository;
@ -11,21 +12,21 @@ class CartRuleController extends Controller
{
/**
* Initialize _config, a default request parameter with route
*
*
* @param array
*/
protected $_config;
/**
* To hold Cart repository instance
*
*
* @var \Webkul\CartRule\Repositories\CartRuleRepository
*/
protected $cartRuleRepository;
/**
* To hold CartRuleCouponRepository repository instance
*
*
* @var \Webkul\CartRule\Repositories\CartRuleCouponRepository
*/
protected $cartRuleCouponRepository;
@ -33,8 +34,8 @@ class CartRuleController extends Controller
/**
* Create a new controller instance.
*
* @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository
* @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository
* @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository
* @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository
*
* @return void
*/
@ -63,6 +64,7 @@ class CartRuleController extends Controller
/**
* Show the form for creating a new resource.
*
*
* @return \Illuminate\Http\Response
*/
public function create()
@ -70,6 +72,28 @@ class CartRuleController extends Controller
return view($this->_config['view']);
}
/**
* Copy a given Cart Rule id. Always make the copy is inactive so the
* user is able to configure it before setting it live.
*/
public function copy(int $cartRuleId): View
{
$originalCartRule = $this->cartRuleRepository
->findOrFail($cartRuleId)
->load('channels')
->load('customer_groups');
$copiedCartRule = $originalCartRule
->replicate()
->fill(['status' => 0]);
$copiedCartRule->save();
return view($this->_config['view'], [
'cartRule' => $copiedCartRule,
]);
}
/**
* Store a newly created resource in storage.
*
@ -106,7 +130,8 @@ class CartRuleController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function edit($id)
@ -119,8 +144,9 @@ class CartRuleController extends Controller
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
@ -154,7 +180,8 @@ class CartRuleController extends Controller
/**
* Remove the specified resource from storage.
*
* @param int $id
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
@ -190,7 +217,7 @@ class CartRuleController extends Controller
'code_length' => 'required|integer|min:10',
'code_format' => 'required',
]);
if (! request('id')) {
return response()->json(['message' => trans('admin::app.promotions.cart-rules.cart-rule-not-defind-error')], 400);
}

View File

@ -19,14 +19,14 @@ class Order
/**
* CartRuleCustomerRepository object
*
* @var Webkul\CartRule\Repositories\\CartRuleCustomerRepository
* @var \Webkul\CartRule\Repositories\CartRuleCustomerRepository
*/
protected $cartRuleCustomerRepository;
/**
* CartRuleCouponRepository object
*
* @var Webkul\CartRule\Repositories\\CartRuleCouponRepository
* @var \Webkul\CartRule\Repositories\CartRuleCouponRepository
*/
protected $cartRuleCouponRepository;
@ -64,7 +64,7 @@ class Order
/**
* Save cart rule and cart rule coupon properties after place order
*
*
* @param \Webkul\Sales\Contracts\Order $order
* @return void
*/
@ -112,7 +112,7 @@ class Order
}
$coupon = $this->cartRuleCouponRepository->findOneByField('code', $order->coupon_code);
if ($coupon) {
$this->cartRuleCouponRepository->update(['times_used' => $coupon->times_used + 1], $coupon->id);

View File

@ -37,7 +37,7 @@ class CartRuleRepository extends Repository
/**
* CartRuleCouponRepository object
*
* @var Webkul\CartRule\Repositories\CartRuleCouponRepository
* @var \Webkul\CartRule\Repositories\CartRuleCouponRepository
*/
protected $cartRuleCouponRepository;

View File

@ -12,6 +12,8 @@ class CategoryTableSeeder extends Seeder
{
DB::table('categories')->delete();
DB::table('category_translations')->delete();
$now = Carbon::now();
DB::table('categories')->insert([

View File

@ -4,7 +4,6 @@ namespace Webkul\Category\Http\Controllers;
use Illuminate\Support\Facades\Event;
use Webkul\Category\Repositories\CategoryRepository;
use Webkul\Category\Models\CategoryTranslation;
use Webkul\Attribute\Repositories\AttributeRepository;
class CategoryController extends Controller
@ -87,18 +86,6 @@ class CategoryController extends Controller
'description' => 'required_if:display_mode,==,description_only,products_and_description',
]);
if (strtolower(request()->input('name')) == 'root') {
$categoryTransalation = new CategoryTranslation();
$result = $categoryTransalation->where('name', request()->input('name'))->get();
if(count($result) > 0) {
session()->flash('error', trans('admin::app.response.create-root-failure'));
return redirect()->back();
}
}
$category = $this->categoryRepository->create(request()->all());
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Category']));

View File

@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Event;
use Webkul\Core\Eloquent\Repository;
use Webkul\Category\Models\Category;
use Webkul\Category\Models\CategoryTranslation;
use Webkul\Category\Models\CategoryTranslationProxy;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\DB;
@ -103,12 +103,12 @@ class CategoryRepository extends Repository
{
static $categories = [];
if(array_key_exists($id, $categories)) {
if (array_key_exists($id, $categories)) {
return $categories[$id];
}
return $categories[$id] = $id
? $this->model::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
? $this->model::orderBy('position', 'ASC')->where('status', 1)->descendantsAndSelf($id)->toTree($id)
: $this->model::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
}
@ -120,8 +120,8 @@ class CategoryRepository extends Repository
* @return bool
*/
public function isSlugUnique($id, $slug)
{
$exists = CategoryTranslation::where('category_id', '<>', $id)
{
$exists = CategoryTranslationProxy::modelClass()::where('category_id', '<>', $id)
->where('slug', $slug)
->limit(1)
->select(DB::raw(1))

View File

@ -2,6 +2,7 @@
namespace Webkul\Checkout;
use Webkul\Checkout\Models\Cart as CartModel;
use Webkul\Checkout\Models\CartAddress;
use Webkul\Checkout\Repositories\CartRepository;
use Webkul\Checkout\Repositories\CartItemRepository;
@ -368,8 +369,14 @@ class Cart
continue;
}
$found = true;
$cartItem->quantity = $newQuantity = $cartItem->quantity + $guestCartItem->quantity;
if ($cartItem->quantity > $cartItem->product->getTypeInstance()->totalQuantity()) {
$cartItem->quantity = $newQuantity = $cartItem->product->getTypeInstance()->totalQuantity();
}
if (! $this->isItemHaveQuantity($cartItem)) {
$this->cartItemRepository->delete($guestCartItem->id);
@ -387,8 +394,6 @@ class Cart
$guestCart->items->forget($key);
$this->cartItemRepository->delete($guestCartItem->id);
$found = true;
}
if (! $found) {
@ -432,20 +437,19 @@ class Cart
*
* @return \Webkul\Checkout\Contracts\Cart|null
*/
public function getCart()
public function getCart(): ?\Webkul\Checkout\Contracts\Cart
{
$cart = null;
if ($this->getCurrentCustomer()->check()) {
$cart = $this->cartRepository->findOneWhere([
return $this->cartRepository->findOneWhere([
'customer_id' => $this->getCurrentCustomer()->user()->id,
'is_active' => 1,
]);
} elseif (session()->has('cart')) {
$cart = $this->cartRepository->find(session()->get('cart')->id);
return $this->cartRepository->find(session()->get('cart')->id);
}
return $cart && $cart->is_active ? $cart : null;
return null;
}
/**
@ -479,7 +483,8 @@ class Cart
*
* @param array $data
*
* @return void is the cart valid
* @return bool
* @throws \Prettus\Validator\Exceptions\ValidatorException
*/
public function saveCustomerAddress($data): bool
{
@ -494,7 +499,7 @@ class Cart
$this->saveAddressesWhenRequested($data, $billingAddressData, $shippingAddressData);
$this->linkAddresses($cart, $billingAddressData, $shippingAddressData);
$this->assignCustomerFields($cart);
$cart->save();
@ -596,6 +601,8 @@ class Cart
$cart->base_discount_amount += $shipping->base_discount_amount;
}
$cart = $this->finalizeCartTotals($cart);
$quantities = 0;
foreach ($cart->items as $item) {
@ -629,6 +636,7 @@ class Cart
} else {
foreach ($cart->items as $item) {
$response = $item->product->getTypeInstance()->validateCartItem($item);
// ToDo: refactoring of all validateCartItem functions, at the moment they return nothing
if ($response) {
return;
@ -658,7 +666,7 @@ class Cart
if (! $cart = $this->getCart()) {
return;
}
Event::dispatch('checkout.cart.calculate.items.tax.before', $cart);
foreach ($cart->items()->get() as $item) {
@ -682,7 +690,7 @@ class Cart
if ($address === null) {
$address = new class() {
public $country;
public $state;
public $postcode;
function __construct()
@ -737,7 +745,7 @@ class Cart
* @param \Webkul\Checkout\Contracts\CartItem $item
* @return \Webkul\Checkout\Contracts\CartItem
*/
protected function setItemTaxToZero(CartItem $item): CartItem
protected function setItemTaxToZero(\Webkul\Checkout\Contracts\CartItem $item): \Webkul\Checkout\Contracts\CartItem
{
$item->tax_percent = 0;
$item->tax_amount = 0;
@ -751,7 +759,7 @@ class Cart
*
* @return bool
*/
public function hasError()
public function hasError(): bool
{
if (! $this->getCart()) {
return true;
@ -769,7 +777,7 @@ class Cart
*
* @return bool
*/
public function isItemsHaveSufficientQuantity()
public function isItemsHaveSufficientQuantity(): bool
{
foreach ($this->getCart()->items as $item) {
if (! $this->isItemHaveQuantity($item)) {
@ -786,7 +794,7 @@ class Cart
* @param \Webkul\Checkout\Contracts\CartItem $item
* @return bool
*/
public function isItemHaveQuantity($item)
public function isItemHaveQuantity($item): bool
{
return $item->product->getTypeInstance()->isItemHaveQuantity($item);
}
@ -796,7 +804,7 @@ class Cart
*
* @return void
*/
public function deActivateCart()
public function deActivateCart(): void
{
if ($cart = $this->getCart()) {
$this->cartRepository->update(['is_active' => false], $cart->id);
@ -812,7 +820,7 @@ class Cart
*
* @return array
*/
public function prepareDataForOrder()
public function prepareDataForOrder(): array
{
$data = $this->toArray();
@ -871,7 +879,7 @@ class Cart
* @param array $data
* @return array
*/
public function prepareDataForOrderItem($data)
public function prepareDataForOrderItem($data): array
{
$finalData = [
'product' => $this->productRepository->find($data['product_id']),
@ -1029,9 +1037,9 @@ class Cart
* When logged in as guest or the customer profile is not complete, we use the
* billing address to fill the order customer_ data.
*
* @param \Webkul\Checkout\Models\Cart $cart
* @param \Webkul\Checkout\Contracts\Cart $cart
*/
private function assignCustomerFields(\Webkul\Checkout\Models\Cart $cart): void
private function assignCustomerFields(\Webkul\Checkout\Contracts\Cart $cart): void
{
if ($this->getCurrentCustomer()->check()
&& ($user = $this->getCurrentCustomer()->user())
@ -1047,6 +1055,25 @@ class Cart
}
}
/**
* Round cart totals
*
* @param \Webkul\Checkout\Models\Cart $cart
*
* @return \Webkul\Checkout\Models\Cart
*/
private function finalizeCartTotals(CartModel $cart): CartModel
{
$cart->discount_amount = round($cart->discount_amount, 2);
$cart->base_discount_amount = round($cart->base_discount_amount, 2);
$cart->grand_total = round($cart->grand_total, 2);
$cart->grand_total = round($cart->grand_total, 2);
$cart->base_grand_total = round($cart->base_grand_total, 2);
return $cart;
}
/**
* @param $user
*
@ -1186,34 +1213,37 @@ class Cart
{
$billingAddressModel = $cart->billing_address;
if ($billingAddressModel) {
$billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_BILLING;
$this->cartAddressRepository->update($billingAddressData, $billingAddressModel->id);
if ($cart->haveStockableItems()) {
$shippingAddressModel = $cart->shipping_address;
if ($shippingAddressModel) {
if (isset($billingAddressData['use_for_shipping']) && $billingAddressData['use_for_shipping']) {
$billingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING;
$this->cartAddressRepository->update($billingAddressData, $shippingAddressModel->id);
} else {
$shippingAddressData['address_type'] = CartAddress::ADDRESS_TYPE_SHIPPING;
$this->cartAddressRepository->update($shippingAddressData, $shippingAddressModel->id);
}
} else {
if (isset($billingAddressData['use_for_shipping']) && $billingAddressData['use_for_shipping']) {
$this->cartAddressRepository->create(array_merge($billingAddressData,
['address_type' => 'shipping']));
['address_type' => CartAddress::ADDRESS_TYPE_SHIPPING]));
} else {
$this->cartAddressRepository->create(array_merge($shippingAddressData,
['address_type' => 'shipping']));
['address_type' => CartAddress::ADDRESS_TYPE_SHIPPING]));
}
}
}
} else {
$this->cartAddressRepository->create(array_merge($billingAddressData, ['address_type' => 'billing']));
$this->cartAddressRepository->create(array_merge($billingAddressData, ['address_type' => CartAddress::ADDRESS_TYPE_BILLING]));
if ($cart->haveStockableItems()) {
if (isset($billingAddressData['use_for_shipping']) && $billingAddressData['use_for_shipping']) {
$this->cartAddressRepository->create(array_merge($billingAddressData, ['address_type' => 'shipping']));
$this->cartAddressRepository->create(array_merge($billingAddressData, ['address_type' => CartAddress::ADDRESS_TYPE_SHIPPING]));
} else {
$this->cartAddressRepository->create(array_merge($shippingAddressData, ['address_type' => 'shipping']));
$this->cartAddressRepository->create(array_merge($shippingAddressData, ['address_type' => CartAddress::ADDRESS_TYPE_SHIPPING]));
}
}
}

View File

@ -6,14 +6,10 @@ use Faker\Generator as Faker;
use Webkul\Checkout\Models\CartAddress;
$factory->define(CartAddress::class, function (Faker $faker) {
$now = date("Y-m-d H:i:s");
return [
'first_name' => $faker->firstName(),
'last_name' => $faker->lastName,
'email' => $faker->email,
'created_at' => $now,
'updated_at' => $now,
'address_type' => 'billing',
'address_type' => CartAddress::ADDRESS_TYPE_BILLING,
];
});

View File

@ -48,7 +48,7 @@ class Cart extends Model implements CartContract
*/
public function billing_address()
{
return $this->addresses()->where('address_type', 'billing');
return $this->addresses()->where('address_type', CartAddress::ADDRESS_TYPE_BILLING);
}
/**
@ -64,7 +64,7 @@ class Cart extends Model implements CartContract
*/
public function shipping_address()
{
return $this->addresses()->where('address_type', 'shipping');
return $this->addresses()->where('address_type', CartAddress::ADDRESS_TYPE_SHIPPING);
}
/**

View File

@ -2,30 +2,47 @@
namespace Webkul\Checkout\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Webkul\Checkout\Contracts\CartAddress as CartAddressContract;
use Webkul\Core\Models\Address;
class CartAddress extends Model implements CartAddressContract
/**
* Class CartAddress
* @package Webkul\Checkout\Models
*
* @property integer $cart_id
* @property Cart $cart
*
*/
class CartAddress extends Address implements CartAddressContract
{
protected $table = 'cart_address';
public const ADDRESS_TYPE_SHIPPING = 'cart_shipping';
public const ADDRESS_TYPE_BILLING = 'cart_billing';
protected $fillable = [
'first_name',
'last_name',
'email',
'company_name',
'vat_id',
'address1',
'city',
'state',
'postcode',
'country',
'phone',
'address_type',
'cart_id',
'customer_id',
/**
* @var array default values
*/
protected $attributes = [
'address_type' => self::ADDRESS_TYPE_BILLING,
];
/**
* The "booted" method of the model.
*
* @return void
*/
protected static function boot()
{
static::addGlobalScope('address_type', static function (Builder $builder) {
$builder->whereIn('address_type', [
self::ADDRESS_TYPE_BILLING,
self::ADDRESS_TYPE_SHIPPING
]);
});
parent::boot();
}
/**
* Get the shipping rates for the cart address.
*/
@ -35,10 +52,10 @@ class CartAddress extends Model implements CartAddressContract
}
/**
* Get all of the attributes for the attribute groups.
* Get the cart record associated with the address.
*/
public function getNameAttribute()
public function cart()
{
return $this->first_name . ' ' . $this->last_name;
return $this->belongsTo(Cart::class);
}
}

View File

@ -24,6 +24,7 @@ class CartShippingRate extends Model implements CartShippingRateContract
*/
public function shipping_address()
{
return $this->belongsTo(CartAddressProxy::modelClass());
return $this->belongsTo(CartAddressProxy::modelClass(), 'cart_address_id')
->where('address_type', CartAddress::ADDRESS_TYPE_SHIPPING);
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace App\Console\Commands;
namespace Webkul\Core\Console\Commands;
use Illuminate\Console\Command;

View File

@ -0,0 +1,36 @@
<?php
namespace Webkul\Core\Console\Commands;
use Illuminate\Console\Command;
class ExchangeRateUpdate extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'exchange-rate:update';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Automatically updates currency exchange rates ';
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
try {
app(config('services.exchange-api.' . config('services.exchange-api.default') . '.class'))->updateRates();
} catch(\Exception $e) {
}
}
}

View File

@ -1,12 +1,12 @@
<?php
namespace App\Console\Commands;
namespace Webkul\Core\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Artisan;
class install extends Command
class Install extends Command
{
/**
* The name and signature of the console command.
@ -77,7 +77,7 @@ class install extends Command
public function checkForEnvFile()
{
$envExists = File::exists(base_path() . '/.env');
if (!$envExists) {
if (! $envExists) {
$this->info('Creating the environment configuration file.');
$this->createEnvFile();
} else {
@ -93,7 +93,7 @@ class install extends Command
try {
File::copy('.env.example', '.env');
Artisan::call('key:generate');
$this->envUpdate('APP_URL=http://localhost', ':8000');
$this->envUpdate('APP_URL=', 'http://localhost:8000');
$locale = $this->choice('Please select the default locale or press enter to continue', ['ar', 'en', 'fa', 'nl', 'pt_BR'], 1);
$this->envUpdate('APP_LOCALE=', $locale);
@ -131,11 +131,31 @@ class install extends Command
*/
public static function envUpdate($key, $value)
{
$path = base_path() . '/.env';
file_put_contents($path, str_replace(
$key,
$key . $value,
file_get_contents($path)
));
$path = base_path() . '/.env';
$data = file($path);
$keyValueData = $changedData = [];
if ($data) {
foreach ($data as $line) {
$line = preg_replace('/\s+/', '', $line);
$rowValues = explode('=', $line);
if (strlen($line) !== 0) {
$keyValueData[$rowValues[0]] = $rowValues[1];
if (strpos($key, $rowValues[0]) !== false) {
$keyValueData[$rowValues[0]] = $value;
}
}
}
}
foreach ($keyValueData as $key => $value) {
$changedData[] = $key . '=' . $value;
}
$changedData = implode(PHP_EOL, $changedData);
file_put_contents($path, $changedData);
}
}

View File

@ -0,0 +1,7 @@
<?php
namespace Webkul\Core\Contracts;
interface Address
{
}

Some files were not shown because too many files have changed in this diff Show More