Merge pull request #9 from bagisto/prashant

Prashant
This commit is contained in:
JItendra Singh 2018-09-19 12:34:08 +05:30 committed by GitHub
commit 6dbdb9f306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 1280 additions and 2476 deletions

View File

@ -3,7 +3,6 @@
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
@ -14,7 +13,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
Schema::defaultStringLength(191);
}
/**

View File

@ -51,7 +51,7 @@ return [
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
],
'pgsql' => [

View File

@ -32,57 +32,186 @@ class Cart {
protected $customer;
public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer) {
//Cookie expiry limit in minutes
protected $minutes = 150;
public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer ,$minutes = 150) {
$this->customer = $customer;
$this->cart = $cart;
$this->cartProduct = $cartProduct;
$this->minutes = $minutes;
}
public function guestUnitAdd($id) {
//empty array for storing the products
$products = array();
$minutes = 10;
if(Cookie::get('current_session_id')) {
if(Cookie::has('cart_session_id')) {
//getting the cart session id from cookie
$cart_session_id = Cookie::get('cart_session_id');
$cart = $this->cart->getOneByField('session_id'. $cart_session_id);
//finding current cart instance in the database table.
$current_cart = $this->cart->findOneByField('session_id', $cart_session_id);
$cartId = $cart->id ?? $cart['id'] ;
//check there is any cart or not
if(isset($current_cart)) {
$current_cart_id = $current_cart['id'] ?? $current_cart->id;
$products = $this->getProducts($id);
foreach($products as $key => $value) {
if($value == $id) {
dd('product already in the cart');
return redirect()->back();
}
$current_cart_session_id = $current_cart['session_id'] ?? $current_cart->session_id;
} else {
//if someone deleted then take the flow to the normal
$this->repairCart($cart_session_id, $id);
}
if($this->cartProduct->create($id)) {
session()->flash('Success', 'Product Added To Cart');
//matching the session id present in the cookie and database are same or not.
if((session()->get('cart_session_id') == Cookie::get('cart_session_id')) && ($current_cart_session_id == session()->get('cart_session_id'))) {
$current_cart_products = array();
$current_cart_products = $this->cart->getProducts($current_cart_id);
//checking new product coming in the cart is new or previously added item.
foreach($current_cart_products as $key => $value) {
$product_id = $value['id'] ?? $value->id;
if($product_id == $id) {
//create status code to communicate with session flash
session()->flash('error', 'Item Already In Cart');
//remove this its temporary
dump('Item Already In Cart');
return redirect()->back();
}
}
//cart data being attached to the instace.
$cart_data = $this->cart->attach($current_cart_id, $id, 1);
//getting the products after being attached to cart instance
$cart_products = $this->cart->getProducts($current_cart_id);
//storing the information in session.
session()->put('cart_data', [$current_cart, $cart_products]);
session()->flash('Success', 'Item Added To Cart Successfully');
dump($cart_products);
//return the control to the controller
return redirect()->back();
} else {
//repair the cart, will remake the session
//and add the product in the new cart instance.
$this->repairCart($cart_session_id, $id);
}
} else {
//function call
$this->createNewCart($id);
}
}
/*helpers*/
/**
* Create New Cart
* Cart, Cookie &
* Session.
*
* @return mixed
*/
public function createNewCart($id) {
$fresh_cart_session_id = session()->getId();
$data['session_id'] = $fresh_cart_session_id;
$data['channel_id'] = core()->getCurrentChannel()->id;
if($cart = $this->cart->create($data)) {
$this->makeCartSession($fresh_cart_session_id);
$new_cart_id = $cart->id ?? $cart['id'];
$cart_product['product_id'] = $id;
$cart_product['quantity'] = 1;
$cart_product['cart_id'] = $new_cart_id;
if($cart_product = $this->cart->attach($new_cart_id, $cart_product['product_id'], $cart_product['quantity'])) {
session()->put('cart_data', [$cart, $cart_product]);
session()->flash('success', 'Item Added To Cart Successfully');
return redirect()->back();
}
return redirect()->back();
}
session()->flash('error', 'Some Error Occured');
} else {
Cookie::queue('cart_session_id', session()->id(), $minutes);
return redirect()->back();
}
$data['session_id'] = Cookie::get('cart_session_id');
/**
* This makes session
* cart.
*/
public function makeCartSession($cart_session_id) {
$fresh_cart_session_id = $cart_session_id;
Cookie::queue('cart_session_id', $fresh_cart_session_id, $this->minutes);
session()->put('cart_session_id', $fresh_cart_session_id);
}
/**
* Reset Session and
* Cookie values
* and sync database
* if present.
*
* @return mixed
*/
public function repairCart($cart_session_id ="null", $product_id = 0) {
if($cart_session_id == session()->get('cart_session_id')) {
$data['session_id'] = $cart_session_id;
$data['channel_id'] = core()->getCurrentChannel()->id;
if($this->cart->create($data)) {
if($this->cartProduct->create($product)) {
session()->flash('Success', 'Product Added To Cart');
}
}
$cart = $this->cart->create($data);
$cart_id = $cart['id'] ?? $cart->id;
$this->cart->attach($cart_id, $product_id, 1);
session()->flash('success', 'Item Added To Cart Successfully');
return redirect()->back();
} else {
Cookie::queue(Cookie::forget('cart_session_id'));
session()->forget('cart_session_id');
session()->regenerate();
session()->flash('error', 'Please Try Adding Product Again.');
return redirect()->back();
}
}
@ -96,8 +225,8 @@ class Cart {
public function guestUnitRemove($id) {
//remove the products here
if(Cookie::has('session_c')) {
$products = unserialize(Cookie::get('session_c'));
if(Cookie::has('session_cart_id')) {
$products = unserialize(Cookie::get('session_cart_id'));
foreach($products as $key => $value) {
if($value == $id) {
@ -105,7 +234,7 @@ class Cart {
array_push($products, $id);
Cookie::queue('session_c', serialize($products));
Cookie::queue('session_cart_id', serialize($products));
return redirect()->back();
}
@ -123,149 +252,81 @@ class Cart {
$products = array();
// $customerLoggedIn = auth()->guard('customer')->check();
// //customer is authenticated
// if ($customerLoggedIn) {
//assuming that there is data in cookie and customer's cart also.
if(!auth()->guard('customer')->check()) {
throw new \Exception('This function is protected for auth customers only.');
}
$data['customer_id'] = auth()->guard('customer')->user()->id;
$data['channel_id'] = core()->getCurrentChannel()->id;
$customerCart = $this->cart->findOneByField('customer_id', $data['customer_id']);
$customer_cart = $this->cart->findOneByField('customer_id', $data['customer_id']);
//if there are products already in cart of that customer.
$customerCartId = $customerCart->id ?? $customerCart['id'];
$customer_cart_id = $customer_cart->id ?? $customer_cart['id'];
$customerCartProducts = $this->cart->getProducts($customerCartId);
/**
* Check if their any
* instance of current
* customer in the cart
* table.
*/
if(isset($customer_cart)) {
$customer_cart_products = $this->cart->getProducts($customer_cart_id);
if (isset($customerCartProducts)) {
if (isset($customer_cart_products)) {
foreach ($customerCartProducts as $previousCartProduct) {
foreach ($customer_cart_products as $customer_cart_product) {
if($customer_cart_product->id == $id) {
dump('Item already exists in cart');
if($previousCartProduct->id == $id) {
dd('product already exists in cart');
session()->flash('error', 'Item already exists in cart');
session()->flash('error', 'Product already exists in cart');
return redirect()->back();
return redirect()->back();
//maybe increase the quantity in here
}
}
//add the product in the cart
$this->cart->attach($customer_cart_id, $id, 1);
session()->flash('success', 'Item Added To Cart Successfully');
return redirect()->back();
} else {
$this->cart->destroy($customer_cart_id);
session()->flash('error', 'Try Adding The Item Again');
dd('cart instance without any product found, delete it and create a new one for the current product id');
return redirect()->back();
}
//add the product in the cart
} else {
/**
* this will work
* for logged in users
* and they do not have
* any cart instance
* found in the database.
*/
$product['product_id'] = $id;
if($new_cart = $this->cart->create($data)) {
$new_cart_id = $new_cart->id ?? $new_cart['id'];
$product['quantity'] = 1;
$this->cart->attach($new_cart_id, $id, 1);
$product['cart_id'] = $customerCartId;
session()->flash('success', 'Item Added To Cart Successfully');
$this->cartProduct->create($product);
return redirect()->back();
return redirect()->back();
} else {
session()->flash('error', 'Cannot Add Item in Cart');
return redirect()->back();
}
}
// }
// //case when cookie has products and customer also have data in cart tables
// if(isset($customerCart) && isset($cartCookie)) {
// //for unsetting the cookie for the cart uncomment after all done
// // Cookie::queue(Cookie::forget('session_c'));
// //check if there is any repetition in the products
// $customerCartId = $customerCart->id ?? $customerCart['id'];
// //to check if the customer is also having some products saved in the pivot
// //for the products.
// $customerCartProducts = $this->cart->getProducts($customerCartId);
// //if there are products already in cart of that customer
// if(isset($customerCartProducts)) {
// foreach($customerCartProducts as $previousCartProduct) {
// dump($customerCartProducts);
// foreach($cookieProducts as $key => $cookieProduct) {
// if($previousCartProduct->id == $cookieProduct) {
// unset($cookieProducts[$key]);
// }
// }
// }
// }
// /*if the above block executes it will remove duplicates
// else product in cookies will be stored in the database.*/
// foreach($cookieProducts as $key => $cookieProduct) {
// $product['product_id'] = $cookieProduct;
// $product['quantity'] = 1;
// $product['cart_id'] = $customerCartId;
// $this->cartProduct->create($product);
// }
// dump('Products in the cart synced.');
// return redirect()->back();
// } else if(isset($customerCart) && !isset($cartCookie)) {
// //case when there is no data in guest's cart
// $customerCartId = $customerCart->id ?? $customerCart['id'];
// $customerCartProducts = $this->cart->getProducts($customerCartId);
// foreach($customerCartProducts as $previousCartProduct) {
// if($previousCartProduct->id == $id) {
// dd('product already in the cart::AUTH');
// return redirect()->back();
// }
// }
// $product['product_id'] = $id;
// $product['quantity'] = 1;
// $product['cart_id'] = $customerCartId;
// $this->cartProduct->create($product);
// dump('new item added in the cart');
// return redirect()->back();
// } else if(!isset($customerCart) && isset($cartCookie)) {
// $products = unserialize(Cookie::get('session_c'));
// if ($cart = $this->cart->create($data)) {
// foreach($products as $product) {
// $product['product_id'] = $id;
// $product['quantity'] = 1;
// $product['cart_id'] = $cart;
// $this->cartProduct->create($product);
// }
// return redirect()->back();
// } else {
// session()->flash('error', 'Cannot Add Your Items To Cart');
// return redirect()->back();
// }
// }
// }
}
/**
@ -284,78 +345,84 @@ class Cart {
* and sync the cookies products
* with the existing data of cart
* in the cart tables;
*/
public function handleMerge() {
*/
// $productsInCookie = unserialize(Cookie::get('session_c'));
public function mergeCart() {
//considering cookie as a source of truth.
if(Cookie::has('cart_session_id')) {
/*
Check for previous cart of customer and
pull products from that cart instance
and then check for unique products
and delete the record with session id
and increase the quantity of the products
that are added again before deleting the
guest cart record.
*/
$cart_session_id = Cookie::get('cart_session_id');
//To hold the customer ID which is currently logged in
$customer_id = auth()->guard('customer')->user()->id;
$cart = $this->cart->findOneByField('session_id');
//having the session id saved in the cart.
$cart_session_id = Cookie::get('cart_session_id');
$cartId = $cart->id ?? $cart['id'];
//pull the record from cart table for above session id.
$guest_cart = $this->cart->findOneByField('session_id', $cart_session_id);
$data['customer_id'] = auth()->guard('customer')->user()->id;
if(!isset($guest_cart)) {
dd('Some One Deleted Cart or it wasn\'t there from the start');
$data['channel_id'] = core()->getCurrentChannel()->id;
return redirect()->back();
}
$customerCart = $this->cart->findOneByField('customer_id', $data['customer_id']);
$guest_cart_products = $this->cart->getProducts($guest_cart->id);
if(isset($customerCart)) {
//check if the current logged in customer is also
//having any previously saved cart instances.
$customer_cart = $this->cart->findOneByField('customer_id', $customer_id);
$customerCartId = $customerCart->id ?? $customerCart['id'];
if(isset($customer_cart)) {
$customer_cart_products = $this->cart->getProducts($customer_cart->id);
$customerCartProducts = $this->cart->getProducts($customerCartId);
foreach($guest_cart_products as $key => $guest_cart_product) {
if(isset($customerCartProducts)) {
foreach($customer_cart_products as $customer_cart_product) {
foreach($customerCartProducts as $previousCartProduct) {
if($guest_cart_product->id == $customer_cart_product->id) {
foreach($productsInCookie as $key => $productInCookie) {
$quantity = $guest_cart_product->toArray()['pivot']['quantity'] + 1;
if($previousCartProduct->id == $productInCookie) {
$pivot = $guest_cart_product->toArray()['pivot'];
unset($productsInCookie[$key]);
$saveQuantity = $this->cart->updateRelatedForMerge($pivot, 'quantity', $quantity);
unset($guest_cart_products[$key]);
}
}
}
}
/*if the above block executes it will remove duplicates
else product in cookies will be stored in the database.*/
//insert the new products here.
foreach ($guest_cart_products as $key => $guest_cart_product) {
$product = $guest_cart_product->toArray();
foreach($productsInCookie as $key => $cookieProduct) {
$product['product_id'] = $cookieProduct;
$product['quantity'] = 1;
$product['cart_id'] = $customerCartId;
$this->cartProduct->create($product);
}
//forget that cookie here.
Cookie::queue(Cookie::forget('session_c'));
} else {
if($cart = $this->cart->create($data)) {
foreach($productsInCookie as $productInCookie) {
$product['product_id'] = $cookieProduct;
$product['quantity'] = 1;
$product['cart_id'] = $cart->id;
$this->cartProduct->create($product);
$this->cart->updateRelatedForMerge($product['pivot'], 'cart_id', $customer_cart->id);
}
}
//forget the Cookie
Cookie::queue(Cookie::forget('session_c'));
return redirect()->back();
//detach with guest cart records
$this->cart->detachAndDeleteParent($guest_cart->id);
Cookie::queue(Cookie::forget('cart_session_id'));
return redirect()->back();
} else {
//this will just update the customer id column in the cart table
$this->cart->update(['customer_id' => $customer_id], $guest_cart->id);
Cookie::queue(Cookie::forget('cart_session_id'));
return redirect()->back();
}
}
return redirect()->back();
}
}

View File

@ -42,7 +42,7 @@ class CartController extends Controller
public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer) {
$this->middleware('customer')->except(['add', 'remove']);
$this->middleware('customer')->except(['add', 'remove', 'test']);
$this->customer = $customer;
@ -66,6 +66,8 @@ class CartController extends Controller
} else {
Cart::guestUnitAdd($id);
}
return redirect()->back();
}
public function remove($id) {
@ -75,5 +77,24 @@ class CartController extends Controller
} else {
Cart::guestUnitRemove($id);
}
return redirect()->back();
}
// public function test() {
// $cookie = Cookie::get('cart_session_id');
// $cart = $this->cart->findOneByField('session_id', $cookie);
// $cart_products = $this->cart->getProducts($cart->id);
// foreach($cart_products as $cart_product) {
// $quantity = $cart_product->toArray()['pivot']['quantity'] + 1;
// $pivot = $cart_product->toArray()['pivot'];
// $saveQuantity = $this->cart->saveRelated($pivot, 'quantity', $quantity+1);
// }
// dd('done');
// }
}

View File

@ -0,0 +1,59 @@
<?php
namespace Webkul\Cart\Http\ViewComposers;
use Illuminate\View\View;
use Illuminate\Support\Collection;
use Webkul\Cart\Repositories\CartRepository;
use Cookie;
use Cart;
/**
* cart List Composer on Navigation Menu
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CartComposer
{
/**
* The cart implementation
* for shop bundle's navigation
* menu
*/
protected $cart;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function __construct(CartRepository $cart) {
$this->cart = $cart;
}
public function compose(View $view) {
if(auth()->guard('customer')->check()) {
$cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id);
$cart_products = $this->cart->getProducts($cart['id']);
// dd($cart_products);
$view->with('cart', $cart_products);
} else {
if(Cookie::has('cart_session_id')) {
$cart = $this->cart->findOneByField('session_id', Cookie::get('cart_session_id'));
$cart_products = $this->cart->getProducts($cart['id']);
$view->with('cart', $cart_products);
}
}
}
}

View File

@ -10,11 +10,12 @@ class Cart extends Model
{
protected $table = 'cart';
protected $fillable = ['customer_id','session_id','channel_id','coupon_code','is_gift'];
protected $fillable = ['customer_id', 'session_id', 'channel_id', 'coupon_code', 'is_gift'];
protected $hidden = ['coupon_code'];
public function with_products() {
return $this->belongsToMany(Product::class, 'cart_products');
return $this->belongsToMany(Product::class, 'cart_products')->withPivot('id', 'product_id','quantity', 'cart_id');
}
}

View File

@ -8,8 +8,8 @@ use Illuminate\Routing\Router;
use Illuminate\Foundation\AliasLoader;
use Webkul\User\Http\Middleware\RedirectIfNotAdmin;
use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
use Webkul\Cart\Cart;
use Webkul\Cart\Facades\Cart as CartFacade;
use Webkul\Cart\Facades\Cart;
use Webkul\Cart\Providers\ComposerServiceProvider;
class CartServiceProvider extends ServiceProvider
{
@ -18,7 +18,11 @@ class CartServiceProvider extends ServiceProvider
{
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
$this->register(EventServiceProvider::class);
$router->aliasMiddleware('admin', RedirectIfNotAdmin::class);
$router->aliasMiddleware('customer', RedirectIfNotCustomer::class);
$this->app->register(ComposerServiceProvider::class);
}
/**
@ -38,6 +42,9 @@ class CartServiceProvider extends ServiceProvider
*/
protected function registerFacades()
{
//to make the cart facade and bind the
//alias to the class needed to be called.
$loader = AliasLoader::getInstance();
$loader->alias('cart', CartFacade::class);

View File

@ -0,0 +1,32 @@
<?php
namespace Webkul\Cart\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use View;
class ComposerServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
//using the class based composers...
View::composer(['shop::layouts.header.index'], 'Webkul\Cart\Http\ViewComposers\CartComposer');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@ -16,7 +16,7 @@ class CartRepository extends Repository
/**
* Specify Model class name
*
* @return mixed
* @return Mixed
*/
function model()
@ -26,7 +26,7 @@ class CartRepository extends Repository
/**
* @param array $data
* @return mixed
* @return Mixed
*/
public function create(array $data)
@ -40,7 +40,7 @@ class CartRepository extends Repository
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
* @return Mixed
*/
public function update(array $data, $id, $attribute = "id")
@ -61,29 +61,43 @@ class CartRepository extends Repository
* Method to attach
* associations
*
* @return mixed
* @return Mixed
*/
// public function onlyAttach($id, $taxRates) {
public function attach($cart_id, $product_id, $quantity) {
// foreach($taxRates as $key => $value) {
return $this->model->findOrFail($cart_id)->with_products()->attach($cart_id, ['product_id' => $product_id, 'cart_id' => $cart_id, 'quantity' => $quantity]);
// $this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]);
// }
// }
}
/**
* This will update the
* quantity of product
* for the customer,
* in case of merge.
*
* @return Mixed
*/
public function updateRelatedForMerge($pivot, $column, $value) {
$cart_product = $this->model->findOrFail($pivot['cart_id']);
return $cart_product->with_products()->updateExistingPivot($pivot['product_id'], array($column => $value));
}
/**
* Method to detach
* and attach the
* associations
* associations.
*
* @return mixed
*/
// public function syncAndDetach($id, $taxRates) {
// $this->model->findOrFail($id)->tax_rates()->detach();
* Use this only with
* guest cart only.
*
* @return Mixed
*/
public function detachAndDeleteParent($cart_id) {
$cart = $this->model->find($cart_id);
// foreach($taxRates as $key => $value) {
// $this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]);
// }
// }
//apply strict check for verifying guest ownership on this record.
$cart->with_products()->detach();
return $this->model->destroy($cart_id);
}
}

View File

@ -71,6 +71,9 @@ class SessionController extends Controller
public function destroy($id)
{
auth()->guard('customer')->logout();
Event::fire('customer.after.logout', 1);
return redirect()->route($this->_config['redirect']);
}
}

View File

@ -27,7 +27,11 @@ class CustomerEventsHandler {
* check emptiness and then
* do the appropriate actions.
*/
Cart::handleMerge();
Cart::mergeCart();
}
//use this when there is very uttermost need to use it.
public function onCustomerLogout($event) {
}
/**
@ -39,5 +43,7 @@ class CustomerEventsHandler {
public function subscribe($events)
{
$events->listen('customer.after.login', 'Webkul\Customer\Http\Listeners\CustomerEventsHandler@onCustomerLogin');
$events->listen('customer.after.logout', 'Webkul\Customer\Http\Listeners\CustomerEventsHandler@onCustomerLogout');
}
}

View File

@ -23,19 +23,12 @@ Route::group(['middleware' => ['web']], function () {
// //Routes for product cart
Route::post('products/guest/cart/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.add');
Route::post('products/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.add');
Route::post('product/guest/cart/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.remove');
// Route::post('product/customer/cart/add/{id}', 'Webkul\Cart\Http\Controllers\CartController@add')->name('cart.customer.add');
// Route::post('product/customer/cart/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.customer.remove');
Route::get('product/customer/cart/merge', 'Webkul\Cart\Http\Controllers\CartController@handleMerge')->name('cart.merge');
Route::post('product/remove/{id}', 'Webkul\Cart\Http\Controllers\CartController@remove')->name('cart.remove');
//Routes for product cart ends
// Product Review routes
Route::get('/reviews/{slug}', 'Webkul\Shop\Http\Controllers\ReviewController@show')->defaults('_config', [
'view' => 'shop::products.reviews.index'
@ -53,13 +46,6 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin.reviews.index'
])->name('admin.reviews.store');
// Route::post('/reviews/create/{slug}', 'Webkul\Core\Http\Controllers\ReviewController@store')->defaults('_config', [
// 'redirect' => 'admin.reviews.index'
// ])->name('admin.reviews.store');
// Route::view('/products/{slug}', 'shop::store.product.details.index');
Route::view('/cart', 'shop::store.product.view.cart.index');
//customer routes starts here
Route::prefix('customer')->group(function () {
@ -90,12 +76,6 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'customer.session.index'
])->name('customer.session.destroy');
Route::view('/cart', 'shop::store.product.cart.cart.index')->name('customer.cart');
Route::view('/product', 'shop::store.product.details.home.index')->name('customer.product');
Route::view('/product/review', 'shop::store.product.review.index')->name('customer.product.review');
//customer account
Route::prefix('account')->group(function () {

View File

@ -10,6 +10,7 @@ Vue.component("category-nav", require("./components/category-nav.vue"));
Vue.component("category-item", require("./components/category-item.vue"));
Vue.component("image-slider", require("./components/image-slider.vue"));
Vue.component("vue-slider", require("vue-slider-component"));
Vue.component("cart-dropdown", require("./components/cart-dropdown.vue"));
$(document).ready(function () {
@ -52,6 +53,7 @@ $(document).ready(function () {
const flashes = this.$refs.flashes;
flashMessages.forEach(function (flash) {
console.log(flash);
flashes.addFlash(flash);
}, this);
},

View File

@ -0,0 +1,156 @@
<template>
<div>
<ul class="cart-dropdown" @click="dropOrHide">
<li class="cart-summary">
<span class="icon cart-icon"></span>
<span class="cart"><span class="cart-count" v-if="totalitems > 0">{{ totalitems }}</span>Products</span>
<span class="icon arrow-down-icon"></span>
</li>
</ul>
<div class="dropdown-cart" :class="{ show: toggle }">
<div class="dropdown-header">
<p class="heading">Cart Subtotal - $80</p>
<i class="icon icon-menu-close" @click="dropOrHide"></i>
</div>
<div class="dropdown-content">
<div class="item">
<div class="item-image">
<img />
</div>
<div class="item-details">
<div class="item-name">Some Item Name</div>
<div class="item-price">$ Some Price</div>
<div class="item-qty">Some Quantity</div>
</div>
</div>
</div>
<div class="dropdown-footer">
<a href="/">View Shopping Cart</a>
<button class="btn btn-primary btn-lg">CHECKOUT</button>
</div>
</div>
</div>
</template>
<script>
// define the item component
export default {
props: {
items: Array,
},
data(){
return {
toggle: true,
totalitems: 0,
cart_items: []
};
},
computed: {
makeDropdown() {
}
},
mounted: function() {
if(this.items != undefined)
this.initializeDropdown();
},
methods: {
dropOrHide: function() {
if(this.toggle == false) {
this.toggle = true;
} else {
this.toggle = false;
}
},
initializeDropdown: function() {
this.totalitems = this.items.length;
}
}
}
</script>
<style>
.show {
display: none;
}
.dropdown-cart {
position: absolute;
background: #FFFFFF;
border: 1px solid #E8E8E8;
box-shadow: 1px 3px 6px 0 rgba(0,0,0,0.40);
padding: 20px;
border-radius: 1px;
right: 10%;
top: 75px;
width: 387px;
z-index: 5;
}
.dropdown-cart > .dropdown-header {
width: 100%;
}
.dropdown-cart > .dropdown-header p{
display: inline;
line-height: 25px;
}
.dropdown-cart > .dropdown-header i{
cursor: pointer;
float: right;
height: 22px;
width: 22px;
}
.dropdown-content {
padding-top: 10px;
padding-bottom: 10px;
}
.dropdown-content .item{
display: flex;
flex-direction: row;
border-bottom: 1px solid #E8E8E8;
}
.dropdown-content .item img{
height: 75px;
width: 75px;
margin-right: 8px;
}
.item-details .item-name {
font-size: 16px;
font-weight: bold;
margin-bottom: 10px;
}
.item-details .item-price {
margin-bottom: 10px;
}
.item-details .item-qty {
margin-bottom: 10px;
}
.dropdown-footer {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.dropdown-footer button {
border-radius: 0px;
}
</style>

View File

@ -8,6 +8,8 @@ body {
margin: 0;
padding: 0;
font-weight: 500;
max-width: 100%;
width: auto;
color: $font-color;
font-size: $font-size-base;
}
@ -19,12 +21,13 @@ body {
.header {
margin-top: 16px;
margin-bottom: 21px;
user-select: none;
.header-top {
margin-bottom: 16px;
display: flex;
max-width: 80%;
width: 100%;
max-width: 100%;
width: auto;
margin-left: auto;
margin-right: auto;
align-items: center;
@ -187,7 +190,8 @@ body {
display: block;
font-size:16px;
height: 48px;
width: 80%;
max-width: 100%;
width: auto;
margin-left: auto;
margin-right: auto;
}
@ -290,7 +294,6 @@ body {
.nav li li:hover > a:first-child:nth-last-child(2):before {
right: 10px;
}
}
}
@ -307,7 +310,7 @@ body {
.header-top {
margin-bottom: 16px;
display: flex;
max-width: 92%;
// max-width: 92%;
width: 100%;
margin-left: auto;
margin-right: auto;
@ -479,7 +482,7 @@ body {
.header-top {
margin-bottom: 16px;
display: flex;
max-width: 92%;
// max-width: 92%;
width: 100%;
margin-left: auto;
margin-right: auto;
@ -610,10 +613,11 @@ body {
section.slider-block {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 5%;
div.slider-content {
width: 80%;
height: 500px;
margin-left: auto;
margin-right: auto;
@ -763,54 +767,42 @@ section.slider-block {
.main-container-wrapper {
margin-left: 10%;
margin-right: 10%;
max-width: 80%;
width: auto;
margin-left: auto;
margin-right: auto;
.content-container {
display: inline-block;
width: 100%;
}
.main {
display: inline-block;
width: 75%
}
.product-grid {
display: grid;
grid-gap: 30px;
&.max-2-col {
grid-template-columns: repeat(2, minmax(250px, 1fr));
grid-template-columns: repeat(2, minmax(auto, 1fr));
}
&.max-3-col {
grid-template-columns: repeat(3, minmax(250px, 1fr));
grid-template-columns: repeat(3, minmax(auto, 1fr));
}
&.max-4-col {
grid-template-columns: repeat(4, minmax(250px, 1fr));
}
.product-card {
display: flex;
flex-flow: column;
justify-content: center;
grid-template-columns: repeat(4, minmax(auto, 1fr));
}
}
.product-card {
.product-image {
background: #F2F2F2;
margin-bottom: 10px;
// width: 380px;
// max-width: 100%;
// text-align: center;
img {
align-self: center;
width: 100%;
max-width: 100%;
width: auto;
margin-bottom: 14px;
}
}
@ -1015,6 +1007,27 @@ section.slider-block {
}
}
//responsive for main-container-wrapper
@media all and (max-width: 480px) {
.main-container-wrapper {
width: 100% !important;
margin-left: auto;
margin-right: auto;
}
}
@media all and (min-width: 481px) and (max-width: 920px) {
.main-container-wrapper {
width: 90%;
margin-left: auto;
margin-right: auto;
}
}
.product-price {
font-size: 16px;
margin-bottom: 14px;
@ -1321,347 +1334,343 @@ section.product-detail {
}
div.layouter {
display: block;
margin-top: 20px;
margin-bottom: 20px;
display: inline-block;
width: 100%;
.mixed-group {
form {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
.single-image {
padding: 2px;
div.product-image-group {
margin-right: 36px;
img {
height: 280px;
width: 280px;
div {
display: flex;
flex-direction: row;
.thumb-list {
display: flex;
flex-direction: column;
margin-right: 4px;
height: 480px;
width: 120px;
overflow: hidden;
position: relative;
justify-content: flex-start;
.thumb-frame {
border: 2px solid transparent;
background: #F2F2F2;
max-width: 120px;
width: auto;
height: 120px;
&.active {
border-color: #979797;
}
img {
width: 100%;
height: 100%;
}
}
.gallery-control {
width: 100%;
position: absolute;
text-align: center;
cursor: pointer;
z-index: 1;
.overlay {
opacity: 0.3;
background: #000000;
width: 100%;
height: 18px;
position: absolute;
left: 0;
z-index: -1;
}
.icon {
z-index: 2;
}
&.top {
top: 0;
}
&.bottom {
bottom: 0;
}
}
}
.product-hero-image {
display: block;
position: relative;
background: #F2F2F2;
width: 480px;
max-height: 480px;
.wishlist {
position: absolute;
top: 10px;
right: 12px;
}
.share {
position: absolute;
top: 10px;
right: 45px;
}
}
}
.cart-fav-seg {
display: block;
float: right;
.wishlist {
position: absolute;
margin-top: -500px;
margin-right: -100px;
}
}
}
.details {
.product-name {
margin-top: 20px;
font-size: 24px;
margin-bottom: 20px;
}
width: 50%;
.product-price {
margin-bottom: 14px;
}
}
}
.rating-reviews {
margin-top: 0px;
width: 50%;
margin-left: 20px;
.title-inline {
display: inline-flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
width: 100%;
button {
float: right;
border-radius: 0px !important;
}
}
.overall {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
height: 150px;
.left-side {
.product-ratings {
margin-bottom: 20px;
.number{
font-size: 34px;
}
}
.right-side {
display: block;
.rater {
display: inline-flex;
align-items: center;
.star {
width: 50px;
height: 20px;
padding: 1px;
margin-right: 8px;
}
.line-bar {
height: 4px;
width: 158px;
margin-right: 12px;
background: $bar-color;
.line-value {
background-color: $dark-blue-shade;
}
}
}
}
}
.reviews {
margin-top: 34px;
margin-bottom: 90px;
.review {
margin-bottom: 25px;
.title {
margin-bottom: 5px;
}
.stars {
margin-bottom: 15px;
}
.message {
margin-bottom: 10px;
}
}
.view-all {
margin-top:15px;
color: $logo-color;
margin-bottom:15px;
}
}
}
div.product-image-group {
width: 43%;
float: left;
min-height: 1px;
position: relative;
.thumb-list {
display: flex;
flex-direction: column;
margin-right: 4px;
height: 480px;
overflow: hidden;
position: relative;
float: left;
.thumb-frame {
border: 2px solid transparent;
background: #F2F2F2;
width: 120px;
height: 120px;
&.active {
border-color: #979797;
}
img {
width: 100%;
height: 100%;
}
}
.gallery-control {
width: 100%;
position: absolute;
text-align: center;
cursor: pointer;
z-index: 1;
.overlay {
opacity: 0.3;
background: #000000;
width: 100%;
height: 18px;
position: absolute;
left: 0;
z-index: -1;
}
.icon {
z-index: 2;
width: 16px;
height: 16px;
}
&.top {
top: 0;
}
&.bottom {
bottom: 0;
.total-reviews {
display: inline-block;
margin-left: 15px;
}
}
}
.product-hero-image {
display: block;
position: relative;
background: #F2F2F2;
width: 480px;
max-height: 480px;
float: left;
.wishlist {
position: absolute;
top: 10px;
right: 12px;
}
.share {
position: absolute;
top: 10px;
right: 45px;
}
}
}
.details {
width: 57%;
float: left;
.product-price {
margin-bottom: 14px;
}
.product-ratings {
margin-bottom: 20px;
.icon {
width: 16px;
height: 16px;
}
.total-reviews {
display: inline-block;
margin-left: 15px;
}
}
.product-heading {
font-size: 24px;
color: $product-font-color;
margin-bottom: 15px;
}
.product-price {
margin-bottom: 15px;
font-size: 24px;
.special-price {
.product-heading {
font-size: 24px;
color: $product-font-color;
margin-bottom: 15px;
}
}
.stock-status {
margin-bottom: 15px;
}
.product-price {
margin-bottom: 15px;
font-size: 24px;
.description {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: solid 1px rgba(162, 162, 162, 0.2)
}
.full-specifications {
td {
padding: 10px 0;
color: #5E5E5E;
&:first-child {
padding-right: 40px;
.special-price {
font-size: 24px;
}
}
.stock-status {
margin-bottom: 15px;
}
.description {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: solid 1px rgba(162, 162, 162, 0.2)
}
.full-specifications {
td {
padding: 10px 0;
color: #5E5E5E;
&:first-child {
padding-right: 40px;
}
}
}
.accordian .accordian-header {
font-size: 16px;
padding-left: 0;
font-weight: 600;
}
.attributes {
display: block;
width: 100%;
border-bottom: solid 1px rgba(162, 162, 162, 0.2);
}
.full-description {
font-size: 16px;
}
}
.accordian .accordian-header {
font-size: 16px;
padding-left: 0;
font-weight: 600;
}
// .rating-reviews {
// margin-top: 0px;
// width: 50%;
// margin-left: 20px;
// .title-inline {
// display: inline-flex;
// align-items: center;
// justify-content: space-between;
// margin-bottom: 20px;
// width: 100%;
// button {
// float: right;
// border-radius: 0px !important;
// }
// }
// .overall {
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: space-between;
// height: 150px;
// .left-side {
// margin-bottom: 20px;
// .number{
// font-size: 34px;
// }
// }
// .right-side {
// display: block;
// .rater {
// display: inline-flex;
// align-items: center;
// .star {
// width: 50px;
// height: 20px;
// padding: 1px;
// margin-right: 8px;
// }
// .line-bar {
// height: 4px;
// width: 158px;
// margin-right: 12px;
// background: $bar-color;
// .line-value {
// background-color: $dark-blue-shade;
// }
// }
// }
// }
// }
// .reviews {
// margin-top: 34px;
// margin-bottom: 90px;
// .review {
// margin-bottom: 25px;
// .title {
// margin-bottom: 5px;
// }
// .stars {
// margin-bottom: 15px;
// }
// .message {
// margin-bottom: 10px;
// }
// }
// .view-all {
// margin-top:15px;
// color: $logo-color;
// margin-bottom:15px;
// }
// }
// }
.attributes {
display: block;
width: 100%;
border-bottom: solid 1px rgba(162, 162, 162, 0.2);
}
.full-description {
font-size: 16px;
}
}
}
}
.rating-reviews {
// .rating-reviews {
.rating-header {
font-weight: 600;
padding: 20px 0;
}
// .rating-header {
// font-weight: 600;
// padding: 20px 0;
// }
.stars {
.icon {
width: 16px;
height: 16px;
}
}
// .stars {
// .icon {
// width: 16px;
// height: 16px;
// }
// }
.overall {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
// .overall {
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: space-between;
.review-info {
.number {
font-size: 34px;
}
// .review-info {
// .number {
// font-size: 34px;
// }
.total-reviews {
margin-top: 10px;
}
}
}
// .total-reviews {
// margin-top: 10px;
// }
// }
// }
.reviews {
margin-top: 40px;
margin-bottom: 40px;
// .reviews {
// margin-top: 40px;
// margin-bottom: 40px;
.review {
margin-bottom: 25px;
// .review {
// margin-bottom: 25px;
.title {
margin-bottom: 5px;
}
// .title {
// margin-bottom: 5px;
// }
.stars {
margin-bottom: 15px;
display: inline-block;
}
// .stars {
// margin-bottom: 15px;
// display: inline-block;
// }
.message {
margin-bottom: 10px;
}
// .message {
// margin-bottom: 10px;
// }
.reviewer-details {
color: #5E5E5E;
}
}
// .reviewer-details {
// color: #5E5E5E;
// }
// }
.view-all {
margin-top:15px;
color: $logo-color;
margin-bottom:15px;
}
}
}
// .view-all {
// margin-top:15px;
// color: $logo-color;
// margin-bottom:15px;
// }
// }
// }
/* cart pages and elements css begins here */
section.cart {

View File

@ -3,7 +3,7 @@
background-size: cover;
}
.dropdown-right-icon{
.dropdown-right-icon {
background-image:URL('../images/icon-dropdown-left.svg');
width: 8px;
height: 8px;
@ -11,6 +11,14 @@
margin-bottom: 2px;
}
.icon-menu-close {
background-image:URL('../images/icon-menu-close.svg');
width: 8px;
height: 8px;
margin-left:auto;
margin-bottom: 2px;
}
.grid-view-icon {
background-image:URL('../images/icon-grid-view.svg');
width: 24px;

View File

@ -1,7 +1,5 @@
<div class="header" id="header">
<div class="header-top">
<div class="left-content">
<ul class="logo-container">
@ -57,6 +55,7 @@
<ul>
<li><a href="{{ route('customer.session.index') }}">Sign In</a></li>
<li><a href="{{ route('customer.register.index') }}">Sign Up</a></li>
</ul>
@ -66,18 +65,20 @@
@endguest
@auth('customer')
<div class="dropdown-list bottom-right" style="display: none;">
<div class="dropdown-container">
<label>Account</label>
<ul>
<li><a href="{{ route('customer.account.index') }}">Account</a></li>
<li><a href="{{ route('customer.profile.index') }}">Profile</a></li>
<li><a href="{{ route('customer.address.index') }}">Address</a></li>
<li><a href="{{ route('customer.wishlist.index') }}">Wishlist</a></li>
<li><a href="{{ route('customer.cart') }}">Cart</a></li>
{{-- <li><a href="{{ route('customer.cart') }}">Cart</a></li> --}}
<li><a href="{{ route('customer.orders.index') }}">Orders</a></li>
<li><a href="{{ route('customer.session.destroy') }}">Logout</a></li>
</ul>
@ -90,21 +91,7 @@
</ul>
<ul class="cart-dropdown">
<li class="cart-summary">
<span class="icon cart-icon"></span>
<span class="cart"><span class="cart-count">5</span>Products</span>
<span class="icon arrow-down-icon"></span>
</li>
</ul>
<cart-dropdown @if(isset($cart)) :items='@json($cart)' @endif></cart-dropdown>
{{-- Meant for responsive views only --}}
<ul class="ham-dropdown-container">
@ -138,13 +125,13 @@
</div>
<div class="suggestion">
<span> designer sarees </span>
<span>Designer sarees</span>
</div>
<div class="suggestion">
<span> India patter sarees </span>
<span>India patter sarees</span>
</div>
<div class="suggestion">
<span> Border Sarees </span>
<span>Border Sarees</span>
</div>
</div>
@ -155,93 +142,7 @@
</div>
@push('scripts')
<script>
window.onload = function() {
var sort = document.getElementById("sortable");
var search = document.getElementById("search");
sort.addEventListener("click", myFunction);
search.addEventListener("click", myFunction);
// function for changing icon for responsive header
function myFunction(){
let className = document.getElementById(this.id).className;
let slider = document.getElementsByClassName("slider-block");
let feature = document.getElementsByClassName("featured-products");
let newUpdate = document.getElementsByClassName("news-update");
for (let i=0 ; i < slider.length ; i++){
slider[i].style.display="none";
}
for (let i=0 ; i < feature.length ; i++){
feature[i].style.display="none";
}
for (let i=0 ; i < newUpdate.length ; i++){
newUpdate[i].style.display="none";
}
if( className == 'icon search-icon') {
search.classList.remove('icon', 'search-icon');
search.classList.add('icon', 'cross-icon');
sort.classList.remove('icon', 'cross-icon');
sort.classList.remove('icon', 'sortable-icon');
sort.classList.add('icon', 'sortable-icon');
document.getElementsByClassName("header-bottom")[0].style.display="none";
document.getElementsByClassName("search-suggestion")[0].style.display="block";
}else if ( className == 'icon sortable-icon'){
sort.classList.remove('icon', 'sortable-icon');
sort.classList.add('icon', 'cross-icon');
search.classList.remove('icon', 'cross-icon');
search.classList.remove('icon', 'search-icon');
search.classList.add('icon', 'search-icon');
document.getElementsByClassName("header-bottom")[0].style.display="block";
document.getElementsByClassName("search-suggestion")[0].style.display="none";
} else {
sort.classList.remove('icon', 'cross-icon');
search.classList.remove('icon', 'cross-icon');
sort.classList.remove('icon', 'sortable-icon');
search.classList.remove('icon', 'search-icon');
sort.classList.add('icon', 'sortable-icon');
search.classList.add('icon', 'search-icon');
document.getElementsByClassName("header-bottom")[0].style.display="none";
document.getElementsByClassName("search-suggestion")[0].style.display="none";
let slider = document.getElementsByClassName("slider-block");
let feature = document.getElementsByClassName("featured-products");
let newUpdate = document.getElementsByClassName("news-update");
for (let i=0 ; i < slider.length ; i++){this.id
slider[i].style.display="block";
}
for (let i=0 ; i < feature.length ; i++){
feature[i].style.display="block";
}
for (let i=0 ; i < newUpdate.length ; i++){
newUpdate[i].style.display="block";
}
}
}
}
</script>
@endpush

View File

@ -1,7 +1,7 @@
<div class="cart-fav-seg">
@include ('shop::products.add-to-cart', ['product' => $product])
<span><img src="{{ bagisto_asset('images/wishlist.svg') }}" /></span>
<span class="wishlist"><img src="{{ bagisto_asset('images/wishlist.svg') }}" /></span>
</div>

View File

@ -13,7 +13,6 @@
</div>
<div class="layouter">
{{-- {{ dd(session()->getId()) }} --}}
<form method="POST" action="{{ route('cart.add', $product->id) }}">
@csrf()

View File

@ -5,9 +5,7 @@
<div class="product-image-group">
<product-gallery></product-gallery>
@include ('shop::products.add-to')
</div>
@push('scripts')

View File

@ -5,7 +5,7 @@
class='alert-wrapper'
>
<flash
v-for='(flash, index) in flashes'
v-for='(flash) in flashes'
:key='flash.uid'
:flash="flash"
@onRemoveFlash="removeFlash($event)"

View File

@ -105,13 +105,13 @@
<th class="grid_head" data-column-name="{{ $column->alias }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
@endif
@endforeach
@if(isset($attribute_columns))
{{-- @if(isset($attribute_columns))
@foreach($attribute_columns as $key => $value)
<th>
{{ $value }}
</th>
@endforeach
@endif
@endif --}}
<th>
Actions
</th>
@ -131,11 +131,11 @@
<td class="">{!! $column->render($result) !!}</td>
@endforeach
@if(isset($attribute_columns))
{{-- @if(isset($attribute_columns))
@foreach ($attribute_columns as $atc)
<td>{{ $result->{$atc} }}</td>
@endforeach
@endif
@endif --}}
<td class="action">
@foreach($actions as $action)

View File

@ -14,7 +14,7 @@ mix.js(
],
"js/ui.js"
)
// .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images")
.copy(__dirname + "/src/Resources/assets/images", publicPath + "/images")
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/ui.css")
.options({
processCssUrls: false

View File

@ -11,6 +11,14 @@
margin-bottom: 2px;
}
.icon-menu-close {
background-image: URL("../images/icon-menu-close.svg");
width: 8px;
height: 8px;
margin-left: auto;
margin-bottom: 2px;
}
.grid-view-icon {
background-image: URL("../images/icon-grid-view.svg");
width: 24px;
@ -27,6 +35,8 @@ body {
margin: 0;
padding: 0;
font-weight: 500;
max-width: 100%;
width: auto;
color: #242424;
font-size: 16px;
}
@ -38,6 +48,10 @@ body {
.header {
margin-top: 16px;
margin-bottom: 21px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.header .header-top {
@ -45,8 +59,8 @@ body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
max-width: 80%;
width: 100%;
max-width: 100%;
width: auto;
margin-left: auto;
margin-right: auto;
-webkit-box-align: center;
@ -260,7 +274,8 @@ body {
display: block;
font-size: 16px;
height: 48px;
width: 80%;
max-width: 100%;
width: auto;
margin-left: auto;
margin-right: auto;
}
@ -377,7 +392,6 @@ body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
max-width: 92%;
width: 100%;
margin-left: auto;
margin-right: auto;
@ -530,7 +544,6 @@ body {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
max-width: 92%;
width: 100%;
margin-left: auto;
margin-right: auto;
@ -645,11 +658,12 @@ body {
section.slider-block {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 5%;
}
section.slider-block div.slider-content {
width: 80%;
height: 500px;
margin-left: auto;
margin-right: auto;
@ -806,8 +820,10 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
}
.main-container-wrapper {
margin-left: 10%;
margin-right: 10%;
max-width: 80%;
width: auto;
margin-left: auto;
margin-right: auto;
}
.main-container-wrapper .content-container {
@ -815,50 +831,32 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
width: 100%;
}
.main-container-wrapper .main {
display: inline-block;
width: 75%;
}
.main-container-wrapper .product-grid {
display: grid;
grid-gap: 30px;
}
.main-container-wrapper .product-grid.max-2-col {
grid-template-columns: repeat(2, minmax(250px, 1fr));
grid-template-columns: repeat(2, minmax(auto, 1fr));
}
.main-container-wrapper .product-grid.max-3-col {
grid-template-columns: repeat(3, minmax(250px, 1fr));
grid-template-columns: repeat(3, minmax(auto, 1fr));
}
.main-container-wrapper .product-grid.max-4-col {
grid-template-columns: repeat(4, minmax(250px, 1fr));
}
.main-container-wrapper .product-grid .product-card {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-flow: column;
flex-flow: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
grid-template-columns: repeat(4, minmax(auto, 1fr));
}
.main-container-wrapper .product-card .product-image {
background: #F2F2F2;
margin-bottom: 10px;
}
.main-container-wrapper .product-card .product-image img {
-ms-flex-item-align: center;
align-self: center;
width: 100%;
max-width: 100%;
width: auto;
margin-bottom: 14px;
}
@ -1069,6 +1067,22 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
width: 100%;
}
@media all and (max-width: 480px) {
.main-container-wrapper {
width: 100% !important;
margin-left: auto;
margin-right: auto;
}
}
@media all and (min-width: 481px) and (max-width: 920px) {
.main-container-wrapper {
width: 90%;
margin-left: auto;
margin-right: auto;
}
}
.product-price {
font-size: 16px;
margin-bottom: 14px;
@ -1390,57 +1404,12 @@ section.product-detail div.category-breadcrumbs {
}
section.product-detail div.layouter {
display: block;
margin-top: 20px;
margin-bottom: 20px;
display: inline-block;
width: 100%;
}
section.product-detail div.layouter .mixed-group .single-image {
padding: 2px;
}
section.product-detail div.layouter .mixed-group .single-image img {
height: 280px;
width: 280px;
}
section.product-detail div.layouter .mixed-group .details .product-name {
margin-top: 20px;
font-size: 24px;
margin-bottom: 20px;
}
section.product-detail div.layouter .mixed-group .details .product-price {
margin-bottom: 14px;
}
section.product-detail div.layouter .rating-reviews {
margin-top: 0px;
width: 50%;
margin-left: 20px;
}
section.product-detail div.layouter .rating-reviews .title-inline {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
margin-bottom: 20px;
width: 100%;
}
section.product-detail div.layouter .rating-reviews .title-inline button {
float: right;
border-radius: 0px !important;
}
section.product-detail div.layouter .rating-reviews .overall {
section.product-detail div.layouter form {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
@ -1448,89 +1417,27 @@ section.product-detail div.layouter .rating-reviews .overall {
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
height: 150px;
width: 100%;
}
section.product-detail div.layouter .rating-reviews .overall .left-side {
margin-bottom: 20px;
section.product-detail div.layouter form div.product-image-group {
margin-right: 36px;
}
section.product-detail div.layouter .rating-reviews .overall .left-side .number {
font-size: 34px;
section.product-detail div.layouter form div.product-image-group div {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
}
section.product-detail div.layouter .rating-reviews .overall .right-side {
display: block;
}
section.product-detail div.layouter .rating-reviews .overall .right-side .rater {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
section.product-detail div.layouter .rating-reviews .overall .right-side .rater .star {
width: 50px;
height: 20px;
padding: 1px;
margin-right: 8px;
}
section.product-detail div.layouter .rating-reviews .overall .right-side .rater .line-bar {
height: 4px;
width: 158px;
margin-right: 12px;
background: #D8D8D8;
}
section.product-detail div.layouter .rating-reviews .overall .right-side .rater .line-bar .line-value {
background-color: #0031F0;
}
section.product-detail div.layouter .rating-reviews .reviews {
margin-top: 34px;
margin-bottom: 90px;
}
section.product-detail div.layouter .rating-reviews .reviews .review {
margin-bottom: 25px;
}
section.product-detail div.layouter .rating-reviews .reviews .review .title {
margin-bottom: 5px;
}
section.product-detail div.layouter .rating-reviews .reviews .review .stars {
margin-bottom: 15px;
}
section.product-detail div.layouter .rating-reviews .reviews .review .message {
margin-bottom: 10px;
}
section.product-detail div.layouter .rating-reviews .reviews .view-all {
margin-top: 15px;
color: #0031f0;
margin-bottom: 15px;
}
section.product-detail div.layouter div.product-image-group {
width: 43%;
float: left;
min-height: 1px;
position: relative;
}
section.product-detail div.layouter div.product-image-group .thumb-list {
section.product-detail div.layouter form div.product-image-group div .thumb-list {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
@ -1540,28 +1447,32 @@ section.product-detail div.layouter div.product-image-group .thumb-list {
flex-direction: column;
margin-right: 4px;
height: 480px;
width: 120px;
overflow: hidden;
position: relative;
float: left;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
}
section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame {
section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame {
border: 2px solid transparent;
background: #F2F2F2;
width: 120px;
max-width: 120px;
width: auto;
height: 120px;
}
section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame.active {
section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame.active {
border-color: #979797;
}
section.product-detail div.layouter div.product-image-group .thumb-list .thumb-frame img {
section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame img {
width: 100%;
height: 100%;
}
section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control {
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control {
width: 100%;
position: absolute;
text-align: center;
@ -1569,7 +1480,7 @@ section.product-detail div.layouter div.product-image-group .thumb-list .gallery
z-index: 1;
}
section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control .overlay {
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control .overlay {
opacity: 0.3;
background: #000000;
width: 100%;
@ -1579,178 +1490,121 @@ section.product-detail div.layouter div.product-image-group .thumb-list .gallery
z-index: -1;
}
section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control .icon {
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control .icon {
z-index: 2;
}
section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control.top {
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control.top {
top: 0;
}
section.product-detail div.layouter div.product-image-group .thumb-list .gallery-control.bottom {
section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control.bottom {
bottom: 0;
}
section.product-detail div.layouter div.product-image-group .product-hero-image {
section.product-detail div.layouter form div.product-image-group div .product-hero-image {
display: block;
position: relative;
background: #F2F2F2;
width: 480px;
max-height: 480px;
float: left;
}
section.product-detail div.layouter div.product-image-group .product-hero-image .wishlist {
section.product-detail div.layouter form div.product-image-group div .product-hero-image .wishlist {
position: absolute;
top: 10px;
right: 12px;
}
section.product-detail div.layouter div.product-image-group .product-hero-image .share {
section.product-detail div.layouter form div.product-image-group div .product-hero-image .share {
position: absolute;
top: 10px;
right: 45px;
}
section.product-detail div.layouter .details {
width: 57%;
float: left;
section.product-detail div.layouter form div.product-image-group .cart-fav-seg {
display: block;
float: right;
}
section.product-detail div.layouter .details .product-price {
section.product-detail div.layouter form div.product-image-group .cart-fav-seg .wishlist {
position: absolute;
margin-top: -500px;
margin-right: -100px;
}
section.product-detail div.layouter form .details {
width: 50%;
}
section.product-detail div.layouter form .details .product-price {
margin-bottom: 14px;
}
section.product-detail div.layouter .details .product-ratings {
section.product-detail div.layouter form .details .product-ratings {
margin-bottom: 20px;
}
section.product-detail div.layouter .details .product-ratings .icon {
section.product-detail div.layouter form .details .product-ratings .icon {
width: 16px;
height: 16px;
}
section.product-detail div.layouter .details .product-ratings .total-reviews {
section.product-detail div.layouter form .details .product-ratings .total-reviews {
display: inline-block;
margin-left: 15px;
}
section.product-detail div.layouter .details .product-heading {
section.product-detail div.layouter form .details .product-heading {
font-size: 24px;
color: #242424;
margin-bottom: 15px;
}
section.product-detail div.layouter .details .product-price {
section.product-detail div.layouter form .details .product-price {
margin-bottom: 15px;
font-size: 24px;
}
section.product-detail div.layouter .details .product-price .special-price {
section.product-detail div.layouter form .details .product-price .special-price {
font-size: 24px;
}
section.product-detail div.layouter .details .stock-status {
section.product-detail div.layouter form .details .stock-status {
margin-bottom: 15px;
}
section.product-detail div.layouter .details .description {
section.product-detail div.layouter form .details .description {
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: solid 1px rgba(162, 162, 162, 0.2);
}
section.product-detail div.layouter .details .full-specifications td {
section.product-detail div.layouter form .details .full-specifications td {
padding: 10px 0;
color: #5E5E5E;
}
section.product-detail div.layouter .details .full-specifications td:first-child {
section.product-detail div.layouter form .details .full-specifications td:first-child {
padding-right: 40px;
}
section.product-detail div.layouter .details .accordian .accordian-header {
section.product-detail div.layouter form .details .accordian .accordian-header {
font-size: 16px;
padding-left: 0;
font-weight: 600;
}
section.product-detail div.layouter .details .attributes {
section.product-detail div.layouter form .details .attributes {
display: block;
width: 100%;
border-bottom: solid 1px rgba(162, 162, 162, 0.2);
}
section.product-detail div.layouter .details .full-description {
section.product-detail div.layouter form .details .full-description {
font-size: 16px;
}
.rating-reviews .rating-header {
font-weight: 600;
padding: 20px 0;
}
.rating-reviews .stars .icon {
width: 16px;
height: 16px;
}
.rating-reviews .overall {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
}
.rating-reviews .overall .review-info .number {
font-size: 34px;
}
.rating-reviews .overall .review-info .total-reviews {
margin-top: 10px;
}
.rating-reviews .reviews {
margin-top: 40px;
margin-bottom: 40px;
}
.rating-reviews .reviews .review {
margin-bottom: 25px;
}
.rating-reviews .reviews .review .title {
margin-bottom: 5px;
}
.rating-reviews .reviews .review .stars {
margin-bottom: 15px;
display: inline-block;
}
.rating-reviews .reviews .review .message {
margin-bottom: 10px;
}
.rating-reviews .reviews .review .reviewer-details {
color: #5E5E5E;
}
.rating-reviews .reviews .view-all {
margin-top: 15px;
color: #0031f0;
margin-bottom: 15px;
}
/* cart pages and elements css begins here */
section.cart {
color: #242424;

File diff suppressed because one or more lines are too long

View File

@ -73,7 +73,7 @@
@else
<a href="{{ route('login') }}">Login</a>
<a href="{{ route('register') }}">Register</a>
@endauth
@endauthexample-component
</div>
@endif