export changes

This commit is contained in:
rahul shukla 2019-01-16 16:43:36 +05:30
commit 8c32a21521
244 changed files with 2582 additions and 11913 deletions

76
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at support@bagisto.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@ -63,7 +63,7 @@ Bagisto is using power of both of these frameworks and making best out of it out
**Run this Command** to download the project on to your local machine or server: **Run this Command** to download the project on to your local machine or server:
>> Note: If you have downloaded zip file then ignore this. > Note: If you have downloaded zip file then ignore this.
~~~ ~~~
composer create-project bagisto/bagisto composer create-project bagisto/bagisto
@ -89,11 +89,12 @@ default.
**Run these Commands Below** **Run these Commands Below**
>> Run this command below, if installing from the zip else skip: > Run this command, in case installing from the zip else skip this command (no need to run this command if you are creating project through composer):
~~~ ~~~
composer install composer install
~~~ ~~~
> Continue run these command below:
~~~ ~~~
php artisan migrate php artisan migrate
~~~ ~~~
@ -115,6 +116,14 @@ composer dump-autoload
> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. > That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory.
> **Note: you can fetch your admin panel by follow below url:**
~~~
http(s)://example.com/admin/login
~~~
~~~
email:admin@example.com
password:admin123
~~~
### 5. License ### 5. License
Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE).

View File

@ -5,7 +5,7 @@ return [
/** /**
* Default Select Value * Default Select Value
*/ */
'select' => 'id', 'default_index' => 'id',
/** /**
* Default OrderBy * Default OrderBy
@ -13,8 +13,9 @@ return [
* * Accepted Values = Array * * Accepted Values = Array
*/ */
'order' => [ 'order' => [
'column' => 'id', 'default' => 'descending',
'direction' => 'desc' 'descending' => 'desc',
'ascending' => 'asc'
], ],
/** /**
@ -29,7 +30,7 @@ return [
* *
* Accepted Value = integer * Accepted Value = integer
*/ */
// 'pagination' => 10, 'paginate' => false,
'operators' => [ 'operators' => [
'eq' => "=", 'eq' => "=",
@ -84,6 +85,6 @@ return [
7 => "orders", 7 => "orders",
8 => "limit", 8 => "limit",
9 => "offset", 9 => "offset",
10 => "lock", 10 => "lock"
] ]
]; ];

View File

@ -28,7 +28,7 @@ class AddressController extends Controller
$this->customerAddress = $customerAddress; $this->customerAddress = $customerAddress;
if(auth()->guard('customer')->check()) { if (auth()->guard('customer')->check()) {
$this->customer = auth()->guard('customer')->user(); $this->customer = auth()->guard('customer')->user();
} else { } else {
$this->customer['message'] = 'unauthorized'; $this->customer['message'] = 'unauthorized';
@ -46,7 +46,7 @@ class AddressController extends Controller
* @return response JSON * @return response JSON
*/ */
public function get() { public function get() {
if($this->customer == false) { if ($this->customer == false) {
return response()->json($this->customer, 401); return response()->json($this->customer, 401);
} else { } else {
$addresses = $this->customer->addresses; $addresses = $this->customer->addresses;
@ -56,7 +56,7 @@ class AddressController extends Controller
} }
public function getDefault() { public function getDefault() {
if($this->customer == false) { if ($this->customer == false) {
return response()->json($this->customer, 401); return response()->json($this->customer, 401);
} else { } else {
$defaultAddress = $this->customer->default_address; $defaultAddress = $this->customer->default_address;
@ -89,13 +89,13 @@ class AddressController extends Controller
$cust_id['customer_id'] = $this->customer->id; $cust_id['customer_id'] = $this->customer->id;
$data = array_merge($cust_id, $data); $data = array_merge($cust_id, $data);
if($this->customer->addresses->count() == 0) { if ($this->customer->addresses->count() == 0) {
$data['default_address'] = 1; $data['default_address'] = 1;
} }
$result = $this->customerAddress->create($data); $result = $this->customerAddress->create($data);
if($result) { if ($result) {
return response()->json(true, 200); return response()->json(true, 200);
} else { } else {
return response()->json(false, 200); return response()->json(false, 200);
@ -111,11 +111,11 @@ class AddressController extends Controller
public function makeDefault($id) { public function makeDefault($id) {
$defaultAddress = $this->customer->default_address; $defaultAddress = $this->customer->default_address;
if($defaultAddress != null && $defaultAddress->count() > 0) { if ($defaultAddress != null && $defaultAddress->count() > 0) {
$defaultAddress->update(['default_address' => 0]); $defaultAddress->update(['default_address' => 0]);
} }
if($this->customerAddress->find($id)->default_address == 1) { if ($this->customerAddress->find($id)->default_address == 1) {
return response()->json(false, 200); return response()->json(false, 200);
} }

View File

@ -26,8 +26,8 @@ class AuthController extends Controller
public function create() { public function create() {
$data = request()->except('_token'); $data = request()->except('_token');
if(!auth()->guard('customer')->check()) { if (! auth()->guard('customer')->check()) {
if(!auth()->guard('customer')->attempt($data)) { if (! auth()->guard('customer')->attempt($data)) {
return response()->json(['message' => 'unauthenticated', 'details' => 'invalid creds'], 401); return response()->json(['message' => 'unauthenticated', 'details' => 'invalid creds'], 401);
} else { } else {
return response()->json(['message' => 'authenticated', 'user' => auth()->guard('customer')->user()], 200); return response()->json(['message' => 'authenticated', 'user' => auth()->guard('customer')->user()], 200);

View File

@ -23,7 +23,7 @@ class CustomerController extends Controller
public function __construct() public function __construct()
{ {
if(auth()->guard('customer')->check()) { if (auth()->guard('customer')->check()) {
$this->customer = auth()->guard('customer')->user(); $this->customer = auth()->guard('customer')->user();
} else { } else {
$this->customer['message'] = 'unauthorized'; $this->customer['message'] = 'unauthorized';
@ -63,10 +63,10 @@ class CustomerController extends Controller
$data = collect(request()->all())->toArray(); $data = collect(request()->all())->toArray();
if($data['oldpassword'] == null) { if ($data['oldpassword'] == null) {
$data = collect(request()->input())->except([ 'oldpassword', 'password', 'password_confirmation'])->toArray(); $data = collect(request()->input())->except([ 'oldpassword', 'password', 'password_confirmation'])->toArray();
} else { } else {
if(Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) {
$data = collect(request()->input())->toArray(); $data = collect(request()->input())->toArray();
$data['password'] = bcrypt($data['password']); $data['password'] = bcrypt($data['password']);
@ -77,7 +77,7 @@ class CustomerController extends Controller
$result = $this->customer->update($data); $result = $this->customer->update($data);
if($result) { if ($result) {
return response()->json(true, 200); return response()->json(true, 200);
} else { } else {
return response()->json(false, 200); return response()->json(false, 200);
@ -92,7 +92,7 @@ class CustomerController extends Controller
public function getAllCart() { public function getAllCart() {
$carts = $this->customer->carts; $carts = $this->customer->carts;
if($cart->count() > 0) { if ($cart->count() > 0) {
return response()->json(['message' => 'successful','items' => $cart], 200); return response()->json(['message' => 'successful','items' => $cart], 200);
} else { } else {
return response()->json(['message' => 'empty', 'items' => null], 200); return response()->json(['message' => 'empty', 'items' => null], 200);
@ -102,11 +102,11 @@ class CustomerController extends Controller
public function getActiveCart() { public function getActiveCart() {
$cart = Cart::getCart(); $cart = Cart::getCart();
if($cart == null) { if ($cart == null) {
return response()->json(['message' => 'empty', 'items' => 'null']); return response()->json(['message' => 'empty', 'items' => 'null']);
} }
if($cart->count() > 0 ) { if ($cart->count() > 0 ) {
return response()->json(['message' => 'success', 'items' => $cart]); return response()->json(['message' => 'success', 'items' => $cart]);
} else { } else {
return response()->json(['message' => 'empty', 'items' => 'null']); return response()->json(['message' => 'empty', 'items' => 'null']);

View File

@ -24,7 +24,7 @@ class WishlistController extends Controller
public function __construct(Product $product, Wishlist $wishlist) public function __construct(Product $product, Wishlist $wishlist)
{ {
if(auth()->guard('customer')->check()) { if (auth()->guard('customer')->check()) {
$this->product = $product; $this->product = $product;
$this->wishlist = $wishlist; $this->wishlist = $wishlist;
$this->customer = auth()->guard('customer')->user(); $this->customer = auth()->guard('customer')->user();
@ -43,7 +43,7 @@ class WishlistController extends Controller
{ {
$wishlist = $this->customer->wishlist_items; $wishlist = $this->customer->wishlist_items;
if($wishlist->count() > 0) { if ($wishlist->count() > 0) {
return response()->json($wishlist, 200); return response()->json($wishlist, 200);
} else { } else {
return response()->json(['message' => 'Wishlist Empty', 'Items' => null], 200); return response()->json(['message' => 'Wishlist Empty', 'Items' => null], 200);
@ -67,14 +67,14 @@ class WishlistController extends Controller
]; ];
//accidental case if some one adds id of the product in the anchor tag amd gives id of a variant. //accidental case if some one adds id of the product in the anchor tag amd gives id of a variant.
if($product->parent_id != null) { if ($product->parent_id != null) {
$data['product_id'] = $productId = $product->parent_id; $data['product_id'] = $productId = $product->parent_id;
} }
$checked = $this->wishlist->findWhere(['channel_id' => core()->getCurrentChannel()->id, 'product_id' => $productId, 'customer_id' => auth()->guard('customer')->user()->id]); $checked = $this->wishlist->findWhere(['channel_id' => core()->getCurrentChannel()->id, 'product_id' => $productId, 'customer_id' => auth()->guard('customer')->user()->id]);
if($checked->isEmpty()) { if ($checked->isEmpty()) {
if($wishlistItem = $this->wishlist->create($data)) { if ($wishlistItem = $this->wishlist->create($data)) {
return response()->json(['message' => 'Successfully Added Item To Wishlist', 'items' => $wishlistItem], 200); return response()->json(['message' => 'Successfully Added Item To Wishlist', 'items' => $wishlistItem], 200);
} else { } else {
return response()->json(['message' => 'Error! Cannot Add Item To Wishlist', 'items' => null], 401); return response()->json(['message' => 'Error! Cannot Add Item To Wishlist', 'items' => null], 401);
@ -93,7 +93,7 @@ class WishlistController extends Controller
{ {
$result = $this->wishlist->deleteWhere(['customer_id' => auth()->guard('customer')->user()->id, 'channel_id' => core()->getCurrentChannel()->id, 'id' => $itemId]); $result = $this->wishlist->deleteWhere(['customer_id' => auth()->guard('customer')->user()->id, 'channel_id' => core()->getCurrentChannel()->id, 'id' => $itemId]);
if($result) { if ($result) {
return response()->json(['message' => 'Item Successfully Removed From Wishlist', 'status' => $result]); return response()->json(['message' => 'Item Successfully Removed From Wishlist', 'status' => $result]);
} else { } else {
return response()->json(['message' => 'Error! While Removing Item From Wishlist', 'status' => $result]); return response()->json(['message' => 'Error! While Removing Item From Wishlist', 'status' => $result]);

View File

@ -89,7 +89,7 @@ class ReviewController extends Controller
$result = $this->productReview->create($data); $result = $this->productReview->create($data);
if($result) { if ($result) {
return response()->json(['message' => 'success', 'status' => $result]); return response()->json(['message' => 'success', 'status' => $result]);
} else { } else {
return response()->json(['message' => 'failed', 'status' => $result]); return response()->json(['message' => 'failed', 'status' => $result]);

View File

@ -39,7 +39,7 @@ class CartController extends Controller
public function get() { public function get() {
$cart = Cart::getCart(); $cart = Cart::getCart();
if($cart == null || $cart == 'null') { if ($cart == null || $cart == 'null') {
return response()->json(['message' => 'empty', 'items' => null]); return response()->json(['message' => 'empty', 'items' => null]);
} }
@ -54,7 +54,7 @@ class CartController extends Controller
public function add($id) { public function add($id) {
$result = Cart::add($id, request()->all()); $result = Cart::add($id, request()->all());
if($result) { if ($result) {
Cart::collectTotals(); Cart::collectTotals();
return response()->json(['message' => 'successful', 'items' => Cart::getCart()->items]); return response()->json(['message' => 'successful', 'items' => Cart::getCart()->items]);
@ -84,7 +84,7 @@ class CartController extends Controller
public function onePage() { public function onePage() {
$cart = Cart::getCart(); $cart = Cart::getCart();
if($cart == null || $cart == 'null') { if ($cart == null || $cart == 'null') {
return response()->json(['message' => 'empty', 'items' => null]); return response()->json(['message' => 'empty', 'items' => null]);
} }
@ -102,13 +102,13 @@ class CartController extends Controller
public function updateOnePage() { public function updateOnePage() {
$request = request()->except('_token'); $request = request()->except('_token');
foreach($request['qty'] as $id => $quantity) { foreach ($request['qty'] as $id => $quantity) {
if($quantity <= 0) { if ($quantity <= 0) {
return response()->json(['message' => 'Illegal Quantity', 'status' => 'error']); return response()->json(['message' => 'Illegal Quantity', 'status' => 'error']);
} }
} }
foreach($request['qty'] as $key => $value) { foreach ($request['qty'] as $key => $value) {
$item = $this->cartItem->findOneByField('id', $key); $item = $this->cartItem->findOneByField('id', $key);
$data['quantity'] = $value; $data['quantity'] = $value;

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{ {
"/js/admin.js": "/js/admin.js?id=c70dacdf945a32e04b77", "/js/admin.js": "/js/admin.js?id=c70dacdf945a32e04b77",
"/css/admin.css": "/css/admin.css?id=d40a640933cbcc121f1d" "/css/admin.css": "/css/admin.css?id=3e790c2215bf5c60ac21"
} }

View File

@ -3,147 +3,142 @@
return [ return [
[ [
'key' => 'dashboard', 'key' => 'dashboard',
'name' => 'Dashboard', 'name' => 'admin::app.acl.dashboard',
'route' => 'admin.dashboard.index', 'route' => 'admin.dashboard.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'sales', 'key' => 'sales',
'name' => 'Sales', 'name' => 'admin::app.acl.sales',
'route' => 'admin.sales.orders.index', 'route' => 'admin.sales.orders.index',
'sort' => 2 'sort' => 2
], [ ], [
'key' => 'sales.orders', 'key' => 'sales.orders',
'name' => 'Orders', 'name' => 'admin::app.acl.orders',
'route' => 'admin.sales.orders.index', 'route' => 'admin.sales.orders.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'sales.invoices', 'key' => 'sales.invoices',
'name' => 'Invoices', 'name' => 'admin::app.acl.invoices',
'route' => 'admin.sales.invoices.index', 'route' => 'admin.sales.invoices.index',
'sort' => 2 'sort' => 2
], [ ], [
'key' => 'sales.shipments', 'key' => 'sales.shipments',
'name' => 'Shipments', 'name' => 'admin::app.acl.shipments',
'route' => 'admin.sales.shipments.index', 'route' => 'admin.sales.shipments.index',
'sort' => 3 'sort' => 3
], [ ], [
'key' => 'catalog', 'key' => 'catalog',
'name' => 'Catalog', 'name' => 'admin::app.acl.catalog',
'route' => 'admin.catalog.index', 'route' => 'admin.catalog.index',
'sort' => 3 'sort' => 3
], [ ], [
'key' => 'catalog.products', 'key' => 'catalog.products',
'name' => 'Products', 'name' => 'admin::app.acl.products',
'route' => 'admin.catalog.products.index', 'route' => 'admin.catalog.products.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'catalog.categories', 'key' => 'catalog.categories',
'name' => 'Categories', 'name' => 'admin::app.acl.categories',
'route' => 'admin.catalog.categories.index', 'route' => 'admin.catalog.categories.index',
'sort' => 2 'sort' => 2
], [ ], [
'key' => 'catalog.attributes', 'key' => 'catalog.attributes',
'name' => 'Attributes', 'name' => 'admin::app.acl.attributes',
'route' => 'admin.catalog.attributes.index', 'route' => 'admin.catalog.attributes.index',
'sort' => 3 'sort' => 3
], [ ], [
'key' => 'catalog.families', 'key' => 'catalog.families',
'name' => 'Families', 'name' => 'admin::app.acl.attribute-families',
'route' => 'admin.catalog.families.index', 'route' => 'admin.catalog.families.index',
'sort' => 4 'sort' => 4
], [ ], [
'key' => 'customers', 'key' => 'customers',
'name' => 'Customers', 'name' => 'admin::app.acl.customers',
'route' => 'admin.customers.index', 'route' => 'admin.customers.index',
'sort' => 4 'sort' => 4
], [ ], [
'key' => 'customers.customers', 'key' => 'customers.customers',
'name' => 'Customers', 'name' => 'admin::app.acl.customers',
'route' => 'admin.customers.index', 'route' => 'admin.customers.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'customers.groups', 'key' => 'customers.groups',
'name' => 'Groups', 'name' => 'admin::app.acl.groups',
'route' => 'admin.groups.index', 'route' => 'admin.groups.index',
'sort' => 2 'sort' => 2
], [ ], [
'key' => 'customers.reviews', 'key' => 'customers.reviews',
'name' => 'Reviews', 'name' => 'admin::app.acl.reviews',
'route' => 'admin.customers.reviews.index', 'route' => 'admin.customers.reviews.index',
'sort' => 3 'sort' => 3
], [ ], [
'key' => 'configuration', 'key' => 'configuration',
'name' => 'Configure', 'name' => 'admin::app.acl.configure',
'route' => 'admin.account.edit', 'route' => 'admin.account.edit',
'sort' => 1 'sort' => 5
], [
'key' => 'configuration',
'name' => 'Configure',
'route' => 'admin.account.edit',
'sort' => 1
], [ ], [
'key' => 'settings', 'key' => 'settings',
'name' => 'Settings', 'name' => 'admin::app.acl.settings',
'route' => 'admin.users.index', 'route' => 'admin.users.index',
'sort' => 6 'sort' => 6
], [ ], [
'key' => 'settings.locales', 'key' => 'settings.locales',
'name' => 'Locales', 'name' => 'admin::app.acl.locales',
'route' => 'admin.locales.index', 'route' => 'admin.locales.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'settings.currencies', 'key' => 'settings.currencies',
'name' => 'Currencies', 'name' => 'admin::app.acl.currencies',
'route' => 'admin.currencies.index', 'route' => 'admin.currencies.index',
'sort' => 2 'sort' => 2
], [ ], [
'key' => 'settings.exchange_rates', 'key' => 'settings.exchange_rates',
'name' => 'Exchange Rates', 'name' => 'admin::app.acl.exchange-rates',
'route' => 'admin.exchange_rates.index', 'route' => 'admin.exchange_rates.index',
'sort' => 3 'sort' => 3
], [ ], [
'key' => 'settings.inventory_sources', 'key' => 'settings.inventory_sources',
'name' => 'Inventory Sources', 'name' => 'admin::app.acl.inventory-sources',
'route' => 'admin.inventory_sources.index', 'route' => 'admin.inventory_sources.index',
'sort' => 4 'sort' => 4
], [ ], [
'key' => 'settings.channels', 'key' => 'settings.channels',
'name' => 'Channels', 'name' => 'admin::app.acl.channels',
'route' => 'admin.channels.index', 'route' => 'admin.channels.index',
'sort' => 5 'sort' => 5
], [ ], [
'key' => 'settings.users', 'key' => 'settings.users',
'name' => 'Users', 'name' => 'admin::app.acl.users',
'route' => 'admin.users.index', 'route' => 'admin.users.index',
'sort' => 6 'sort' => 6
], [ ], [
'key' => 'settings.users.users', 'key' => 'settings.users.users',
'name' => 'Users', 'name' => 'admin::app.acl.users',
'route' => 'admin.users.index', 'route' => 'admin.users.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'settings.users.roles', 'key' => 'settings.users.roles',
'name' => 'Roles', 'name' => 'admin::app.acl.roles',
'route' => 'admin.roles.index', 'route' => 'admin.roles.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'settings.sliders', 'key' => 'settings.sliders',
'name' => 'Sliders', 'name' => 'admin::app.acl.sliders',
'route' => 'admin.sliders.index', 'route' => 'admin.sliders.index',
'sort' => 7 'sort' => 7
], [ ], [
'key' => 'settings.taxes', 'key' => 'settings.taxes',
'name' => 'Taxes', 'name' => 'admin::app.acl.taxes',
'route' => 'admin.tax-categories.index', 'route' => 'admin.tax-categories.index',
'sort' => 8 'sort' => 8
], [ ], [
'key' => 'settings.taxes.tax-categories', 'key' => 'settings.taxes.tax-categories',
'name' => 'Tax Categories', 'name' => 'admin::app.acl.tax-categories',
'route' => 'admin.tax-categories.index', 'route' => 'admin.tax-categories.index',
'sort' => 1 'sort' => 1
], [ ], [
'key' => 'settings.taxes.tax-rates', 'key' => 'settings.taxes.tax-rates',
'name' => 'Tax Rates', 'name' => 'admin::app.acl.tax-rates',
'route' => 'admin.tax-rates.index', 'route' => 'admin.tax-rates.index',
'sort' => 2 'sort' => 2
] ]

View File

@ -3,176 +3,176 @@
return [ return [
[ [
'key' => 'dashboard', 'key' => 'dashboard',
'name' => 'Dashboard', 'name' => 'admin::app.layouts.dashboard',
'route' => 'admin.dashboard.index', 'route' => 'admin.dashboard.index',
'sort' => 1, 'sort' => 1,
'icon-class' => 'dashboard-icon', 'icon-class' => 'dashboard-icon',
], [ ], [
'key' => 'sales', 'key' => 'sales',
'name' => 'Sales', 'name' => 'admin::app.layouts.sales',
'route' => 'admin.sales.orders.index', 'route' => 'admin.sales.orders.index',
'sort' => 2, 'sort' => 2,
'icon-class' => 'sales-icon', 'icon-class' => 'sales-icon',
], [ ], [
'key' => 'sales.orders', 'key' => 'sales.orders',
'name' => 'Orders', 'name' => 'admin::app.layouts.orders',
'route' => 'admin.sales.orders.index', 'route' => 'admin.sales.orders.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'sales.shipments', 'key' => 'sales.shipments',
'name' => 'Shipments', 'name' => 'admin::app.layouts.shipments',
'route' => 'admin.sales.shipments.index', 'route' => 'admin.sales.shipments.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'sales.invoices', 'key' => 'sales.invoices',
'name' => 'Invoices', 'name' => 'admin::app.layouts.invoices',
'route' => 'admin.sales.invoices.index', 'route' => 'admin.sales.invoices.index',
'sort' => 3, 'sort' => 3,
'icon-class' => '', 'icon-class' => '',
], ],
[ [
'key' => 'catalog', 'key' => 'catalog',
'name' => 'Catalog', 'name' => 'admin::app.layouts.catalog',
'route' => 'admin.catalog.products.index', 'route' => 'admin.catalog.products.index',
'sort' => 3, 'sort' => 3,
'icon-class' => 'catalog-icon', 'icon-class' => 'catalog-icon',
], [ ], [
'key' => 'catalog.products', 'key' => 'catalog.products',
'name' => 'Products', 'name' => 'admin::app.layouts.products',
'route' => 'admin.catalog.products.index', 'route' => 'admin.catalog.products.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'catalog.categories', 'key' => 'catalog.categories',
'name' => 'Categories', 'name' => 'admin::app.layouts.categories',
'route' => 'admin.catalog.categories.index', 'route' => 'admin.catalog.categories.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'catalog.attributes', 'key' => 'catalog.attributes',
'name' => 'Attributes', 'name' => 'admin::app.layouts.attributes',
'route' => 'admin.catalog.attributes.index', 'route' => 'admin.catalog.attributes.index',
'sort' => 3, 'sort' => 3,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'catalog.families', 'key' => 'catalog.families',
'name' => 'Families', 'name' => 'admin::app.layouts.attribute-families',
'route' => 'admin.catalog.families.index', 'route' => 'admin.catalog.families.index',
'sort' => 4, 'sort' => 4,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'customers', 'key' => 'customers',
'name' => 'Customers', 'name' => 'admin::app.layouts.customers',
'route' => 'admin.customer.index', 'route' => 'admin.customer.index',
'sort' => 4, 'sort' => 4,
'icon-class' => 'customer-icon', 'icon-class' => 'customer-icon',
], [ ], [
'key' => 'customers.customers', 'key' => 'customers.customers',
'name' => 'Customers', 'name' => 'admin::app.layouts.customers',
'route' => 'admin.customer.index', 'route' => 'admin.customer.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'customers.groups', 'key' => 'customers.groups',
'name' => 'Groups', 'name' => 'admin::app.layouts.groups',
'route' => 'admin.groups.index', 'route' => 'admin.groups.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'customers.reviews', 'key' => 'customers.reviews',
'name' => 'Reviews', 'name' => 'admin::app.layouts.reviews',
'route' => 'admin.customer.review.index', 'route' => 'admin.customer.review.index',
'sort' => 3, 'sort' => 3,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'customers.subscribers', 'key' => 'customers.subscribers',
'name' => 'Newsletter Subscription', 'name' => 'admin::app.layouts.newsletter-subscriptions',
'route' => 'admin.customers.subscribers.index', 'route' => 'admin.customers.subscribers.index',
'sort' => 4, 'sort' => 4,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'configuration', 'key' => 'configuration',
'name' => 'Configure', 'name' => 'admin::app.layouts.configure',
'route' => 'admin.configuration.index', 'route' => 'admin.configuration.index',
'sort' => 5, 'sort' => 5,
'icon-class' => 'configuration-icon', 'icon-class' => 'configuration-icon',
], [ ], [
'key' => 'settings', 'key' => 'settings',
'name' => 'Settings', 'name' => 'admin::app.layouts.settings',
'route' => 'admin.locales.index', 'route' => 'admin.locales.index',
'sort' => 6, 'sort' => 6,
'icon-class' => 'settings-icon', 'icon-class' => 'settings-icon',
], [ ], [
'key' => 'settings.locales', 'key' => 'settings.locales',
'name' => 'Locales', 'name' => 'admin::app.layouts.locales',
'route' => 'admin.locales.index', 'route' => 'admin.locales.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.currencies', 'key' => 'settings.currencies',
'name' => 'Currencies', 'name' => 'admin::app.layouts.currencies',
'route' => 'admin.currencies.index', 'route' => 'admin.currencies.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.exchange_rates', 'key' => 'settings.exchange_rates',
'name' => 'Exchange Rates', 'name' => 'admin::app.layouts.exchange-rates',
'route' => 'admin.exchange_rates.index', 'route' => 'admin.exchange_rates.index',
'sort' => 3, 'sort' => 3,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.inventory_sources', 'key' => 'settings.inventory_sources',
'name' => 'Inventory Sources', 'name' => 'admin::app.layouts.inventory-sources',
'route' => 'admin.inventory_sources.index', 'route' => 'admin.inventory_sources.index',
'sort' => 4, 'sort' => 4,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.channels', 'key' => 'settings.channels',
'name' => 'Channels', 'name' => 'admin::app.layouts.channels',
'route' => 'admin.channels.index', 'route' => 'admin.channels.index',
'sort' => 5, 'sort' => 5,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.users', 'key' => 'settings.users',
'name' => 'Users', 'name' => 'admin::app.layouts.users',
'route' => 'admin.users.index', 'route' => 'admin.users.index',
'sort' => 6, 'sort' => 6,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.users.users', 'key' => 'settings.users.users',
'name' => 'Users', 'name' => 'admin::app.layouts.users',
'route' => 'admin.users.index', 'route' => 'admin.users.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.users.roles', 'key' => 'settings.users.roles',
'name' => 'Roles', 'name' => 'admin::app.layouts.roles',
'route' => 'admin.roles.index', 'route' => 'admin.roles.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.sliders', 'key' => 'settings.sliders',
'name' => 'Sliders', 'name' => 'admin::app.layouts.sliders',
'route' => 'admin.sliders.index', 'route' => 'admin.sliders.index',
'sort' => 7, 'sort' => 7,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.taxes', 'key' => 'settings.taxes',
'name' => 'Taxes', 'name' => 'admin::app.layouts.taxes',
'route' => 'admin.tax-categories.index', 'route' => 'admin.tax-categories.index',
'sort' => 8, 'sort' => 8,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.taxes.tax-categories', 'key' => 'settings.taxes.tax-categories',
'name' => 'Tax Categories', 'name' => 'admin::app.layouts.tax-categories',
'route' => 'admin.tax-categories.index', 'route' => 'admin.tax-categories.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'settings.taxes.tax-rates', 'key' => 'settings.taxes.tax-rates',
'name' => 'Tax Rates', 'name' => 'admin::app.layouts.tax-rates',
'route' => 'admin.tax-rates.index', 'route' => 'admin.tax-rates.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',

View File

@ -2,18 +2,21 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * AttributeDataGrid class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class AttributeDataGrid extends AbsGrid class AttributeDataGrid extends DataGrid
{ {
public $allColumns = []; protected $itemsPerPage = 5; //overriding the default items per page
protected $index = 'id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +25,11 @@ class AttributeDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'attributeId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +38,7 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'attributeCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +47,7 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'admin_name', 'index' => 'admin_name',
'alias' => 'attributeAdminName', 'label' => trans('admin::app.datagrid.admin-name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,8 +56,7 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'type', 'index' => 'type',
'alias' => 'attributeType', 'label' => trans('admin::app.datagrid.type'),
'label' => 'Type',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => true, 'searchable' => true,
@ -70,14 +65,13 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'is_required', 'index' => 'is_required',
'alias' => 'attributeRequired', 'label' => trans('admin::app.datagrid.required'),
'label' => 'Required',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'True'; return 'True';
else else
return 'False'; return 'False';
@ -86,14 +80,13 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'is_unique', 'index' => 'is_unique',
'alias' => 'attributeIsUnique', 'label' => trans('admin::app.datagrid.unique'),
'label' => 'Unique',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'True'; return 'True';
else else
return 'False'; return 'False';
@ -102,14 +95,13 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'value_per_locale', 'index' => 'value_per_locale',
'alias' => 'attributeValuePerLocale', 'label' => trans('admin::app.datagrid.per-locale'),
'label' => 'Locale Based',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'True'; return 'True';
else else
return 'False'; return 'False';
@ -118,14 +110,13 @@ class AttributeDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'value_per_channel', 'index' => 'value_per_channel',
'alias' => 'attributeValuePerChannel', 'label' => trans('admin::app.datagrid.per-channel'),
'label' => 'Channel Based',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'True'; return 'True';
else else
return 'False'; return 'False';
@ -133,7 +124,8 @@ class AttributeDataGrid extends AbsGrid
]); ]);
} }
public function prepareActions() { public function prepareActions()
{
$this->addAction([ $this->addAction([
'type' => 'Edit', 'type' => 'Edit',
'route' => 'admin.catalog.attributes.edit', 'route' => 'admin.catalog.attributes.edit',
@ -147,10 +139,12 @@ class AttributeDataGrid extends AbsGrid
]); ]);
} }
public function prepareMassActions() { public function prepareMassActions()
{
$this->addMassAction([ $this->addMassAction([
'type' => 'delete', 'type' => 'delete',
'action' => route('admin.catalog.attributes.massdelete'), 'action' => route('admin.catalog.attributes.massdelete'),
'label' => 'Delete',
'method' => 'DELETE' 'method' => 'DELETE'
]); ]);
} }

View File

@ -2,18 +2,20 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * AttributeFamilyDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class AttributeFamilyDataGrid extends AbsGrid class AttributeFamilyDataGrid extends DataGrid
{ {
public $allColumns = []; protected $itemsPerPage = 5;
protected $index = 'id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +24,11 @@ class AttributeFamilyDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'attributeFamilyId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +37,7 @@ class AttributeFamilyDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'attributeFamilyCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +46,7 @@ class AttributeFamilyDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'attributeFamilyName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * CategoryDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class CategoryDataGrid extends AbsGrid class CategoryDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'category_id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('categories as cat')->select('cat.id', 'ct.name', 'cat.position', 'cat.status', 'ct.locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id'); $queryBuilder = DB::table('categories as cat')->select('cat.id as category_id', 'ct.name as category_name', 'cat.position as category_position', 'cat.status as category_status', 'ct.locale as category_locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'cat.id', 'index' => 'category_id',
'alias' => 'catId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class CategoryDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ct.name', 'index' => 'category_name',
'alias' => 'catName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -49,9 +43,8 @@ class CategoryDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'cat.position', 'index' => 'category_position',
'alias' => 'catPosition', 'label' => trans('admin::app.datagrid.position'),
'label' => 'Position',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -59,15 +52,14 @@ class CategoryDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'cat.status', 'index' => 'category_status',
'alias' => 'catStatus', 'label' => trans('admin::app.datagrid.status'),
'label' => 'Status',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => true, 'searchable' => true,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'Active'; return 'Active';
else else
return 'Inactive'; return 'Inactive';
@ -75,9 +67,8 @@ class CategoryDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ct.locale', 'index' => 'category_locale',
'alias' => 'catLocale', 'label' => trans('admin::app.datagrid.locale'),
'label' => 'Locale',
'type' => 'boolean', 'type' => 'boolean',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Channel Data Grid class * ChannelDataGrid class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class ChannelDataGrid extends AbsGrid class ChannelDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class ChannelDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'channelId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class ChannelDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'channelCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class ChannelDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'channelName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,8 +53,7 @@ class ChannelDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'hostname', 'index' => 'hostname',
'alias' => 'channelHostname', 'label' => trans('admin::app.datagrid.hostname'),
'label' => 'Hostname',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => true, 'searchable' => true,

View File

@ -1,113 +0,0 @@
<?php
namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid;
use DB;
/**
* Product Data Grid class
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CountryDataGrid extends AbsGrid
{
public $allColumns = [];
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('countries')->select('id')->addSelect($this->columns);
$this->setQueryBuilder($queryBuilder);
}
public function addColumns()
{
$this->addColumn([
'column' => 'id',
'alias' => 'countryId',
'label' => 'ID',
'type' => 'number',
'searchable' => false,
'sortable' => true,
'width' => '40px'
]);
$this->addColumn([
'column' => 'code',
'alias' => 'countryCode',
'label' => 'Code',
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'column' => 'name',
'alias' => 'countryName',
'label' => 'Name',
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'column' => 'status',
'alias' => 'countryStatus',
'label' => 'Status',
'type' => 'number',
'sortable' => true,
'searchable' => true,
'width' => '100px'
]);
}
public function prepareActions() {
$this->prepareAction([
'type' => 'Edit',
'route' => 'admin.catalog.products.edit',
'icon' => 'icon pencil-lg-icon'
]);
$this->prepareAction([
'type' => 'Delete',
'route' => 'admin.catalog.products.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon'
]);
}
public function prepareMassActions() {
// $this->prepareMassAction([
// 'type' => 'delete',
// 'action' => route('admin.catalog.products.massdelete'),
// 'method' => 'DELETE'
// ]);
// $this->prepareMassAction([
// 'type' => 'update',
// 'action' => route('admin.catalog.products.massupdate'),
// 'method' => 'PUT',
// 'options' => [
// 0 => true,
// 1 => false,
// ]
// ]);
}
public function render()
{
$this->addColumns();
$this->prepareActions();
$this->prepareMassActions();
$this->prepareQueryBuilder();
return view('ui::testgrid.table')->with('results', ['records' => $this->getCollection(), 'columns' => $this->allColumns, 'actions' => $this->actions, 'massactions' => $this->massActions]);
}
}

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Currency Data Grid class * CurrencyDataGrid class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class CurrencyDataGrid extends AbsGrid class CurrencyDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class CurrencyDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'currencyId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class CurrencyDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'currencyName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class CurrencyDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'currencyCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,36 +2,33 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Currency Data Grid class * CustomerDataGrid class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class CustomerDataGrid extends AbsGrid class CustomerDataGrid extends DataGrid
{ {
public $allColumns = []; protected $itemsPerPage = 5;
protected $index = 'customer_id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('customers as cus')->addSelect('cus.id', 'cus.first_name', 'cus.email', 'cg.name')->leftJoin('customer_groups as cg', 'cus.customer_group_id', '=', 'cg.id'); $queryBuilder = DB::table('customers')->addSelect('customers.id as customer_id', 'customers.email as customer_email', 'customer_groups.name as customer_group_name')->addSelect(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as customer_full_name'))->leftJoin('customer_groups', 'customers.customer_group_id', '=', 'customer_groups.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'cus.id', 'index' => 'customer_id',
'alias' => 'customerId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,10 +36,8 @@ class CustomerDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
// 'column' => 'CONCAT(cus.first_name, " ", cus.last_name)', 'index' => 'customer_full_name',
'index' => 'cus.first_name', 'label' => trans('admin::app.datagrid.name'),
'alias' => 'customerFullName',
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,9 +45,8 @@ class CustomerDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'cus.email', 'index' => 'customer_email',
'alias' => 'customerEmail', 'label' => trans('admin::app.datagrid.email'),
'label' => 'Email',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,9 +54,8 @@ class CustomerDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'cg.name', 'index' => 'customer_group_name',
'alias' => 'customerGroupName', 'label' => trans('admin::app.datagrid.group'),
'label' => 'Group',
'type' => 'string', 'type' => 'string',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Currency Data Grid class * CustomerDataGrid class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class CustomerGroupDataGrid extends AbsGrid class CustomerGroupDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,15 +22,10 @@ class CustomerGroupDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'groupId',
'label' => 'ID', 'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
@ -39,9 +34,7 @@ class CustomerGroupDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
// 'column' => 'CONCAT(cus.first_name, " ", cus.last_name)',
'index' => 'name', 'index' => 'name',
'alias' => 'groupName',
'label' => 'Name', 'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Currency Data Grid class * CustomerReviewDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class CustomerReviewDataGrid extends AbsGrid class CustomerReviewDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'product_review_id'; //the column that needs to be treated as index column
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id', 'pr.title', 'pr.comment', 'pg.name', 'pr.status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id'); $queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id as product_review_id', 'pr.title as product_review_title', 'pr.comment as product_review_comment', 'pg.name as product_review_name', 'pr.status as product_review_status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'pr.id', 'index' => 'product_review_id',
'alias' => 'reviewId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class CustomerReviewDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'pr.title', 'index' => 'product_review_title',
'alias' => 'reviewTitle', 'label' => trans('admin::app.datagrid.title'),
'label' => 'Title',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -49,9 +43,8 @@ class CustomerReviewDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'pr.comment', 'index' => 'product_review_comment',
'alias' => 'reviewComment', 'label' => trans('admin::app.datagrid.comment'),
'label' => 'Comment',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -59,9 +52,8 @@ class CustomerReviewDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'pg.name', 'index' => 'product_review_name',
'alias' => 'productName', 'label' => trans('admin::app.datagrid.product-name'),
'label' => 'Product',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -69,18 +61,17 @@ class CustomerReviewDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'pr.status', 'index' => 'product_review_status',
'alias' => 'reviewStatus', 'label' => trans('admin::app.datagrid.status'),
'label' => 'Status',
'type' => 'boolean', 'type' => 'boolean',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
'width' => '100px', 'width' => '100px',
'closure' => true, 'closure' => true,
'wrapper' => function ($value) { 'wrapper' => function ($value) {
if($value == 'approved') if ($value == 'approved')
return '<span class="badge badge-md badge-success">Approved</span>'; return '<span class="badge badge-md badge-success">Approved</span>';
else if($value == "pending") else if ($value == "pending")
return '<span class="badge badge-md badge-warning">Pending</span>'; return '<span class="badge badge-md badge-warning">Pending</span>';
}, },
]); ]);
@ -103,17 +94,19 @@ class CustomerReviewDataGrid extends AbsGrid
public function prepareMassActions() { public function prepareMassActions() {
$this->addMassAction([ $this->addMassAction([
'type' => 'delete', 'type' => 'delete',
'action' => route('admin.catalog.products.massdelete'), 'label' => 'Delete',
'action' => route('admin.customer.review.massdelete'),
'method' => 'DELETE' 'method' => 'DELETE'
]); ]);
$this->addMassAction([ $this->addMassAction([
'type' => 'update', 'type' => 'update',
'action' => route('admin.catalog.products.massupdate'), 'label' => 'Update Status',
'action' => route('admin.customer.review.massupdate'),
'method' => 'PUT', 'method' => 'PUT',
'options' => [ 'options' => [
0 => true, 'Disapprove' => 0,
1 => false, 'Approve' => 1
] ]
]); ]);
} }

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * ExchangeRateDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class ExchangeRatesDataGrid extends AbsGrid class ExchangeRatesDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'currency_exch_id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id', 'curr.name', 'cer.rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id'); $queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id as currency_exch_id', 'curr.name as currency_exch_name', 'cer.rate as currency_exch_rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'cer.id', 'index' => 'currency_exch_id',
'alias' => 'exchId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class ExchangeRatesDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'curr.name', 'index' => 'currency_exch_name',
'alias' => 'exchName', 'label' => trans('admin::app.datagrid.currency-name'),
'label' => 'Currency Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -49,9 +43,8 @@ class ExchangeRatesDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'cer.rate', 'index' => 'currency_exch_rate',
'alias' => 'exchRate', 'label' => trans('admin::app.datagrid.exch-rate'),
'label' => 'Exchange Rate',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * InventorySourcesDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class InventorySourcesDataGrid extends AbsGrid class InventorySourcesDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class InventorySourcesDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'invId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class InventorySourcesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'invCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class InventorySourcesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'invName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,8 +53,7 @@ class InventorySourcesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'priority', 'index' => 'priority',
'alias' => 'invPriority', 'label' => trans('admin::app.datagrid.priority'),
'label' => 'Priority',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -70,14 +62,13 @@ class InventorySourcesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'status', 'index' => 'status',
'alias' => 'invStatus', 'label' => trans('admin::app.datagrid.status'),
'label' => 'Status',
'type' => 'boolean', 'type' => 'boolean',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'Active'; return 'Active';
else else
return 'Inactive'; return 'Inactive';

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * LocalesDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class LocalesDataGrid extends AbsGrid class LocalesDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class LocalesDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'localeId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class LocalesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'localeCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class LocalesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'localeName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* News Letter Grid class * NewsLetterDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class NewsLetterDataGrid extends AbsGrid class NewsLetterDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class NewsLetterDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'subsId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,14 +35,13 @@ class NewsLetterDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'is_subscribed', 'index' => 'is_subscribed',
'alias' => 'subsCode', 'label' => trans('admin::app.datagrid.subscribed'),
'label' => 'Subscribed',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value){ 'wrapper' => function($value) {
if($value == 1) if ($value == 1)
return 'True'; return 'True';
else else
return 'False'; return 'False';
@ -56,8 +50,7 @@ class NewsLetterDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'email', 'index' => 'email',
'alias' => 'subsEmail', 'label' => trans('admin::app.datagrid.email'),
'label' => 'Email',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * OrderDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class OrderDataGrid extends AbsGrid class OrderDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as fullname')); $queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as full_name'));
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'orderId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class OrderDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'base_grand_total', 'index' => 'base_grand_total',
'alias' => 'baseGrandTotal', 'label' => trans('admin::app.datagrid.base-total'),
'label' => 'Base Total',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -53,8 +47,7 @@ class OrderDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'grand_total', 'index' => 'grand_total',
'alias' => 'grandTotal', 'label' => trans('admin::app.datagrid.grand-total'),
'label' => 'Grand Total',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -66,8 +59,7 @@ class OrderDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'created_at', 'index' => 'created_at',
'alias' => 'orderDate', 'label' => trans('admin::app.datagrid.order-date'),
'label' => 'Order Date',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => true, 'searchable' => true,
@ -76,8 +68,7 @@ class OrderDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'channel_name', 'index' => 'channel_name',
'alias' => 'channelName', 'label' => trans('admin::app.datagrid.channel-name'),
'label' => 'Channel Name',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
@ -86,35 +77,33 @@ class OrderDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'status', 'index' => 'status',
'alias' => 'status', 'label' => trans('admin::app.datagrid.status'),
'label' => 'Status',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
'width' => '100px', 'width' => '100px',
'closure' => true, 'closure' => true,
'wrapper' => function ($value) { 'wrapper' => function ($value) {
if($value == 'processing') if ($value == 'processing')
return '<span class="badge badge-md badge-success">Processing</span>'; return '<span class="badge badge-md badge-success">Processing</span>';
else if($value == 'completed') else if ($value == 'completed')
return '<span class="badge badge-md badge-success">Completed</span>'; return '<span class="badge badge-md badge-success">Completed</span>';
else if($value == "canceled") else if ($value == "canceled")
return '<span class="badge badge-md badge-danger">Canceled</span>'; return '<span class="badge badge-md badge-danger">Canceled</span>';
else if($value == "closed") else if ($value == "closed")
return '<span class="badge badge-md badge-info">Closed</span>'; return '<span class="badge badge-md badge-info">Closed</span>';
else if($value == "pending") else if ($value == "pending")
return '<span class="badge badge-md badge-warning">Pending</span>'; return '<span class="badge badge-md badge-warning">Pending</span>';
else if($value == "pending_payment") else if ($value == "pending_payment")
return '<span class="badge badge-md badge-warning">Pending Payment</span>'; return '<span class="badge badge-md badge-warning">Pending Payment</span>';
else if($value == "fraud") else if ($value == "fraud")
return '<span class="badge badge-md badge-danger">Fraud</span>'; return '<span class="badge badge-md badge-danger">Fraud</span>';
} }
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'fullname', 'index' => 'full_name',
'alias' => 'fullName', 'label' => trans('admin::app.datagrid.billed-to'),
'label' => 'Billed To',
'type' => 'string', 'type' => 'string',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * OrderInvoicesDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class OrderInvoicesDataGrid extends AbsGrid class OrderInvoicesDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class OrderInvoicesDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'invid', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class OrderInvoicesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'order_id', 'index' => 'order_id',
'alias' => 'orderId', 'label' => trans('admin::app.datagrid.order-id'),
'label' => 'Order ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class OrderInvoicesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'grand_total', 'index' => 'grand_total',
'alias' => 'invgrandtotal', 'label' => trans('admin::app.datagrid.grand-total'),
'label' => 'Grand Total',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,8 +53,7 @@ class OrderInvoicesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'created_at', 'index' => 'created_at',
'alias' => 'invcreatedat', 'label' => trans('admin::app.datagrid.invoice-date'),
'label' => 'Invoice Date',
'type' => 'datetime', 'type' => 'datetime',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Product Data Grid class * OrderShipmentsDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class OrderShipmentsDataGrid extends AbsGrid class OrderShipmentsDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'shipment_id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('shipments as ship')->select('ship.id', 'ship.order_id', 'ship.total_qty', 'is.name', 'ors.created_at as orderdate', 'ship.created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id'); $queryBuilder = DB::table('shipments as ship')->select('ship.id as shipment_id', 'ship.order_id as shipment_order_id', 'ship.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'ship.created_at as shipment_created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id'; //the column that needs to be treated as index column
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'ship.id', 'index' => 'shipment_id',
'alias' => 'shipId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class OrderShipmentsDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ship.order_id', 'index' => 'shipment_order_id',
'alias' => 'orderId', 'label' => trans('admin::app.datagrid.order-id'),
'label' => 'Order ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -49,9 +43,8 @@ class OrderShipmentsDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ship.total_qty', 'index' => 'shipment_total_qty',
'alias' => 'shipTotalQty', 'label' => trans('admin::app.datagrid.total-qty'),
'label' => 'Total Qty',
'type' => 'number', 'type' => 'number',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -59,9 +52,8 @@ class OrderShipmentsDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'is.name', 'index' => 'inventory_source_name',
'alias' => 'shipInventoryName', 'label' => trans('admin::app.datagrid.inventory-source'),
'label' => 'Inventory Source',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -70,8 +62,7 @@ class OrderShipmentsDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'orderdate', 'index' => 'orderdate',
'alias' => 'shipOrderDate', 'label' => trans('admin::app.datagrid.order-date'),
'label' => 'Order Date',
'type' => 'datetime', 'type' => 'datetime',
'sortable' => true, 'sortable' => true,
'searchable' => true, 'searchable' => true,
@ -79,9 +70,8 @@ class OrderShipmentsDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ship.created_at', 'index' => 'shipment_created_at',
'alias' => 'shipDate', 'label' => trans('admin::app.datagrid.shipment-date'),
'label' => 'Shipment Date',
'type' => 'datetime', 'type' => 'datetime',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,
@ -90,8 +80,7 @@ class OrderShipmentsDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'custname', 'index' => 'custname',
'alias' => 'shipTO', 'label' => trans('admin::app.datagrid.shipment-to'),
'label' => 'Shipping To',
'type' => 'string', 'type' => 'string',
'sortable' => true, 'sortable' => true,
'searchable' => false, 'searchable' => false,

299
packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php Executable file → Normal file
View File

@ -2,208 +2,133 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Illuminate\View\View; use Webkul\Ui\DataGrid\DataGrid;
use Webkul\Ui\DataGrid\Facades\DataGrid; use DB;
use Webkul\Channel\Repositories\ChannelRepository;
use Webkul\Product\Repositories\ProductRepository;
/** /**
* Product DataGrid * ProductDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class ProductDataGrid class ProductDataGrid extends DataGrid
{ {
protected $index = 'product_id';
/** public function prepareQueryBuilder()
* The Data Grid implementation for Products
*/
public function createProductDataGrid()
{ {
return DataGrid::make([ $queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id as product_id', 'products_grid.sku as product_sku', 'products_grid.name as product_name', 'products.type as product_type', 'products_grid.status as product_status', 'products_grid.price as product_price', 'products_grid.quantity as product_quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id');
'name' => 'Products',
'table' => 'products_grid as prods',
'select' => 'prods.product_id',
'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'massoperations' => [ $this->setQueryBuilder($queryBuilder);
0 => [ }
'type' => 'delete', //all lower case will be shifted in the configuration file for better control and increased fault tolerance
'action' => route('admin.catalog.products.massdelete'),
'method' => 'DELETE'
],
1 => [ public function addColumns()
'type' => 'update', //all lower case will be shifted in the configuration file for better control and increased fault tolerance {
'action' => route('admin.catalog.products.massupdate'), $this->addColumn([
'method' => 'PUT', 'index' => 'product_id',
'options' => [ 'label' => trans('admin::app.datagrid.id'),
0 => 'In Active', 'type' => 'number',
1 => 'Active', 'searchable' => false,
] 'sortable' => true,
] 'width' => '40px'
],
'actions' => [
[
'type' => 'Edit',
'route' => 'admin.catalog.products.edit',
// 'confirm_text' => trans('ui::app.datagrid.massaction.edit', ['resource' => 'product']),
'icon' => 'icon pencil-lg-icon'
], [
'type' => 'Delete',
'route' => 'admin.catalog.products.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon'
]
],
'join' => [
],
//use aliasing on secodary columns if join is performed
'columns' => [
//name, alias, type, label, sortable
[
'name' => 'prods.product_id',
'alias' => 'id',
'type' => 'string',
'label' => 'ID',
'sortable' => true,
], [
'name' => 'prods.sku',
'alias' => 'productSku',
'type' => 'string',
'label' => 'SKU',
'sortable' => true,
], [
'name' => 'prods.name',
'alias' => 'ProductName',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
], [
'name' => 'prods.type',
'alias' => 'ProductType',
'type' => 'string',
'label' => 'Type',
'sortable' => true,
], [
'name' => 'prods.status',
'alias' => 'ProductStatus',
'type' => 'boolean',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 1)
return 'Active';
else
return 'Inactive';
},
], [
'name' => 'prods.price',
'alias' => 'ProductPrice',
'type' => 'string',
'label' => 'Price',
'sortable' => true,
'wrapper' => function ($value) {
return core()->formatBasePrice($value);
},
], [
'name' => 'prods.attribute_family_name',
'alias' => 'productattributefamilyname',
'type' => 'string',
'label' => 'Attribute Family',
'sortable' => true,
], [
'name' => 'prods.quantity',
'alias' => 'ProductQuantity',
'type' => 'string',
'label' => 'Product Quantity',
'sortable' => true,
]
],
'filterable' => [
//column, alias, type, and label
[
'column' => 'prods.product_id',
'alias' => 'productID',
'type' => 'number',
'label' => 'ID',
], [
'column' => 'prods.sku',
'alias' => 'productSku',
'type' => 'string',
'label' => 'SKU',
], [
'column' => 'prods.name',
'alias' => 'ProductName',
'type' => 'string',
'label' => 'Product Name',
], [
'column' => 'prods.type',
'alias' => 'ProductType',
'type' => 'string',
'label' => 'Product Type',
], [
'column' => 'prods.status',
'alias' => 'ProductStatus',
'type' => 'boolean',
'label' => 'Status'
]
],
//don't use aliasing in case of searchables
'searchable' => [
//column, type and label
[
'column' => 'prods.product_id',
'type' => 'number',
'label' => 'ID',
], [
'column' => 'prods.sku',
'type' => 'string',
'label' => 'SKU',
], [
'column' => 'prods.name',
'type' => 'string',
'label' => 'Product Name',
], [
'column' => 'prods.type',
'type' => 'string',
'label' => 'Product Type',
]
],
//list of viable operators that will be used
'operators' => [
'eq' => "=",
'lt' => "<",
'gt' => ">",
'lte' => "<=",
'gte' => ">=",
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
]); ]);
$this->addColumn([
'index' => 'product_sku',
'label' => trans('admin::app.datagrid.sku'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'product_name',
'label' => trans('admin::app.datagrid.name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'product_type',
'label' => trans('admin::app.datagrid.type'),
'type' => 'string',
'sortable' => true,
'searchable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'product_status',
'label' => trans('admin::app.datagrid.status'),
'type' => 'boolean',
'sortable' => true,
'searchable' => false,
'width' => '100px',
'wrapper' => function($value) {
if ($value == 1)
return 'Active';
else
return 'Inactive';
}
]);
$this->addColumn([
'index' => 'product_price',
'label' => trans('admin::app.datagrid.price'),
'type' => 'number',
'sortable' => true,
'searchable' => false,
'width' => '100px',
'wrapper' => function($value) {
return core()->formatBasePrice($value);
}
]);
$this->addColumn([
'index' => 'product_quantity',
'label' => trans('admin::app.datagrid.qty'),
'type' => 'number',
'sortable' => true,
'searchable' => false,
'width' => '100px'
]);
} }
public function render() public function prepareActions() {
{ $this->addAction([
return $this->createProductDataGrid()->render(); 'type' => 'Edit',
'route' => 'admin.catalog.products.edit',
'icon' => 'icon pencil-lg-icon'
]);
$this->addAction([
'type' => 'Delete',
'route' => 'admin.catalog.products.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon'
]);
} }
public function export() public function prepareMassActions() {
{ $this->addMassAction([
$paginate = false; 'type' => 'delete',
return $this->createProductDataGrid()->render($paginate); 'label' => 'Delete',
} 'action' => route('admin.catalog.products.massdelete'),
'method' => 'DELETE'
]);
$this->addMassAction([
'type' => 'update',
'label' => 'Update Status',
'action' => route('admin.catalog.products.massupdate'),
'method' => 'PUT',
'options' => [
'Active' => 1,
'Inactive' => 0
]
]);
}
} }

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* News Letter Grid class * RolesDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class RolesDataGrid extends AbsGrid class RolesDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class RolesDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'roleId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class RolesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'roleName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class RolesDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'permission_type', 'index' => 'permission_type',
'alias' => 'roleType', 'label' => trans('admin::app.datagrid.permission-type'),
'label' => 'Permission Type',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* News Letter Grid class * SliderDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class SliderDataGrid extends AbsGrid class SliderDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'slider_id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('sliders as sl')->addSelect('sl.id', 'sl.title', 'ch.name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id'); $queryBuilder = DB::table('sliders as sl')->addSelect('sl.id as slider_id', 'sl.title as slider_title', 'ch.name as channel_name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'sl.id', 'index' => 'slider_id',
'alias' => 'sliderId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class SliderDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'sl.title', 'index' => 'slider_title',
'alias' => 'sliderTitle', 'label' => trans('admin::app.datagrid.title'),
'label' => 'Tile',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -49,9 +43,8 @@ class SliderDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'ch.name', 'index' => 'channel_name',
'alias' => 'channelName', 'label' => trans('admin::app.datagrid.channel-name'),
'label' => 'Channel Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Tax Category Grid class * TaxCategoryDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class TaxCategoryDataGrid extends AbsGrid class TaxCategoryDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class TaxCategoryDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'taxCatId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class TaxCategoryDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'name', 'index' => 'name',
'alias' => 'taxCatName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class TaxCategoryDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'code', 'index' => 'code',
'alias' => 'taxCatCode', 'label' => trans('admin::app.datagrid.code'),
'label' => 'Code',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -2,18 +2,18 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* Tax Rate Grid class * TaxRateDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class TaxRateDataGrid extends AbsGrid class TaxRateDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
@ -22,16 +22,11 @@ class TaxRateDataGrid extends AbsGrid
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'id', 'index' => 'id',
'alias' => 'taxRateId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -40,8 +35,7 @@ class TaxRateDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'identifier', 'index' => 'identifier',
'alias' => 'taxRateName', 'label' => trans('admin::app.datagrid.identifier'),
'label' => 'Identifier',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -50,8 +44,7 @@ class TaxRateDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'state', 'index' => 'state',
'alias' => 'taxRateState', 'label' => trans('admin::app.datagrid.state'),
'label' => 'State',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -60,8 +53,7 @@ class TaxRateDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'country', 'index' => 'country',
'alias' => 'taxRateCountry', 'label' => trans('admin::app.datagrid.country'),
'label' => 'Country',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -70,8 +62,7 @@ class TaxRateDataGrid extends AbsGrid
$this->addColumn([ $this->addColumn([
'index' => 'tax_rate', 'index' => 'tax_rate',
'alias' => 'taxRate', 'label' => trans('admin::app.datagrid.tax-rate'),
'label' => 'Rate',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -1,147 +0,0 @@
<?php
namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid;
use DB;
/**
* Product Data Grid class
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TestDataGrid extends AbsGrid
{
public $allColumns = [];
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id', 'products_grid.sku', 'products_grid.name', 'products.type', 'products_grid.status', 'products_grid.price', 'products_grid.quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id');
$this->setQueryBuilder($queryBuilder);
}
public function setIndex() {
$this->index = 'product_id'; //the column that needs to be treated as index column
}
// public function setGridName() {
// $this->gridName = 'products_grid'; // should be the table name for getting proper index
// }
public function addColumns()
{
$this->addColumn([
'index' => 'products_grid.product_id',
'alias' => 'productid',
'label' => 'ID',
'type' => 'number',
'searchable' => false,
'sortable' => true,
'width' => '40px'
]);
$this->addColumn([
'index' => 'products_grid.sku',
'alias' => 'productsku',
'label' => 'SKU',
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'products_grid.name',
'alias' => 'productname',
'label' => 'Name',
'type' => 'string',
'searchable' => true,
'sortable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'products.type',
'alias' => 'producttype',
'label' => 'Type',
'type' => 'string',
'sortable' => true,
'searchable' => true,
'width' => '100px'
]);
$this->addColumn([
'index' => 'products_grid.status',
'alias' => 'productstatus',
'label' => 'Status',
'type' => 'boolean',
'sortable' => true,
'searchable' => false,
'width' => '100px',
'wrapper' => function($value) {
if($value == 1)
return 'Active';
else
return 'Inactive';
}
]);
$this->addColumn([
'index' => 'products_grid.price',
'alias' => 'productprice',
'label' => 'Price',
'type' => 'number',
'sortable' => true,
'searchable' => false,
'width' => '100px',
'wrapper' => function($value) {
return core()->formatBasePrice($value);
}
]);
$this->addColumn([
'index' => 'products_grid.quantity',
'alias' => 'productqty',
'label' => 'Quantity',
'type' => 'number',
'sortable' => true,
'searchable' => false,
'width' => '100px'
]);
}
public function prepareActions() {
$this->addAction([
'type' => 'Edit',
'route' => 'admin.catalog.products.edit',
'icon' => 'icon pencil-lg-icon'
]);
$this->addAction([
'type' => 'Delete',
'route' => 'admin.catalog.products.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
'icon' => 'icon trash-icon'
]);
}
public function prepareMassActions() {
$this->addMassAction([
'type' => 'delete',
'action' => route('admin.catalog.products.massdelete'),
'method' => 'DELETE'
]);
$this->addMassAction([
'type' => 'update',
'action' => route('admin.catalog.products.massupdate'),
'method' => 'PUT',
'options' => [
0 => true,
1 => false,
]
]);
}
}

View File

@ -2,36 +2,31 @@
namespace Webkul\Admin\DataGrids; namespace Webkul\Admin\DataGrids;
use Webkul\Ui\DataGrid\AbsGrid; use Webkul\Ui\DataGrid\DataGrid;
use DB; use DB;
/** /**
* News Letter Grid class * UserDataGrid Class
* *
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul * @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/ */
class UserDataGrid extends AbsGrid class UserDataGrid extends DataGrid
{ {
public $allColumns = []; protected $index = 'user_id';
public function prepareQueryBuilder() public function prepareQueryBuilder()
{ {
$queryBuilder = DB::table('admins as u')->addSelect('u.id', 'u.name', 'u.status', 'u.email', 'ro.name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id'); $queryBuilder = DB::table('admins as u')->addSelect('u.id as user_id', 'u.name as user_name', 'u.status as user_status', 'u.email as user_email', 'ro.name as role_name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
public function setIndex() {
$this->index = 'id';
}
public function addColumns() public function addColumns()
{ {
$this->addColumn([ $this->addColumn([
'index' => 'u.id', 'index' => 'user_id',
'alias' => 'adminId', 'label' => trans('admin::app.datagrid.id'),
'label' => 'ID',
'type' => 'number', 'type' => 'number',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
@ -39,9 +34,8 @@ class UserDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'u.name', 'index' => 'user_name',
'alias' => 'adminName', 'label' => trans('admin::app.datagrid.name'),
'label' => 'Name',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
@ -49,15 +43,14 @@ class UserDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'u.status', 'index' => 'user_status',
'alias' => 'adminStatus', 'label' => trans('admin::app.datagrid.status'),
'label' => 'Status',
'type' => 'boolean', 'type' => 'boolean',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,
'width' => '100px', 'width' => '100px',
'wrapper' => function($value) { 'wrapper' => function($value) {
if($value == 1) { if ($value == 1) {
return 'Active'; return 'Active';
} else { } else {
return 'Inactive'; return 'Inactive';
@ -66,9 +59,8 @@ class UserDataGrid extends AbsGrid
]); ]);
$this->addColumn([ $this->addColumn([
'index' => 'u.email', 'index' => 'user_email',
'alias' => 'adminEmail', 'label' => trans('admin::app.datagrid.email'),
'label' => 'Email',
'type' => 'string', 'type' => 'string',
'searchable' => true, 'searchable' => true,
'sortable' => true, 'sortable' => true,

View File

@ -35,7 +35,7 @@ class Handler extends ExceptionHandler
} }
// else if ($exception instanceof ErrorException) { // else if ($exception instanceof ErrorException) {
// if(strpos($_SERVER['REQUEST_URI'], 'admin') !== false){ // if (strpos($_SERVER['REQUEST_URI'], 'admin') !== false) {
// return response()->view('admin::errors.500', [], 500); // return response()->view('admin::errors.500', [], 500);
// }else { // }else {
// return response()->view('shop::errors.500', [], 500); // return response()->view('shop::errors.500', [], 500);

View File

@ -42,9 +42,11 @@ class DataGridExport implements FromView, ShouldAutoSize
{ {
$pagination = false; $pagination = false;
return view('admin::export.export', [ dd($this->gridData);
'results' => $this->gridData->render($pagination)->results,
'columns' => $this->gridData->render($pagination)->columns, // return view('admin::export.export', [
]); // 'results' => $this->gridData->render($pagination)->results,
// 'columns' => $this->gridData->render($pagination)->columns,
// ]);
} }
} }

View File

@ -65,7 +65,7 @@ class ConfigurationController extends Controller
{ {
$tree = Tree::create(); $tree = Tree::create();
foreach(config('core') as $item) { foreach (config('core') as $item) {
$tree->add($item); $tree->add($item);
} }
@ -83,7 +83,7 @@ class ConfigurationController extends Controller
{ {
$slugs = $this->getDefaultConfigSlugs(); $slugs = $this->getDefaultConfigSlugs();
if(count($slugs)) { if (count($slugs)) {
return redirect()->route('admin.configuration.index', $slugs); return redirect()->route('admin.configuration.index', $slugs);
} }
@ -99,7 +99,7 @@ class ConfigurationController extends Controller
{ {
$slugs = []; $slugs = [];
if(!request()->route('slug')) { if (! request()->route('slug')) {
$firstItem = current($this->configTree->items); $firstItem = current($this->configTree->items);
$secondItem = current($firstItem['children']); $secondItem = current($firstItem['children']);
@ -110,7 +110,7 @@ class ConfigurationController extends Controller
'slug2' => end($temp) 'slug2' => end($temp)
]; ];
} else { } else {
if(!request()->route('slug2')) { if (! request()->route('slug2')) {
$secondItem = current($this->configTree->items[request()->route('slug')]['children']); $secondItem = current($this->configTree->items[request()->route('slug')]['children']);
$temp = explode('.', $secondItem['key']); $temp = explode('.', $secondItem['key']);

View File

@ -103,7 +103,6 @@ class CustomerController extends Controller
'first_name' => 'string|required', 'first_name' => 'string|required',
'last_name' => 'string|required', 'last_name' => 'string|required',
'gender' => 'required', 'gender' => 'required',
'phone' => 'nullable|numeric|unique:customers,phone',
'email' => 'required|unique:customers,email', 'email' => 'required|unique:customers,email',
'date_of_birth' => 'date|before:today' 'date_of_birth' => 'date|before:today'
]); ]);
@ -112,7 +111,9 @@ class CustomerController extends Controller
$password = bcrypt(rand(100000,10000000)); $password = bcrypt(rand(100000,10000000));
$data['password']=$password; $data['password'] = $password;
$data['is_verified'] = 1;
$this->customer->create($data); $this->customer->create($data);

View File

@ -129,7 +129,7 @@ class CustomerGroupController extends Controller
{ {
$group = $this->customerGroup->findOneByField('id', $id); $group = $this->customerGroup->findOneByField('id', $id);
if($group->is_user_defined == 0) { if ($group->is_user_defined == 0) {
session()->flash('warning', trans('admin::app.customers.customers.group-default')); session()->flash('warning', trans('admin::app.customers.customers.group-default'));
} else { } else {
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer Group'])); session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer Group']));

View File

@ -114,7 +114,7 @@ class DashboardController extends Controller
public function getPercentageChange($previous, $current) public function getPercentageChange($previous, $current)
{ {
if(!$previous) if (! $previous)
return $current ? 100 : 0; return $current ? 100 : 0;
return ($current - $previous) / $previous * 100; return ($current - $previous) / $previous * 100;
@ -291,7 +291,7 @@ class DashboardController extends Controller
? Carbon::createFromTimeString(request()->get('end') . " 23:59:59") ? Carbon::createFromTimeString(request()->get('end') . " 23:59:59")
: Carbon::now(); : Carbon::now();
if($this->endDate > Carbon::now()) if ($this->endDate > Carbon::now())
$this->endDate = Carbon::now(); $this->endDate = Carbon::now();
$this->lastStartDate = clone $this->startDate; $this->lastStartDate = clone $this->startDate;

View File

@ -32,7 +32,11 @@ class ExportController extends Controller
*/ */
public function export() public function export()
{ {
$results = unserialize(request()->all()['gridData']); $results = request()->all()['gridData'];
$data = json_decode($results, true);
$results = (object) $data;
$file_name = class_basename($results); $file_name = class_basename($results);

View File

@ -91,7 +91,7 @@ class InvoiceController extends Controller
{ {
$order = $this->order->find($orderId); $order = $this->order->find($orderId);
if(!$order->canInvoice()) { if (! $order->canInvoice()) {
session()->flash('error', 'Order invoice creation is not allowed.'); session()->flash('error', 'Order invoice creation is not allowed.');
return redirect()->back(); return redirect()->back();
@ -105,13 +105,13 @@ class InvoiceController extends Controller
$haveProductToInvoice = false; $haveProductToInvoice = false;
foreach ($data['invoice']['items'] as $itemId => $qty) { foreach ($data['invoice']['items'] as $itemId => $qty) {
if($qty) { if ($qty) {
$haveProductToInvoice = true; $haveProductToInvoice = true;
break; break;
} }
} }
if(!$haveProductToInvoice) { if (! $haveProductToInvoice) {
session()->flash('error', 'Invoice can not be created without products.'); session()->flash('error', 'Invoice can not be created without products.');
return redirect()->back(); return redirect()->back();

View File

@ -78,7 +78,7 @@ class OrderController extends Controller
{ {
$result = $this->order->cancel($id); $result = $this->order->cancel($id);
if($result) { if ($result) {
session()->flash('success', trans('Order canceled successfully.')); session()->flash('success', trans('Order canceled successfully.'));
} else { } else {
session()->flash('error', trans('Order can not be canceled.')); session()->flash('error', trans('Order can not be canceled.'));

View File

@ -91,7 +91,7 @@ class ShipmentController extends Controller
{ {
$order = $this->order->find($orderId); $order = $this->order->find($orderId);
if(!$order->channel || !$order->canShip()) { if (! $order->channel || !$order->canShip()) {
session()->flash('error', 'Shipment can not be created for this order.'); session()->flash('error', 'Shipment can not be created for this order.');
return redirect()->back(); return redirect()->back();
@ -111,7 +111,7 @@ class ShipmentController extends Controller
{ {
$order = $this->order->find($orderId); $order = $this->order->find($orderId);
if(!$order->canShip()) { if (! $order->canShip()) {
session()->flash('error', 'Order shipment creation is not allowed.'); session()->flash('error', 'Order shipment creation is not allowed.');
return redirect()->back(); return redirect()->back();
@ -126,7 +126,7 @@ class ShipmentController extends Controller
$data = request()->all(); $data = request()->all();
if(!$this->isInventoryValidate($data)) { if (! $this->isInventoryValidate($data)) {
session()->flash('error', 'Requested quantity is invalid or not available.'); session()->flash('error', 'Requested quantity is invalid or not available.');
return redirect()->back(); return redirect()->back();
@ -159,6 +159,7 @@ class ShipmentController extends Controller
$inventory = $product->inventories() $inventory = $product->inventories()
->where('inventory_source_id', $data['shipment']['source']) ->where('inventory_source_id', $data['shipment']['source'])
->where('vendor_id', 0)
->first(); ->first();
if ($orderItem->qty_to_ship < $qty || $inventory->qty < $qty) { if ($orderItem->qty_to_ship < $qty || $inventory->qty < $qty) {

View File

@ -47,7 +47,7 @@ class Product {
public function afterProductCreated($product) { public function afterProductCreated($product) {
$result = $this->productCreated($product); $result = $this->productCreated($product);
if($result) { if ($result) {
return true; return true;
} else { } else {
return false; return false;
@ -76,13 +76,13 @@ class Product {
$found = $this->productGrid->findOneByField('product_id', $product->id); $found = $this->productGrid->findOneByField('product_id', $product->id);
//extra measure to stop duplicate entries //extra measure to stop duplicate entries
if($found == null) { if ($found == null) {
$this->productGrid->create($gridObject); $this->productGrid->create($gridObject);
if($product->type == 'configurable') { if ($product->type == 'configurable') {
$variants = $product->variants()->get(); $variants = $product->variants()->get();
foreach($variants as $variant) { foreach ($variants as $variant) {
$variantObj = [ $variantObj = [
'product_id' => $variant->id, 'product_id' => $variant->id,
'sku' => $variant->sku, 'sku' => $variant->sku,
@ -130,7 +130,7 @@ class Product {
public function productUpdated($product) { public function productUpdated($product) {
$productGridObject = $this->productGrid->findOneByField('product_id', $product->id); $productGridObject = $this->productGrid->findOneByField('product_id', $product->id);
if(!$productGridObject) { if (! $productGridObject) {
return false; return false;
} }
@ -143,13 +143,13 @@ class Product {
'status' => $product->status, 'status' => $product->status,
]; ];
if($product->type == 'configurable') { if ($product->type == 'configurable') {
$gridObject['quantity'] = 0; $gridObject['quantity'] = 0;
$gridObject['price'] = 0; $gridObject['price'] = 0;
} else { } else {
$qty = 0; $qty = 0;
//inventories and inventory sources relation for the variants return empty or null collection objects only //inventories and inventory sources relation for the variants return empty or null collection objects only
foreach($product->inventories()->get() as $inventory_source) { foreach ($product->inventories()->get() as $inventory_source) {
$qty = $qty + $inventory_source->qty; $qty = $qty + $inventory_source->qty;
} }
@ -162,7 +162,7 @@ class Product {
if ($product->type == 'configurable') { if ($product->type == 'configurable') {
$variants = $product->variants()->get(); $variants = $product->variants()->get();
foreach($variants as $variant) { foreach ($variants as $variant) {
$variantObj = [ $variantObj = [
'product_id' => $variant->id, 'product_id' => $variant->id,
'sku' => $variant->sku, 'sku' => $variant->sku,
@ -176,7 +176,7 @@ class Product {
$qty = 0; $qty = 0;
//inventories and inventory sources relation for the variants return empty or null collection objects only //inventories and inventory sources relation for the variants return empty or null collection objects only
foreach($variant->inventories()->get() as $inventory_source) { foreach ($variant->inventories()->get() as $inventory_source) {
$qty = $qty + $inventory_source->qty; $qty = $qty + $inventory_source->qty;
} }
@ -186,7 +186,7 @@ class Product {
$productGridVariant = $this->productGrid->findOneByField('product_id', $variant->id); $productGridVariant = $this->productGrid->findOneByField('product_id', $variant->id);
if(isset($productGridVariant)) { if (isset($productGridVariant)) {
$this->productGrid->update($variantObj, $productGridVariant->id); $this->productGrid->update($variantObj, $productGridVariant->id);
} else { } else {
$variantObj = [ $variantObj = [
@ -202,7 +202,7 @@ class Product {
$qty = 0; $qty = 0;
//inventories and inventory sources relation for the variants return empty or null collection objects only //inventories and inventory sources relation for the variants return empty or null collection objects only
foreach($variant->inventories()->get() as $inventory_source) { foreach ($variant->inventories()->get() as $inventory_source) {
$qty = $qty + $inventory_source->qty; $qty = $qty + $inventory_source->qty;
} }
@ -224,7 +224,7 @@ class Product {
public function sync() { public function sync() {
$gridObject = []; $gridObject = [];
foreach($this->product->all() as $product) { foreach ($this->product->all() as $product) {
$gridObject = [ $gridObject = [
'product_id' => $product->id, 'product_id' => $product->id,
'sku' => $product->sku, 'sku' => $product->sku,
@ -235,12 +235,12 @@ class Product {
'status' => $product->status 'status' => $product->status
]; ];
if($product->type == 'configurable') { if ($product->type == 'configurable') {
$gridObject['quantity'] = 0; $gridObject['quantity'] = 0;
} else { } else {
$qty = 0; $qty = 0;
foreach($product->toArray()['inventories'] as $inventorySource) { foreach ($product->toArray()['inventories'] as $inventorySource) {
$qty = $qty + $inventorySource['qty']; $qty = $qty + $inventorySource['qty'];
} }
@ -251,7 +251,7 @@ class Product {
$oldGridObject = $this->productGrid->findOneByField('product_id', $product->id); $oldGridObject = $this->productGrid->findOneByField('product_id', $product->id);
if($oldGridObject) { if ($oldGridObject) {
$oldGridObject->update($gridObject); $oldGridObject->update($gridObject);
} else { } else {
$this->productGrid->create($gridObject); $this->productGrid->create($gridObject);

View File

@ -65,7 +65,7 @@ class AdminServiceProvider extends ServiceProvider
view()->composer(['admin::catalog.products.create', 'admin::catalog.products.edit'], function ($view) { view()->composer(['admin::catalog.products.create', 'admin::catalog.products.edit'], function ($view) {
$accordian = Tree::create(); $accordian = Tree::create();
foreach(config('product_form_accordians') as $item) { foreach (config('product_form_accordians') as $item) {
$accordian->add($item); $accordian->add($item);
} }
@ -77,7 +77,7 @@ class AdminServiceProvider extends ServiceProvider
view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) { view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) {
$tree = Tree::create(); $tree = Tree::create();
foreach(config('menu.admin') as $item) { foreach (config('menu.admin') as $item) {
if (bouncer()->hasPermission($item['key'])) { if (bouncer()->hasPermission($item['key'])) {
$tree->add($item, 'menu'); $tree->add($item, 'menu');
} }
@ -114,12 +114,12 @@ class AdminServiceProvider extends ServiceProvider
{ {
static $tree; static $tree;
if($tree) if ($tree)
return $tree; return $tree;
$tree = Tree::create(); $tree = Tree::create();
foreach(config('acl') as $item) { foreach (config('acl') as $item) {
$tree->add($item, 'acl'); $tree->add($item, 'acl');
} }

View File

@ -8,6 +8,70 @@ return [
'true' => 'True', 'true' => 'True',
'false' => 'False' 'false' => 'False'
], ],
'layouts' => [
'my-account' => 'My Account',
'logout' => 'Logout',
'visit-shop' => 'Visit Shop',
'dashboard' => 'Dashboard',
'sales' => 'Sales',
'orders' => 'Orders',
'shipments' => 'Shipments',
'invoices' => 'Invoices',
'catalog' => 'Catalog',
'products' => 'Products',
'categories' => 'Categories',
'attributes' => 'Attributes',
'attribute-families' => 'Attribute Families',
'customers' => 'Customers',
'groups' => 'Groups',
'reviews' => 'Reviews',
'newsletter-subscriptions' => 'Newsletter Subscriptions',
'configure' => 'Configure',
'settings' => 'Settings',
'locales' => 'Locales',
'currencies' => 'Currencies',
'exchange-rates' => 'Exchange Rates',
'inventory-sources' => 'Inventory Sources',
'channels' => 'Channels',
'users' => 'Users',
'roles' => 'Roles',
'sliders' => 'Sliders',
'taxes' => 'Taxes',
'tax-categories' => 'Tax Categories',
'tax-rates' => 'Tax Rates'
],
'acl' => [
'dashboard' => 'Dashboard',
'sales' => 'Sales',
'orders' => 'Orders',
'shipments' => 'Shipments',
'invoices' => 'Invoices',
'catalog' => 'Catalog',
'products' => 'Products',
'categories' => 'Categories',
'attributes' => 'Attributes',
'attribute-families' => 'Attribute Families',
'customers' => 'Customers',
'groups' => 'Groups',
'reviews' => 'Reviews',
'newsletter-subscriptions' => 'Newsletter Subscriptions',
'configure' => 'Configure',
'settings' => 'Settings',
'locales' => 'Locales',
'currencies' => 'Currencies',
'exchange-rates' => 'Exchange Rates',
'inventory-sources' => 'Inventory Sources',
'channels' => 'Channels',
'users' => 'Users',
'roles' => 'Roles',
'sliders' => 'Sliders',
'taxes' => 'Taxes',
'tax-categories' => 'Tax Categories',
'tax-rates' => 'Tax Rates'
],
'dashboard' => [ 'dashboard' => [
'title' => 'Dashboard', 'title' => 'Dashboard',
'from' => 'From', 'from' => 'From',
@ -35,8 +99,51 @@ return [
'method-error' => 'Error! Wrong method detected, please check mass action configuration', 'method-error' => 'Error! Wrong method detected, please check mass action configuration',
'delete-success' => 'Selected index of :resource were successfully deleted', 'delete-success' => 'Selected index of :resource were successfully deleted',
'partial-action' => 'Some actions were not performed due restricted system constraints on :resource', 'partial-action' => 'Some actions were not performed due restricted system constraints on :resource',
'update-success' => 'Selected index of :resource were successfully updated' 'update-success' => 'Selected index of :resource were successfully updated',
] ],
'id' => 'ID',
'status' => 'Status',
'code' => 'Code',
'admin-name' => 'Name',
'name' => 'Name',
'fullname' => 'Full Name',
'type' => 'Type',
'required' => 'Required',
'unique' => 'Unique',
'per-locale' => 'Locale Based',
'per-channel' => 'Channel Based',
'position' => 'Position',
'locale' => 'Locale',
'hostname' => 'Hostname',
'email' => 'Email',
'group' => 'Group',
'title' => 'Title',
'comment' => 'Comment',
'product-name' => 'Product',
'currency-name' => 'Currency Name',
'exch-rate' => 'Exchange Rate',
'priority' => 'Priority',
'subscribed' => 'Subscribed',
'base-total' => 'Base Total',
'grand-total' => 'Grand Total',
'order-date' => 'Order Date',
'channel-name' => 'Channel Name',
'billed-to' => 'Billed To',
'order-id' => 'Order Id',
'invoice-date' => 'Invoice Date',
'total-qty' => 'Total Qty',
'inventory-source' => 'Inventory Source',
'shipment-date' => 'Shipment Date',
'shipment-to' => 'Shipping To',
'sku' => 'SKU',
'price' => 'Price',
'qty' => 'Quantity',
'permission-type' => 'Permission Type',
'identifier' => 'Identifier',
'state' => 'State',
'country' => 'Country',
'tax-rate' => 'Rate'
], ],
'account' => [ 'account' => [

View File

@ -57,7 +57,7 @@
<span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span> <span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span>
</div> </div>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<div class="control-group"> <div class="control-group">
<label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label> <label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label>
@ -173,7 +173,7 @@
<tr> <tr>
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th> <th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th> <th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
@ -194,7 +194,7 @@
</div> </div>
</td> </td>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<td> <td>
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']"> <div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/> <input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
@ -227,7 +227,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#type').on('change', function (e) { $('#type').on('change', function (e) {
if(['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) { if (['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) {
$('#options').parent().addClass('hide') $('#options').parent().addClass('hide')
} else { } else {
$('#options').parent().removeClass('hide') $('#options').parent().removeClass('hide')
@ -248,7 +248,7 @@
var rowCount = this.optionRowCount++; var rowCount = this.optionRowCount++;
var row = {'id': 'option_' + rowCount}; var row = {'id': 'option_' + rowCount};
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
row['{{ $locale->code }}'] = ''; row['{{ $locale->code }}'] = '';
@endforeach @endforeach

View File

@ -77,7 +77,7 @@
<span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span> <span class="control-error" v-if="errors.has('admin_name')">@{{ errors.first('admin_name') }}</span>
</div> </div>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<div class="control-group"> <div class="control-group">
<label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label> <label for="locale-{{ $locale->code }}">{{ $locale->name . ' (' . $locale->code . ')' }}</label>
@ -229,7 +229,7 @@
<tr> <tr>
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th> <th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th> <th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
@ -250,7 +250,7 @@
</div> </div>
</td> </td>
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
<td> <td>
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']"> <div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/> <input type="text" v-validate="'required'" v-model="row['{{ $locale->code }}']" :name="localeInputName(row, '{{ $locale->code }}')" class="control" data-vv-as="&quot;{{ $locale->name . ' (' . $locale->code . ')' }}&quot;"/>
@ -283,7 +283,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#type').on('change', function (e) { $('#type').on('change', function (e) {
if(['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) { if (['select', 'multiselect', 'checkbox'].indexOf($(e.target).val()) === -1) {
$('#options').parent().addClass('hide') $('#options').parent().addClass('hide')
} else { } else {
$('#options').parent().removeClass('hide') $('#options').parent().removeClass('hide')
@ -295,11 +295,11 @@
template: '#options-template', template: '#options-template',
created () { created () {
@foreach($attribute->options as $option) @foreach ($attribute->options as $option)
this.optionRowCount++; this.optionRowCount++;
var row = {'id': '{{ $option->id }}', 'admin_name': '{{ $option->admin_name }}', 'sort_order': '{{ $option->sort_order }}'}; var row = {'id': '{{ $option->id }}', 'admin_name': '{{ $option->admin_name }}', 'sort_order': '{{ $option->sort_order }}'};
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
row['{{ $locale->code }}'] = "{{ $option->translate($locale->code)['label'] }}"; row['{{ $locale->code }}'] = "{{ $option->translate($locale->code)['label'] }}";
@endforeach @endforeach
@ -317,7 +317,7 @@
var rowCount = this.optionRowCount++; var rowCount = this.optionRowCount++;
var row = {'id': 'option_' + rowCount}; var row = {'id': 'option_' + rowCount};
@foreach(Webkul\Core\Models\Locale::all() as $locale) @foreach (Webkul\Core\Models\Locale::all() as $locale)
row['{{ $locale->code }}'] = ''; row['{{ $locale->code }}'] = '';
@endforeach @endforeach

View File

@ -75,7 +75,7 @@
</div> </div>
</accordian> </accordian>
@if($categories->count()) @if ($categories->count())
<accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true"> <accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true">
<div slot="body"> <div slot="body">

View File

@ -16,7 +16,7 @@
<div class="control-group"> <div class="control-group">
<select class="control" id="locale-switcher" onChange="window.location.href = this.value"> <select class="control" id="locale-switcher" onChange="window.location.href = this.value">
@foreach(core()->getAllLocales() as $localeModel) @foreach (core()->getAllLocales() as $localeModel)
<option value="{{ route('admin.catalog.categories.update', $category->id) . '?locale=' . $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}> <option value="{{ route('admin.catalog.categories.update', $category->id) . '?locale=' . $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }} {{ $localeModel->name }}
@ -89,7 +89,7 @@
</div> </div>
</accordian> </accordian>
@if($categories->count()) @if ($categories->count())
<accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true"> <accordian :title="'{{ __('admin::app.catalog.categories.parent-category') }}'" :active="true">
<div slot="body"> <div slot="body">

View File

@ -202,7 +202,7 @@
return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim()) return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim())
}) })
if(filteredGroups.length) { if (filteredGroups.length) {
const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' }); const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' });
if (field) { if (field) {
@ -248,7 +248,7 @@
group.custom_attributes.forEach(function(attribute) { group.custom_attributes.forEach(function(attribute) {
var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id) var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id)
if(attribute.length) { if (attribute.length) {
let index = this.custom_attributes.indexOf(attribute[0]) let index = this.custom_attributes.indexOf(attribute[0])
this.custom_attributes.splice(index, 1) this.custom_attributes.splice(index, 1)
@ -323,7 +323,7 @@
$(e.target).prev().find('li input').each(function() { $(e.target).prev().find('li input').each(function() {
var attributeId = $(this).val(); var attributeId = $(this).val();
if($(this).is(':checked')) { if ($(this).is(':checked')) {
attributeIds.push(attributeId); attributeIds.push(attributeId);
$(this).prop('checked', false); $(this).prop('checked', false);

View File

@ -200,7 +200,7 @@
return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim()) return this_this.group.groupName.trim() === (group.name ? group.name.trim() : group.groupName.trim())
}) })
if(filteredGroups.length) { if (filteredGroups.length) {
const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' }); const field = this.$validator.fields.find({ name: 'groupName', scope: 'add-group-form' });
if (field) { if (field) {
@ -246,7 +246,7 @@
group.custom_attributes.forEach(function(attribute) { group.custom_attributes.forEach(function(attribute) {
var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id) var attribute = this.custom_attributes.filter(attributeTemp => attributeTemp.id == attribute.id)
if(attribute.length) { if (attribute.length) {
let index = this.custom_attributes.indexOf(attribute[0]) let index = this.custom_attributes.indexOf(attribute[0])
this.custom_attributes.splice(index, 1) this.custom_attributes.splice(index, 1)
@ -306,7 +306,7 @@
computed: { computed: {
groupInputName () { groupInputName () {
if(this.group.id) if (this.group.id)
return "attribute_groups[" + this.group.id + "]"; return "attribute_groups[" + this.group.id + "]";
return "attribute_groups[group_" + this.index + "]"; return "attribute_groups[group_" + this.index + "]";
@ -324,7 +324,7 @@
$(e.target).prev().find('li input').each(function() { $(e.target).prev().find('li input').each(function() {
var attributeId = $(this).val(); var attributeId = $(this).val();
if($(this).is(':checked')) { if ($(this).is(':checked')) {
attributeIds.push(attributeId); attributeIds.push(attributeId);
$(this).prop('checked', false); $(this).prop('checked', false);

View File

@ -1,4 +1,4 @@
@if($categories->count()) @if ($categories->count())
<accordian :title="'{{ __($accordian['name']) }}'" :active="true"> <accordian :title="'{{ __($accordian['name']) }}'" :active="true">
<div slot="body"> <div slot="body">

View File

@ -7,7 +7,7 @@
$qty = 0; $qty = 0;
foreach ($product->inventories as $inventory) { foreach ($product->inventories as $inventory) {
if($inventory->inventory_source_id == $inventorySource->id) { if ($inventory->inventory_source_id == $inventorySource->id && ! $inventory->vendor_id) {
$qty = $inventory->qty; $qty = $inventory->qty;
break; break;
} }

View File

@ -205,7 +205,7 @@
var matchCount = 0; var matchCount = 0;
for (var key in this_this.variant) { for (var key in this_this.variant) {
if(variant[key] == this_this.variant[key]) { if (variant[key] == this_this.variant[key]) {
matchCount++; matchCount++;
} }
} }
@ -213,7 +213,7 @@
return matchCount == this_this.super_attributes.length; return matchCount == this_this.super_attributes.length;
}) })
if(filteredVariants.length) { if (filteredVariants.length) {
this.$parent.closeModal(); this.$parent.closeModal();
window.flashMessages = [{'type': 'alert-error', 'message': "{{ __('admin::app.catalog.products.variant-already-exist-message') }}" }]; window.flashMessages = [{'type': 'alert-error', 'message': "{{ __('admin::app.catalog.products.variant-already-exist-message') }}" }];
@ -297,7 +297,7 @@
computed: { computed: {
variantInputName () { variantInputName () {
if(this.variant.id) if (this.variant.id)
return "variants[" + this.variant.id + "]"; return "variants[" + this.variant.id + "]";
return "variants[variant_" + this.index + "]"; return "variants[variant_" + this.index + "]";
@ -314,7 +314,7 @@
this.superAttributes.forEach(function(attribute) { this.superAttributes.forEach(function(attribute) {
attribute.options.forEach(function(option) { attribute.options.forEach(function(option) {
if(optionId == option.id) { if (optionId == option.id) {
optionName = option.admin_name; optionName = option.admin_name;
} }
}); });
@ -325,10 +325,10 @@
sourceInventoryQty (inventorySourceId) { sourceInventoryQty (inventorySourceId) {
var inventories = this.variant.inventories.filter(function(inventory) { var inventories = this.variant.inventories.filter(function(inventory) {
return inventorySourceId === inventory.inventory_source_id; return inventorySourceId === inventory.inventory_source_id && !inventory.vendor_id;
}) })
if(inventories.length) if (inventories.length)
return inventories[0]['qty']; return inventories[0]['qty'];
return 0; return 0;

View File

@ -51,7 +51,7 @@
<option value="configurable" {{ $familyId ? 'selected' : '' }}>{{ __('admin::app.catalog.products.configurable') }}</option> <option value="configurable" {{ $familyId ? 'selected' : '' }}>{{ __('admin::app.catalog.products.configurable') }}</option>
</select> </select>
@if($familyId) @if ($familyId)
<input type="hidden" name="type" value="configurable"/> <input type="hidden" name="type" value="configurable"/>
@endif @endif
<span class="control-error" v-if="errors.has('type')">@{{ errors.first('type') }}</span> <span class="control-error" v-if="errors.has('type')">@{{ errors.first('type') }}</span>
@ -61,12 +61,12 @@
<label for="attribute_family_id" class="required">{{ __('admin::app.catalog.products.familiy') }}</label> <label for="attribute_family_id" class="required">{{ __('admin::app.catalog.products.familiy') }}</label>
<select class="control" v-validate="'required'" id="attribute_family_id" name="attribute_family_id" {{ $familyId ? 'disabled' : '' }} data-vv-as="&quot;{{ __('admin::app.catalog.products.familiy') }}&quot;"> <select class="control" v-validate="'required'" id="attribute_family_id" name="attribute_family_id" {{ $familyId ? 'disabled' : '' }} data-vv-as="&quot;{{ __('admin::app.catalog.products.familiy') }}&quot;">
<option value=""></option> <option value=""></option>
@foreach($families as $family) @foreach ($families as $family)
<option value="{{ $family->id }}" {{ ($familyId == $family->id || old('attribute_family_id') == $family->id) ? 'selected' : '' }}>{{ $family->name }}</option> <option value="{{ $family->id }}" {{ ($familyId == $family->id || old('attribute_family_id') == $family->id) ? 'selected' : '' }}>{{ $family->name }}</option>
@endforeach @endforeach
</select> </select>
@if($familyId) @if ($familyId)
<input type="hidden" name="attribute_family_id" value="{{ $familyId }}"/> <input type="hidden" name="attribute_family_id" value="{{ $familyId }}"/>
@endif @endif
<span class="control-error" v-if="errors.has('attribute_family_id')">@{{ errors.first('attribute_family_id') }}</span> <span class="control-error" v-if="errors.has('attribute_family_id')">@{{ errors.first('attribute_family_id') }}</span>
@ -81,7 +81,7 @@
</div> </div>
</accordian> </accordian>
@if($familyId) @if ($familyId)
<accordian :title="'{{ __('admin::app.catalog.products.configurable-attributes') }}'" :active="true"> <accordian :title="'{{ __('admin::app.catalog.products.configurable-attributes') }}'" :active="true">
<div slot="body"> <div slot="body">
@ -96,13 +96,13 @@
</thead> </thead>
<tbody> <tbody>
@foreach($configurableFamily->configurable_attributes as $attribute) @foreach ($configurableFamily->configurable_attributes as $attribute)
<tr> <tr>
<td> <td>
{{ $attribute->admin_name }} {{ $attribute->admin_name }}
</td> </td>
<td> <td>
@foreach($attribute->options as $option) @foreach ($attribute->options as $option)
<span class="label"> <span class="label">
<input type="hidden" name="super_attributes[{{$attribute->code}}][]" value="{{ $option->id }}"/> <input type="hidden" name="super_attributes[{{$attribute->code}}][]" value="{{ $option->id }}"/>
{{ $option->admin_name }} {{ $option->admin_name }}

View File

@ -18,7 +18,7 @@
<div class="control-group"> <div class="control-group">
<select class="control" id="channel-switcher" name="channel"> <select class="control" id="channel-switcher" name="channel">
@foreach(core()->getAllChannels() as $channelModel) @foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}> <option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }} {{ $channelModel->name }}
@ -30,7 +30,7 @@
<div class="control-group"> <div class="control-group">
<select class="control" id="locale-switcher" name="locale"> <select class="control" id="locale-switcher" name="locale">
@foreach(core()->getAllLocales() as $localeModel) @foreach (core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}> <option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }} {{ $localeModel->name }}
@ -54,19 +54,19 @@
<input name="_method" type="hidden" value="PUT"> <input name="_method" type="hidden" value="PUT">
@foreach ($product->attribute_family->attribute_groups as $attributeGroup) @foreach ($product->attribute_family->attribute_groups as $attributeGroup)
@if(count($attributeGroup->custom_attributes)) @if (count($attributeGroup->custom_attributes))
<accordian :title="'{{ __($attributeGroup->name) }}'" :active="true"> <accordian :title="'{{ __($attributeGroup->name) }}'" :active="true">
<div slot="body"> <div slot="body">
@foreach($attributeGroup->custom_attributes as $attribute) @foreach ($attributeGroup->custom_attributes as $attribute)
@if(!$product->super_attributes->contains($attribute)) @if (! $product->super_attributes->contains($attribute))
<?php <?php
$validations = []; $validations = [];
$disabled = false; $disabled = false;
if($product->type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight'])) { if ($product->type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight'])) {
if(!$attribute->is_required) if (! $attribute->is_required)
continue; continue;
$disabled = true; $disabled = true;
@ -85,7 +85,7 @@
$validations = implode('|', array_filter($validations)); $validations = implode('|', array_filter($validations));
?> ?>
@if(view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type)) @if (view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
<div class="control-group {{ $attribute->type }}" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']"> <div class="control-group {{ $attribute->type }}" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}> <label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
@ -97,16 +97,16 @@
<?php <?php
$channel_locale = []; $channel_locale = [];
if($attribute->value_per_channel) { if ($attribute->value_per_channel) {
array_push($channel_locale, $channel); array_push($channel_locale, $channel);
} }
if($attribute->value_per_locale) { if ($attribute->value_per_locale) {
array_push($channel_locale, $locale); array_push($channel_locale, $locale);
} }
?> ?>
@if(count($channel_locale)) @if (count($channel_locale))
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span> <span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
@endif @endif
</label> </label>

View File

@ -1,6 +1,6 @@
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" multiple {{ $disabled ? 'disabled' : '' }}> <select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" multiple {{ $disabled ? 'disabled' : '' }}>
@foreach($attribute->options as $option) @foreach ($attribute->options as $option)
<option value="{{ $option->id }}" {{ in_array($option->id, explode(',', $attribute[$attribute->code])) ? 'selected' : ''}}> <option value="{{ $option->id }}" {{ in_array($option->id, explode(',', $attribute[$attribute->code])) ? 'selected' : ''}}>
{{ $option->admin_name }} {{ $option->admin_name }}
</option> </option>

View File

@ -2,9 +2,9 @@
<?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?> <?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?>
@if($attribute->code != 'tax_category_id') @if ($attribute->code != 'tax_category_id')
@foreach($attribute->options as $option) @foreach ($attribute->options as $option)
<option value="{{ $option->id }}" {{ $option->id == $selectedOption ? 'selected' : ''}}> <option value="{{ $option->id }}" {{ $option->id == $selectedOption ? 'selected' : ''}}>
{{ $option->admin_name }} {{ $option->admin_name }}
</option> </option>
@ -14,7 +14,7 @@
<option value=""></option> <option value=""></option>
@foreach(app('Webkul\Tax\Repositories\TaxCategoryRepository')->all() as $taxCategory) @foreach (app('Webkul\Tax\Repositories\TaxCategoryRepository')->all() as $taxCategory)
<option value="{{ $taxCategory->id }}" {{ $taxCategory->id == $selectedOption ? 'selected' : ''}}> <option value="{{ $taxCategory->id }}" {{ $taxCategory->id == $selectedOption ? 'selected' : ''}}>
{{ $taxCategory->name }} {{ $taxCategory->name }}
</option> </option>

View File

@ -22,7 +22,7 @@
{{-- @inject('product','Webkul\Admin\DataGrids\ProductDataGrid') {{-- @inject('product','Webkul\Admin\DataGrids\ProductDataGrid')
{!! $product->render() !!} --}} {!! $product->render() !!} --}}
@inject('products', 'Webkul\Admin\DataGrids\TestDataGrid') @inject('products', 'Webkul\Admin\DataGrids\ProductDataGrid')
{!! $products->render() !!} {!! $products->render() !!}
</div> </div>
</div> </div>

View File

@ -25,12 +25,12 @@
$channel_locale = []; $channel_locale = [];
if(isset($field['channel_based']) && $field['channel_based']) if (isset($field['channel_based']) && $field['channel_based'])
{ {
array_push($channel_locale, $channel); array_push($channel_locale, $channel);
} }
if(isset($field['locale_based']) && $field['locale_based']) { if (isset($field['locale_based']) && $field['locale_based']) {
array_push($channel_locale, $locale); array_push($channel_locale, $locale);
} }
?> ?>
@ -41,7 +41,7 @@
{{ $field['title'] }} {{ $field['title'] }}
@if(count($channel_locale)) @if (count($channel_locale))
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span> <span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
@endif @endif
@ -60,15 +60,15 @@
<select v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" data-vv-as="&quot;{{ $field['name'] }}&quot;" > <select v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" data-vv-as="&quot;{{ $field['name'] }}&quot;" >
@if (isset($field['repository'])) @if (isset($field['repository']))
@foreach($value as $option) @foreach ($value as $option)
<option value="{{ $option['name'] }}" {{ $option['name'] == $selectedOption ? 'selected' : ''}} <option value="{{ $option['name'] }}" {{ $option['name'] == $selectedOption ? 'selected' : ''}}
{{ $option['name'] }} {{ $option['name'] }}
</option> </option>
@endforeach @endforeach
@else @else
@foreach($field['options'] as $option) @foreach ($field['options'] as $option)
<?php <?php
if($option['value'] == false) { if ($option['value'] == false) {
$value = 0; $value = 0;
} else { } else {
$value = $option['value']; $value = $option['value'];
@ -89,10 +89,10 @@
<select v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]" data-vv-as="&quot;{{ $field['name'] }}&quot;" multiple> <select v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]" data-vv-as="&quot;{{ $field['name'] }}&quot;" multiple>
@foreach($field['options'] as $option) @foreach ($field['options'] as $option)
<?php <?php
if($option['value'] == false) { if ($option['value'] == false) {
$value = 0; $value = 0;
} else { } else {
$value = $option['value']; $value = $option['value'];
@ -223,7 +223,7 @@
this.country = country; this.country = country;
}) })
if(this.countryStates[this.country] && this.countryStates[this.country].length) if (this.countryStates[this.country] && this.countryStates[this.country].length)
return true; return true;
return false; return false;

View File

@ -20,7 +20,7 @@
<div class="control-group"> <div class="control-group">
<select class="control" id="channel-switcher" name="channel"> <select class="control" id="channel-switcher" name="channel">
@foreach(core()->getAllChannels() as $channelModel) @foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}> <option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }} {{ $channelModel->name }}
@ -32,7 +32,7 @@
<div class="control-group"> <div class="control-group">
<select class="control" id="locale-switcher" name="locale"> <select class="control" id="locale-switcher" name="locale">
@foreach(core()->getAllLocales() as $localeModel) @foreach (core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}> <option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }} {{ $localeModel->name }}

View File

@ -65,7 +65,7 @@
methods: { methods: {
haveStates() { haveStates() {
if(this.countryStates[this.country] && this.countryStates[this.country].length) if (this.countryStates[this.country] && this.countryStates[this.country].length)
return true; return true;
return false; return false;

View File

@ -75,14 +75,14 @@
<div class="control-group"> <div class="control-group">
<label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label> <label for="customerGroup" >{{ __('admin::app.customers.customers.customer_group') }}</label>
@if(!is_null($customer->customer_group_id)) @if (! is_null($customer->customer_group_id))
<?php $selectedCustomerOption = $customer->customerGroup->id ?> <?php $selectedCustomerOption = $customer->customerGroup->id ?>
@else @else
<?php $selectedCustomerOption = '' ?> <?php $selectedCustomerOption = '' ?>
@endif @endif
<select class="control" name="customer_group_id"> <select class="control" name="customer_group_id">
@foreach($customerGroup as $group) @foreach ($customerGroup as $group)
<option value="{{ $group->id }}" {{ $selectedCustomerOption == $group->id ? 'selected' : '' }}> <option value="{{ $group->id }}" {{ $selectedCustomerOption == $group->id ? 'selected' : '' }}>
{{ $group->name}} {{ $group->name}}
</option> </option>
@ -93,14 +93,14 @@
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel" >{{ __('admin::app.customers.customers.channel_name') }}</label> <label for="channel" >{{ __('admin::app.customers.customers.channel_name') }}</label>
@if(!is_null($customer->channel_id)) @if (! is_null($customer->channel_id))
<?php $selectedChannelOption = $customer->channel_id ?> <?php $selectedChannelOption = $customer->channel_id ?>
@else @else
<?php $selectedChannelOption = $customer->channel_id ?> <?php $selectedChannelOption = $customer->channel_id ?>
@endif @endif
<select class="control" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customers.customers.channel_name') }}&quot;"> <select class="control" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customers.customers.channel_name') }}&quot;">
@foreach($channelName as $channel) @foreach ($channelName as $channel)
<option value="{{ $channel->id }}" {{ $selectedChannelOption == $channel->id ? 'selected' : '' }}> <option value="{{ $channel->id }}" {{ $selectedChannelOption == $channel->id ? 'selected' : '' }}>
{{ $channel->name}} {{ $channel->name}}
</option> </option>

View File

@ -32,8 +32,8 @@
<label for="title">{{ __('admin::app.customers.subscribers.is_subscribed') }}</label> <label for="title">{{ __('admin::app.customers.subscribers.is_subscribed') }}</label>
<select class="control" name="is_subscribed" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.subscribers.is_subscribed') }}&quot;"> <select class="control" name="is_subscribed" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.customers.subscribers.is_subscribed') }}&quot;">
<option value="1" @if($subscriber->is_subscribed == 1) selected @endif>{{ __('admin::app.common.true') }}</option> <option value="1" @if ($subscriber->is_subscribed == 1) selected @endif>{{ __('admin::app.common.true') }}</option>
<option value="0" @if($subscriber->is_subscribed == 0) selected @endif>{{ __('admin::app.common.false') }}</option> <option value="0" @if ($subscriber->is_subscribed == 0) selected @endif>{{ __('admin::app.common.false') }}</option>
</select> </select>
<span class="control-error" v-if="errors.has('is_subscribed')">@{{ errors.first('is_subscribed') }}</span> <span class="control-error" v-if="errors.has('is_subscribed')">@{{ errors.first('is_subscribed') }}</span>

View File

@ -176,7 +176,7 @@
</ul> </ul>
@if (!count($statistics['top_selling_categories'])) @if (! count($statistics['top_selling_categories']))
<div class="no-result-found"> <div class="no-result-found">
@ -231,7 +231,7 @@
</ul> </ul>
@if (!count($statistics['top_selling_products'])) @if (! count($statistics['top_selling_products']))
<div class="no-result-found"> <div class="no-result-found">
@ -289,7 +289,7 @@
</ul> </ul>
@if (!count($statistics['customer_with_most_sales'])) @if (! count($statistics['customer_with_most_sales']))
<div class="no-result-found"> <div class="no-result-found">
@ -339,7 +339,7 @@
</ul> </ul>
@if (!count($statistics['stock_threshold'])) @if (! count($statistics['stock_threshold']))
<div class="no-result-found"> <div class="no-result-found">

View File

@ -94,11 +94,11 @@
<script type="text/javascript"> <script type="text/javascript">
window.flashMessages = []; window.flashMessages = [];
@if($success = session('success')) @if ($success = session('success'))
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }]; window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
@elseif($warning = session('warning')) @elseif ($warning = session('warning'))
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }]; window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
@elseif($error = session('error')) @elseif ($error = session('error'))
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }]; window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
@endif @endif

View File

@ -15,39 +15,57 @@
@yield('css') @yield('css')
{!! view_render_event('bagisto.admin.layout.head') !!}
</head> </head>
<body style="scroll-behavior: smooth;"> <body style="scroll-behavior: smooth;">
{!! view_render_event('bagisto.admin.layout.body.before') !!}
<div id="app"> <div id="app">
<flash-wrapper ref='flashes'></flash-wrapper> <flash-wrapper ref='flashes'></flash-wrapper>
{!! view_render_event('bagisto.admin.layout.nav-top.before') !!}
@include ('admin::layouts.nav-top') @include ('admin::layouts.nav-top')
{!! view_render_event('bagisto.admin.layout.nav-top.after') !!}
{!! view_render_event('bagisto.admin.layout.nav-left.before') !!}
@include ('admin::layouts.nav-left') @include ('admin::layouts.nav-left')
{!! view_render_event('bagisto.admin.layout.nav-left.after') !!}
<div class="content-container"> <div class="content-container">
{!! view_render_event('bagisto.admin.layout.content.before') !!}
@yield('content-wrapper') @yield('content-wrapper')
{!! view_render_event('bagisto.admin.layout.content.after') !!}
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
window.flashMessages = []; window.flashMessages = [];
@if($success = session('success')) @if ($success = session('success'))
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }]; window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
@elseif($warning = session('warning')) @elseif ($warning = session('warning'))
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }]; window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
@elseif($error = session('error')) @elseif ($error = session('error'))
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }]; window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
@elseif($info = session('info')) @elseif ($info = session('info'))
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $info }}" }]; window.flashMessages = [{'type': 'alert-error', 'message': "{{ $info }}" }];
@endif @endif
window.serverErrors = []; window.serverErrors = [];
@if(isset($errors)) @if (isset($errors))
@if (count($errors)) @if (count($errors))
window.serverErrors = @json($errors->getMessages()); window.serverErrors = @json($errors->getMessages());
@endif @endif
@ -59,6 +77,8 @@
@stack('scripts') @stack('scripts')
{!! view_render_event('bagisto.admin.layout.body.after') !!}
<div class="modal-overlay"></div> <div class="modal-overlay"></div>
</body> </body>
</html> </html>

View File

@ -3,10 +3,10 @@
@if (request()->route()->getName() != 'admin.configuration.index') @if (request()->route()->getName() != 'admin.configuration.index')
<?php $keys = explode('.', $menu->currentKey); ?> <?php $keys = explode('.', $menu->currentKey); ?>
@foreach(array_get($menu->items, current($keys) . '.children') as $item) @foreach (array_get($menu->items, current($keys) . '.children') as $item)
<li class="{{ $menu->getActive($item) }}"> <li class="{{ $menu->getActive($item) }}">
<a href="{{ $item['url'] }}"> <a href="{{ $item['url'] }}">
{{ $item['name'] }} {{ trans($item['name']) }}
@if ($menu->getActive($item)) @if ($menu->getActive($item))
<i class="angle-right-icon"></i> <i class="angle-right-icon"></i>
@ -15,10 +15,10 @@
</li> </li>
@endforeach @endforeach
@else @else
@foreach($config->items as $key => $item) @foreach ($config->items as $key => $item)
<li class="{{ $item['key'] == request()->route('slug') ? 'active' : '' }}"> <li class="{{ $item['key'] == request()->route('slug') ? 'active' : '' }}">
<a href="{{ route('admin.configuration.index', $item['key']) }}"> <a href="{{ route('admin.configuration.index', $item['key']) }}">
{{ isset($item['name']) ? $item['name'] : '' }} {{ isset($item['name']) ? trans($item['name']) : '' }}
@if ($item['key'] == request()->route('slug')) @if ($item['key'] == request()->route('slug'))
<i class="angle-right-icon"></i> <i class="angle-right-icon"></i>

View File

@ -1,11 +1,11 @@
<div class="navbar-left"> <div class="navbar-left">
<ul class="menubar"> <ul class="menubar">
@foreach($menu->items as $menuItem) @foreach ($menu->items as $menuItem)
<li class="menu-item {{ $menu->getActive($menuItem) }}"> <li class="menu-item {{ $menu->getActive($menuItem) }}">
<a href="{{ count($menuItem['children']) ? current($menuItem['children'])['url'] : $menuItem['url'] }}"> <a href="{{ count($menuItem['children']) ? current($menuItem['children'])['url'] : $menuItem['url'] }}">
<span class="icon {{ $menuItem['icon-class'] }}"> <span class="icon {{ $menuItem['icon-class'] }}">
</span> </span>
{{ $menuItem['name'] }} {{ trans($menuItem['name']) }}
</a> </a>
</li> </li>
@endforeach @endforeach

View File

@ -31,13 +31,13 @@
<label>Account</label> <label>Account</label>
<ul> <ul>
<li> <li>
<a href="{{ route('shop.home.index') }}" target="_blank">Visit Shop</a> <a href="{{ route('shop.home.index') }}" target="_blank">{{ trans('admin::app.layouts.visit-shop') }}</a>
</li> </li>
<li> <li>
<a href="{{ route('admin.account.edit') }}">My Account</a> <a href="{{ route('admin.account.edit') }}">{{ trans('admin::app.layouts.my-account') }}</a>
</li> </li>
<li> <li>
<a href="{{ route('admin.session.destroy') }}">Logout</a> <a href="{{ route('admin.session.destroy') }}">{{ trans('admin::app.layouts.logout') }}</a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -8,11 +8,11 @@
<ul> <ul>
@foreach(array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children') as $item) @foreach (array_get($menu->items, implode('.children.', array_slice($keys, 0, 2)) . '.children') as $item)
<li class="{{ $menu->getActive($item) }}"> <li class="{{ $menu->getActive($item) }}">
<a href="{{ $item['url'] }}"> <a href="{{ $item['url'] }}">
{{ $item['name'] }} {{ trans($item['name']) }}
</a> </a>
</li> </li>
@ -32,7 +32,7 @@
<li class="{{ $key == request()->route('slug2') ? 'active' : '' }}"> <li class="{{ $key == request()->route('slug2') ? 'active' : '' }}">
<a href="{{ route('admin.configuration.index', (request()->route('slug') . '/' . $key)) }}"> <a href="{{ route('admin.configuration.index', (request()->route('slug') . '/' . $key)) }}">
{{ $item['name'] }} {{ trans($item['name']) }}
</a> </a>
</li> </li>

View File

@ -121,7 +121,7 @@
</div> </div>
</div> </div>
@if($order->shipping_address) @if ($order->shipping_address)
<div class="sale-section"> <div class="sale-section">
<div class="secton-title"> <div class="secton-title">
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span> <span>{{ __('admin::app.sales.orders.shipping-address') }}</span>

View File

@ -121,7 +121,7 @@
</div> </div>
</div> </div>
@if($order->shipping_address) @if ($order->shipping_address)
<div class="sale-section"> <div class="sale-section">
<div class="secton-title"> <div class="secton-title">
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span> <span>{{ __('admin::app.sales.orders.shipping-address') }}</span>

View File

@ -15,19 +15,19 @@
</div> </div>
<div class="page-action"> <div class="page-action">
@if($order->canCancel()) @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') }}'"> <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') }} {{ __('admin::app.sales.orders.cancel-btn-title') }}
</a> </a>
@endif @endif
@if($order->canInvoice()) @if ($order->canInvoice())
<a href="{{ route('admin.sales.invoices.create', $order->id) }}" class="btn btn-lg btn-primary"> <a href="{{ route('admin.sales.invoices.create', $order->id) }}" class="btn btn-lg btn-primary">
{{ __('admin::app.sales.orders.invoice-btn-title') }} {{ __('admin::app.sales.orders.invoice-btn-title') }}
</a> </a>
@endif @endif
@if($order->canShip()) @if ($order->canShip())
<a href="{{ route('admin.sales.shipments.create', $order->id) }}" class="btn btn-lg btn-primary"> <a href="{{ route('admin.sales.shipments.create', $order->id) }}" class="btn btn-lg btn-primary">
{{ __('admin::app.sales.orders.shipment-btn-title') }} {{ __('admin::app.sales.orders.shipment-btn-title') }}
</a> </a>
@ -108,7 +108,7 @@
</span> </span>
</div> </div>
@if(!is_null($order->customer)) @if (! is_null($order->customer))
<div class="row"> <div class="row">
<span class="title"> <span class="title">
{{ __('admin::app.customers.customers.customer_group') }} {{ __('admin::app.customers.customers.customer_group') }}
@ -140,7 +140,7 @@
</div> </div>
</div> </div>
@if($order->shipping_address) @if ($order->shipping_address)
<div class="sale-section"> <div class="sale-section">
<div class="secton-title"> <div class="secton-title">
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span> <span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
@ -359,7 +359,7 @@
</tr> </tr>
@endforeach @endforeach
@if (!$order->invoices->count()) @if (! $order->invoices->count())
<tr> <tr>
<td class="empty" colspan="7">{{ __('admin::app.common.no-result-found') }}</td> <td class="empty" colspan="7">{{ __('admin::app.common.no-result-found') }}</td>
<tr> <tr>
@ -403,7 +403,7 @@
</tr> </tr>
@endforeach @endforeach
@if (!$order->shipments->count()) @if (! $order->shipments->count())
<tr> <tr>
<td class="empty" colspan="7">{{ __('admin::app.common.no-result-found') }}</td> <td class="empty" colspan="7">{{ __('admin::app.common.no-result-found') }}</td>
<tr> <tr>

View File

@ -121,7 +121,7 @@
</div> </div>
</div> </div>
@if($order->shipping_address) @if ($order->shipping_address)
<div class="sale-section"> <div class="sale-section">
<div class="secton-title"> <div class="secton-title">
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span> <span>{{ __('admin::app.sales.orders.shipping-address') }}</span>
@ -299,13 +299,26 @@
<td> <td>
<?php <?php
if($item->type == 'configurable') { if ($item->type == 'configurable') {
$sourceQty = $item->child->product->inventory_source_qty($inventorySource); $sourceQty = $item->child->product->inventory_source_qty($inventorySource);
} else { } else {
$sourceQty = $item->product->inventory_source_qty($inventorySource); $sourceQty = $item->product->inventory_source_qty($inventorySource);
} }
?> ?>
<?php
$sourceQty = 0;
$product = $item->type == 'configurable' ? $item->child->product : $item->product;
foreach ($product->inventories as $inventory) {
if ($inventory->inventory_source_id == $inventorySource->id && !$inventory->vendor_id) {
$sourceQty = $inventory->qty;
break;
}
}
?>
{{ $sourceQty }} {{ $sourceQty }}
</td> </td>

View File

@ -117,7 +117,7 @@
</div> </div>
</div> </div>
@if($order->shipping_address) @if ($order->shipping_address)
<div class="sale-section"> <div class="sale-section">
<div class="secton-title"> <div class="secton-title">
<span>{{ __('admin::app.sales.orders.shipping-address') }}</span> <span>{{ __('admin::app.sales.orders.shipping-address') }}</span>

View File

@ -47,7 +47,7 @@
<div class="control-group" :class="[errors.has('inventory_sources[]') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('inventory_sources[]') ? 'has-error' : '']">
<label for="inventory_sources" class="required">{{ __('admin::app.settings.channels.inventory_sources') }}</label> <label for="inventory_sources" class="required">{{ __('admin::app.settings.channels.inventory_sources') }}</label>
<select v-validate="'required'" class="control" id="inventory_sources" name="inventory_sources[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.inventory_sources') }}&quot;" multiple> <select v-validate="'required'" class="control" id="inventory_sources" name="inventory_sources[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.inventory_sources') }}&quot;" multiple>
@foreach(app('Webkul\Inventory\Repositories\InventorySourceRepository')->all() as $inventorySource) @foreach (app('Webkul\Inventory\Repositories\InventorySourceRepository')->all() as $inventorySource)
<option value="{{ $inventorySource->id }}" {{ old('inventory_sources') && in_array($inventorySource->id, old('inventory_sources')) ? 'selected' : '' }}> <option value="{{ $inventorySource->id }}" {{ old('inventory_sources') && in_array($inventorySource->id, old('inventory_sources')) ? 'selected' : '' }}>
{{ $inventorySource->name }} {{ $inventorySource->name }}
</option> </option>
@ -59,7 +59,7 @@
<div class="control-group" :class="[errors.has('root_category_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('root_category_id') ? 'has-error' : '']">
<label for="root_category_id" class="required">{{ __('admin::app.settings.channels.root-category') }}</label> <label for="root_category_id" class="required">{{ __('admin::app.settings.channels.root-category') }}</label>
<select v-validate="'required'" class="control" id="root_category_id" name="root_category_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.root-category') }}&quot;"> <select v-validate="'required'" class="control" id="root_category_id" name="root_category_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.root-category') }}&quot;">
@foreach(app('Webkul\Category\Repositories\CategoryRepository')->getRootCategories() as $category) @foreach (app('Webkul\Category\Repositories\CategoryRepository')->getRootCategories() as $category)
<option value="{{ $category->id }}" {{ old('root_category_id') == $category->id ? 'selected' : '' }}> <option value="{{ $category->id }}" {{ old('root_category_id') == $category->id ? 'selected' : '' }}>
{{ $category->name }} {{ $category->name }}
</option> </option>
@ -82,7 +82,7 @@
<div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']">
<label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label> <label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label>
<select v-validate="'required'" class="control" id="locales" name="locales[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.locales') }}&quot;" multiple> <select v-validate="'required'" class="control" id="locales" name="locales[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.locales') }}&quot;" multiple>
@foreach(core()->getAllLocales() as $locale) @foreach (core()->getAllLocales() as $locale)
<option value="{{ $locale->id }}" {{ old('locales') && in_array($locale->id, old('locales')) ? 'selected' : '' }}> <option value="{{ $locale->id }}" {{ old('locales') && in_array($locale->id, old('locales')) ? 'selected' : '' }}>
{{ $locale->name }} {{ $locale->name }}
</option> </option>
@ -94,7 +94,7 @@
<div class="control-group" :class="[errors.has('default_locale_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('default_locale_id') ? 'has-error' : '']">
<label for="default_locale_id" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label> <label for="default_locale_id" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label>
<select v-validate="'required'" class="control" id="default_locale_id" name="default_locale_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.default-locale') }}&quot;"> <select v-validate="'required'" class="control" id="default_locale_id" name="default_locale_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.default-locale') }}&quot;">
@foreach(core()->getAllLocales() as $locale) @foreach (core()->getAllLocales() as $locale)
<option value="{{ $locale->id }}" {{ old('default_locale_id') == $locale->id ? 'selected' : '' }}> <option value="{{ $locale->id }}" {{ old('default_locale_id') == $locale->id ? 'selected' : '' }}>
{{ $locale->name }} {{ $locale->name }}
</option> </option>
@ -106,7 +106,7 @@
<div class="control-group" :class="[errors.has('currencies[]') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('currencies[]') ? 'has-error' : '']">
<label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label> <label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label>
<select v-validate="'required'" class="control" id="currencies" name="currencies[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.currencies') }}&quot;" multiple> <select v-validate="'required'" class="control" id="currencies" name="currencies[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.currencies') }}&quot;" multiple>
@foreach(core()->getAllCurrencies() as $currency) @foreach (core()->getAllCurrencies() as $currency)
<option value="{{ $currency->id }}" {{ old('currencies') && in_array($currency->id, old('currencies')) ? 'selected' : '' }}> <option value="{{ $currency->id }}" {{ old('currencies') && in_array($currency->id, old('currencies')) ? 'selected' : '' }}>
{{ $currency->name }} {{ $currency->name }}
</option> </option>
@ -118,7 +118,7 @@
<div class="control-group" :class="[errors.has('base_currency_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('base_currency_id') ? 'has-error' : '']">
<label for="base_currbase_currency_idency" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label> <label for="base_currbase_currency_idency" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label>
<select v-validate="'required'" class="control" id="base_currency_id" name="base_currency_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.base-currency') }}&quot;"> <select v-validate="'required'" class="control" id="base_currency_id" name="base_currency_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.base-currency') }}&quot;">
@foreach(core()->getAllCurrencies() as $currency) @foreach (core()->getAllCurrencies() as $currency)
<option value="{{ $currency->id }}" {{ old('base_currency_id') == $currency->id ? 'selected' : '' }}> <option value="{{ $currency->id }}" {{ old('base_currency_id') == $currency->id ? 'selected' : '' }}>
{{ $currency->name }} {{ $currency->name }}
</option> </option>
@ -135,7 +135,7 @@
<div class="control-group"> <div class="control-group">
<label for="theme">{{ __('admin::app.settings.channels.theme') }}</label> <label for="theme">{{ __('admin::app.settings.channels.theme') }}</label>
<select class="control" id="theme" name="theme"> <select class="control" id="theme" name="theme">
@foreach(themes()->all() as $theme) @foreach (themes()->all() as $theme)
<option value="{{ $theme->code }}" {{ old('theme') == $theme->code ? 'selected' : '' }}> <option value="{{ $theme->code }}" {{ old('theme') == $theme->code ? 'selected' : '' }}>
{{ $theme->name }} {{ $theme->name }}
</option> </option>

View File

@ -50,7 +50,7 @@
<label for="inventory_sources" class="required">{{ __('admin::app.settings.channels.inventory_sources') }}</label> <label for="inventory_sources" class="required">{{ __('admin::app.settings.channels.inventory_sources') }}</label>
<?php $selectedOptionIds = old('inventory_sources') ?: $channel->inventory_sources->pluck('id')->toArray() ?> <?php $selectedOptionIds = old('inventory_sources') ?: $channel->inventory_sources->pluck('id')->toArray() ?>
<select v-validate="'required'" class="control" id="inventory_sources" name="inventory_sources[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.inventory_sources') }}&quot;" multiple> <select v-validate="'required'" class="control" id="inventory_sources" name="inventory_sources[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.inventory_sources') }}&quot;" multiple>
@foreach(app('Webkul\Inventory\Repositories\InventorySourceRepository')->all() as $inventorySource) @foreach (app('Webkul\Inventory\Repositories\InventorySourceRepository')->all() as $inventorySource)
<option value="{{ $inventorySource->id }}" {{ in_array($inventorySource->id, $selectedOptionIds) ? 'selected' : '' }}> <option value="{{ $inventorySource->id }}" {{ in_array($inventorySource->id, $selectedOptionIds) ? 'selected' : '' }}>
{{ $inventorySource->name }} {{ $inventorySource->name }}
</option> </option>
@ -63,7 +63,7 @@
<label for="root_category_id" class="required">{{ __('admin::app.settings.channels.root-category') }}</label> <label for="root_category_id" class="required">{{ __('admin::app.settings.channels.root-category') }}</label>
<?php $selectedOption = old('root_category_id') ?: $channel->root_category_id ?> <?php $selectedOption = old('root_category_id') ?: $channel->root_category_id ?>
<select v-validate="'required'" class="control" id="root_category_id" name="root_category_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.root-category') }}&quot;"> <select v-validate="'required'" class="control" id="root_category_id" name="root_category_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.root-category') }}&quot;">
@foreach(app('Webkul\Category\Repositories\CategoryRepository')->getRootCategories() as $category) @foreach (app('Webkul\Category\Repositories\CategoryRepository')->getRootCategories() as $category)
<option value="{{ $category->id }}" {{ $selectedOption == $category->id ? 'selected' : '' }}> <option value="{{ $category->id }}" {{ $selectedOption == $category->id ? 'selected' : '' }}>
{{ $category->name }} {{ $category->name }}
</option> </option>
@ -87,7 +87,7 @@
<label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label> <label for="locales" class="required">{{ __('admin::app.settings.channels.locales') }}</label>
<?php $selectedOptionIds = old('locales') ?: $channel->locales->pluck('id')->toArray() ?> <?php $selectedOptionIds = old('locales') ?: $channel->locales->pluck('id')->toArray() ?>
<select v-validate="'required'" class="control" id="locales" name="locales[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.locales') }}&quot;" multiple> <select v-validate="'required'" class="control" id="locales" name="locales[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.locales') }}&quot;" multiple>
@foreach(core()->getAllLocales() as $locale) @foreach (core()->getAllLocales() as $locale)
<option value="{{ $locale->id }}" {{ in_array($locale->id, $selectedOptionIds) ? 'selected' : '' }}> <option value="{{ $locale->id }}" {{ in_array($locale->id, $selectedOptionIds) ? 'selected' : '' }}>
{{ $locale->name }} {{ $locale->name }}
</option> </option>
@ -100,7 +100,7 @@
<label for="default_locale_id" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label> <label for="default_locale_id" class="required">{{ __('admin::app.settings.channels.default-locale') }}</label>
<?php $selectedOption = old('default_locale_id') ?: $channel->default_locale_id ?> <?php $selectedOption = old('default_locale_id') ?: $channel->default_locale_id ?>
<select v-validate="'required'" class="control" id="default_locale_id" name="default_locale_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.default-locale') }}&quot;"> <select v-validate="'required'" class="control" id="default_locale_id" name="default_locale_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.default-locale') }}&quot;">
@foreach(core()->getAllLocales() as $locale) @foreach (core()->getAllLocales() as $locale)
<option value="{{ $locale->id }}" {{ $selectedOption == $locale->id ? 'selected' : '' }}> <option value="{{ $locale->id }}" {{ $selectedOption == $locale->id ? 'selected' : '' }}>
{{ $locale->name }} {{ $locale->name }}
</option> </option>
@ -113,7 +113,7 @@
<label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label> <label for="currencies" class="required">{{ __('admin::app.settings.channels.currencies') }}</label>
<?php $selectedOptionIds = old('currencies') ?: $channel->currencies->pluck('id')->toArray() ?> <?php $selectedOptionIds = old('currencies') ?: $channel->currencies->pluck('id')->toArray() ?>
<select v-validate="'required'" class="control" id="currencies" name="currencies[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.currencies') }}&quot;" multiple> <select v-validate="'required'" class="control" id="currencies" name="currencies[]" data-vv-as="&quot;{{ __('admin::app.settings.channels.currencies') }}&quot;" multiple>
@foreach(core()->getAllCurrencies() as $currency) @foreach (core()->getAllCurrencies() as $currency)
<option value="{{ $currency->id }}" {{ in_array($currency->id, $selectedOptionIds) ? 'selected' : '' }}> <option value="{{ $currency->id }}" {{ in_array($currency->id, $selectedOptionIds) ? 'selected' : '' }}>
{{ $currency->name }} {{ $currency->name }}
</option> </option>
@ -126,7 +126,7 @@
<label for="base_currency_id" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label> <label for="base_currency_id" class="required">{{ __('admin::app.settings.channels.base-currency') }}</label>
<?php $selectedOption = old('base_currency_id') ?: $channel->base_currency_id ?> <?php $selectedOption = old('base_currency_id') ?: $channel->base_currency_id ?>
<select v-validate="'required'" class="control" id="base_currency_id" name="base_currency_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.base-currency') }}&quot;"> <select v-validate="'required'" class="control" id="base_currency_id" name="base_currency_id" data-vv-as="&quot;{{ __('admin::app.settings.channels.base-currency') }}&quot;">
@foreach(core()->getAllCurrencies() as $currency) @foreach (core()->getAllCurrencies() as $currency)
<option value="{{ $currency->id }}" {{ $selectedOption == $currency->id ? 'selected' : '' }}> <option value="{{ $currency->id }}" {{ $selectedOption == $currency->id ? 'selected' : '' }}>
{{ $currency->name }} {{ $currency->name }}
</option> </option>
@ -146,7 +146,7 @@
<?php $selectedOption = old('theme') ?: $channel->theme ?> <?php $selectedOption = old('theme') ?: $channel->theme ?>
<select class="control" id="theme" name="theme"> <select class="control" id="theme" name="theme">
@foreach(themes()->all() as $theme) @foreach (themes()->all() as $theme)
<option value="{{ $theme->code }}" {{ $selectedOption == $theme->code ? 'selected' : '' }}> <option value="{{ $theme->code }}" {{ $selectedOption == $theme->code ? 'selected' : '' }}>
{{ $theme->name }} {{ $theme->name }}
</option> </option>

View File

@ -49,8 +49,8 @@
<td> <td>
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']"> <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;"> <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) @foreach ($currencies as $currency)
@if(is_null($currency->CurrencyExchangeRate)) @if (is_null($currency->CurrencyExchangeRate))
<option value="{{ $currency->id }}">{{ $currency->name }}</option> <option value="{{ $currency->id }}">{{ $currency->name }}</option>
@endif @endif
@endforeach @endforeach

View File

@ -50,7 +50,7 @@
<td> <td>
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']"> <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;"> <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) @foreach ($currencies as $currency)
<option value="{{ $currency->id }}" {{ $exchangeRate->target_currency == $currency->id ? 'selected' : '' }}> <option value="{{ $currency->id }}" {{ $exchangeRate->target_currency == $currency->id ? 'selected' : '' }}>
{{ $currency->name }} {{ $currency->name }}
</option> </option>

View File

@ -32,8 +32,8 @@
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel_id">{{ __('admin::app.settings.sliders.channels') }}</label> <label for="channel_id">{{ __('admin::app.settings.sliders.channels') }}</label>
<select class="control" id="channel_id" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.settings.sliders.channels') }}&quot;"> <select class="control" id="channel_id" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.settings.sliders.channels') }}&quot;">
@foreach($channels as $channel) @foreach ($channels as $channel)
<option value="{{ $channel->id }}" @if($channel->id == old('channel_id')) selected @endif> <option value="{{ $channel->id }}" @if ($channel->id == old('channel_id')) selected @endif>
{{ __($channel->name) }} {{ __($channel->name) }}
</option> </option>
@endforeach @endforeach

View File

@ -34,8 +34,8 @@
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel_id">{{ __('admin::app.settings.sliders.channels') }}</label> <label for="channel_id">{{ __('admin::app.settings.sliders.channels') }}</label>
<select class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.settings.sliders.channels') }}&quot;" value="" v-validate="'required'"> <select class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.settings.sliders.channels') }}&quot;" value="" v-validate="'required'">
@foreach($channels as $channel) @foreach ($channels as $channel)
<option value="{{ $channel->id }}" @if($channel->id == $slider->channel_id) selected @endif> <option value="{{ $channel->id }}" @if ($channel->id == $slider->channel_id) selected @endif>
{{ __($channel->name) }} {{ __($channel->name) }}
</option> </option>
@endforeach @endforeach

View File

@ -26,7 +26,7 @@
<label for="channel" class="required">{{ __('admin::app.configuration.tax-categories.select-channel') }}</label> <label for="channel" class="required">{{ __('admin::app.configuration.tax-categories.select-channel') }}</label>
<select class="control" name="channel_id"> <select class="control" name="channel_id">
@foreach(core()->getAllChannels() as $channelModel) @foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->id }}"> <option value="{{ $channelModel->id }}">
{{ $channelModel->name }} {{ $channelModel->name }}
@ -66,7 +66,7 @@
<label for="taxrates" class="required">{{ __('admin::app.configuration.tax-categories.select-taxrates') }}</label> <label for="taxrates" class="required">{{ __('admin::app.configuration.tax-categories.select-taxrates') }}</label>
<select multiple="multiple" v-validate="'required'" class="control" id="taxrates" name="taxrates[]" data-vv-as="&quot;{{ __('admin::app.configuration.tax-categories.select-taxrates') }}&quot;" value="{{ old('taxrates') }}"> <select multiple="multiple" v-validate="'required'" class="control" id="taxrates" name="taxrates[]" data-vv-as="&quot;{{ __('admin::app.configuration.tax-categories.select-taxrates') }}&quot;" value="{{ old('taxrates') }}">
@foreach($taxRates as $taxRate) @foreach ($taxRates as $taxRate)
<option value="{{ $taxRate['id'] }}">{{ $taxRate['identifier'] }}</option> <option value="{{ $taxRate['id'] }}">{{ $taxRate['identifier'] }}</option>
@endforeach @endforeach
</select> </select>

View File

@ -27,9 +27,9 @@
<label for="channel" class="required">{{ __('admin::app.settings.tax-categories.select-channel') }}</label> <label for="channel" class="required">{{ __('admin::app.settings.tax-categories.select-channel') }}</label>
<select class="control" name="channel_id"> <select class="control" name="channel_id">
@foreach(core()->getAllChannels() as $channelModel) @foreach (core()->getAllChannels() as $channelModel)
<option @if($taxCategory->channel_id == $channelModel->id) selected @endif value="{{ $channelModel->id }}"> <option @if ($taxCategory->channel_id == $channelModel->id) selected @endif value="{{ $channelModel->id }}">
{{ $channelModel->name }} {{ $channelModel->name }}
</option> </option>
@ -57,7 +57,7 @@
@inject('taxRates', 'Webkul\Tax\Repositories\TaxRateRepository') @inject('taxRates', 'Webkul\Tax\Repositories\TaxRateRepository')
<select multiple="multiple" class="control" id="taxrates" name="taxrates[]" data-vv-as="&quot;{{ __('admin::app.settings.tax-categories.select-taxrates') }}&quot;" v-validate="'required'"> <select multiple="multiple" class="control" id="taxrates" name="taxrates[]" data-vv-as="&quot;{{ __('admin::app.settings.tax-categories.select-taxrates') }}&quot;" v-validate="'required'">
@foreach($taxRates->all() as $taxRate) @foreach ($taxRates->all() as $taxRate)
<option value="{{ $taxRate->id }}" {{ is_numeric($taxCategory->tax_rates->pluck('id')->search($taxRate->id)) ? 'selected' : '' }}>{{ $taxRate->identifier }}</option> <option value="{{ $taxRate->id }}" {{ is_numeric($taxCategory->tax_rates->pluck('id')->search($taxRate->id)) ? 'selected' : '' }}>{{ $taxRate->identifier }}</option>
@endforeach @endforeach
</select> </select>

View File

@ -64,7 +64,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#permission_type').on('change', function(e) { $('#permission_type').on('change', function(e) {
if($(e.target).val() == 'custom') { if ($(e.target).val() == 'custom') {
$('.tree-container').removeClass('hide') $('.tree-container').removeClass('hide')
} else { } else {
$('.tree-container').addClass('hide') $('.tree-container').addClass('hide')

View File

@ -66,7 +66,7 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#permission_type').on('change', function(e) { $('#permission_type').on('change', function(e) {
if($(e.target).val() == 'custom') { if ($(e.target).val() == 'custom') {
$('.tree-wrapper').removeClass('hide') $('.tree-wrapper').removeClass('hide')
} else { } else {
$('.tree-wrapper').addClass('hide') $('.tree-wrapper').addClass('hide')

View File

@ -60,7 +60,7 @@
<div class="control-group" :class="[errors.has('role_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('role_id') ? 'has-error' : '']">
<label for="role" class="required">{{ __('admin::app.users.users.role') }}</label> <label for="role" class="required">{{ __('admin::app.users.users.role') }}</label>
<select v-validate="'required'" class="control" name="role_id" data-vv-as="&quot;{{ __('admin::app.users.users.role') }}&quot;"> <select v-validate="'required'" class="control" name="role_id" data-vv-as="&quot;{{ __('admin::app.users.users.role') }}&quot;">
@foreach($roles as $role) @foreach ($roles as $role)
<option value="{{ $role->id }}">{{ $role->name }}</option> <option value="{{ $role->id }}">{{ $role->name }}</option>
@endforeach @endforeach
</select> </select>

View File

@ -61,7 +61,7 @@
<div class="control-group" :class="[errors.has('role_id') ? 'has-error' : '']"> <div class="control-group" :class="[errors.has('role_id') ? 'has-error' : '']">
<label for="role" class="required">{{ __('admin::app.users.users.role') }}</label> <label for="role" class="required">{{ __('admin::app.users.users.role') }}</label>
<select v-validate="'required'" class="control" name="role_id" data-vv-as="&quot;{{ __('admin::app.users.users.role') }}&quot;"> <select v-validate="'required'" class="control" name="role_id" data-vv-as="&quot;{{ __('admin::app.users.users.role') }}&quot;">
@foreach($roles as $role) @foreach ($roles as $role)
<option value="{{ $role->id }}" {{ $user->role_id == $role->id ? 'selected' : '' }}>{{ $role->name }}</option> <option value="{{ $role->id }}" {{ $user->role_id == $role->id ? 'selected' : '' }}>{{ $role->name }}</option>
@endforeach @endforeach
</select> </select>
@ -72,7 +72,7 @@
<label for="status">{{ __('admin::app.users.users.status') }}</label> <label for="status">{{ __('admin::app.users.users.status') }}</label>
<span class="checkbox"> <span class="checkbox">
<input type="checkbox" id="status" name="status" <input type="checkbox" id="status" name="status"
{{-- @if($user->status == 0) {{-- @if ($user->status == 0)
value="false" value="false"
@else @else
value="true" value="true"

View File

@ -1,8 +1,8 @@
const { mix } = require("laravel-mix"); const { mix } = require("laravel-mix");
require("laravel-mix-merge-manifest"); require("laravel-mix-merge-manifest");
// var publicPath = 'publishable/assets'; var publicPath = 'publishable/assets';
var publicPath = "../../../public/vendor/webkul/admin/assets"; // var publicPath = "../../../public/vendor/webkul/admin/assets";
mix.setPublicPath(publicPath).mergeManifest(); mix.setPublicPath(publicPath).mergeManifest();
mix.disableNotifications(); mix.disableNotifications();

View File

@ -158,7 +158,7 @@ class AttributeController extends Controller
$attribute = $this->attribute->findOrFail($value); $attribute = $this->attribute->findOrFail($value);
try { try {
if (!$attribute->is_user_defined) { if (! $attribute->is_user_defined) {
continue; continue;
} else { } else {
$this->attribute->delete($value); $this->attribute->delete($value);
@ -170,7 +170,7 @@ class AttributeController extends Controller
} }
} }
if (!$suppressFlash) if (! $suppressFlash)
session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'attributes'])); session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success', ['resource' => 'attributes']));
else else
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'attributes'])); session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'attributes']));

View File

@ -168,7 +168,7 @@ class AttributeFamilyController extends Controller
} }
} }
if (!$suppressFlash) if (! $suppressFlash)
session()->flash('success', ('admin::app.datagrid.mass-ops.delete-success')); session()->flash('success', ('admin::app.datagrid.mass-ops.delete-success'));
else else
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Attribute Family'])); session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Attribute Family']));

View File

@ -74,7 +74,7 @@ class AttributeFamilyRepository extends Repository
$attributeGroup = $family->attribute_groups()->create($group); $attributeGroup = $family->attribute_groups()->create($group);
foreach ($custom_attributes as $key => $attribute) { foreach ($custom_attributes as $key => $attribute) {
if(isset($attribute['id'])) { if (isset($attribute['id'])) {
$attributeModel = $this->attribute->find($attribute['id']); $attributeModel = $this->attribute->find($attribute['id']);
} else { } else {
$attributeModel = $this->attribute->findOneByField('code', $attribute['code']); $attributeModel = $this->attribute->findOneByField('code', $attribute['code']);
@ -84,7 +84,7 @@ class AttributeFamilyRepository extends Repository
} }
} }
Event::fire('catalog.attribute_family.create.after', $attributeFamily); Event::fire('catalog.attribute_family.create.after', $family);
return $family; return $family;
} }
@ -105,19 +105,19 @@ class AttributeFamilyRepository extends Repository
$previousAttributeGroupIds = $family->attribute_groups()->pluck('id'); $previousAttributeGroupIds = $family->attribute_groups()->pluck('id');
if(isset($data['attribute_groups'])) { if (isset($data['attribute_groups'])) {
foreach ($data['attribute_groups'] as $attributeGroupId => $attributeGroupInputs) { foreach ($data['attribute_groups'] as $attributeGroupId => $attributeGroupInputs) {
if (str_contains($attributeGroupId, 'group_')) { if (str_contains($attributeGroupId, 'group_')) {
$attributeGroup = $family->attribute_groups()->create($attributeGroupInputs); $attributeGroup = $family->attribute_groups()->create($attributeGroupInputs);
if(isset($attributeGroupInputs['custom_attributes'])) { if (isset($attributeGroupInputs['custom_attributes'])) {
foreach ($attributeGroupInputs['custom_attributes'] as $key => $attribute) { foreach ($attributeGroupInputs['custom_attributes'] as $key => $attribute) {
$attributeModel = $this->attribute->find($attribute['id']); $attributeModel = $this->attribute->find($attribute['id']);
$attributeGroup->custom_attributes()->save($attributeModel, ['position' => $key + 1]); $attributeGroup->custom_attributes()->save($attributeModel, ['position' => $key + 1]);
} }
} }
} else { } else {
if(is_numeric($index = $previousAttributeGroupIds->search($attributeGroupId))) { if (is_numeric($index = $previousAttributeGroupIds->search($attributeGroupId))) {
$previousAttributeGroupIds->forget($index); $previousAttributeGroupIds->forget($index);
} }
@ -126,9 +126,9 @@ class AttributeFamilyRepository extends Repository
$attributeIds = $attributeGroup->custom_attributes()->get()->pluck('id'); $attributeIds = $attributeGroup->custom_attributes()->get()->pluck('id');
if(isset($attributeGroupInputs['custom_attributes'])) { if (isset($attributeGroupInputs['custom_attributes'])) {
foreach ($attributeGroupInputs['custom_attributes'] as $key => $attribute) { foreach ($attributeGroupInputs['custom_attributes'] as $key => $attribute) {
if(is_numeric($index = $attributeIds->search($attribute['id']))) { if (is_numeric($index = $attributeIds->search($attribute['id']))) {
$attributeIds->forget($index); $attributeIds->forget($index);
} else { } else {
$attributeModel = $this->attribute->find($attribute['id']); $attributeModel = $this->attribute->find($attribute['id']);
@ -137,7 +137,7 @@ class AttributeFamilyRepository extends Repository
} }
} }
if($attributeIds->count()) { if ($attributeIds->count()) {
$attributeGroup->custom_attributes()->detach($attributeIds); $attributeGroup->custom_attributes()->detach($attributeIds);
} }
} }

View File

@ -59,7 +59,7 @@ class AttributeRepository extends Repository
unset($data['options']); unset($data['options']);
$attribute = $this->model->create($data); $attribute = $this->model->create($data);
if(in_array($attribute->type, ['select', 'multiselect', 'checkbox']) && count($options)) { if (in_array($attribute->type, ['select', 'multiselect', 'checkbox']) && count($options)) {
foreach ($options as $option) { foreach ($options as $option) {
$attribute->options()->create($option); $attribute->options()->create($option);
} }
@ -88,13 +88,13 @@ class AttributeRepository extends Repository
$previousOptionIds = $attribute->options()->pluck('id'); $previousOptionIds = $attribute->options()->pluck('id');
if(in_array($attribute->type, ['select', 'multiselect', 'checkbox'])) { if (in_array($attribute->type, ['select', 'multiselect', 'checkbox'])) {
if(isset($data['options'])) { if (isset($data['options'])) {
foreach ($data['options'] as $optionId => $optionInputs) { foreach ($data['options'] as $optionId => $optionInputs) {
if (str_contains($optionId, 'option_')) { if (str_contains($optionId, 'option_')) {
$attribute->options()->create($optionInputs); $attribute->options()->create($optionInputs);
} else { } else {
if(is_numeric($index = $previousOptionIds->search($optionId))) { if (is_numeric($index = $previousOptionIds->search($optionId))) {
$previousOptionIds->forget($index); $previousOptionIds->forget($index);
} }
@ -132,11 +132,11 @@ class AttributeRepository extends Repository
*/ */
public function validateUserInput($data) public function validateUserInput($data)
{ {
if($data['is_configurable']) { if ($data['is_configurable']) {
$data['value_per_channel'] = $data['value_per_locale'] = 0; $data['value_per_channel'] = $data['value_per_locale'] = 0;
} }
if(!in_array($data['type'], ['select', 'multiselect', 'price'])) { if (! in_array($data['type'], ['select', 'multiselect', 'price'])) {
$data['is_filterable'] = 0; $data['is_filterable'] = 0;
} }
@ -158,7 +158,7 @@ class AttributeRepository extends Repository
{ {
$attributeColumns = ['id', 'code', 'value_per_channel', 'value_per_locale', 'type', 'is_filterable']; $attributeColumns = ['id', 'code', 'value_per_channel', 'value_per_locale', 'type', 'is_filterable'];
if(!is_array($codes) && !$codes) if (! is_array($codes) && !$codes)
return $this->findWhereIn('code', [ return $this->findWhereIn('code', [
'name', 'name',
'description', 'description',
@ -171,7 +171,7 @@ class AttributeRepository extends Repository
'status' 'status'
], $attributeColumns); ], $attributeColumns);
if(in_array('*', $codes)) if (in_array('*', $codes))
return $this->all($attributeColumns); return $this->all($attributeColumns);
return $this->findWhereIn('code', $codes, $attributeColumns); return $this->findWhereIn('code', $codes, $attributeColumns);

View File

@ -111,7 +111,7 @@ class CategoryController extends Controller
$this->validate(request(), [ $this->validate(request(), [
$locale . '.slug' => ['required', new \Webkul\Core\Contracts\Validations\Slug, function ($attribute, $value, $fail) use ($id) { $locale . '.slug' => ['required', new \Webkul\Core\Contracts\Validations\Slug, function ($attribute, $value, $fail) use ($id) {
if (!$this->category->isSlugUnique($id, $value)) { if (! $this->category->isSlugUnique($id, $value)) {
$fail('The :attribute has already been taken.'); $fail('The :attribute has already been taken.');
} }
}], }],
@ -153,10 +153,10 @@ class CategoryController extends Controller
public function massDestroy() { public function massDestroy() {
$suppressFlash = false; $suppressFlash = false;
if(request()->isMethod('delete')) { if (request()->isMethod('delete')) {
$indexes = explode(',', request()->input('indexes')); $indexes = explode(',', request()->input('indexes'));
foreach($indexes as $key => $value) { foreach ($indexes as $key => $value) {
try { try {
Event::fire('catalog.category.delete.before', $value); Event::fire('catalog.category.delete.before', $value);
@ -170,7 +170,7 @@ class CategoryController extends Controller
} }
} }
if(!$suppressFlash) if (! $suppressFlash)
session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success')); session()->flash('success', trans('admin::app.datagrid.mass-ops.delete-success'));
else else
session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Attribute Family'])); session()->flash('info', trans('admin::app.datagrid.mass-ops.partial-action', ['resource' => 'Attribute Family']));

View File

@ -137,7 +137,7 @@ class Cart {
]; ];
//Authentication details //Authentication details
if(auth()->guard('customer')->check()) { if (auth()->guard('customer')->check()) {
$cartData['customer_id'] = auth()->guard('customer')->user()->id; $cartData['customer_id'] = auth()->guard('customer')->user()->id;
$cartData['is_guest'] = 0; $cartData['is_guest'] = 0;
$cartData['customer_first_name'] = auth()->guard('customer')->user()->first_name; $cartData['customer_first_name'] = auth()->guard('customer')->user()->first_name;
@ -151,8 +151,8 @@ class Cart {
$this->putCart($result); $this->putCart($result);
if($result) { if ($result) {
if($item = $this->createItem($id, $data)) if ($item = $this->createItem($id, $data))
return $item; return $item;
else else
return false; return false;
@ -172,10 +172,10 @@ class Cart {
public function add($id, $data) { public function add($id, $data) {
$cart = $this->getCart(); $cart = $this->getCart();
if($cart != null) { if ($cart != null) {
$ifExists = $this->checkIfItemExists($id, $data); $ifExists = $this->checkIfItemExists($id, $data);
if($ifExists) { if ($ifExists) {
$item = $this->cartItem->findOneByField('id', $ifExists); $item = $this->cartItem->findOneByField('id', $ifExists);
$data['quantity'] = $data['quantity'] + $item->quantity; $data['quantity'] = $data['quantity'] + $item->quantity;
@ -199,14 +199,14 @@ class Cart {
public function checkIfItemExists($id, $data) { public function checkIfItemExists($id, $data) {
$items = $this->getCart()->items; $items = $this->getCart()->items;
foreach($items as $item) { foreach ($items as $item) {
if($id == $item->product_id) { if ($id == $item->product_id) {
$product = $this->product->findOnebyField('id', $id); $product = $this->product->findOnebyField('id', $id);
if($product->type == 'configurable') { if ($product->type == 'configurable') {
$variant = $this->product->findOneByField('id', $data['selected_configurable_option']); $variant = $this->product->findOneByField('id', $data['selected_configurable_option']);
if($item->child->product_id == $data['selected_configurable_option']) { if ($item->child->product_id == $data['selected_configurable_option']) {
return $item->id; return $item->id;
} }
} else { } else {
@ -228,8 +228,8 @@ class Cart {
$product = $parentProduct = $configurable = false; $product = $parentProduct = $configurable = false;
$product = $this->product->findOneByField('id', $id); $product = $this->product->findOneByField('id', $id);
if($product->type == 'configurable') { if ($product->type == 'configurable') {
if(!isset($data['selected_configurable_option'])) { if (! isset($data['selected_configurable_option'])) {
return false; return false;
} }
@ -237,7 +237,7 @@ class Cart {
$canAdd = $parentProduct->haveSufficientQuantity($data['quantity']); $canAdd = $parentProduct->haveSufficientQuantity($data['quantity']);
if(!$canAdd) { if (! $canAdd) {
session()->flash('warning', 'insuff qty'); session()->flash('warning', 'insuff qty');
return false; return false;
@ -247,7 +247,7 @@ class Cart {
} else { } else {
$canAdd = $product->haveSufficientQuantity($data['quantity']); $canAdd = $product->haveSufficientQuantity($data['quantity']);
if(!$canAdd) { if (! $canAdd) {
session()->flash('warning', 'insuff qty'); session()->flash('warning', 'insuff qty');
return false; return false;
@ -255,12 +255,12 @@ class Cart {
} }
//Check if the product's information is proper or not //Check if the product's information is proper or not
if(!isset($data['product']) || !isset($data['quantity'])) { if (! isset($data['product']) || !isset($data['quantity'])) {
session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_fields')); session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_fields'));
return false; return false;
} else { } else {
if($product->type == 'configurable' && !isset($data['super_attribute'])) { if ($product->type == 'configurable' && !isset($data['super_attribute'])) {
session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_options')); session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_options'));
return false; return false;
@ -290,7 +290,7 @@ class Cart {
'additional' => $data, 'additional' => $data,
]; ];
if($configurable) { if ($configurable) {
$attributeDetails = $this->getProductAttributeOptionDetails($parentProduct); $attributeDetails = $this->getProductAttributeOptionDetails($parentProduct);
unset($attributeDetails['html']); unset($attributeDetails['html']);
@ -330,10 +330,10 @@ class Cart {
$additional = $item->additional; $additional = $item->additional;
} }
if($item->type == 'configurable') { if ($item->type == 'configurable') {
$product = $this->product->findOneByField('id', $item->child->product_id); $product = $this->product->findOneByField('id', $item->child->product_id);
if(!$product->haveSufficientQuantity($data['quantity'])) { if (! $product->haveSufficientQuantity($data['quantity'])) {
session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning')); session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning'));
return false; return false;
@ -346,7 +346,7 @@ class Cart {
} else { } else {
$product = $this->product->findOneByField('id', $item->product_id); $product = $this->product->findOneByField('id', $item->product_id);
if(!$product->haveSufficientQuantity($data['quantity'])) { if (! $product->haveSufficientQuantity($data['quantity'])) {
session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning')); session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning'));
return false; return false;
@ -366,7 +366,7 @@ class Cart {
$this->collectTotals(); $this->collectTotals();
if($result) { if ($result) {
session()->flash('success', trans('shop::app.checkout.cart.quantity.success')); session()->flash('success', trans('shop::app.checkout.cart.quantity.success'));
return $item; return $item;
@ -384,15 +384,15 @@ class Cart {
*/ */
public function removeItem($itemId) public function removeItem($itemId)
{ {
if($cart = $this->getCart()) { if ($cart = $this->getCart()) {
$this->cartItem->delete($itemId); $this->cartItem->delete($itemId);
//delete the cart instance if no items are there //delete the cart instance if no items are there
if($cart->items()->get()->count() == 0) { if ($cart->items()->get()->count() == 0) {
$this->cart->delete($cart->id); $this->cart->delete($cart->id);
// $this->deActivateCart(); // $this->deActivateCart();
if(session()->has('cart')) { if (session()->has('cart')) {
session()->forget('cart'); session()->forget('cart');
} }
} }
@ -412,10 +412,10 @@ class Cart {
*/ */
public function mergeCart() public function mergeCart()
{ {
if(session()->has('cart')) { if (session()->has('cart')) {
$cart = $this->cart->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'is_active' => 1]); $cart = $this->cart->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'is_active' => 1]);
if($cart->count()) { if ($cart->count()) {
$cart = $cart->first(); $cart = $cart->first();
} else { } else {
$cart = false; $cart = false;
@ -424,7 +424,7 @@ class Cart {
$guestCart = session()->get('cart'); $guestCart = session()->get('cart');
//when the logged in customer is not having any of the cart instance previously and are active. //when the logged in customer is not having any of the cart instance previously and are active.
if(!$cart) { if (! $cart) {
$guestCart->update([ $guestCart->update([
'customer_id' => auth()->guard('customer')->user()->id, 'customer_id' => auth()->guard('customer')->user()->id,
'is_guest' => 0, 'is_guest' => 0,
@ -444,17 +444,17 @@ class Cart {
$guestCartItems = $this->cart->findOneByField('id', $guestCartId)->items; $guestCartItems = $this->cart->findOneByField('id', $guestCartId)->items;
foreach($guestCartItems as $key => $guestCartItem) { foreach ($guestCartItems as $key => $guestCartItem) {
foreach($cartItems as $cartItem) { foreach ($cartItems as $cartItem) {
if($guestCartItem->type == "simple") { if ($guestCartItem->type == "simple") {
if($cartItem->product_id == $guestCartItem->product_id) { if ($cartItem->product_id == $guestCartItem->product_id) {
$prevQty = $cartItem->quantity; $prevQty = $cartItem->quantity;
$newQty = $guestCartItem->quantity; $newQty = $guestCartItem->quantity;
$product = $this->product->findOneByField('id', $cartItem->product_id); $product = $this->product->findOneByField('id', $cartItem->product_id);
if(!$product->haveSufficientQuantity($prevQty + $newQty)) { if (! $product->haveSufficientQuantity($prevQty + $newQty)) {
$this->cartItem->delete($guestCartItem->id); $this->cartItem->delete($guestCartItem->id);
continue; continue;
} }
@ -466,18 +466,18 @@ class Cart {
$guestCartItems->forget($key); $guestCartItems->forget($key);
$this->cartItem->delete($guestCartItem->id); $this->cartItem->delete($guestCartItem->id);
} }
} else if($guestCartItem->type == "configurable" && $cartItem->type == "configurable") { } else if ($guestCartItem->type == "configurable" && $cartItem->type == "configurable") {
$guestCartItemChild = $guestCartItem->child; $guestCartItemChild = $guestCartItem->child;
$cartItemChild = $cartItem->child; $cartItemChild = $cartItem->child;
if($guestCartItemChild->product_id == $cartItemChild->product_id) { if ($guestCartItemChild->product_id == $cartItemChild->product_id) {
$prevQty = $guestCartItem->quantity; $prevQty = $guestCartItem->quantity;
$newQty = $cartItem->quantity; $newQty = $cartItem->quantity;
$product = $this->product->findOneByField('id', $cartItem->child->product_id); $product = $this->product->findOneByField('id', $cartItem->child->product_id);
if(!$product->haveSufficientQuantity($prevQty + $newQty)) { if (! $product->haveSufficientQuantity($prevQty + $newQty)) {
$this->cartItem->delete($guestCartItem->id); $this->cartItem->delete($guestCartItem->id);
continue; continue;
} }
@ -495,9 +495,9 @@ class Cart {
} }
//now handle the products that are not removed from the list of items in the guest cart. //now handle the products that are not removed from the list of items in the guest cart.
foreach($guestCartItems as $guestCartItem) { foreach ($guestCartItems as $guestCartItem) {
if($guestCartItem->type == "configurable") { if ($guestCartItem->type == "configurable") {
$guestCartItem->update(['cart_id' => $cart->id]); $guestCartItem->update(['cart_id' => $cart->id]);
$guestCartItem->child->update(['cart_id' => $cart->id]); $guestCartItem->child->update(['cart_id' => $cart->id]);
@ -527,7 +527,7 @@ class Cart {
*/ */
public function putCart($cart) public function putCart($cart)
{ {
if(!auth()->guard('customer')->check()) { if (! auth()->guard('customer')->check()) {
session()->put('cart', $cart); session()->put('cart', $cart);
} }
} }
@ -551,8 +551,8 @@ class Cart {
$cart = $this->cart->find(session()->get('cart')->id); $cart = $this->cart->find(session()->get('cart')->id);
} }
// if($cart != null) { // if ($cart != null) {
// if($cart->items->count() == 0) { // if ($cart->items->count() == 0) {
// $this->cart->delete($cart->id); // $this->cart->delete($cart->id);
// return false; // return false;
@ -594,7 +594,7 @@ class Cart {
$labels = []; $labels = [];
$attribute = $product->parent->super_attributes; $attribute = $product->parent->super_attributes;
foreach($product->parent->super_attributes as $attribute) { foreach ($product->parent->super_attributes as $attribute) {
$option = $attribute->options()->where('id', $product->{$attribute->code})->first(); $option = $attribute->options()->where('id', $product->{$attribute->code})->first();
$data['attributes'][$attribute->code] = [ $data['attributes'][$attribute->code] = [
@ -618,24 +618,24 @@ class Cart {
*/ */
public function saveCustomerAddress($data) public function saveCustomerAddress($data)
{ {
if(!$cart = $this->getCart()) if (! $cart = $this->getCart())
return false; return false;
$billingAddress = $data['billing']; $billingAddress = $data['billing'];
$shippingAddress = $data['shipping']; $shippingAddress = $data['shipping'];
$billingAddress['cart_id'] = $shippingAddress['cart_id'] = $cart->id; $billingAddress['cart_id'] = $shippingAddress['cart_id'] = $cart->id;
if($billingAddressModel = $cart->billing_address) { if ($billingAddressModel = $cart->billing_address) {
$this->cartAddress->update($billingAddress, $billingAddressModel->id); $this->cartAddress->update($billingAddress, $billingAddressModel->id);
if($shippingAddressModel = $cart->shipping_address) { if ($shippingAddressModel = $cart->shipping_address) {
if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->update($billingAddress, $shippingAddressModel->id); $this->cartAddress->update($billingAddress, $shippingAddressModel->id);
} else { } else {
$this->cartAddress->update($shippingAddress, $shippingAddressModel->id); $this->cartAddress->update($shippingAddress, $shippingAddressModel->id);
} }
} else { } else {
if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping'])); $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping']));
} else { } else {
$this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping'])); $this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping']));
@ -644,14 +644,14 @@ class Cart {
} else { } else {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'billing'])); $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'billing']));
if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { if (isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) {
$this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping'])); $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping']));
} else { } else {
$this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping'])); $this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping']));
} }
} }
if(auth()->guard('customer')->check()) { if (auth()->guard('customer')->check()) {
$cart->customer_email = auth()->guard('customer')->user()->email; $cart->customer_email = auth()->guard('customer')->user()->email;
$cart->customer_first_name = auth()->guard('customer')->user()->first_name; $cart->customer_first_name = auth()->guard('customer')->user()->first_name;
$cart->customer_last_name = auth()->guard('customer')->user()->last_name; $cart->customer_last_name = auth()->guard('customer')->user()->last_name;
@ -674,14 +674,14 @@ class Cart {
*/ */
public function saveShippingMethod($shippingMethodCode) public function saveShippingMethod($shippingMethodCode)
{ {
if(!$cart = $this->getCart()) if (! $cart = $this->getCart())
return false; return false;
$cart->shipping_method = $shippingMethodCode; $cart->shipping_method = $shippingMethodCode;
$cart->save(); $cart->save();
// foreach($cart->shipping_rates as $rate) { // foreach ($cart->shipping_rates as $rate) {
// if($rate->method != $shippingMethodCode) { // if ($rate->method != $shippingMethodCode) {
// $rate->delete(); // $rate->delete();
// } // }
// } // }
@ -697,10 +697,10 @@ class Cart {
*/ */
public function savePaymentMethod($payment) public function savePaymentMethod($payment)
{ {
if(!$cart = $this->getCart()) if (! $cart = $this->getCart())
return false; return false;
if($cartPayment = $cart->payment) if ($cartPayment = $cart->payment)
$cartPayment->delete(); $cartPayment->delete();
$cartPayment = new CartPayment; $cartPayment = new CartPayment;
@ -721,11 +721,11 @@ class Cart {
{ {
$validated = $this->validateItems(); $validated = $this->validateItems();
if(!$validated) { if (! $validated) {
return false; return false;
} }
if(!$cart = $this->getCart()) if (! $cart = $this->getCart())
return false; return false;
$this->calculateItemsTax(); $this->calculateItemsTax();
@ -745,13 +745,13 @@ class Cart {
$cart->base_tax_total = (float) $cart->base_tax_total + $item->base_tax_amount; $cart->base_tax_total = (float) $cart->base_tax_total + $item->base_tax_amount;
} }
if($shipping = $cart->selected_shipping_rate) { if ($shipping = $cart->selected_shipping_rate) {
$cart->grand_total = (float) $cart->grand_total + $shipping->price; $cart->grand_total = (float) $cart->grand_total + $shipping->price;
$cart->base_grand_total = (float) $cart->base_grand_total + $shipping->base_price; $cart->base_grand_total = (float) $cart->base_grand_total + $shipping->base_price;
} }
$quantities = 0; $quantities = 0;
foreach($cart->items as $item) { foreach ($cart->items as $item) {
$quantities = $quantities + $item->quantity; $quantities = $quantities + $item->quantity;
} }
@ -772,27 +772,27 @@ class Cart {
{ {
$cart = $this->getCart(); $cart = $this->getCart();
if(!$cart) { if (! $cart) {
return false; return false;
} }
//rare case of accident-->used when there are no items. //rare case of accident-->used when there are no items.
if(count($cart->items) == 0) { if (count($cart->items) == 0) {
$this->cart->delete($cart->id); $this->cart->delete($cart->id);
return false; return false;
} else { } else {
$items = $cart->items; $items = $cart->items;
foreach($items as $item) { foreach ($items as $item) {
if($item->product->type == 'configurable') { if ($item->product->type == 'configurable') {
if($item->product->sku != $item->sku) { if ($item->product->sku != $item->sku) {
$item->update(['sku' => $item->product->sku]); $item->update(['sku' => $item->product->sku]);
} else if($item->product->name != $item->name) { } else if ($item->product->name != $item->name) {
$item->update(['name' => $item->product->name]); $item->update(['name' => $item->product->name]);
} else if($item->child->product->price != $item->price) { } else if ($item->child->product->price != $item->price) {
$price = (float) $item->custom_price ? $item->custom_price : $item->child->product->price; $price = (float) $item->custom_price ? $item->custom_price : $item->child->product->price;
$item->update([ $item->update([
@ -803,14 +803,14 @@ class Cart {
]); ]);
} }
} else if($item->product->type == 'simple') { } else if ($item->product->type == 'simple') {
if($item->product->sku != $item->sku) { if ($item->product->sku != $item->sku) {
$item->update(['sku' => $item->product->sku]); $item->update(['sku' => $item->product->sku]);
} else if($item->product->name != $item->name) { } else if ($item->product->name != $item->name) {
$item->update(['name' => $item->product->name]); $item->update(['name' => $item->product->name]);
} else if($item->product->price != $item->price) { } else if ($item->product->price != $item->price) {
$price = (float) $item->custom_price ? $item->custom_price : $item->product->price; $price = (float) $item->custom_price ? $item->custom_price : $item->product->price;
$item->update([ $item->update([
@ -835,13 +835,13 @@ class Cart {
{ {
$cart = $this->getCart(); $cart = $this->getCart();
if(!$shippingAddress = $cart->shipping_address) if (! $shippingAddress = $cart->shipping_address)
return; return;
foreach ($cart->items()->get() as $item) { foreach ($cart->items()->get() as $item) {
$taxCategory = $this->taxCategory->find($item->product->tax_category_id); $taxCategory = $this->taxCategory->find($item->product->tax_category_id);
if(!$taxCategory) if (! $taxCategory)
continue; continue;
$taxRates = $taxCategory->tax_rates()->where([ $taxRates = $taxCategory->tax_rates()->where([
@ -849,20 +849,20 @@ class Cart {
'country' => $shippingAddress->country, 'country' => $shippingAddress->country,
])->orderBy('tax_rate', 'desc')->get(); ])->orderBy('tax_rate', 'desc')->get();
foreach($taxRates as $rate) { foreach ($taxRates as $rate) {
$haveTaxRate = false; $haveTaxRate = false;
if(!$rate->is_zip) { if (! $rate->is_zip) {
if($rate->zip_code == '*' || $rate->zip_code == $shippingAddress->postcode) { if ($rate->zip_code == '*' || $rate->zip_code == $shippingAddress->postcode) {
$haveTaxRate = true; $haveTaxRate = true;
} }
} else { } else {
if($shippingAddress->postcode >= $rate->zip_from && $shippingAddress->postcode <= $rate->zip_to) { if ($shippingAddress->postcode >= $rate->zip_from && $shippingAddress->postcode <= $rate->zip_to) {
$haveTaxRate = true; $haveTaxRate = true;
} }
} }
if($haveTaxRate) { if ($haveTaxRate) {
$item->tax_percent = $rate->tax_rate; $item->tax_percent = $rate->tax_rate;
$item->tax_amount = ($item->total * $rate->tax_rate) / 100; $item->tax_amount = ($item->total * $rate->tax_rate) / 100;
$item->base_tax_amount = ($item->base_total * $rate->tax_rate) / 100; $item->base_tax_amount = ($item->base_total * $rate->tax_rate) / 100;
@ -881,10 +881,10 @@ class Cart {
*/ */
public function hasError() public function hasError()
{ {
if(!$this->getCart()) if (! $this->getCart())
return true; return true;
if(!$this->isItemsHaveSufficientQuantity()) if (! $this->isItemsHaveSufficientQuantity())
return true; return true;
return false; return false;
@ -898,7 +898,7 @@ class Cart {
public function isItemsHaveSufficientQuantity() public function isItemsHaveSufficientQuantity()
{ {
foreach ($this->getCart()->items as $item) { foreach ($this->getCart()->items as $item) {
if(!$this->isItemHaveQuantity($item)) if (! $this->isItemHaveQuantity($item))
return false; return false;
} }
@ -914,7 +914,7 @@ class Cart {
{ {
$product = $item->type == 'configurable' ? $item->child->product : $item->product; $product = $item->type == 'configurable' ? $item->child->product : $item->product;
if(!$product->haveSufficientQuantity($item->quantity)) if (! $product->haveSufficientQuantity($item->quantity))
return false; return false;
return true; return true;
@ -927,10 +927,10 @@ class Cart {
*/ */
public function deActivateCart() public function deActivateCart()
{ {
if($cart = $this->getCart()) { if ($cart = $this->getCart()) {
$this->cart->update(['is_active' => false], $cart->id); $this->cart->update(['is_active' => false], $cart->id);
if(session()->has('cart')) { if (session()->has('cart')) {
session()->forget('cart'); session()->forget('cart');
} }
} }
@ -980,7 +980,7 @@ class Cart {
'channel' => core()->getCurrentChannel(), 'channel' => core()->getCurrentChannel(),
]; ];
foreach($data['items'] as $item) { foreach ($data['items'] as $item) {
$finalData['items'][] = $this->prepareDataForOrderItem($item); $finalData['items'][] = $this->prepareDataForOrderItem($item);
} }
@ -1012,7 +1012,7 @@ class Cart {
'additional' => $data['additional'], 'additional' => $data['additional'],
]; ];
if(isset($data['child']) && $data['child']) { if (isset($data['child']) && $data['child']) {
$finalData['child'] = $this->prepareDataForOrderItem($data['child']); $finalData['child'] = $this->prepareDataForOrderItem($data['child']);
} }
@ -1027,18 +1027,18 @@ class Cart {
public function moveToCart($wishlistItem) { public function moveToCart($wishlistItem) {
$product = $wishlistItem->product; $product = $wishlistItem->product;
if($product->type == 'simple') { if ($product->type == 'simple') {
$data['quantity'] = 1; $data['quantity'] = 1;
$data['product'] = $wishlistItem->product->id; $data['product'] = $wishlistItem->product->id;
$result = $this->add($product->id, $data); $result = $this->add($product->id, $data);
if($result) { if ($result) {
return 1; return 1;
} else { } else {
return 0; return 0;
} }
} else if($product->type == 'configurable' && $product->parent_id == null) { } else if ($product->type == 'configurable' && $product->parent_id == null) {
return -1; return -1;
} }
} }
@ -1057,9 +1057,9 @@ class Cart {
'customer_id' => auth()->guard('customer')->user()->id, 'customer_id' => auth()->guard('customer')->user()->id,
]; ];
foreach($items as $item) { foreach ($items as $item) {
if($item->id == $itemId) { if ($item->id == $itemId) {
if(is_null($item['parent_id']) && $item['type'] == 'simple') { if (is_null($item['parent_id']) && $item['type'] == 'simple') {
$wishlist['product_id'] = $item->product_id; $wishlist['product_id'] = $item->product_id;
} else { } else {
$wishlist['product_id'] = $item->child->product_id; $wishlist['product_id'] = $item->child->product_id;
@ -1068,14 +1068,14 @@ class Cart {
$shouldBe = $this->wishlist->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'product_id' => $wishlist['product_id']]); $shouldBe = $this->wishlist->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'product_id' => $wishlist['product_id']]);
if($shouldBe->isEmpty()) { if ($shouldBe->isEmpty()) {
$wishlist = $this->wishlist->create($wishlist); $wishlist = $this->wishlist->create($wishlist);
} }
$result = $this->cartItem->delete($itemId); $result = $this->cartItem->delete($itemId);
if($result) { if ($result) {
if($cart->items()->count() == 0) if ($cart->items()->count() == 0)
$this->cart->delete($cart->id); $this->cart->delete($cart->id);
session()->flash('success', trans('shop::app.checkout.cart.move-to-wishlist-success')); session()->flash('success', trans('shop::app.checkout.cart.move-to-wishlist-success'));
@ -1098,14 +1098,14 @@ class Cart {
public function proceedToBuyNow($id) { public function proceedToBuyNow($id) {
$product = $this->product->findOneByField('id', $id); $product = $this->product->findOneByField('id', $id);
if($product->type == 'configurable') { if ($product->type == 'configurable') {
session()->flash('warning', trans('shop::app.buynow.no-options')); session()->flash('warning', trans('shop::app.buynow.no-options'));
return false; return false;
} else { } else {
$simpleOrVariant = $this->product->find($id); $simpleOrVariant = $this->product->find($id);
if($simpleOrVariant->parent_id != null) { if ($simpleOrVariant->parent_id != null) {
$parent = $simpleOrVariant->parent; $parent = $simpleOrVariant->parent;
$data['product'] = $parent->id; $data['product'] = $parent->id;

View File

@ -38,7 +38,7 @@ class CustomerAddressForm extends FormRequest
'billing.country' => ['required'] 'billing.country' => ['required']
]; ];
if(isset($this->get('billing')['use_for_shipping']) && !$this->get('billing')['use_for_shipping']) { if (isset($this->get('billing')['use_for_shipping']) && !$this->get('billing')['use_for_shipping']) {
$this->rules = array_merge($this->rules, [ $this->rules = array_merge($this->rules, [
'shipping.first_name' => ['required'], 'shipping.first_name' => ['required'],
'shipping.last_name' => ['required'], 'shipping.last_name' => ['required'],

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