Merge pull request #56 from bagisto/prashant

Prashant
This commit is contained in:
JItendra Singh 2018-10-17 13:06:58 +05:30 committed by GitHub
commit 0bd7d83531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 1322 additions and 1266 deletions

View File

@ -29,10 +29,10 @@ class AttributeDataGrid
'name' => 'Attributes',
'table' => 'attributes',
'select' => 'id',
'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'perpage' => 5,
'aliased' => true,
'massoperations' =>[
'massoperations' => [
[
'route' => route('admin.datagrid.delete'),
'method' => 'DELETE',
@ -55,20 +55,11 @@ class AttributeDataGrid
],
],
'join' => [
// [
// 'join' => 'leftjoin',
// 'table' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
'join' => [],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'id',
'alias' => 'attributeId',
@ -95,73 +86,106 @@ class AttributeDataGrid
'alias' => 'attributeType',
'type' => 'string',
'label' => 'Type',
'sortable' => true,
'sortable' => false,
],
[
'name' => 'is_required',
'alias' => 'attributeIsRequired',
'type' => 'string',
'label' => 'Required',
'sortable' => true,
'sortable' => false,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
[
'name' => 'is_unique',
'alias' => 'attributeIsUnique',
'type' => 'string',
'label' => 'Unique',
'sortable' => true,
'sortable' => false,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
[
'name' => 'value_per_locale',
'alias' => 'attributeValuePerLocale',
'type' => 'string',
'label' => 'ValuePerLocale',
'sortable' => true,
'sortable' => false,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
[
'name' => 'value_per_channel',
'alias' => 'attributeValuePerChannel',
'type' => 'string',
'label' => 'ValuePerChannel',
'sortable' => true,
'sortable' => false,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
],
'filterable' => [
// [
// 'column' => 'id',
// 'alias' => 'attribute_family_id',
// 'type' => 'number',
// 'label' => 'ID',
// ],
// [
// 'column' => 'code',
// 'alias' => 'attribute_family_code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
// [
// 'column' => 'name',
// 'alias' => 'attribute_family_name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
[
'column' => 'id',
'alias' => 'attributeId',
'type' => 'number',
'label' => 'ID',
],
[
'column' => 'code',
'alias' => 'attributeCode',
'type' => 'string',
'label' => 'Code',
],
[
'column' => 'admin_name',
'alias' => 'attributeAdminName',
'type' => 'string',
'label' => 'AdminName',
],
[
'column' => 'type',
'alias' => 'attributeType',
'type' => 'string',
'label' => 'Type',
],
],
//don't use aliasing in case of searchables
'searchable' => [
// [
// 'column' => 'name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
// [
// 'column' => 'code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
[
'column' => 'code',
'alias' => 'attributeCode',
'type' => 'string',
],
[
'column' => 'admin_name',
'alias' => 'attributeAdminName',
'type' => 'string',
],
[
'column' => 'type',
'alias' => 'attributeType',
'type' => 'string',
],
],
//list of viable operators that will be used
@ -176,16 +200,14 @@ class AttributeDataGrid
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
// 'css' => []
]);
}
public function render()
{
return $this->createAttributeDataGrid()->render();
}
}

View File

@ -69,7 +69,6 @@ class CategoryDataGrid
'condition' => '=',
'secondaryKey' => 'cta.category_id',
],
],
//use aliasing on secodary columns if join is performed
@ -105,44 +104,56 @@ class CategoryDataGrid
'type' => 'string',
'label' => 'Visible in Menu',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
],
'filterable' => [
// [
// 'column' => 'id',
// 'alias' => 'attribute_family_id',
// 'type' => 'number',
// 'label' => 'ID',
// ],
// [
// 'column' => 'code',
// 'alias' => 'attribute_family_code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
// [
// 'column' => 'name',
// 'alias' => 'attribute_family_name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
[
'column' => 'cat.id',
'alias' => 'catID',
'type' => 'number',
'label' => 'Category ID',
], [
'column' => 'ct.name',
'alias' => 'catName',
'type' => 'string',
'label' => 'Category Name',
], [
'column' => 'cta.name',
'alias' => 'parentName',
'type' => 'string',
'label' => 'Parent Name',
], [
'column' => 'cat.status',
'alias' => 'catStatus',
'type' => 'string',
'label' => 'Visible in Menu',
],
],
//don't use aliasing in case of searchables
'searchable' => [
// [
// 'column' => 'name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
// [
// 'column' => 'code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
[
'column' => 'cat.id',
'type' => 'number',
'label' => 'Category ID',
], [
'column' => 'ct.name',
'type' => 'string',
'label' => 'Category Name',
], [
'column' => 'cat.status',
'type' => 'string',
'label' => 'Visible in Menu',
]
],
//list of viable operators that will be used
@ -158,14 +169,11 @@ class CategoryDataGrid
'nlike' => "not like",
],
// 'css' => []
]);
}
public function render()
{
return $this->createCategoryDataGrid()->render();
}

View File

@ -30,14 +30,14 @@ class CustomerDataGrid
'table' => 'customers',
'select' => 'id',
'perpage' => 10,
'aliased' => false, //use this with false as default and true in case of joins
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
[
'route' => route('admin.datagrid.delete'),
'method' => 'DELETE',
'label' => 'Delete',
'type' => 'button',
'type' => 'button', //select || button only
],
],
@ -56,53 +56,45 @@ class CustomerDataGrid
],
'join' => [
// [
// 'join' => 'leftjoin',
// 'table' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'id',
'alias' => 'customerId',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
'label' => 'Customer ID',
'sortable' => true,
],
[
'name' => 'first_name',
'alias' => 'customerFirstName',
'alias' => 'FirstName',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
'label' => 'Customer First Name',
'sortable' => false,
],
[
'name' => 'email',
'alias' => 'customerEmail',
'alias' => 'Email',
'type' => 'string',
'label' => 'Email',
'sortable' => true,
'label' => 'Customer E-Mail',
'sortable' => false,
],
[
'name' => 'phone',
'alias' => 'customerPhone',
'alias' => 'Phone',
'type' => 'number',
'label' => 'Phone',
'label' => 'Customer Phone',
'sortable' => true,
],
[
'name' => 'customer_group_id',
'alias' => 'customerGroupId',
'alias' => 'CustomerGroupId',
'type' => 'number',
'label' => 'Customer Group',
'sortable' => true,
'sortable' => false,
],
],
@ -111,49 +103,31 @@ class CustomerDataGrid
'filterable' => [
[
'name' => 'id',
'alias' => 'customerId',
'column' => 'id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
'label' => 'Customer ID',
],
[
'name' => 'first_name',
'alias' => 'customerFirstName',
'column' => 'first_name',
'alias' => 'FirstName',
'type' => 'string',
'label' => 'Name',
],
[
'name' => 'email',
'alias' => 'customerEmail',
'type' => 'string',
'label' => 'Email',
],
[
'name' => 'phone',
'alias' => 'customerPhone',
'type' => 'number',
'label' => 'Phone',
],
[
'name' => 'customer_group_id',
'alias' => 'customerGroupId',
'type' => 'string',
'label' => 'Customer Group',
],
'label' => 'Customer First Name',
]
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'first_name',
'column' => 'FirstName',
'type' => 'string',
'label' => 'Title',
'label' => 'Customer First Name',
],
[
'column' => 'email',
'type' => 'string',
'label' => 'Rating',
'label' => 'Customer E-Mail',
],
],

View File

@ -19,7 +19,7 @@ class CustomerReviewDataGrid
* The CustomerReviewDataGrid
* implementation.
*
* @var ReviewsDataGrid
* @var CustomerReviewsDataGrid
* for Reviews
*/
@ -57,13 +57,6 @@ class CustomerReviewDataGrid
],
'join' => [
// [
// 'join' => 'leftjoin',
// 'table' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
//use aliasing on secodary columns if join is performed
@ -76,67 +69,51 @@ class CustomerReviewDataGrid
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
], [
'name' => 'title',
'alias' => 'titleName',
'type' => 'string',
'label' => 'Title',
'sortable' => true,
],
[
'name' => 'rating',
'alias' => 'productRating',
'type' => 'number',
'label' => 'Rating',
'sortable' => true,
],
[
], [
'name' => 'comment',
'alias' => 'productComment',
'type' => 'string',
'label' => 'Comment',
'sortable' => true,
],
[
], [
'name' => 'status',
'alias' => 'reviewStatus',
'type' => 'number',
'label' => 'Status',
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
'name' => 'id',
'column' => 'id',
'alias' => 'reviewId',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'title',
], [
'column' => 'title',
'alias' => 'titleName',
'type' => 'string',
'label' => 'Title',
],
[
'name' => 'rating',
], [
'column' => 'rating',
'alias' => 'productRating',
'type' => 'number',
'label' => 'Rating',
],
[
'name' => 'comment',
], [
'column' => 'comment',
'alias' => 'productComment',
'type' => 'string',
'label' => 'Comment',
],
[
'name' => 'status',
], [
'column' => 'status',
'alias' => 'reviewStatus',
'type' => 'string',
'label' => 'Status',
@ -144,14 +121,12 @@ class CustomerReviewDataGrid
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'title',
'type' => 'string',
'label' => 'Title',
],
[
], [
'column' => 'rating',
'type' => 'number',
'label' => 'Rating',

View File

@ -64,7 +64,6 @@ class InventorySourcesDataGrid
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
@ -73,34 +72,36 @@ class InventorySourcesDataGrid
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
], [
'name' => 'code',
'alias' => 'inventoryCode',
'type' => 'string',
'label' => 'Code',
'sortable' => true,
],
[
'sortable' => false,
], [
'name' => 'name',
'alias' => 'inventoryName',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
],
[
'sortable' => false,
], [
'name' => 'priority',
'alias' => 'inventoryPriority',
'type' => 'string',
'label' => 'Priority',
'sortable' => true,
],
[
], [
'name' => 'status',
'alias' => 'inventoryStatus',
'type' => 'string',
'label' => 'Status',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 0)
return "In Active";
else
return "Active";
},
],
],

View File

@ -0,0 +1,179 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* Order DataGrid
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrderDataGrid
{
/**
* The Data Grid implementation.
*
* @var AttributeDataGrid
* for countries
*/
public function createCategoryDataGrid()
{
return DataGrid::make([
'name' => 'Orders',
'table' => 'orders as ord',
'select' => 'ord.id',
'perpage' => 5,
'aliased' => true, //use this with false as default and true in case of joins
'massoperations' =>[
[
'route' => route('admin.datagrid.delete'),
'method' => 'DELETE',
'label' => 'Delete',
'type' => 'button',
],
],
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really want to do this?',
'icon' => 'icon pencil-lg-icon',
], [
'type' => 'Delete',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really want to do this?',
'icon' => 'icon trash-icon',
],
],
'join' => [
[
'join' => 'leftjoin',
'table' => 'category_translations as ct',
'primaryKey' => 'cat.id',
'condition' => '=',
'secondaryKey' => 'ct.category_id',
], [
'join' => 'leftjoin',
'table' => 'category_translations as cta',
'primaryKey' => 'cat.parent_id',
'condition' => '=',
'secondaryKey' => 'cta.category_id',
],
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'cat.id',
'alias' => 'catID',
'type' => 'number',
'label' => 'Category ID',
'sortable' => true,
], [
'name' => 'ct.name',
'alias' => 'catName',
'type' => 'string',
'label' => 'Category Name',
'sortable' => false,
], [
'name' => 'cat.position',
'alias' => 'catPosition',
'type' => 'string',
'label' => 'Category Position',
'sortable' => false,
], [
'name' => 'cta.name',
'alias' => 'parentName',
'type' => 'string',
'label' => 'Parent Name',
'sortable' => true,
], [
'name' => 'cat.status',
'alias' => 'catStatus',
'type' => 'string',
'label' => 'Visible in Menu',
'sortable' => true,
'wrapper' => function ($value) {
if($value == 0)
return "False";
else
return "True";
},
],
],
'filterable' => [
[
'column' => 'cat.id',
'alias' => 'catID',
'type' => 'number',
'label' => 'Category ID',
], [
'column' => 'ct.name',
'alias' => 'catName',
'type' => 'string',
'label' => 'Category Name',
], [
'column' => 'cta.name',
'alias' => 'parentName',
'type' => 'string',
'label' => 'Parent Name',
], [
'column' => 'cat.status',
'alias' => 'catStatus',
'type' => 'string',
'label' => 'Visible in Menu',
],
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'cat.id',
'type' => 'number',
'label' => 'Category ID',
], [
'column' => 'ct.name',
'type' => 'string',
'label' => 'Category Name',
], [
'column' => 'cat.status',
'type' => 'string',
'label' => 'Visible in Menu',
]
],
//list of viable operators that will be used
'operators' => [
'eq' => "=",
'lt' => "<",
'gt' => ">",
'lte' => "<=",
'gte' => ">=",
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
]);
}
public function render()
{
return $this->createCategoryDataGrid()->render();
}
}

View File

@ -129,25 +129,25 @@ class ProductDataGrid
'filterable' => [
//column, type, and label
[
'name' => 'prods.id',
'column' => 'prods.id',
'alias' => 'productID',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'prods.sku',
'column' => 'prods.sku',
'alias' => 'productCode',
'type' => 'string',
'label' => 'SKU',
],
[
'name' => 'attfam.name',
'column' => 'attfam.name',
'alias' => 'FamilyName',
'type' => 'string',
'label' => 'Family Name',
],
[
'name' => 'pi.qty',
'column' => 'pi.qty',
'alias' => 'ProductQuantity',
'type' => 'number',
'label' => 'Product Quatity',

View File

@ -67,28 +67,25 @@ class SliderDataGrid
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 's.id',
'alias' => 'sliderId',
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
], [
'name' => 's.title',
'alias' => 'sliderTitle',
'type' => 'string',
'label' => 'title',
],
[
'sortable' => false
], [
'name' => 's.channel_id',
'alias' => 'channelId',
'type' => 'string',
'label' => 'Channel ID',
'sortable' => true,
],
[
'sortable' => false,
], [
'name' => 'c.name',
'alias' => 'channelName',
'type' => 'string',
@ -98,41 +95,31 @@ class SliderDataGrid
],
//don't use aliasing in case of filters
'filterable' => [
[
'column' => 'id',
'alias' => 'locale_id',
'column' => 's.id',
'alias' => 'sliderId',
'type' => 'number',
'label' => 'ID',
],
[
'column' => 'code',
'alias' => 'locale_code',
'label' => 'ID'
], [
'column' => 's.title',
'alias' => 'SliderTitle',
'type' => 'string',
'label' => 'Code',
],
[
'column' => 'name',
'alias' => 'locale_name',
'type' => 'string',
'label' => 'Name',
'label' => 'Slider Title'
],
],
//don't use aliasing in case of searchables
'searchable' => [
// [
// 'column' => 'name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
// [
// 'column' => 'code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
[
'column' => 's.id',
'type' => 'number',
'label' => 'ID'
], [
'column' => 's.title',
'type' => 'string',
'label' => 'Slider Title'
]
],
//list of viable operators that will be used
@ -148,9 +135,7 @@ class SliderDataGrid
'nlike' => "not like",
],
// 'css' => []
]);
}
public function render()

View File

@ -24,7 +24,6 @@ class TaxRateDataGrid
{
return DataGrid::make([
'name' => 'Tax Rates',
'table' => 'tax_rates as tr',
'select' => 'tr.id',
@ -64,21 +63,13 @@ class TaxRateDataGrid
'icon' => 'icon trash-icon',
],
],
'join' => [
// [
// 'join' => 'leftjoin',
// 'table' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
'join' => [],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'tr.id',
'alias' => 'ID',
'alias' => 'id',
'type' => 'number',
'label' => 'ID',
'sortable' => true,
@ -90,7 +81,7 @@ class TaxRateDataGrid
'label' => 'Identifier',
'sortable' => true,
// 'wrapper' => function ($value, $object) {
// return '<a class="color-red">' . $object->Name . '</a>';
// return '<a class="color-red">' . $object->identifier . '</a>';
// },
],
[
@ -119,32 +110,27 @@ class TaxRateDataGrid
//don't use aliasing in case of filters
'filterable' => [
[
'name' => 'tr.id',
'column' => 'tr.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'tr.identifier',
], [
'column' => 'tr.identifier',
'alias' => 'identifier',
'type' => 'string',
'label' => 'Identifier',
],
[
'name' => 'tr.state',
], [
'column' => 'tr.state',
'alias' => 'state',
'type' => 'string',
'label' => 'State',
],
[
'name' => 'tr.country',
], [
'column' => 'tr.country',
'alias' => 'country',
'type' => 'string',
'label' => 'Country',
],
[
'name' => 'tr.tax_rate',
], [
'column' => 'tr.tax_rate',
'alias' => 'tax_rate',
'type' => 'number',
'label' => 'Tax Rate',
@ -157,22 +143,6 @@ class TaxRateDataGrid
'type' => 'string',
'label' => 'Identifier',
],
[
'column' => 'tr.state',
'type' => 'string',
'label' => 'State',
],
[
'column' => 'tr.country',
'type' => 'string',
'label' => 'Country',
],
[
'column' => 'tr.tax_rate',
'type' => 'number',
'label' => 'Tax Rate',
],
],
'operators' => [
'eq' => "=",

View File

@ -107,8 +107,6 @@ class Cart {
{
$product = $this->product->findOneByField('id', $productId);
// dd($product);
//Check if the product's information is proper or not.
if(!isset($data['product']) || !isset($data['quantity'])) {
session()->flash('error', trans('shop::app.checkout.cart.integrity.missing_fields'));
@ -961,4 +959,24 @@ class Cart {
return $finalData;
}
/**
* Move to Cart
*
* Move a wishlist item to cart
*/
public function moveToCart($productId) {
$data = [
'product' => $productId,
'quantity' => 1,
];
$result = $this->add($productId, $data);
if($result instanceof Collection || $result == true) {
return true;
} else {
return false;
}
}
}

View File

@ -5,7 +5,9 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Customer\Repositories\WishlistRepository;
use Cart;
use Auth;
/**
@ -26,13 +28,15 @@ class WishlistController extends Controller
protected $wishlist;
protected $product;
/**
* Initializes the required repository instances.
*
* @param $customer
* @param $wishlist
*/
public function __construct(CustomerRepository $customer, WishlistRepository $wishlist)
public function __construct(CustomerRepository $customer, WishlistRepository $wishlist, ProductRepository $product)
{
$this->middleware('customer');
@ -41,6 +45,8 @@ class WishlistController extends Controller
$this->customer = $customer;
$this->wishlist = $wishlist;
$this->product = $product;
}
/**
@ -67,6 +73,15 @@ class WishlistController extends Controller
* @param integer $itemId
*/
public function add($itemId) {
$product = $this->product->findOneByField('id', $itemId);
if($product->type == "configurable") {
$slug = $product->url_key;
session()->flash('warning', trans('customer::app.wishlist.select-options'));
return redirect()->route('shop.products.index', $slug);
}
$data = [
'channel_id' => core()->getCurrentChannel()->id,
@ -111,12 +126,45 @@ class WishlistController extends Controller
}
}
/**
* Add the configurable product
* to the wishlist.
*
* @return response
*/
public function addconfigurable($urlkey) {
dd($urlkey);
session()->flash('warning', trans('Select options before adding to wishlist'));
return redirect()->route('shop.products.index', $urlkey);
}
/**
* Function to move item from wishlist to cart.
*
* @param integer $itemId
*/
public function moveToCart() {
dd('adding item to wishlist');
public function moveAll() {
Cart::moveAllToCart();
}
/**
* Function to move item from wishlist to cart.
*
* @param integer $itemId
*/
public function move($productId) {
$result = Cart::moveToCart($productId);
$wishlist = $this->wishlist->findWhere(['customer_id' => auth()->guard('customer')->user()->id, 'product_id' => $productId]);
if($this->wishlist->delete($wishlist[0]->id)) {
session()->flash('success', 'Item Moved To Cart Successfully');
return redirect()->back();
} else {
session()->flash('error', 'Item Cannot Be Moved To Cart Successfully');
return redirect()->back();
}
}
}

View File

@ -7,6 +7,7 @@ return [
'already' => 'Item Already Present In Your Wishlist',
'removed' => 'Item Successfully Added To Wishlist',
'remove-fail' => 'Item Cannot Be Removed From Wishlist',
'empty' => 'You Don\'t Have Any Items In Your Wishlist'
'empty' => 'You Don\'t Have Any Items In Your Wishlist',
'select-options' => 'Need To Select Options Before Adding To Wishlist'
],
];

View File

@ -7,7 +7,7 @@ class Review extends AbstractProduct
/**
* Returns the product's avg rating
*
* @param Product $product
* @param Product $product
* @return float
*/
public function getReviews($product)
@ -18,7 +18,7 @@ class Review extends AbstractProduct
/**
* Returns the product's avg rating
*
* @param Product $product
* @param Product $product
* @return float
*/
public function getAverageRating($product)

View File

@ -1,6 +1,7 @@
<?php
Route::group(['middleware' => ['web']], function () {
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
'view' => 'shop::home.index'
])->name('shop.home.index');
@ -119,6 +120,10 @@ Route::group(['middleware' => ['web']], function () {
Route::get('wishlist/remove/{id}', 'Webkul\Customer\Http\Controllers\WishlistController@remove')->name('customer.wishlist.remove');
Route::get('wishlist/move/{id}', 'Webkul\Customer\Http\Controllers\WishlistController@move')->name('customer.wishlist.move');
Route::get('wishlist/moveall', 'Webkul\Customer\Http\Controllers\WishlistController@moveAll')->name('customer.wishlist.moveall');
//customer account
Route::prefix('account')->group(function () {
@ -163,7 +168,6 @@ Route::group(['middleware' => ['web']], function () {
Route::post('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [
'redirect' => 'customer.address.index'
])->name('customer.address.edit');
/* Routes for Addresses ends here */
/* Wishlist route */
@ -188,5 +192,4 @@ Route::group(['middleware' => ['web']], function () {
});
});
//customer routes end here
});

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Artboard</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<path d="M9.06852618,23.2496556 L22.5678375,9.75034436" id="Line-2" stroke="#242424" stroke-width="3"></path>
<path d="M9.06852618,9.75034436 L22.5678375,23.2496556" id="Line-2" stroke="#242424" stroke-width="3"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 708 B

View File

@ -481,7 +481,7 @@ section.slider-block {
}
.nav a:first-child{
margin-left: 20px;
// margin-left: 20px;
}
.nav li > .icon{
@ -1658,62 +1658,52 @@ section.review {
.review-layouter {
display: flex;
flex-flow: row;
margin-top: 20px;
flex-direction: row;
.product-info {
.image {
border:1px solid red;
.product-image {
img {
display: block;
height: 280px;
width: 280px;
}
}
.heading {
.product-name {
margin-top: 20px;
span {
font-size: 24px;
}
}
.price {
.product-price {
margin-top: 10px;
.pro-price {
font-size: 24px;
color: $disc-price;
}
.pro-price-not {
margin-left: 10px;
color: $disc-price-pro;
}
.offer {
margin-left: 10px;
}
}
}
.review-info {
.review-form {
margin-left: 20px;
width: 49%;
.heading {
margin-top: 10px;
span {
}
.btn.btn-primary.right {
float: right;
margin-top: -10px;

View File

@ -1,3 +1,57 @@
.product-card {
.product-image {
max-height: 350px;
max-width: 280px;
margin-bottom: 10px;
background: #F2F2F2;
img {
display: block;
width: 100%;
}
}
.product-name {
margin-bottom: 14px;
width: 100%;
color: $font-color;
a {
color: $font-color;
}
}
.product-description {
display: none;
}
.product-ratings {
width: 100%;
.icon {
width: 16px;
height: 16px;
}
}
.cart-wish-wrap {
display: inline-flex;
justify-content: flex-start;
align-items: center;
height: 40px;
.addtocart {
margin-right: 10px;
text-transform: uppercase;
}
.add-to-wishlist {
margin-top: 5px;
}
}
}
// product card, requires no changes for responsiveness.
.product-grid-4 {
display: grid;
@ -43,55 +97,6 @@
}
}
.product-card {
.product-image {
max-height: 350px;
max-width: 280px;
margin-bottom: 10px;
background: #F2F2F2;
img {
display: block;
width: 100%;
}
}
.product-name {
margin-bottom: 14px;
width: 100%;
color: $font-color;
a {
color: $font-color;
}
}
.product-description {
display: none;
}
.product-ratings {
width: 100%;
.icon {
width: 16px;
height: 16px;
}
}
.cart-fav-seg {
display: inline-flex;
align-items: center;
.addtocart {
margin-right: 10px;
text-transform: uppercase;
white-space: nowrap;
}
}
}
//wishlist icon hover properties
.add-to-wishlist {
@ -140,7 +145,7 @@
text-align: left;
}
.account-edit {
.account-action {
font-size: 17px;
margin-top: 1%;
color: $brand-color;

View File

@ -15,8 +15,12 @@
background-image:URL('../images/icon-menu-close.svg');
width: 24px;
height: 24px;
margin-left:auto;
margin-bottom: 2px;
}
.icon-menu-close-adj {
background-image:URL('../images/cross-icon-adj.svg');
width: 32px;
height: 32px;
}
.grid-view-icon {

View File

@ -11,6 +11,13 @@ return [
]
],
'reviews' => [
'add-review-page-title' => 'Add Review',
'write-review' => 'Write a review',
'review-title' => 'Give Your Review a Title',
'empty' => 'You Haven\'t Reviewed Any Product Yet'
],
'customer' => [
'signup-text' => [
'account_exists' => 'Already have an account',
@ -191,7 +198,11 @@ return [
'wishlist' => [
'title' => 'Wishlist',
'deleteall' => 'Delete All',
'moveall' => 'Move All Products To Cart'
'moveall' => 'Move All Products To Cart',
'move-to-cart' => 'Move To Cart',
'empty' => 'You Have No Items In Your Wishlist',
'add' => 'Item Successfully Added To Wishlist',
'remove' => 'Item Successfully Removed From Wishlist'
],
'checkout' => [

View File

@ -16,7 +16,7 @@
<span class="account-heading">{{ __('shop::app.customer.account.address.index.title') }}</span>
@if(!$address->isEmpty())
<span class="account-edit">
<span class="account-action">
<a href="{{ route('customer.address.edit') }}">
{{ __('shop::app.customer.account.address.index.edit') }}
</a>

View File

@ -7,7 +7,7 @@
@include('shop::customers.account.partials.sidemenu')
<div class="account-layout">
<div class="account-head mb-10">
<div class="account-head mb-15">
<div class="account-heading">{{ __('shop::app.customer.account.address.create.title') }}</div>
</div>
<form method="post" action="{{ route('customer.address.create') }}" @submit.prevent="onSubmit">

View File

@ -8,7 +8,7 @@
<div class="account-layout">
<div class="account-head mb-10">
<div class="account-head mb-15">
<div class="account-heading">{{ __('shop::app.customer.account.address.edit.title') }}</div>
</div>

View File

@ -16,7 +16,7 @@
<span class="account-heading">{{ __('shop::app.customer.account.profile.index.title') }}</span>
<span class="account-edit">
<span class="account-action">
<a href="{{ route('customer.profile.edit') }}">{{ __('shop::app.customer.account.profile.index.edit') }}</a>
</span>

View File

@ -6,59 +6,41 @@
@include('shop::customers.account.partials.sidemenu')
<div class="account-layout">
<div class="account-head">
<span class="account-heading">Reviews</span>
<div class="horizontal-rule"></div>
</div>
<div class="account-items-list">
{{-- <div class="account-item-card mt-15 mb-15">
<div class="media-info">
@php
$image = $productImageHelper->getProductBaseImage($item);
@endphp
<img class="media" src="{{ $image['small_image_url'] }}" />
@if(count($reviews))
@foreach($reviews as $review)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
<?php $image = $productImageHelper->getGalleryImages($review->product); ?>
<img class="media" src="{{ $image[0]['small_image_url'] }}" />
<div class="info mt-20">
<div class="product-name">{{$item->name}}</div>
</div>
</div>
<div class="info mt-20">
<div class="product-name">{{$review->product->name}}</div>
<div class="operations">
<a class="mb-50" href="{{ route('customer.wishlist.remove', $item->id) }}"><span class="icon trash-icon"></span></a>
<div>
@for($i=0 ; $i < $review->rating ; $i++)
<span class="icon star-icon"></span>
@endfor
</div>
<button class="btn btn-primary btn-md">Move To Cart</button>
</div>
</div> --}}
@foreach($reviews as $review)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
<?php $image = $productImageHelper->getGalleryImages($review->product); ?>
<img class="media" src="{{ $image[0]['small_image_url'] }}" />
<div class="info mt-20">
<div class="product-name">{{$review->product->name}}</div>
<div>
@for($i=0 ; $i < $review->rating ; $i++)
<span class="icon star-icon"></span>
@endfor
</div>
<div>
{{ $review->comment }}
<div>
{{ $review->comment }}
</div>
</div>
</div>
</div>
<div class="operations">
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
@else
<div class="empty">
{{ __('customer::app.reviews.empty') }}
</div>
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
@endif
</div>
</div>
</div>

View File

@ -9,11 +9,11 @@
<div class="account-layout">
<div class="account-head">
<div class="account-head mb-15">
<span class="account-heading">{{ __('shop::app.wishlist.title') }}</span>
@if(count($items))
<div class="account-edit">
<div class="account-action">
<a href="" style="margin-right: 15px;">{{ __('shop::app.wishlist.deleteall') }}</a>
<a href="">{{ __('shop::app.wishlist.moveall') }}</a>
</div>
@ -40,7 +40,7 @@
<div class="operations">
<a class="mb-50" href="{{ route('customer.wishlist.remove', $item->id) }}"><span class="icon trash-icon"></span></a>
<button class="btn btn-primary btn-md">Move To Cart</button>
<a href="{{ route('customer.wishlist.move', $item->id) }}" class="btn btn-primary btn-md">{{ __('shop::app.wishlist.move-to-cart') }}</a>
</div>
</div>
<div class="horizontal-rule mb-10 mt-10"></div>

View File

@ -0,0 +1,19 @@
@extends('shop::layouts.master')
@section('content-wrapper')
<div class="error-container" style="width: 100%; display: flex; justify-content: center;">
<div class="wrapper" style="display: flex; height: 100vh; width: 80vw;
justify-content: space-between; align-items: center;">
<div class="error-box">
<div class="error-title">404</div>
<div class="error-messgae">Page Not Found</div>
<div class="error-description"></div>
<a href="url()->to('/')">GO TO HOME</a>
{{-- pass the content dynamically --}}
Show the exception here or error message here.
</div>
<div class="error-graphic" style="height: 236px; width: 255px; border: 1px solid red; background-image: url('.{{ asset('images.error') }}.')">
</div>
</div>
</div>
@endsection

View File

@ -1,22 +1,11 @@
@inject('rateHelper' , 'Webkul\Shipping\Helper\Rate')
<div>
@foreach($rateHelper->collectRates() as $key=>$count)
<div class="shipping-method">
<input type="radio" name="price"> ${{ core()->currency($count) }} <span> {{ $key }} </span>
</div>
<div class="shipping-method">
<input type="radio" name="price"> ${{ core()->currency($count) }} <span> {{ $key }} </span>
</div>
@endforeach
</div>
<style>
span {
margin-left: 10px;

View File

@ -262,79 +262,46 @@
</div>
</div>
@push('scripts')
<script>
window.onload = function() {
var hamMenu = document.getElementById("hammenu");
var search = document.getElementById("search");
var searchResponsive = document.getElementsByClassName('search-responsive')[0];
var sortLimit = document.getElementsByClassName('reponsive-sorter-limiter')[0];
var layerFilter = document.getElementsByClassName('responsive-layred-filter')[0];
var navResponsive = document.getElementsByClassName('responsive-nav')[0];
var thumbList = document.getElementsByClassName('thumb-list')[0];
<script>
search.addEventListener("click", header);
hamMenu.addEventListener("click", header);
window.onload = function() {
var hamMenu = document.getElementById("hammenu");
var search = document.getElementById("search");
var searchResponsive = document.getElementsByClassName('search-responsive')[0];
var sortLimit = document.getElementsByClassName('reponsive-sorter-limiter')[0];
var layerFilter = document.getElementsByClassName('responsive-layred-filter')[0];
var navResponsive = document.getElementsByClassName('responsive-nav')[0];
var thumbList = document.getElementsByClassName('thumb-list')[0];
var thumbFrame = document.getElementsByClassName('thumb-frame');
var productHeroImage = document.getElementsByClassName('product-hero-image')[0];
search.addEventListener("click", header);
hamMenu.addEventListener("click", header);
// activate on window resize
window.addEventListener('resize', function(){
if(window.innerWidth > 720){
searchResponsive.style.display = 'none';
navResponsive.style.display = 'none';
if(layerFilter && sortLimit){
layerFilter.style.display ="none";
sortLimit.style.display ="none";
// for header responsive icon
function header(){
var className = document.getElementById(this.id).className;
if(className === 'icon icon-search' ){
search.classList.remove("icon-search");
search.classList.add("icon-menu-close");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'block';
navResponsive.style.display = 'none';
}else if(className === 'icon icon-menu'){
hamMenu.classList.remove("icon-menu");
hamMenu.classList.add("icon-menu-close");
search.classList.remove("icon-menu-close");
search.classList.add("icon-search");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'block';
}else{
search.classList.remove("icon-menu-close");
search.classList.add("icon-search");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'none';
}
}
if(window.innerWidth < 1313 && window.innerWidth > 720){
if(thumbList){
thumbList.style.maxHeight = productHeroImage.offsetHeight + "px";
for(let i=0 ; i < thumbFrame.length ; i++){
thumbFrame[i].style.height = (productHeroImage.offsetHeight/4) + "px";
}
}
}else {
for(let i=0 ; i < thumbFrame.length ; i++){
thumbFrame[i].style.height = 120 + "px";
}
}
});
// for header responsive icon
function header(){
var className = document.getElementById(this.id).className;
if(className === 'icon icon-search' ){
search.classList.remove("icon-search");
search.classList.add("icon-menu-close");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'block';
navResponsive.style.display = 'none';
}else if(className === 'icon icon-menu'){
hamMenu.classList.remove("icon-menu");
hamMenu.classList.add("icon-menu-close");
search.classList.remove("icon-menu-close");
search.classList.add("icon-search");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'block';
}else{
search.classList.remove("icon-menu-close");
search.classList.add("icon-search");
hamMenu.classList.remove("icon-menu-close");
hamMenu.classList.add("icon-menu");
searchResponsive.style.display = 'none';
navResponsive.style.display = 'none';
}
}
}
</script>
</script>
@endpush

View File

@ -42,14 +42,21 @@
<script type="text/javascript">
window.flashMessages = [];
@if($success = session('success'))
window.flashMessages = [{'type': 'alert-success', 'message': "{{ $success }}" }];
@elseif($warning = session('warning'))
window.flashMessages = [{'type': 'alert-warning', 'message': "{{ $warning }}" }];
@elseif($warning = session('info'))
window.flashMessages = [{'type': 'alert-info', 'message': "{{ $info }}" }
];
@elseif($error = session('error'))
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }];
window.flashMessages = [{'type': 'alert-error', 'message': "{{ $error }}" }
];
@endif
window.serverErrors = [];
@if (count($errors))
window.serverErrors = @json($errors->getMessages());
@endif

View File

@ -3,16 +3,13 @@
@section('content-wrapper')
@inject ('productRepository', 'Webkul\Product\Repositories\ProductRepository')
<div class="main">
<div class="category-container">
@include ('shop::products.list.layered-navigation')
<div class="category-block">
<div class="hero-image mb-35">
<img src="https://images.pexels.com/photos/428338/pexels-photo-428338.jpeg?cs=srgb&dl=adolescent-casual-cute-428338.jpg&fm=jpg" />
<img src="https://images.pexels.com/photos/428338/pexels-photo-428338.jpeg?cs=srgb&dl=adolescent-casual-cute-428338.jpg&fm=jpg" />
</div>
<?php $products = $productRepository->findAllByCategory($category->id); ?>
@ -23,84 +20,72 @@
@if ($toolbarHelper->getCurrentMode() == 'grid')
<div class="product-grid-3">
@foreach ($products as $product)
@include ('shop::products.list.card', ['product' => $product])
@endforeach
</div>
@else
<div class="product-list">
@foreach ($products as $product)
@include ('shop::products.list.card', ['product' => $product])
@endforeach
</div>
@endif
<div class="bottom-toolbar">
{{ $products->appends(request()->input())->links() }}
</div>
</div>
</div>
</div>
@stop
@push('scripts')
<script>
$(document).ready(function() {
var sort = document.getElementById("sort");
var filter = document.getElementById("filter");
var sortLimit = document.getElementsByClassName('reponsive-sorter-limiter')[0];
var layerFilter = document.getElementsByClassName('responsive-layred-filter')[0];
<script>
$(document).ready(function() {
var sort = document.getElementById("sort");
var filter = document.getElementById("filter");
var sortLimit = document.getElementsByClassName('reponsive-sorter-limiter')[0];
var layerFilter = document.getElementsByClassName('responsive-layred-filter')[0];
if(sort && filter){
sort.addEventListener("click", sortFilter);
filter.addEventListener("click", sortFilter);
}
function sortFilter(){
var className = document.getElementById(this.id).className;
if(className === 'icon sort-icon' ){
sort.classList.remove("sort-icon");
sort.classList.add("icon-menu-close");
filter.classList.remove("icon-menu-close");
filter.classList.add("filter-icon");
sortLimit.style.display ="flex";
sortLimit.style.justifyContent="space-between";
layerFilter.style.display ="none";
}else if(className === 'icon filter-icon'){
filter.classList.remove("filter-icon");
filter.classList.add("icon-menu-close");
sort.classList.remove("icon-menu-close");
sort.classList.add("sort-icon");
layerFilter.style.display ="block";
sortLimit.style.display ="none";
}else{
sort.classList.remove("icon-menu-close");
sort.classList.add("sort-icon");
filter.classList.remove("icon-menu-close");
filter.classList.add("filter-icon");
sortLimit.style.display ="none";
layerFilter.style.display ="none";
if(sort && filter){
sort.addEventListener("click", sortFilter);
filter.addEventListener("click", sortFilter);
}
}
})
</script>
@endpush
function sortFilter(){
var className = document.getElementById(this.id).className;
if(className === 'icon sort-icon'){
sort.classList.remove("sort-icon");
sort.classList.add("icon-menu-close-adj");
filter.classList.remove("icon-menu-close-adj");
filter.classList.add("filter-icon");
sortLimit.style.display ="flex";
sortLimit.style.justifyContent="space-between";
layerFilter.style.display ="none";
}else if(className === 'icon filter-icon'){
filter.classList.remove("filter-icon");
filter.classList.add("icon-menu-close-adj");
sort.classList.remove("icon-menu-close-adj");
sort.classList.add("sort-icon");
layerFilter.style.display ="block";
sortLimit.style.display ="none";
}else{
sort.classList.remove("icon-menu-close-adj");
sort.classList.add("sort-icon");
filter.classList.remove("icon-menu-close-adj");
filter.classList.add("filter-icon");
sortLimit.style.display ="none";
layerFilter.style.display ="none";
}
}
});
</script>
@endpush

View File

@ -33,15 +33,18 @@
@else
@if($product->type == "configurable")
<a href="{{ route('cart.add.configurable', $product->url_key) }}" class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</a>
@else
<form action="{{route('cart.add', $product->id)}}" method="POST">
@csrf
<input type="hidden" name="product" value="{{ $product->id }}">
<input type="hidden" name="quantity" value="1">
<input type="hidden" value="false" name="is_configurable">
<button class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</button>
</form>
@include('shop::products.wishlist')
@else
<div class="cart-wish-wrap">
<form action="{{route('cart.add', $product->id)}}" method="POST">
@csrf
<input type="hidden" name="product" value="{{ $product->id }}">
<input type="hidden" name="quantity" value="1">
<input type="hidden" value="false" name="is_configurable">
<button class="btn btn-lg btn-primary addtocart">{{ __('shop::app.home.product-card.add-to-cart') }}</button>
</form>
@include('shop::products.wishlist')
</div>
@endif
@endif
</div>

View File

@ -1,26 +1,25 @@
@extends('shop::layouts.master')
@section('page_title')
{{ __('shop::app.reviews.add-review-page-title') }} - {{ $product->name }}
@endsection
@section('content-wrapper')
<section class="review">
<div class="category-breadcrumbs">
{{-- <div class="category-breadcrumbs">
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
</div>
<div class="review-layouter">
</div> --}}
<div class="review-layouter mb-20">
<div class="product-info">
<div class="image">
<div class="product-image">
<img src="{{ bagisto_asset('images/jeans_big.jpg') }}" />
</div>
<div class="heading">
<div class="product-name">
<span>{{ $product->name }}</span>
</div>
<div class="price">
<div class="product-price">
@inject ('priceHelper', 'Webkul\Product\Helpers\Price')
@ -34,37 +33,37 @@
@endif
@endif
<span class="pro-price-not">
{{-- <span class="pro-price-not">
<strike> $45.00 </strike>
</span>
<span class="offer"> 10% Off </span>
<span class="offer"> 10% Off </span> --}}
</div>
</div>
<div class="review-info">
<div class="review-form">
<form method="POST" action="{{ route('shop.reviews.store', $product->id ) }}">
@csrf
<div class="heading">
<span> Write a review </span>
<span>{{ __('shop::app.reviews.write-review') }}</span>
</div>
<div class="rating">
<span> {{ __('admin::app.customers.reviews.rating') }} </span>
</div>
<div class="stars">
<label class="star star-5" for="star-5" onclick="calculateRating(id)" id="1"></label>
<label class="star star-4" for="star-4" onclick="calculateRating(id)" id="2"></label>
<label class="star star-3" for="star-3" onclick="calculateRating(id)" id="3"></label>
<label class="star star-2" for="star-2" onclick="calculateRating(id)" id="4"></label>
<label class="star star-1" for="star-1" onclick="calculateRating(id)" id="5"></label>
<input type="name" name="title" class="form-control" placeholder="title">
<input type="name" name="title" class="form-control" placeholder="{{ __('shop::app.reviews.review-title') }}">
<input type="hidden" id="rating" name="rating">

View File

@ -65,53 +65,14 @@
</accordian>
@include ('shop::products.view.attributes')
@include ('shop::products.view.reviews')
</div>
</form>
</div>
@include ('shop::products.view.up-sells')
</section>
@endsection
@push('scripts')
<script>
document.onreadystatechange = function () {
var state = document.readyState
var galleryTemplate = document.getElementById('product-gallery-template');
var addTOButton = document.getElementsByClassName('add-to-buttons')[0];
if(galleryTemplate){
if (state == 'interactive') {
galleryTemplate.style.display="none";
} else {
document.getElementById('loader').style.display="none";
addTOButton.style.display="flex";
}
}
}
$(document).ready(function() {
var thumbList = document.getElementsByClassName('thumb-list')[0];
var thumbFrame = document.getElementsByClassName('thumb-frame');
var productHeroImage = document.getElementsByClassName('product-hero-image')[0];
// for product page resize image
if(thumbList && productHeroImage){
thumbList.style.maxHeight = productHeroImage.offsetHeight + "px";
for(let i=0 ; i < thumbFrame.length ; i++){
thumbFrame[i].style.height = (productHeroImage.offsetHeight/4) + "px";
}
}
})
</script>
@endpush

View File

@ -70,4 +70,10 @@
</div>
</div>
@else
@if(!is_null($customer))
<a href="{{ route('shop.reviews.create', $product->url_key) }}" class="btn btn-lg btn-primary">
{{ __('shop::app.products.write-review-btn') }}
</a>
@endif
@endif

View File

@ -1,5 +1,5 @@
@auth('customer')
<a class="add-to-wishlist" href="{{ route('customer.wishlist.add', $product->id) }}">
<span class="icon wishlist-icon"></span>
</a>
<a class="add-to-wishlist" href="{{ route('customer.wishlist.add', $product->id) }}">
<span class="icon wishlist-icon"></span>
</a>
@endauth

View File

@ -596,7 +596,7 @@ class DataGrid
array_values($value)[0]
);
} else {
throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually.');
throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually');
}
} elseif ($key=="search") {
@ -689,7 +689,6 @@ class DataGrid
$parsed = $this->parse();
if ($this->aliased==true) {
//flags
$table_alias = false;
$join_table_alias = false;
@ -710,7 +709,7 @@ class DataGrid
//check whether exploded string still has same table name
if ($exploded[0]==$this->table) {
$table_alias = false;
} else { // (isset($exploded))
} else {
$table_alias = true;
$table_name = trim($exploded[0]);
$table_alias = trim($exploded[1]);

View File

@ -20,6 +20,8 @@ class UiServiceProvider extends ServiceProvider
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/ui/assets'),
], 'public');
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'ui');
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'ui');
Paginator::defaultView('ui::partials.pagination');

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="10px" height="14px" viewBox="0 0 10 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Icon-Sort-Down</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Settings-Users-Roles" transform="translate(-451.000000, -218.000000)" stroke="#979797">
<g id="Paper" transform="translate(344.000000, 145.000000)">
<g id="Table" transform="translate(0.000000, 61.000000)">
<g id="Strip-Head">
<g id="Icon-Sort-Up" transform="translate(103.000000, 10.000000)">
<g id="Icon-Sort-Down" transform="translate(9.000000, 9.000000) scale(1, -1) rotate(90.000000) translate(-9.000000, -9.000000) translate(3.000000, 5.000000)">
<path d="M1.13686838e-12,4 L10.068125,4" id="Path-3" stroke-width="2"></path>
<polyline id="Path-4" stroke-width="2" points="8 0 12 4.08548298 8 8"></polyline>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Artboard</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<path d="M9.06852618,23.2496556 L22.5678375,9.75034436" id="Line-2" stroke="#242424" stroke-width="3"></path>
<path d="M9.06852618,9.75034436 L22.5678375,23.2496556" id="Line-2" stroke="#242424" stroke-width="3"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

View File

@ -1,7 +1,7 @@
<template>
<div class="alert" v-bind:class="flash.type">
<span class="icon white-cross-sm-icon" @click="remove"></span>
<p>{{ flash.message }}</p>
<p>{{ flash.message }}</p>
</div>
</template>

View File

@ -1,5 +1,6 @@
$font-color: #3a3a3a;
$brand-color: #0041FF;
$info-color: #204d74;
$danger-color: #FC6868;
$success-color: #4CAF50;
$warning-color: #FFC107;

View File

@ -1,6 +1,7 @@
// Icon scss
@import "icons";
@import "variables";
@import "components";
@import "mixins";
@import "animations";
@ -521,6 +522,10 @@ h2 {
background: $danger-color;
}
&.alert-info {
background: $info-color;
}
&.alert-success {
background: $success-color;
}
@ -675,263 +680,6 @@ h2 {
}
}
/* Data grid css starts here */
.grid-container {
user-select: none;
.filter-wrapper {
display: block;
box-sizing: border-box;
.filter-row-one,
.filter-row-two {
display: flex;
flex-direction: row;
}
.filter-row-one {
height: 40px;
align-items: center;
justify-content: space-between;
.search-filter {
.control {
font-family: "montserrat", sans-serif;
padding-left: 5px;
width: 380px;
height: 36px;
border: 2px solid $control-border-color;
border-radius: 3px;
border-right: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
font-size: 14px;
}
.ic-wrapper {
display: block;
height: 36px;
width: 36px;
border: 2px solid $control-border-color;
border-left: none;
border-radius: 2px;
.search-icon {
margin-left: 4px;
margin-top: 4px;
height: 24px;
width: 24px;
}
}
}
.dropdown-filters {
display: inline-flex;
.more-filters {
margin-right: 5px;
.dropdown-toggle {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
font-family: "montserrat", sans-serif;
padding-left: 5px;
height: 36px;
width: 150px;
border: 2px solid $control-border-color;
border-radius: 2px;
background-color: $color-white;
color: $filter-toggle-color;
font-size: 14px;
.dropdown-header {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.arrow-down-icon {
margin-right: 5px;
}
}
}
.dropdown-list {
.dropdown-container {
ul {
li.filter-column-dropdown {
.filter-column-select {
width: 100%;
background: $color-white;
border: 2px solid $control-border-color;
border-radius: 3px;
height: 36px;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
}
li {
select {
background: $color-white;
border: 2px solid $control-border-color;
border-radius: 3px;
height: 36px;
max-width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
input {
background: #fff;
border: 2px solid #c7c7c7;
border-radius: 3px;
height: 36px;
max-width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
}
.filter-condition-dropdown-string {
display: none;
}
.filter-condition-dropdown-number {
display: none;
}
.filter-condition-dropdown-datetime {
display: none;
}
.filter-response-string {
display: none;
}
.filter-response-boolean {
display: none;
}
.filter-response-datetime {
display: none;
}
.filter-response-number {
display: none;
}
}
}
}
}
}
}
.filter-row-two {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 6px;
margin-bottom: 6px;
.filter-one {
margin-right: 10px;
.filter-name {
margin-right: 5px;
}
.filter-value {
display: inline-flex;
background: #e7e7e7;
padding-left: 5px;
color: $color-black-shade;
vertical-align: middle;
.f-value {
margin: auto;
}
.cross-icon {
margin: 5px;
height: 18px !important;
width: 18px !important;
cursor: pointer;
}
}
}
}
}
.table {
thead {
.mass-action-wrapper {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.massaction-remove {
margin-top: 10px;
margin-right: 10px;
}
form {
margin-top: 8px;
}
.selected-items {
margin-right: 15px;
}
}
tr {
th.grid_head {
cursor:pointer;
.sort-down-icon {
margin-left: 5px;
margin-top: -3px;
vertical-align: middle;
cursor: pointer;
}
}
th {
text-transform: capitalize;
}
}
}
tbody {
td.action {
a:first-child {
margin-right: 10px;
}
}
}
.pagination {
margin-top:20px;
}
}
}
/* DataGrid css ends in here */
.modal-open {
overflow: hidden;
}

View File

@ -0,0 +1,257 @@
/* Data grid css starts here */
.grid-container {
user-select: none;
.filter-wrapper {
display: block;
box-sizing: border-box;
.filter-row-one,
.filter-row-two {
display: flex;
flex-direction: row;
}
.filter-row-one {
height: 40px;
align-items: center;
justify-content: space-between;
.search-filter {
.control {
font-family: "montserrat", sans-serif;
padding-left: 10px;
width: 380px;
height: 36px;
border: 2px solid $control-border-color;
border-radius: 3px;
border-right: 0px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
font-size: 14px;
}
.ic-wrapper {
display: block;
height: 36px;
width: 36px;
border: 2px solid $control-border-color;
border-left: none;
border-radius: 2px;
.search-icon {
margin-left: 4px;
margin-top: 4px;
height: 24px;
width: 24px;
}
}
}
.dropdown-filters {
display: inline-flex;
.more-filters {
margin-right: 5px;
.dropdown-toggle {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
font-family: "montserrat", sans-serif;
padding-left: 5px;
height: 36px;
width: 150px;
border: 2px solid $control-border-color;
border-radius: 2px;
background-color: $color-white;
color: $filter-toggle-color;
font-size: 14px;
.dropdown-header {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
.arrow-down-icon {
margin-right: 5px;
}
}
}
.dropdown-list {
.dropdown-container {
ul {
li.filter-column-dropdown {
.filter-column-select {
width: 100%;
background: $color-white;
border: 2px solid $control-border-color;
border-radius: 3px;
height: 36px;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
}
li {
select {
background: $color-white;
border: 2px solid $control-border-color;
border-radius: 3px;
height: 36px;
max-width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
input {
background: #fff;
border: 2px solid #c7c7c7;
border-radius: 3px;
height: 36px;
max-width: 100%;
display: inline-block;
vertical-align: middle;
-webkit-transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
transition: 0.2s
cubic-bezier(0.4, 0, 0.2, 1);
padding: 0px 5px;
font-family: "montserrat", sans-serif;
margin-top: 10px;
margin-bottom: 5px;
}
}
.filter-condition-dropdown-string {
display: none;
}
.filter-condition-dropdown-number {
display: none;
}
.filter-condition-dropdown-datetime {
display: none;
}
.filter-response-string {
display: none;
}
.filter-response-boolean {
display: none;
}
.filter-response-datetime {
display: none;
}
.filter-response-number {
display: none;
}
}
}
}
}
}
}
.filter-row-two {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 6px;
margin-bottom: 6px;
.filter-one {
margin-right: 10px;
.filter-name {
margin-right: 5px;
}
.filter-value {
display: inline-flex;
background: #e7e7e7;
padding-left: 5px;
color: $color-black-shade;
vertical-align: middle;
.f-value {
margin: auto;
}
.cross-icon {
margin: 5px;
height: 18px !important;
width: 18px !important;
cursor: pointer;
}
}
}
}
}
.table {
thead {
.mass-action-wrapper {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
.massaction-remove {
margin-top: 10px;
margin-right: 10px;
}
form {
margin-top: 8px;
}
.selected-items {
margin-right: 15px;
}
}
tr {
th.grid_head {
.sort-down-icon, .sort-up-icon {
margin-left: 5px;
margin-top: -3px;
vertical-align: middle;
}
}
th.grid_head.sortable {
cursor: pointer;
}
th {
text-transform: capitalize;
}
}
}
tbody {
td.action {
a:first-child {
margin-right: 10px;
}
}
}
.pagination {
margin-top:20px;
}
}
}
/* DataGrid css ends in here */

View File

@ -0,0 +1,11 @@
.color-red {
color: red;
}
.color-default {
color: $font-color;
}
.color-brand {
color: $brand-color;
}

View File

@ -0,0 +1,6 @@
<?php
return [
'datagrid' => [
'actions' => 'Actions'
]
];

View File

@ -1,5 +1,4 @@
<div class="{{ $css->filter }}filter-wrapper">
{{-- for loading the filters from another file --}}
<div class="filter-row-one">
<div class="search-filter" style="display: inline-flex; align-items: center;">
<input type="search" class="control search-field" placeholder="Search Users" value="" />
@ -24,7 +23,8 @@
<div class="more-filters">
<div class="dropdown-toggle">
<div class="dropdown-header">
<span class="name">Filter</span> {{-- <span class="role">Filter</span> --}}
<span class="name">Filter</span>
{{-- <span class="role">Filter</span> --}}
<i class="icon arrow-down-icon active"></i>
</div>
</div>

View File

@ -1,73 +1,53 @@
<div class="grid-container {{-- $css->datagrid --}}">
<div class="grid-container">
{{-- For loading the filters from includes directory file --}}
@include('ui::datagrid.filters.default')
@include('ui::datagrid.filters')
{{-- for generating the table and its content --}}
@include('ui::datagrid.table.default')
@include('ui::datagrid.table')
{{-- Section for datagrid javascript --}}
@push('scripts')
<script type="text/javascript">
var columns = @json($columns); //referential
var allFilters = [];
var search_value;
var filter_column;
var filter_condition;
var filter_range;
var count_filters = parseInt(0);
var url;
var array_start = '[';
var array_end = ']';
var typeValue;
var selectedColumn = '';
var myURL = document.location;
let params;
$(document).ready(function() {
params = (new URL(document.location)).search;
if(params.length>0) {
if(params.length > 0) {
if(allFilters.length == 0) {
//call reverse url function
arrayFromUrl(params.slice(1,params.length));
arrayFromUrl(params.slice(1, params.length));
}
}
$('.search-btn').click(function() {
search_value = $(".search-field").val();
formURL('search','all', search_value, params); //format for search
formURL('search', 'all', search_value, params); //format for search
});
//controls for header when sorting is done
$('.grid_head').on('click', function() {
var column = $(this).data('column-name');
var currentSort = $(this).data('column-sort');
if(currentSort == "asc")
formURL("sort",column,"desc",params);
else if(currentSort == "desc")
formURL("sort",column,"asc",params);
if(currentSort == "asc") {
formURL("sort", column, "desc", params);
}
else if(currentSort == "desc") {
formURL("sort", column, "asc", params);
}
});
$('select.filter-column-select').change(function() {
@ -80,32 +60,22 @@
if(typeValue == 'string') {
//default behaviour for strings
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-condition-dropdown-datetime').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-datetime').css('display','none');
$('.filter-response-boolean').css('display','none');
//show the two wanted
$('.filter-condition-dropdown-string').css('display','inherit');
$('.filter-response-string').css('display','inherit');
}
else if(typeValue == 'boolean') {
//hide unwanted
$('.filter-condition-dropdown-string').css('display','none');
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-condition-dropdown-datetime').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-datetime').css('display','none');
//only true or false for that column is needed as input
@ -114,37 +84,26 @@
else if(typeValue == 'datetime') {
//hide unwanted
$('.filter-condition-dropdown-string').css('display','none');
$('.filter-condition-dropdown-number').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-number').css('display','none');
$('.filter-response-boolean').css('display','none');
//show what is wanted
$('.filter-condition-dropdown-datetime').css('display','inherit');
$('.filter-response-datetime').css('display','inherit');
}
else if(typeValue == 'number') {
//hide unwanted
$('.filter-condition-dropdown-string').css('display','none');
$('.filter-condition-dropdown-datetime').css('display','none');
$('.filter-response-string').css('display','none');
$('.filter-response-datetime').css('display','none');
$('.filter-response-boolean').css('display','none');
//show what is wanted
$('.filter-condition-dropdown-number').css('display','inherit');
$('.filter-response-number').css('display','inherit');
}
$('.apply-filter').on('click',function() {
@ -152,26 +111,19 @@
params = (new URL(document.location)).search;
if(typeValue == 'number') {
var conditionUsed = $('.filter-condition-dropdown-number').find(':selected').val();
var response = $('.response-number').val();
formURL(selectedColumn,conditionUsed,response,params,col_label);
}
if(typeValue == 'string') {
var conditionUsed = $('.filter-condition-dropdown-string').find(':selected').val();
var response = $('.response-string').val();
formURL(selectedColumn,conditionUsed,response,params,col_label);
}
if(typeValue == 'datetime') {
var conditionUsed = $('.filter-condition-dropdown-datetime').find(':selected').val();
var response = $('.response-datetime').val();
formURL(selectedColumn,conditionUsed,response,params,col_label);
@ -217,22 +169,17 @@
});
$('.mass-action').css('display','');
$('.table-grid-header').css('display','none');
// $('.selected-items').html(id.toString());
$('#indexes').val(id);
}
else if($("input[id=mastercheckbox]").prop('checked') == false) {
$('.indexers').each(function(){ this.checked = false; });
id = [];
$('.mass-action').css('display','none');
$('.table-grid-header').css('display','');
$('#indexes').val('');
}
});
@ -269,25 +216,18 @@
}
if(id.length>0) {
$('.mass-action').css('display','');
$('.table-grid-header').css('display','none');
$('#indexes').val(id);
}else if(id.length == 0) {
$('.mass-action').css('display','none');
$('.table-grid-header').css('display','');
$('#indexes').val('');
if($('#mastercheckbox').prop('checked')) {
$('#mastercheckbox').prop('checked',false);
}
}
});
@ -296,10 +236,8 @@
//make the url from the array and redirect
function makeURL(repetition = false) {
if(allFilters.length>0 && repetition == false)
{
for(i=0;i<allFilters.length;i++) {
if(i==0){
url = '?' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
@ -310,27 +248,22 @@
document.location = url;
} else if(allFilters.length>0 && repetition == true) {
//this is the case when the filter is being repeated on a single column with different condition and value
for(i=0;i<allFilters.length;i++) {
if(i==0){
if(i==0) {
url = '?' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
}
else
else {
url = url + '&' + allFilters[i].column + '[' + allFilters[i].cond + ']' + '=' + allFilters[i].val;
}
}
document.location = url;
} else {
var uri = window.location.href.toString();
var clean_uri = uri.substring(0, uri.indexOf("?"));
document.location = clean_uri;
}
}
@ -338,72 +271,63 @@
function arrayFromUrl(urlstring) {
var obj={};
t = urlstring.slice(0,urlstring.length);
splitted = [];
moreSplitted = [];
splitted = t.split('&');
for(i=0;i<splitted.length;i++) {
moreSplitted.push(splitted[i].split('='));
}
for(i=0;i<moreSplitted.length;i++) {
col = moreSplitted[i][0].replace(']','').split('[')[0];
cond = moreSplitted[i][0].replace(']','').split('[')[1]
val = moreSplitted[i][1];
obj.column = col;
obj.cond = cond;
obj.val = val;
if(col!=undefined && cond!=undefined && val!=undefined)
allFilters.push(obj);
obj = {};
}
makeTags();
}
//use the label to prevent the display of column name on the body
//Use the label to prevent the display of column name on the body
function makeTags() {
var filterRepeat = 0;
if(allFilters.length!=0)
for(var i = 0;i<allFilters.length;i++) {
if(allFilters[i].column == "sort") {
col_label_tag = $('li[data-name="'+allFilters[i].cond+'"]').text();
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
sorted_col = allFilters[i].cond;
var apply_on_column = $('th[data-column-name="'+sorted_col+'"]').children('.icon');
if(allFilters[i].val == "asc") {
apply_on_column.addClass('sort-down-icon');
} else {
apply_on_column.addClass('sort-up-icon');
}
$('.filter-row-two').append(filter_card);
} else if(allFilters[i].column == "search") {
col_label_tag = "Search";
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
$('.filter-row-two').append(filter_card);
} else {
col_label_tag = $('li[data-name="'+allFilters[i].column+'"]').text().trim();
var filter_card = '<span class="filter-one" id="'+ i +'"><span class="filter-name">'+ col_label_tag +'</span><span class="filter-value"><span class="f-value">'+ allFilters[i].val +'</span><span class="icon cross-icon remove-filter"></span></span></span>';
$('.filter-row-two').append(filter_card);
}
}
@ -414,13 +338,11 @@
/* validate the conditions here and do the replacements and
push here in the all filters array */
var obj1 = {};
console.log(allFilters.length);
if(column == "" || condition == "" || response == "") {
alert("Some of the required field is null, please check column, condition and value properly.");
return false;
@ -441,11 +363,9 @@
return false;
} else if(allFilters[j].column == column) {
filter_repeated = 1;
allFilters[j].cond = condition;
allFilters[j].val = response;
makeURL(true);
@ -454,84 +374,55 @@
if(filter_repeated == 0) {
obj1.column = column;
obj1.cond = condition;
obj1.val = response;
obj1.label = clabel;
allFilters.push(obj1);
obj1 = {};
makeURL();
}
}
if(column == "sort") {
sort_exists = 0;
for(j=0;j<allFilters.length;j++) {
if(allFilters[j].column == "sort") {
if(allFilters[j].column==column && allFilters[j].cond==condition && allFilters[j].val==response) {
if(response=="asc") {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = "desc";
allFilters[j].label = clabel;
makeURL();
}
else {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = "asc";
allFilters[j].label = clabel;
makeURL();
}
}
else {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = response;
allFilters[j].label = clabel;
makeURL();
}
}
}
}
if(column == "search") {
search_found = 0;
for(j=0;j<allFilters.length;j++) {
if(allFilters[j].column == "search") {
allFilters[j].column = column;
allFilters[j].cond = condition;
allFilters[j].val = response;
@ -539,13 +430,11 @@
makeURL();
}
}
for(j=0;j<allFilters.length;j++) {
if(allFilters[j].column == "search") {
search_found = 1;
}
}
if(search_found == 0) {
obj1.column = column;
obj1.cond = condition;
@ -557,27 +446,21 @@
}
}
} else {
obj1.column = column;
obj1.cond = condition;
obj1.val = response;
obj1.label = clabel;
allFilters.push(obj1);
obj1 = {};
makeURL();
}
}
}
function confirm_click(message){
if (confirm(message)) {
//do the action required
} else {
return false;
}

View File

@ -0,0 +1,3 @@
<div class="pagination">
{{ $results->links() }}
</div>

View File

@ -0,0 +1,7 @@
<div class="table">
<table class="{{ $css->table }}">
@include('ui::datagrid.table.head')
@include('ui::datagrid.table.body')
</table>
@include('ui::datagrid.pagination')
</div>

View File

@ -0,0 +1,32 @@
<tbody class="{{ $css->tbody }}">
@if(count($results) == 0)
<tr>
<td colspan="{{ count($columns)+1 }}" style="text-align: center;">
No Records Found.
</td>
</tr>
@endif
@foreach ($results as $result)
<tr>
<td class="">
<span class="checkbox">
<input type="checkbox" class="indexers" id="{{ $result->id }}" name="checkbox[]">
<label class="checkbox-view" for="checkbox1"></label>
</span>
</td>
@foreach ($columns as $column)
<td class="">{!! $column->render($result) !!}</td>
@endforeach
<td class="action">
@foreach($actions as $action)
<a @if($action['type'] == "Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
<i class="{{ $action['icon'] }}"></i>
</a>
@endforeach
</td>
</tr>
@endforeach
</tbody>

View File

@ -1,162 +0,0 @@
<div class="table">
<table class="{{ $css->table }}">
<thead>
<tr class="mass-action" style="display: none; height:63px;">
<th colspan="{{ count($columns)+1 }}">
<div class="mass-action-wrapper">
<span class="massaction-remove">
<span class="icon checkbox-dash-icon"></span>
</span>
@foreach($massoperations as $massoperation)
@if($massoperation['type'] == "button")
<form onsubmit="return confirm('Are You Sure?');"
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation['method'])=="POST" )
method="{{ strtoupper($massoperation['method']) }}"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" id="indexes" name="indexes" value="">
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
</form>
@elseif($massoperation['type'] == "select")
<form
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" )
method="{{ strtoupper($massoperation['method']) }}"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" id="indexes" name="indexes" value="">
<select name="choices">
@foreach($massoperation['options'] as $option)
<option>{{ $option }}</option>
@endforeach
</select>
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
</form>
@endif
@endforeach
</div>
</th>
</tr>
<tr class="table-grid-header">
<th>
<span class="checkbox">
<input type="checkbox" id="mastercheckbox">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
@foreach ($columns as $column)
@if($column->sortable == "true")
<th class="grid_head"
@if(strpos($column->alias, ' as '))
<?php $exploded_name = explode(' as ',$column->name); ?>
data-column-name="{{ $exploded_name[0] }}"
@else
data-column-name="{{ $column->alias }}"
@endif
data-column-label="{{ $column->label }}"
data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
</th>
@else
<th class="grid_head" data-column-name="{{ $column->alias }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
@endif
@endforeach
{{-- @if(isset($attribute_columns))
@foreach($attribute_columns as $key => $value)
<th>
{{ $value }}
</th>
@endforeach
@endif --}}
<th>
Actions
</th>
</tr>
</thead>
<tbody class="{{ $css->tbody }}">
@if(count($results) == 0)
<tr>
<td colspan="{{ count($columns)+1 }}" style="text-align: center;">
No Records Found.
</td>
</tr>
@endif
@foreach ($results as $result)
<tr>
<td class="">
<span class="checkbox">
<input type="checkbox" class="indexers" id="{{ $result->id }}" name="checkbox[]">
<label class="checkbox-view" for="checkbox1"></label>
</span>
</td>
@foreach ($columns as $column)
<td class="">{!! $column->render($result) !!}</td>
@endforeach
{{-- @if(isset($attribute_columns))
@foreach ($attribute_columns as $atc)
<td>{{ $result->{$atc} }}</td>
@endforeach
@endif --}}
<td class="action">
@foreach($actions as $action)
<a @if($action['type'] == "Edit") href="{{ url()->current().'/edit/'.$result->id }}" @elseif($action['type']=="Delete") href="{{ url()->current().'/delete/'.$result->id }}" @endif class="Action-{{ $action['type'] }}" id="{{ $result->id }}" onclick="return confirm_click('{{ $action['confirm_text'] }}');">
<i class="{{ $action['icon'] }}"></i>
</a>
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="pagination">
{{ $results->links() }}
</div>
</div>

View File

@ -0,0 +1,105 @@
<thead>
<tr class="mass-action" style="display: none; height:63px;">
<th colspan="{{ count($columns)+1 }}">
<div class="mass-action-wrapper">
<span class="massaction-remove">
<span class="icon checkbox-dash-icon"></span>
</span>
{{-- Mass operation implementation --}}
@foreach($massoperations as $massoperation)
@if($massoperation['type'] == "button")
<form onsubmit="return confirm('Are You Sure?');"
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation['method'])=="POST" )
method="{{ strtoupper($massoperation['method']) }}"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" id="indexes" name="indexes" value="">
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
</form>
@elseif($massoperation['type'] == "select")
<form
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" )
method="{{ strtoupper($massoperation['method']) }}"
@else
method="POST"
@endif
action="{{ $massoperation['route'] }}">
{{ csrf_field() }}
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
@method($massoperation['method'])
@endif
<input type="hidden" id="indexes" name="indexes" value="">
<select name="choices">
@foreach($massoperation['options'] as $option)
<option>{{ $option }}</option>
@endforeach
</select>
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
</form>
@endif
@endforeach
</div>
</th>
</tr>
<tr class="table-grid-header">
<th>
<span class="checkbox">
<input type="checkbox" id="mastercheckbox">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
@foreach ($columns as $column)
@if($column->sortable == "true")
<th class="grid_head sortable"
@if(strpos($column->alias, ' as '))
<?php $exploded_name = explode(' as ',$column->name); ?>
data-column-name="{{ $exploded_name[0] }}"
@else
data-column-name="{{ $column->alias }}"
@endif
data-column-label="{{ $column->label }}"
data-column-sort="asc">
{!! $column->sorting() !!}<span class="icon"></span>
</th>
@else
<th class="grid_head"
data-column-name="{{ $column->alias }}"
data-column-label="{{ $column->label }}">
{!! $column->sorting() !!}
</th>
@endif
@endforeach
<th>
{{ __('ui::app.datagrid.actions') }}
</th>
</tr>
</thead>

View File

@ -15,8 +15,12 @@
background-image: URL("../images/icon-menu-close.svg");
width: 24px;
height: 24px;
margin-left: auto;
margin-bottom: 2px;
}
.icon-menu-close-adj {
background-image: URL("../images/cross-icon-adj.svg");
width: 32px;
height: 32px;
}
.grid-view-icon {
@ -121,6 +125,63 @@
height: 18px;
}
.product-card .product-image {
max-height: 350px;
max-width: 280px;
margin-bottom: 10px;
background: #F2F2F2;
}
.product-card .product-image img {
display: block;
width: 100%;
}
.product-card .product-name {
margin-bottom: 14px;
width: 100%;
color: #242424;
}
.product-card .product-name a {
color: #242424;
}
.product-card .product-description {
display: none;
}
.product-card .product-ratings {
width: 100%;
}
.product-card .product-ratings .icon {
width: 16px;
height: 16px;
}
.product-card .cart-wish-wrap {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 40px;
}
.product-card .cart-wish-wrap .addtocart {
margin-right: 10px;
text-transform: uppercase;
}
.product-card .cart-wish-wrap .add-to-wishlist {
margin-top: 5px;
}
.product-grid-4 {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
@ -163,56 +224,6 @@
}
}
.product-card .product-image {
max-height: 350px;
max-width: 280px;
margin-bottom: 10px;
background: #F2F2F2;
}
.product-card .product-image img {
display: block;
width: 100%;
}
.product-card .product-name {
margin-bottom: 14px;
width: 100%;
color: #242424;
}
.product-card .product-name a {
color: #242424;
}
.product-card .product-description {
display: none;
}
.product-card .product-ratings {
width: 100%;
}
.product-card .product-ratings .icon {
width: 16px;
height: 16px;
}
.product-card .cart-fav-seg {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.product-card .cart-fav-seg .addtocart {
margin-right: 10px;
text-transform: uppercase;
white-space: nowrap;
}
.add-to-wishlist .wishlist-icon:hover {
background-image: url("../images/wishadd.svg");
}
@ -251,7 +262,7 @@
text-align: left;
}
.account-head .account-edit {
.account-head .account-action {
font-size: 17px;
margin-top: 1%;
color: #0031F0;
@ -1155,10 +1166,6 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
position: relative;
}
.header .header-bottom .nav a:first-child {
margin-left: 20px;
}
.header .header-bottom .nav li > .icon {
display: none;
}
@ -2358,94 +2365,90 @@ section.review .review-layouter {
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-flow: row;
flex-flow: row;
margin-top: 20px;
-ms-flex-direction: row;
flex-direction: row;
}
section.review .review-layouter .product-info .image {
border: 1px solid red;
}
section.review .review-layouter .product-info .image img {
section.review .review-layouter .product-info .product-image img {
display: block;
height: 280px;
width: 280px;
}
section.review .review-layouter .product-info .heading {
section.review .review-layouter .product-info .product-name {
margin-top: 20px;
}
section.review .review-layouter .product-info .heading span {
section.review .review-layouter .product-info .product-name span {
font-size: 24px;
}
section.review .review-layouter .product-info .price {
section.review .review-layouter .product-info .product-price {
margin-top: 10px;
}
section.review .review-layouter .product-info .price .pro-price {
section.review .review-layouter .product-info .product-price .pro-price {
font-size: 24px;
color: #FF6472;
}
section.review .review-layouter .product-info .price .pro-price-not {
section.review .review-layouter .product-info .product-price .pro-price-not {
margin-left: 10px;
color: #A5A5A5;
}
section.review .review-layouter .product-info .price .offer {
section.review .review-layouter .product-info .product-price .offer {
margin-left: 10px;
}
section.review .review-layouter .review-info {
section.review .review-layouter .review-form {
margin-left: 20px;
width: 49%;
}
section.review .review-layouter .review-info .heading {
section.review .review-layouter .review-form .heading {
margin-top: 10px;
}
section.review .review-layouter .review-info .heading .btn.btn-primary.right {
section.review .review-layouter .review-form .heading .btn.btn-primary.right {
float: right;
margin-top: -10px;
}
section.review .review-layouter .review-info .rating {
section.review .review-layouter .review-form .rating {
margin-top: 25px;
color: #A5A5A5;
}
section.review .review-layouter .review-info .rating span {
section.review .review-layouter .review-form .rating span {
display: inline;
}
section.review .review-layouter .review-info .stars {
section.review .review-layouter .review-form .stars {
width: 270px;
display: inline-block;
}
section.review .review-layouter .review-info .stars label.star {
section.review .review-layouter .review-form .stars label.star {
font-size: 36px;
color: #d4d4d4;
-webkit-transition: all .2s;
transition: all .2s;
}
section.review .review-layouter .review-info .stars label.star:before {
section.review .review-layouter .review-form .stars label.star:before {
content: '\2605';
}
section.review .review-layouter .review-info .write-review {
section.review .review-layouter .review-form .write-review {
margin-top: 25px;
}
section.review .review-layouter .review-info .write-review .control-group {
section.review .review-layouter .review-form .write-review .control-group {
margin-bottom: 0px;
}
section.review .review-layouter .review-info .write-review .control-group textarea {
section.review .review-layouter .review-form .write-review .control-group textarea {
margin-top: 5px;
border: 2px solid #E8E8E8;
border-radius: 3px;
@ -2453,11 +2456,11 @@ section.review .review-layouter .review-info .write-review .control-group textar
height: 120px;
}
section.review .review-layouter .review-info .submit-button {
section.review .review-layouter .review-form .submit-button {
margin-top: 10px;
}
section.review .review-layouter .review-info .submit-button button {
section.review .review-layouter .review-form .submit-button button {
background: #0031F0;
font-size: 14px;
color: #F2F2F2;
@ -2467,7 +2470,7 @@ section.review .review-layouter .review-info .submit-button button {
border: none;
}
section.review .review-layouter .review-info .review-detail {
section.review .review-layouter .review-form .review-detail {
height: 150px;
border: 1px solid firebrick;
margin-top: 30px;
@ -2480,18 +2483,18 @@ section.review .review-layouter .review-info .review-detail {
flex-direction: row;
}
section.review .review-layouter .review-info .review-detail .rating-review {
section.review .review-layouter .review-form .review-detail .rating-review {
margin-top: 40px;
margin-left: 20px;
width: 48%;
}
section.review .review-layouter .review-info .review-detail .rating-review .avg-rating-count span {
section.review .review-layouter .review-form .review-detail .rating-review .avg-rating-count span {
font-size: 34px;
text-align: center;
}
section.review .review-layouter .review-info .review-detail .rating-calculate .progress-only {
section.review .review-layouter .review-form .review-detail .rating-calculate .progress-only {
width: 20px;
border: 1px solid blue;
}

File diff suppressed because one or more lines are too long