diff --git a/config/carriers.php b/config/carriers.php index ca9253b71..030b22f1c 100644 --- a/config/carriers.php +++ b/config/carriers.php @@ -9,6 +9,14 @@ return [ 'default_rate' => '10', 'type' => 'per_unit', 'class' => 'Webkul\Shipping\Carriers\FlatRate', + ], + + 'free' => [ + 'code' => 'free', + 'title' => 'Free Shipping', + 'description' => 'This is a free shipping', + 'active' => true, + 'class' => 'Webkul\Shipping\Carriers\Free', ] ]; diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index a98ff0be2..b4e0c7229 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -49,7 +49,7 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'admin::customers.orders.index' ])->name('admin.customer.orders.index'); - Route::get('customer/reviews', 'Webkul\Shop\Http\Controllers\ReviewController@index')->defaults('_config',[ + Route::get('customer/reviews', 'Webkul\Product\Http\Controllers\ReviewController@index')->defaults('_config',[ 'view' => 'admin::customers.review.index' ])->name('admin.customer.review.index'); @@ -61,11 +61,11 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'admin.customer.index' ])->name('admin.customer.store'); - Route::get('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@edit')->defaults('_config',[ + Route::get('customer/reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@edit')->defaults('_config',[ 'view' => 'admin::customers.review.edit' ])->name('admin.customer.review.edit'); - Route::put('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@update')->defaults('_config', [ + Route::put('customer/reviews/edit/{id}', 'Webkul\Product\Http\Controllers\ReviewController@update')->defaults('_config', [ 'redirect' => 'admin.customer.review.index' ])->name('admin.customer.review.update'); @@ -73,7 +73,7 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'admin::customers.edit' ])->name('admin.customer.edit'); - Route::put('customer/reviews/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@update')->defaults('_config', [ + Route::put('customer/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@update')->defaults('_config', [ 'redirect' => 'admin.customer.index' ])->name('admin.customer.update'); diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index accef9ceb..599550acd 100644 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -113,7 +113,7 @@ class EventServiceProvider extends ServiceProvider $acl->add('catalog.products', 'Products', 'admin.catalog.products.index', 1); $acl->add('catalog.categories', 'Categories', 'admin.catalog.categories.index', 1); - + $acl->add('configuration', 'Configure', 'admin.account.edit', 5); $acl->add('settings', 'Settings', 'admin.users.index', 6); diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php index 489c50210..0cc75d9e8 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/edit.blade.php @@ -7,7 +7,7 @@ @section('content')
get('locale') ?: app()->getLocale(); ?> - +
- + @stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php index 245b9bac6..0ea37bc67 100644 --- a/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/customers/edit.blade.php @@ -63,8 +63,13 @@
- customerGroup->id ?> + + @if(!is_null($customer->customer_group_id)) + customerGroup->id ?> + @endif + - -
diff --git a/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php b/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php new file mode 100644 index 000000000..3a46d37a5 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php @@ -0,0 +1,13 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.catalog.categories.edit-title') }} +@stop + +@section('content') +
+ + + +
+@stop \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Cart.php b/packages/Webkul/Cart/src/Cart.php index 246254906..2a1572cd1 100644 --- a/packages/Webkul/Cart/src/Cart.php +++ b/packages/Webkul/Cart/src/Cart.php @@ -3,104 +3,305 @@ namespace Webkul\Cart; use Carbon\Carbon; - use Webkul\Cart\Repositories\CartRepository; use Webkul\Cart\Repositories\CartItemRepository; - +use Webkul\Cart\Repositories\CartAddressRepository; use Webkul\Customer\Repositories\CustomerRepository; - use Webkul\Product\Repositories\ProductRepository; - use Cookie; /** - * Facade for all - * the methods to be - * implemented in Cart. + * Facade for all the methods to be implemented in Cart. * * @author Prashant Singh + * @author Jitendra Singh * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class Cart { - protected $cart; //cart repository instance + /** + * CartRepository model + * + * @var mixed + */ + protected $cart; - protected $cartItem; //cart_item repository instance + /** + * CartItemRepository model + * + * @var mixed + */ + protected $cartItem; - protected $customer; //customer repository instance + /** + * CustomerRepository model + * + * @var mixed + */ + protected $customer; - protected $product; //product repository instance + /** + * CartAddressRepository model + * + * @var mixed + */ + protected $cartAddress; - public function __construct(CartRepository $cart, - CartItemRepository $cartItem, - CustomerRepository $customer, - ProductRepository $product) { + /** + * ProductRepository model + * + * @var mixed + */ + protected $product; + /** + * Create a new controller instance. + * + * @param Webkul\Cart\Repositories\CartRepository $cart + * @param Webkul\Cart\Repositories\CartItemRepository $cartItem + * @param Webkul\Cart\Repositories\CartAddressRepository $cartAddress + * @param Webkul\Customer\Repositories\CustomerRepository $customer + * @param Webkul\Product\Repositories\ProductRepository $product + * @return void + */ + public function __construct( + CartRepository $cart, + CartItemRepository $cartItem, + CartAddressRepository $cartAddress, + CustomerRepository $customer, + ProductRepository $product) + { $this->customer = $customer; $this->cart = $cart; $this->cartItem = $cartItem; + $this->cartAddress = $cartAddress; + $this->product = $product; } - /** - * Create new cart - * instance with the - * current item added. + /** + * Method to check if the product is available and its required quantity + * is available or not in the inventory sources. * - * @param Integer $id - * @param Mixed $data + * @param integer $id * - * @return Mixed + * @return Array */ - public function createNewCart($id, $data) { + public function canCheckOut($id) { + $cart = $this->cart->findOneByField('id', 144); + + $items = $cart->items; + + $allProdQty = array(); + + $allProdQty1 = array(); + + $totalQty = 0; + + foreach($items as $item) { + $inventories = $item->product->inventories; + + $inventory_sources = $item->product->inventory_sources; + + $totalQty = 0; + + foreach($inventory_sources as $inventory_source) { + if($inventory_source->status!=0) { + foreach($inventories as $inventory) { + $totalQty = $totalQty + $inventory->qty; + } + + array_push($allProdQty1, $totalQty); + + $allProdQty[$item->product->id] = $totalQty; + } + } + } + + foreach ($items as $item) { + $inventories = $item->product->inventory_sources->where('status', '=', '1'); + + foreach($inventories as $inventory) { + dump($inventory->status); + } + } + + dd($allProdQty); + + dd([true, false]); + } + + /** + * Create new cart instance with the current item added. + * + * @param integer $id + * @param array $data + * + * @return Response + */ + public function createNewCart($id, $data) + { + $itemData = $this->prepareItemData($id, $data); + + // dd($itemData); + $cartData['channel_id'] = core()->getCurrentChannel()->id; + // this will auto set the customer id for the cart instances if customer is authenticated if(auth()->guard('customer')->check()) { $cartData['customer_id'] = auth()->guard('customer')->user()->id; + $cartData['is_guest'] = 1; + $cartData['customer_full_name'] = auth()->guard('customer')->user()->first_name .' '. auth()->guard('customer')->user()->last_name; } + $cartData['items_count'] = 1; + + $cartData['items_quantity'] = $data['quantity']; + if($cart = $this->cart->create($cartData)) { - $data['cart_id'] = $cart->id; - $data['product_id'] = $id; + $itemData['parent']['cart_id'] = $cart->id; if ($data['is_configurable'] == "true") { - $temp = $data['super_attribute']; + //parent product entry + $itemData['parent']['additional'] = json_encode($data); + if($parent = $this->cartItem->create($itemData['parent'])) { - unset($data['super_attribute']); + $itemData['child']['parent_id'] = $parent->id; + if($child = $this->cartItem->create($itemData['child'])) { + session()->put('cart', $cart); - $data['additional'] = json_encode($temp); - } + session()->flash('success', 'Item Added To Cart Successfully'); - if($result = $this->cartItem->create($data)) { - session()->put('cart', $cart); + return redirect()->back(); + } + } - session()->flash('success', 'Item Added To Cart Successfully'); + } else if($data['is_configurable'] == "false") { + if($result = $this->cartItem->create($itemData['parent'])) { + session()->put('cart', $cart); - return redirect()->back(); + session()->flash('success', 'Item Added To Cart Successfully'); + + return redirect()->back(); + } } } - session()->flash('error', 'Some error occured'); + + session()->flash('error', 'Some Error Occured'); return redirect()->back(); } /** - * Add Items in a - * cart with some - * cart and item - * details. + * Prepare the other data for the product to be added. + * + * @param integer $id + * @param array $data + * + * @return array + */ + public function prepareItemData($id, $data) { + unset($data['_token']); + + if(!isset($data['is_configurable']) || !isset($data['product']) ||!isset($data['quantity'])) { + session()->flash('error', 'Cart System Integrity Violation, Some Required Fields Missing.'); + + dd('discrepancy 1'); + + return redirect()->back(); + } else { + if($data['is_configurable'] == "true") { + if(!isset($data['super_attribute'])) { + session()->flash('error', 'Cart System Integrity Violation, Configurable Options Not Found In Request.'); + + dd('discrepancy 2'); + + return redirect()->back(); + } + } + } + + $data['sku'] = $this->product->findOneByField('id', $data['product'])->sku; + + if(isset($data['is_configurable']) && $data['is_configurable'] == "true") { + $parentData['sku'] = $data['sku']; + + $parentData['product_id'] = $id; + + $parentData['quantity'] = $data['quantity']; + + $parentData['type'] = 'configurable'; + + $parentData['name'] = $this->product->findOneByField('id', $id)->name; + + $parentData['price'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->price; + + $parentData['base_price'] = $parentData['price']; + + $parentData['item_total'] = $parentData['price'] * $data['quantity']; + + $parentData['base_item_total'] = $parentData['price'] * $data['quantity']; + + $parentData['weight'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->weight; + + $parentData['item_weight'] = $parentData['weight'] * $parentData['quantity']; + + $parentData['base_item_weight'] = $parentData['weight'] * $parentData['quantity']; + + //child row data + $childData['product_id'] = $data['selected_configurable_option']; + + $childData['quantity'] = 1; + + $childData['sku'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->sku; + + $childData['type'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->type; + + $childData['name'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->name; + + return ['parent' => $parentData, 'child' => $childData]; + } else { + $data['product_id'] = $id; + unset($data['product']); + + $data['type'] = 'simple'; + + $data['name'] = $this->product->findOneByField('id', $id)->name; + + $data['price'] = $this->product->findOneByField('id', $id)->price; + + $data['base_price'] = $data['price']; + + $data['item_total'] = $data['price'] * $data['quantity']; + + $data['base_item_total'] = $data['price'] * $data['quantity']; + + $data['weight'] = $this->product->findOneByField('id', $id)->weight; + + $data['item_weight'] = $data['weight'] * $data['quantity']; + + $data['base_item_weight'] = $data['weight'] * $data['quantity']; + + return ['parent' => $data, 'child' => null]; + } + } + + /** + * Add Items in a cart with some cart and item details. * * @param @id * @param $data * - * @return Mixed + * @return void */ - public function add($id, $data) { + public function add($id, $data) + { + $itemData = $this->prepareItemData($id, $data); if(session()->has('cart')) { $cart = session()->get('cart'); @@ -109,34 +310,51 @@ class Cart { if(isset($cartItems)) { foreach($cartItems as $cartItem) { - if($cartItem->product_id == $id) { - $prevQty = $cartItem->quantity; + if($data['is_configurable'] == "false") { + if($cartItem->product_id == $id) { + $prevQty = $cartItem->quantity; - $newQty = $data['quantity']; + $newQty = $data['quantity']; - $cartItem->update(['quantity' => $prevQty + $newQty]); + $cartItem->update(['quantity' => $prevQty + $newQty]); - session()->flash('success', "Product Quantity Successfully Updated"); + session()->flash('success', "Product Quantity Successfully Updated"); - return redirect()->back(); + return redirect()->back(); + } + } else if($data['is_configurable'] == "true") { + //check the parent and child records that holds info abt this product. + if($cartItem->product_id == $data['selected_configurable_option']) { + $child = $cartItem; + + $parentId = $child->parent_id; + + $parent = $this->cartItem->findOneByField('id', $parentId); + + $parentPrice = $parent->price; + + $prevQty = $parent->quantity; + + $newQty = $data['quantity']; + + $parent->update(['quantity' => $prevQty + $newQty, 'item_total' => $parentPrice * ($prevQty + $newQty)]); + + session()->flash('success', "Product Quantity Successfully Updated"); + + return redirect()->back(); + } } } - $data['cart_id'] = $cart->id; + $parent = $cart->items()->create($itemData['parent']); - $data['product_id'] = $id; + $itemData['child']['parent_id'] = $parent->id; - if ($data['is_configurable'] == "true") { - $temp = $data['super_attribute']; - - unset($data['super_attribute']); - - $data['additional'] = json_encode($temp); - } - - $cart->items()->create($data); + $cart->items()->create($itemData['child']); session()->flash('success', 'Item Successfully Added To Cart'); + + return redirect()->back(); } else { if(isset($cart)) { $this->cart->delete($cart->id); @@ -150,26 +368,24 @@ class Cart { } /** - * use detach to remove the - * current product from cart tables + * Use detach to remove the current product from cart tables * * @param Integer $id * @return Mixed */ - public function remove($id) { + public function remove($id) + { dd("Removing Item from Cart"); } /** - * This function handles - * when guest has some of - * cart products and then - * logs in. + * This function handles when guest has some of cart products and then logs in. * - * @return Redirect + * @return Response */ - public function mergeCart() { + public function mergeCart() + { if(session()->has('cart')) { $cart = session()->get('cart'); @@ -182,20 +398,45 @@ class Cart { if(isset($customerCart)) { foreach($customerCartItems as $customerCartItem) { + if($customerCartItem->type == "simple" && isset($customerCartItem->parent_id)) { + //write the merge case whem the items exists with the customer cart also. + $child = $customerCartItem; - foreach($cartItems as $key => $cartItem) { + $parentId = $child->parent_id; - if($cartItem->product_id == $customerCartItem->product_id) { + $parent = $this->cartItem->findOneByField('id', $parentId); - $customerItemQuantity = $customerCartItem->quantity; + $parentPrice = $parent->price; - $cartItemQuantity = $cartItem->quantity; + $prevQty = $parent->quantity; - $customerCartItem->update(['cart_id' => $customerCart->id, 'quantity' => $cartItemQuantity + $customerItemQuantity]); + foreach ($cartItems as $key => $cartItem) { + if ($cartItem->type == "simple" && isset($cartItem->parent_id)) { + $newQty = $data['quantity']; - $this->cartItem->delete($cartItem->id); + $parent->update(['quantity' => $prevQty + $newQty, 'item_total' => $parentPrice * ($prevQty + $newQty)]); + } else if($cartItem->type == "simple" && is_null($cartItem->parent_id)){ - $cartItems->forget($key); + } + + } + + + } elseif($customerCartItem->type == "simple" && is_null($customerCartItem->parent_id)) { + foreach($cartItems as $key => $cartItem) { + + if($cartItem->product_id == $customerCartItem->product_id) { + + $customerItemQuantity = $customerCartItem->quantity; + + $cartItemQuantity = $cartItem->quantity; + + $customerCartItem->update(['cart_id' => $customerCart->id, 'quantity' => $cartItemQuantity + $customerItemQuantity]); + + $this->cartItem->delete($cartItem->id); + + $cartItems->forget($key); + } } } } @@ -219,4 +460,80 @@ class Cart { return redirect()->back(); } } + + /** + * Returns cart + * + * @return Mixed + */ + public function getCart() + { + if(!$cart = session()->get('cart')) + return false; + + return $cart; + } + + /** + * Save customer address + * + * @return Mixed + */ + public function saveCustomerAddress($data) + { + if(!$cart = $this->getCart()) + return false; + + $billingAddress = $data['billing']; + $shippingAddress = $data['shipping']; + $billingAddress['cart_id'] = $shippingAddress['cart_id'] = $cart->id; + + if($billingAddressModel = $cart->biling_address) { + $this->cartAddress->update($billingAddress, $billingAddressModel->id); + + if($shippingAddress = $cart->shipping_address) { + if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { + $this->cartAddress->update($billingAddress, $shippingAddress->id); + } else { + $this->cartAddress->update($shippingAddress, $shippingAddress->id); + } + } else { + if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { + $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping'])); + } else { + $this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping'])); + } + } + } else { + $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'billing'])); + + if(isset($billingAddress['use_for_shipping']) && $billingAddress['use_for_shipping']) { + $this->cartAddress->create(array_merge($billingAddress, ['address_type' => 'shipping'])); + } else { + $this->cartAddress->create(array_merge($shippingAddress, ['address_type' => 'shipping'])); + } + } + + return true; + } + + /** + * Save shipping method for cart + * + * @param string $shippingMethodCode + * @return Mixed + */ + public function saveShippingMethod($shippingMethodCode) + { + if(!$cart = $this->getCart()) + return false; + + foreach($cart->shipping_rates as $rate) { + if($rate->method != $shippingMethodCode) { + $rate->delete(); + } + } + + return true; + } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php index f5027b241..c32dcd1dc 100644 --- a/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php @@ -17,18 +17,13 @@ class CreateCartTable extends Migration $table->increments('id'); $table->integer('customer_id')->unsigned()->nullable(); $table->foreign('customer_id')->references('id')->on('customers'); - $table->string('session_id')->nullable(); $table->integer('channel_id')->unsigned(); $table->foreign('channel_id')->references('id')->on('channels'); - $table->string('sku')->nullable(); - $table->string('type')->nullable(); - $table->string('name')->nullable(); - $table->integer('parent_id')->nullable(); - $table->foreign('parent_id')->references('id')->on('cart'); $table->string('coupon_code')->nullable(); - $table->boolean('is_gift')->nullable(); + $table->boolean('is_gift')->default(0); $table->integer('items_count')->nullable(); $table->decimal('items_qty', 12, 4)->nullable(); + $table->decimal('exchange_rate', 12, 4)->nullable(); $table->string('global_currency_code')->nullable(); $table->string('base_currency_code')->nullable(); $table->string('store_currency_code')->nullable(); @@ -41,6 +36,7 @@ class CreateCartTable extends Migration $table->decimal('base_sub_total_with_discount', 12, 4)->nullable(); $table->string('checkout_method')->nullable(); $table->boolean('is_guest')->nullable(); + $table->boolean('is_active')->nullable()->default(0); $table->string('customer_full_name')->nullable(); $table->dateTime('conversion_time')->nullable(); $table->timestamps(); diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php index 5fe74cc90..e60bd6dd4 100644 --- a/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_items_table.php @@ -20,20 +20,35 @@ class CreateCartItemsTable extends Migration $table->integer('quantity')->unsigned()->default(1); $table->integer('cart_id')->unsigned(); $table->foreign('cart_id')->references('id')->on('cart'); + $table->string('sku')->nullable(); + $table->string('type')->nullable(); + $table->string('name')->nullable(); + $table->integer('parent_id')->unsigned()->nullable(); $table->integer('tax_category_id')->unsigned()->nullable(); $table->foreign('tax_category_id')->references('id')->on('tax_categories'); $table->string('coupon_code')->nullable(); - $table->decimal('weight', 12,4)->nullable(); - $table->decimal('price', 12,4)->nullable(); - $table->decimal('base_price', 12,4)->nullable(); - $table->decimal('custom_price', 12,4)->nullable(); - $table->decimal('discount_percent', 12,4)->nullable(); - $table->decimal('discount_amount', 12,4)->nullable(); - $table->decimal('base_discount_amount', 12,4)->nullable(); + $table->decimal('weight', 12,4)->default(1); + $table->decimal('item_total_weight', 12,4)->default(0); + $table->decimal('base_item_total_weight', 12,4)->default(0); + $table->decimal('price', 12,4)->default(1); + $table->decimal('item_total', 12,4)->default(0); + $table->decimal('base_item_total', 12,4)->default(0); + $table->decimal('item_total_with_discount', 12,4)->default(0); + $table->decimal('base_item_total_with_discount', 12,4)->default(0); + $table->decimal('base_price', 12,4)->default(0); + $table->decimal('custom_price', 12,4)->default(0); + $table->decimal('discount_percent', 12,4)->default(0); + $table->decimal('discount_amount', 12,4)->default(0); + $table->decimal('base_discount_amount', 12,4)->default(0); $table->boolean('no_discount')->nullable()->default(0); + $table->boolean('free_shipping')->nullable()->default(0); $table->json('additional')->nullable(); $table->timestamps(); }); + + Schema::table('cart_items', function (Blueprint $table) { + $table->foreign('parent_id')->references('id')->on('cart_items'); + }); } /** diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php index 070ea4609..2148ccf8f 100644 --- a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php @@ -15,6 +15,9 @@ class CreateCartAddress extends Migration { Schema::create('cart_address', function (Blueprint $table) { $table->increments('id'); + $table->string('first_name'); + $table->string('last_name'); + $table->string('email'); $table->string('address1'); $table->string('address2')->nullable(); $table->string('country'); diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping_rates_table.php similarity index 74% rename from packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php rename to packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping_rates_table.php index 9413012ae..3b286d510 100644 --- a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateCartShipping extends Migration +class CreateCartShippingRatesTable extends Migration { /** * Run the migrations. @@ -13,7 +13,7 @@ class CreateCartShipping extends Migration */ public function up() { - Schema::create('cart_shipping', function (Blueprint $table) { + Schema::create('cart_shipping_rates', function (Blueprint $table) { $table->increments('id'); $table->string('carrier'); $table->string('carrier_title'); @@ -21,8 +21,6 @@ class CreateCartShipping extends Migration $table->string('method_title'); $table->string('method_description')->nullable(); $table->double('price')->nullable(); - $table->integer('cart_id')->nullable()->unsigned(); - $table->foreign('cart_id')->references('id')->on('cart'); $table->integer('cart_address_id')->nullable()->unsigned(); $table->foreign('cart_address_id')->references('id')->on('cart_address'); $table->timestamps(); @@ -36,6 +34,6 @@ class CreateCartShipping extends Migration */ public function down() { - Schema::dropIfExists('cart_shipping'); + Schema::dropIfExists('cart_shipping_rates'); } } diff --git a/packages/Webkul/Cart/src/Http/Controllers/CartController.php b/packages/Webkul/Cart/src/Http/Controllers/CartController.php index 59af6df1b..6c766aa8a 100644 --- a/packages/Webkul/Cart/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Cart/src/Http/Controllers/CartController.php @@ -10,8 +10,6 @@ use Webkul\Product\Repositories\ProductRepository; use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Product\Product\ProductImage; use Webkul\Product\Product\View as ProductView; -use Webkul\Attribute\Repositories\AttributeOptionRepository; - use Cart; /** @@ -51,28 +49,16 @@ class CartController extends Controller protected $productView; - /** - * Initializing various - * required repositories - * and classes. - * - * @param Mixed $cart - * @param Mixed $cartItem - * @param Mixed $customer - * @param Mixed $product - * @param Mixed $productImage - * @param Mixed $productView - */ public function __construct( CartRepository $cart, CartItemRepository $cartItem, CustomerRepository $customer, ProductRepository $product, ProductImage $productImage, - ProductView $productView) - { + ProductView $productView + ) { - $this->middleware('customer')->except(['add', 'remove', 'test']); + // $this->middleware('customer')->except(['add', 'remove', 'test']); $this->customer = $customer; @@ -89,6 +75,19 @@ class CartController extends Controller $this->_config = request('_config'); } + /** + * Method to populate + * the cart page which + * will be populated + * before the checkout + * process. + * + * @return Mixed + */ + public function index() { + return view($this->_config['view'])->with('cart', Cart::getCart()); + } + /** * Function for guests * user to add the product @@ -98,36 +97,12 @@ class CartController extends Controller */ public function add($id) { + // session()->forget('cart'); - session()->forget('cart'); - return redirect()->back(); + // return redirect()->back(); $data = request()->input(); - if(!isset($data['is_configurable']) || !isset($data['product']) ||!isset($data['quantity'])) { - session()->flash('error', 'Cart System Integrity Violation'); - - return redirect()->back(); - } else { - //handle the accidental case - //when some one deleted - //form fields from the DOM - if($data['is_configurable']) { - if(!isset($data['super_attributes'])) { - session()->flash('error', 'Cart System Integrity Violation'); - - return redirect()->back(); - } - } - } - - if(isset($data['is_configurable']) && $data['is_configurable']) { - $data['price'] = $this->product->findOneByField('id', $data['selected_configurable_option'])->price; - - } else { - $data['price'] = $this->product->findOneByField('id', $data['product'])->price; - } - Cart::add($id, $data); return redirect()->back(); @@ -144,118 +119,6 @@ class CartController extends Controller return redirect()->back(); } - /** - * Method to populate - * the cart page which - * will be populated - * before the checkout - * process. - * - * @return Mixed - */ - public function beforeCheckout() { - if(auth()->guard('customer')->check()) { - $cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id); - - if(isset($cart)) { - $cart = $this->cart->findOneByField('id', 144); - - $cartItems = $this->cart->items($cart['id']); - - $products = array(); - - foreach($cartItems as $cartItem) { - $image = $this->productImage->getGalleryImages($cartItem->product); - - if(isset($image[0]['small_image_url'])) { - $products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity]; - } - else { - $products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity]; - } - - } - } - } else { - if(session()->has('cart')) { - $cart = session()->get('cart'); - - if(isset($cart)) { - $cart = $this->cart->findOneByField('id', 144); - - $cartItems = $this->cart->items($cart['id']); - - $products = array(); - - foreach($cartItems as $cartItem) { - $image = $this->productImage->getGalleryImages($cartItem->product); - - if(isset($image[0]['small_image_url'])) { - $products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, $image[0]['small_image_url'], $cartItem->quantity]; - } - else { - $products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity]; - } - - } - } - } - } - - return view($this->_config['view'])->with('products', $products); - } - - /** - * This method will return - * the quantities from - * inventory sources whose - * status are not false. - * - * @return Array - */ - public function canAddOrUpdate() { - $cart = $this->cart->findOneByField('id', 144); - - $items = $cart->items; - - $allProdQty = array(); - - $allProdQty1 = array(); - - $totalQty = 0; - - foreach($items as $item) { - $inventories = $item->product->inventories; - - $inventory_sources = $item->product->inventory_sources; - - $totalQty = 0; - foreach($inventory_sources as $inventory_source) { - - if($inventory_source->status!=0) { - foreach($inventories as $inventory) { - $totalQty = $totalQty + $inventory->qty; - } - - array_push($allProdQty1, $totalQty); - - $allProdQty[$item->product->id] = $totalQty; - } - - } - } - - dd($allProdQty); - - foreach ($items as $item) { - $inventories = $item->product->inventory_sources->where('status', '=', '1'); - - foreach($inventories as $inventory) { - dump($inventory->status); - } - } - } - public function test() { $cart = $this->cart->findOneByField('id', 144); @@ -274,9 +137,7 @@ class CartController extends Controller else { $products[$cartItem->product->id] = [$cartItem->product->name, $cartItem->price, 'null', $cartItem->quantity]; } - } - dd($products); } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php b/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php index 8f8022a0d..486067e2d 100644 --- a/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php +++ b/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php @@ -43,7 +43,10 @@ class CheckoutController extends Controller */ public function index() { - return view($this->_config['view']); + if(!$cart = Cart::getCart()) + return redirect()->route('shop.checkout.cart.index'); + + return view($this->_config['view'])->with('cart', $cart); } /** @@ -54,11 +57,10 @@ class CheckoutController extends Controller */ public function saveAddress(CustomerAddressForm $request) { - if(!Cart::saveCustomerAddress(request()->all())) { - // return response()->json(['redirect_url' => route('store.home')], 403) - } + if(!Cart::saveCustomerAddress(request()->all()) || !$rates = Shipping::collectRates()) + return response()->json(['redirect_url' => route('shop.checkout.cart.index')], 403); - return response()->json(Shipping::collectRates()); + return response()->json($rates); } /** diff --git a/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php b/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php index 6432d6f7e..f5a4a0b98 100644 --- a/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php +++ b/packages/Webkul/Cart/src/Http/ViewComposers/CartComposer.php @@ -44,6 +44,8 @@ class CartComposer } public function compose(View $view) { + // session()->forget('cart'); + // return redirect()->back(); if(auth()->guard('customer')->check()) { $cart = $this->cart->findOneByField('customer_id', auth()->guard('customer')->user()->id); @@ -68,9 +70,7 @@ class CartComposer $view->with('cart', $products); } } else { - if(session()->has('cart')) { - $cart = session()->get('cart'); - + if($cart = session()->get('cart')) { if(isset($cart)) { $cartItems = $this->cart->items($cart['id']); diff --git a/packages/Webkul/Cart/src/Models/Cart.php b/packages/Webkul/Cart/src/Models/Cart.php index 734897522..ef1d711c0 100644 --- a/packages/Webkul/Cart/src/Models/Cart.php +++ b/packages/Webkul/Cart/src/Models/Cart.php @@ -5,13 +5,13 @@ namespace Webkul\Cart\Models; use Illuminate\Database\Eloquent\Model; use Webkul\Product\Models\Product; use Webkul\Cart\Models\CartAddress; -use Webkul\Cart\Models\CartShipping; +use Webkul\Cart\Models\CartShippingRate; class Cart extends Model { protected $table = 'cart'; - protected $fillable = ['customer_id', 'session_id', 'channel_id', 'coupon_code', 'is_gift', 'global_currency_code', 'base_currency_code', 'store_currency_code', 'quote_currency_code', 'grand_total', 'base_grand_total', 'sub_total', 'base_sub_total', 'sub_total_with_discount', 'base_sub_total_with_discount', 'checkout_method', 'is_guest', 'customer_full_name', 'conversion_time']; + protected $fillable = ['customer_id', 'session_id', 'channel_id', 'coupon_code', 'is_gift', 'items_count', 'items_qty', 'exchange_rate', 'global_currency_code', 'base_currency_code', 'store_currency_code', 'quote_currency_code', 'grand_total', 'base_grand_total', 'sub_total', 'base_sub_total', 'sub_total_with_discount', 'base_sub_total_with_discount', 'checkout_method', 'is_guest', 'is_active', 'customer_full_name', 'conversion_time']; protected $hidden = ['coupon_code']; @@ -28,10 +28,42 @@ class Cart extends Model } /** - * Get the shipping for the cart. + * Get the biling address for the cart. */ - public function shipping() + public function biling_address() { - return $this->hasMany(CartShipping::class); + return $this->addresses()->where('address_type', 'billing'); } -} + + /** + * Get all of the attributes for the attribute groups. + */ + public function getBilingAddressAttribute() + { + return $this->biling_address()->first(); + } + + /** + * Get the shipping address for the cart. + */ + public function shipping_address() + { + return $this->addresses()->where('address_type', 'shipping'); + } + + /** + * Get all of the attributes for the attribute groups. + */ + public function getShippingAddressAttribute() + { + return $this->shipping_address()->first(); + } + + /** + * Get the shipping rates for the cart. + */ + public function shipping_rates() + { + return $this->hasManyThrough(CartShippingRate::class, CartAddress::class, 'cart_id', 'cart_address_id'); + } +} \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Models/CartAddress.php b/packages/Webkul/Cart/src/Models/CartAddress.php index 5ecad6830..889328d39 100644 --- a/packages/Webkul/Cart/src/Models/CartAddress.php +++ b/packages/Webkul/Cart/src/Models/CartAddress.php @@ -3,8 +3,19 @@ namespace Webkul\Cart\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Cart\Models\CartShippingRate; class CartAddress extends Model { - -} + protected $table = 'cart_address'; + + protected $fillable = ['first_name', 'last_name', 'email', 'address1', 'address2', 'city', 'state', 'postcode', 'country', 'email', 'phone', 'address_type', 'cart_id']; + + /** + * Get the shipping rates for the cart address. + */ + public function shipping_rates() + { + return $this->hasMany(CartShippingRate::class); + } +} \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Models/CartItem.php b/packages/Webkul/Cart/src/Models/CartItem.php index c54ba0756..4c02b8138 100644 --- a/packages/Webkul/Cart/src/Models/CartItem.php +++ b/packages/Webkul/Cart/src/Models/CartItem.php @@ -9,7 +9,7 @@ class CartItem extends Model { protected $table = 'cart_items'; - protected $fillable = ['product_id','quantity','cart_id','tax_category_id','coupon_code', 'weight', 'price', 'base_price', 'discount_percent', 'discount_amount', 'base_discount_amount', 'no_discount', 'custom_price', 'additional']; + protected $fillable = ['product_id', 'quantity', 'cart_id', 'sku', 'type', 'name', 'parent_id','tax_category_id', 'coupon_code', 'weight', 'item_total_weight', 'base_item_total_weight', 'price', 'item_total', 'item_total_with_discount', 'base_item_total_with_discount', 'base_price', 'custom_price', 'discount_percent', 'discount_amount', 'base_discount_amount', 'no_discount', 'free_shipping', 'additional']; public function product() { return $this->hasOne('Webkul\Product\Models\Product', 'id', 'product_id'); diff --git a/packages/Webkul/Cart/src/Models/CartShipping.php b/packages/Webkul/Cart/src/Models/CartShipping.php deleted file mode 100644 index fd1cc7f76..000000000 --- a/packages/Webkul/Cart/src/Models/CartShipping.php +++ /dev/null @@ -1,10 +0,0 @@ -belongsTo(CartAddress::class); + } +} \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Repositories/CartAddressRepository.php b/packages/Webkul/Cart/src/Repositories/CartAddressRepository.php new file mode 100644 index 000000000..9491aeefa --- /dev/null +++ b/packages/Webkul/Cart/src/Repositories/CartAddressRepository.php @@ -0,0 +1,25 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class CartAddressRepository extends Repository +{ + /** + * Specify Model class name + * + * @return Mixed + */ + function model() + { + return 'Webkul\Cart\Models\CartAddress'; + } +} \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php index a8501b133..913ecdd9d 100644 --- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php @@ -5,6 +5,7 @@ namespace Webkul\Customer\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; use Webkul\Customer\Repositories\CustomerRepository; +use Webkul\Product\Repositories\ProductReviewRepository as ProductReview; use Webkul\Customer\Models\Customer; use Auth; @@ -27,14 +28,29 @@ class CustomerController extends Controller protected $_config; protected $customer; + /** + * ProductReviewRepository object + * + * @var array + */ + protected $productReview; - public function __construct(CustomerRepository $customer) + /** + * Create a new controller instance. + * + * @param Webkul\Product\Repositories\ProductReviewRepository $productReview + * @return void + */ + + public function __construct(CustomerRepository $customer , ProductReview $productReview) { $this->middleware('customer'); $this->_config = request('_config'); $this->customer = $customer; + + $this->productReview = $productReview; } /** @@ -141,7 +157,12 @@ class CustomerController extends Controller } public function reviews() { - return view($this->_config['view']); + + $id = auth()->guard('customer')->user()->id; + + $reviews = $this->productReview->getCustomerReview($id); + + return view($this->_config['view'],compact('reviews')); } public function address() { diff --git a/packages/Webkul/Core/src/Http/Controllers/ReviewController.php b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php similarity index 61% rename from packages/Webkul/Core/src/Http/Controllers/ReviewController.php rename to packages/Webkul/Product/src/Http/Controllers/ReviewController.php index ac6b76995..3428b1f2b 100644 --- a/packages/Webkul/Core/src/Http/Controllers/ReviewController.php +++ b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php @@ -1,6 +1,6 @@ _config = request('_config'); } - /** - * Store a newly created resource in storage. + /** + * Display a listing of the resource. * - * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function index() + { + return view($this->_config['view']); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id * @return \Illuminate\Http\Response */ - public function store(Request $request , $id) - { - $this->validate(request(), [ - 'comment' => 'required', - ]); + public function edit($id) + { + $review = $this->productReview->find($id); - $input=$request->all(); + return view($this->_config['view'],compact('review')); + } - $input['product_id']=$id; + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { - $input['customer_id']=1; + $this->productReview->update(request()->all(), $id); - $this->productReview->create($input); - - session()->flash('success', 'Review submitted successfully.'); + session()->flash('success', 'Review updated successfully.'); return redirect()->route($this->_config['redirect']); } - } diff --git a/packages/Webkul/Product/src/Models/ProductReview.php b/packages/Webkul/Product/src/Models/ProductReview.php index a6ed903ec..cad0146d5 100644 --- a/packages/Webkul/Product/src/Models/ProductReview.php +++ b/packages/Webkul/Product/src/Models/ProductReview.php @@ -4,6 +4,7 @@ namespace Webkul\Product\Models; use Illuminate\Database\Eloquent\Model; use Webkul\Customer\Models\Customer; +use Webkul\Product\Models\Product; class ProductReview extends Model { @@ -16,4 +17,12 @@ class ProductReview extends Model { return $this->belongsTo(Customer::class); } + + /** + * Get the product. + */ + public function product() + { + return $this->belongsTo(Product::class); + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Product/Review.php b/packages/Webkul/Product/src/Product/Review.php index 3fc979da2..72a4d910b 100644 --- a/packages/Webkul/Product/src/Product/Review.php +++ b/packages/Webkul/Product/src/Product/Review.php @@ -56,7 +56,7 @@ class Review extends AbstractProduct */ public function getTotalRating($product) { - return $product->reviews()->where('status',1)->sum('rating'); + return $product->reviews()->where('status','approved')->sum('rating'); } /** @@ -101,7 +101,7 @@ class Review extends AbstractProduct $link = $_SERVER['PHP_SELF']; $link_array = explode('/',$link); $last=end($link_array); - $itemPerPage = $last*5; + $itemPerPage = 1*5; return $product->reviews()->where('status',1)->paginate($itemPerPage); } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Repositories/ProductReviewRepository.php b/packages/Webkul/Product/src/Repositories/ProductReviewRepository.php index e8bff8b5e..4e135b324 100644 --- a/packages/Webkul/Product/src/Repositories/ProductReviewRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductReviewRepository.php @@ -1,8 +1,10 @@ -product = $product; + + parent::__construct($app); + } + /** * Specify Model class name * @@ -21,4 +45,16 @@ class ProductReviewRepository extends Repository { return 'Webkul\Product\Models\ProductReview'; } + + /** + * Retrieve review for customerId + * + * @param int $customerId + */ + function getCustomerReview($customerId) + { + $reviews = $this->model->where('customer_id',$customerId)->with('product')->get(); + + return $reviews; + } } \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Carriers/FlatRate.php b/packages/Webkul/Shipping/src/Carriers/FlatRate.php index 0d93f4cdc..449b32e0d 100644 --- a/packages/Webkul/Shipping/src/Carriers/FlatRate.php +++ b/packages/Webkul/Shipping/src/Carriers/FlatRate.php @@ -3,7 +3,7 @@ namespace Webkul\Shipping\Carriers; use Config; -use Webkul\Cart\Models\CartShipping; +use Webkul\Cart\Models\CartShippingRate; use Webkul\Shipping\Facades\Shipping; /** @@ -19,12 +19,17 @@ class FlatRate extends AbstractShipping */ protected $code = 'flatrate'; + /** + * Returns rate for flatrate + * + * @return array + */ public function calculate() { if(!$this->isAvailable()) return false; - $object = new CartShipping; + $object = new CartShippingRate; $object->carrier = 'flatrate'; $object->carrier_title = $this->getConfigData('title'); diff --git a/packages/Webkul/Shipping/src/Carriers/Free.php b/packages/Webkul/Shipping/src/Carriers/Free.php new file mode 100644 index 000000000..e51a1ec53 --- /dev/null +++ b/packages/Webkul/Shipping/src/Carriers/Free.php @@ -0,0 +1,43 @@ +isAvailable()) + return false; + + $object = new CartShippingRate; + + $object->carrier = 'free'; + $object->carrier_title = $this->getConfigData('title'); + $object->method = 'free_free'; + $object->method_title = $this->getConfigData('title'); + $object->method_description = $this->getConfigData('description'); + $object->price = 0; + + return $object; + } +} \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Shipping.php b/packages/Webkul/Shipping/src/Shipping.php index 201b7af19..fb8d06406 100644 --- a/packages/Webkul/Shipping/src/Shipping.php +++ b/packages/Webkul/Shipping/src/Shipping.php @@ -3,6 +3,7 @@ namespace Webkul\Shipping; use Illuminate\Support\Facades\Config; +use Webkul\Cart\Facades\Cart; /** * Class Shipping. @@ -10,10 +11,25 @@ use Illuminate\Support\Facades\Config; */ class Shipping { + /** + * Rates + * + * @var array + */ protected $rates = []; + /** + * Collects rate from available shipping methods + * + * @return array + */ public function collectRates() { + if(!$cart = Cart::getCart()) + return false; + + $this->removeAllShippingRates(); + foreach(Config::get('carriers') as $shippingMethod) { $object = new $shippingMethod['class']; @@ -26,12 +42,53 @@ class Shipping } } + $this->saveAllShippingRates(); + return [ 'jump_to_section' => 'shipping', 'html' => view('shop::checkout.onepage.shipping', ['shippingRateGroups' => $this->getGroupedAllShippingRates()])->render() ]; } + + /** + * Persist shipping rate to database + * + * @return void + */ + public function removeAllShippingRates() + { + if(!$cart = Cart::getCart()) + return; + foreach($cart->shipping_rates()->get() as $rate) { + $rate->delete(); + } + } + + /** + * Persist shipping rate to database + * + * @return void + */ + public function saveAllShippingRates() + { + if(!$cart = Cart::getCart()) + return; + + $shippingAddress = $cart->shipping_address; + + foreach($this->rates as $rate) { + $rate->cart_address_id = $shippingAddress->id; + + $rate->save(); + } + } + + /** + * Returns shipping rates, grouped by shipping method + * + * @return void + */ public function getGroupedAllShippingRates() { $rates = []; diff --git a/packages/Webkul/Shop/src/Http/Controllers/ProductController.php b/packages/Webkul/Shop/src/Http/Controllers/ProductController.php index b94ba5ade..f410aeb03 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/ProductController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ProductController.php @@ -52,6 +52,8 @@ class ProductController extends Controller { $product = $this->product->findBySlugOrFail($slug); - return view($this->_config['view'], compact('product')); + $customer = auth()->guard('customer')->user(); + + return view($this->_config['view'], compact('product','customer')); } } diff --git a/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php b/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php index f6f6fb26a..4447db8b0 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php @@ -94,7 +94,7 @@ class ReviewController extends Controller $customer_id = auth()->guard('customer')->user()->id; - $data['status']=0; + $data['status']='pending'; $data['product_id']=$id; $data['customer_id']=$customer_id; diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 68743d727..cf15f1fa7 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -10,16 +10,16 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'shop::products.index' ]); - Route::get('/checkout', 'Webkul\Cart\Http\Controllers\CheckoutController@index')->defaults('_config', [ + Route::get('/checkout/cart', 'Webkul\Cart\Http\Controllers\CartController@index')->defaults('_config', [ + 'view' => 'shop::checkout.cart.index' + ])->name('shop.checkout.cart.index'); + + Route::get('/checkout/onepage', 'Webkul\Cart\Http\Controllers\CheckoutController@index')->defaults('_config', [ 'view' => 'shop::checkout.onepage' - ])->name('shop.checkout'); + ])->name('shop.checkout.onepage.index'); Route::get('test', 'Webkul\Cart\Http\Controllers\CartController@test'); - Route::get('cart', 'Webkul\Cart\Http\Controllers\CartController@beforeCheckout')->defaults('_config', [ - 'view' => 'shop::store.cart.index' - ]); - Route::post('/checkout/save-address', 'Webkul\Cart\Http\Controllers\CheckoutController@saveAddress')->name('shop.checkout.save-address'); Route::post('/checkout/save-shipping', 'Webkul\Cart\Http\Controllers\CheckoutController@saveShipping')->name('shop.checkout.save-shipping'); @@ -51,12 +51,12 @@ Route::group(['middleware' => ['web']], function () { ])->name('shop.reviews.create'); Route::post('/product/{slug}/review', 'Webkul\Shop\Http\Controllers\ReviewController@store')->defaults('_config', [ - 'redirect' => 'shop.reviews.index' + 'redirect' => 'customer.reviews.index' ])->name('shop.reviews.store'); - Route::post('/reviews/create/{slug}', 'Webkul\Shop\Http\Controllers\ReviewController@store')->defaults('_config', [ - 'redirect' => 'admin.reviews.index' - ])->name('admin.reviews.store'); + // Route::post('/reviews/create/{slug}', 'Webkul\Shop\Http\Controllers\ReviewController@store')->defaults('_config', [ + // 'redirect' => 'admin.reviews.index' + // ])->name('admin.reviews.store'); //customer routes starts here diff --git a/packages/Webkul/Shop/src/Resources/assets/images/icon-filter.svg b/packages/Webkul/Shop/src/Resources/assets/images/icon-filter.svg new file mode 100644 index 000000000..292a6b68a --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/assets/images/icon-filter.svg @@ -0,0 +1,10 @@ + + + + icon-filter + Created with Sketch. + + + + + \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/images/icon-sort.svg b/packages/Webkul/Shop/src/Resources/assets/images/icon-sort.svg new file mode 100644 index 000000000..f52b8f0da --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/assets/images/icon-sort.svg @@ -0,0 +1,13 @@ + + + + icon-sort + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index 2ec9230a2..a59bf9439 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -1,3 +1,4 @@ + @import url("https://fonts.googleapis.com/css?family=Montserrat:400,500"); @import "icons"; @@ -759,7 +760,7 @@ section.slider-block { } .filter-attributes-title .icon { - background-image: url('../images/arrow-up.svg') !important; + background-image: url('../images//arrow-up.svg') !important; } } } @@ -774,8 +775,9 @@ section.slider-block { margin-right: auto; .content-container { - display: inline-block; + display: flex; width: 100%; + flex-direction: row; } .product-grid { @@ -849,6 +851,7 @@ section.slider-block { border-radius: 0px; margin-right: 10px; text-transform: uppercase; + white-space: nowrap; } } } @@ -890,6 +893,14 @@ section.slider-block { float: left; color: $font-color; line-height: 45px; + + span:first-child { + display: inline; + } + + span:last-child { + display: none; + } } .pager { @@ -921,6 +932,10 @@ section.slider-block { margin-right: 10px; } } + + .sort-filter { + display: none; + } } .sorter { @@ -934,6 +949,10 @@ section.slider-block { } } + .reponsive-sorter-limiter { + display: none; + } + .bottom-toolbar { display: block; margin-top: 40px; @@ -1009,27 +1028,230 @@ section.slider-block { } } -//responsive for main-container-wrapper +// responsive category css start here @media all and (max-width: 480px) { + .main-container-wrapper { - width: 100% !important; - margin-left: auto; - margin-right: auto; + + .content-container { + flex-direction: column-reverse; + } + + .layered-filter-wrapper { + display: none; + } + + .main { + width: 92%; + margin-left: 4%; + } + + .product-grid { + + &.max-2-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + + &.max-3-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + + &.max-4-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + } + + .product-card { + + .product-ratings { + .total-reviews { + display: none; + } + } + + .cart-fav-seg { + .addtocart { + font-size: 12px; + } + } + } + + .top-toolbar { + border-bottom: 1px solid #E8E8E8; + margin-bottom: 10px; + + .page-info { + + span:first-child { + display: none; + } + + span:last-child { + display: inline; + font-size: 18px; + } + } + + .pager { + + .view-mode { + margin-right: 0px; + + a, span { + display: none; + + &.grid-view { + display: none; + } + } + + .sort-filter { + margin-top: 15px; + display: inline-block; + } + } + + .sorter { + display: none; + } + + .limiter { + display: none; + } + } + } + + .reponsive-sorter-limiter { + display: none; + + select { + background: #FFFFFF; + border: 1px solid #C7C7C7; + border-radius: 3px; + font-size: 16px; + color: $font-color; + padding: 10px; + } + } + + .bottom-toolbar { + margin-bottom: 80px; + } } } -@media all and (min-width: 481px) and (max-width: 920px) { +@media all and (min-width: 481px) and (max-width: 920px) { + .main-container-wrapper { - width: 90%; - margin-left: auto; - margin-right: auto; + + .content-container { + flex-direction: column-reverse; + } + + .layered-filter-wrapper { + display: none; + } + + .main { + width: 92%; + margin-left: 4%; + } + + .product-grid { + + &.max-2-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + + &.max-3-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + + &.max-4-col { + grid-template-columns: repeat( auto-fill, minmax(150px, 1fr) ); + } + } + + .product-card { + + .product-ratings { + .total-reviews { + display: none; + } + } + + .cart-fav-seg { + .addtocart { + font-size: 12px; + } + } + } + + .top-toolbar { + border-bottom: 1px solid #E8E8E8; + margin-bottom: 10px; + + .page-info { + + span:first-child { + display: none; + } + + span:last-child { + display: inline; + font-size: 18px; + } + } + + .pager { + + .view-mode { + margin-right: 0px; + + a, span { + display: none; + + &.grid-view { + display: none; + } + } + + .sort-filter { + margin-top: 15px; + display: inline-block; + } + } + + .sorter { + display: none; + } + + .limiter { + display: none; + } + } + } + + .reponsive-sorter-limiter { + display: none; + + select { + background: #FFFFFF; + border: 1px solid #C7C7C7; + border-radius: 3px; + font-size: 16px; + color: $font-color; + padding: 10px; + } + } + + .bottom-toolbar { + margin-bottom: 80px; + } } } - - - .product-price { font-size: 16px; margin-bottom: 14px; @@ -1343,7 +1565,7 @@ section.product-detail { form { display: flex; flex-direction: row; - justify-content: space-between; + // justify-content: space-between; width: 100%; div.product-image-group { @@ -1415,9 +1637,27 @@ section.product-detail { display: block; position: relative; background: #F2F2F2; - width: 480px; + width: 100%; max-height: 480px; + img { + width: 100%; + height: 480px; + max-height: 480px; + } + + .whishlist-icon { + margin-top: -480px; + float: right; + margin-right: 10px; + } + + .share-icon { + margin-top: -480px; + float: right; + margin-right: 40px; + } + .wishlist { position: absolute; top: 10px; @@ -1434,18 +1674,24 @@ section.product-detail { .cart-fav-seg { display: block; - float: right; + margin-top: 10px; - .wishlist { - position: absolute; - margin-top: -500px; - margin-right: -100px; + .addtocart { + border-radius: 0px; + width: 49%; + background: black; + } + + .buynow { + border-radius: 0px; + width: 49%; + float:right; } } } .details { - width: 50%; + width: 47.5%; .product-price { margin-bottom: 14px; @@ -1507,6 +1753,10 @@ section.product-detail { font-weight: 600; } + .accordian .accordian-content { + padding: 20px 0px; + } + .attributes { display: block; width: 100%; @@ -1517,10 +1767,229 @@ section.product-detail { font-size: 16px; } } + + // .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; + // } + // } + // } } } } +// products responsive css start here + +@media all and (max-width: 480px) { + + section.product-detail { + + div.category-breadcrumbs { + display: none; + } + + div.layouter { + + form { + display: block; + + div.product-image-group { + margin-right: 0px; + + div { + flex-direction: column-reverse; + + .thumb-list { + height: 140px; + margin-top: 5px; + width:100%; + flex-direction: row; + overflow-x: scroll; + + .thumb-frame { + + img { + height: 100%; + width: auto; + } + } + + .gallery-control { + display: none; + } + } + + .product-hero-image { + width: 100%; + + img { + width: 100%; + } + } + } + } + + .details { + width: 100%; + margin-top: 20px; + border-bottom: 1px solid #e8e8e8e8; + + .attributes { + border-bottom: none; + } + } + } + } + } + +} + +@media all and (min-width: 481px) and (max-width: 920px) { + + section.product-detail { + + div.category-breadcrumbs { + display: none; + } + + div.layouter { + + form { + display: block; + + div.product-image-group { + margin-right: 0px; + + div { + flex-direction: column-reverse; + + .thumb-list { + height: 140px; + margin-top: 5px; + width:100%; + flex-direction: row; + overflow-x: scroll; + + .thumb-frame { + + img { + height: 100%; + width: auto; + } + } + + .gallery-control { + display: none; + } + } + + .product-hero-image { + width: 100%; + + img { + width: 100%; + } + } + } + } + + .details { + width: 100%; + margin-top: 20px; + border-bottom: 1px solid #e8e8e8e8; + + .attributes { + border-bottom: none; + } + } + } + } + } + +} + +// products responsive css end here + .rating-reviews { .rating-header { @@ -1841,6 +2310,45 @@ section.cart { } } +@media all and (max-width: 480px){ + + .attached-products-wrapper { + + .title { + + .border-bottom { + border-bottom: 1px solid rgba(162, 162, 162, 0.2); + display: inline-block; + width: 100%; + position: initial; + top: 40px; + left: 0%; + margin-left: 0px; + } + } + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + + .attached-products-wrapper { + + .title { + + .border-bottom { + border-bottom: 1px solid rgba(162, 162, 162, 0.2); + display: inline-block; + width: 100%; + position: initial; + top: 40px; + left: 0%; + margin-left: 0px; + } + } + } +} + + // order page css start here .order { @@ -2115,8 +2623,572 @@ section.cart { // oder page css end here +// responsive order page css start here + +@media all and (max-width: 480px) { + + .order { + margin-left: 0%; + + .order-section-head { + display: none; + } + + .order-section-head-small { + display: block; + margin-top: -15px; + + span { + display:inline-block; + width:33.3%; + } + + .icon { + float: left; + + img { + margin-top: 11px; + } + } + + .order-number { + text-align: center; + font-size: 16px; + color: #242424; + letter-spacing: -0.38px; + text-align: center; + margin-top: 13px; + margin-bottom: 13px; + } + + .cancel { + float: right; + text-align: right; + font-size: 17px; + color: #0031F0; + letter-spacing: -0.11px; + margin-top: 13px; + margin-bottom: 13px; + } + + .horizon-rule { + border: .5px solid #E8E8E8; + width: 150%; + margin-left: -10%; + margin-right: -10%; + } + } + + .payment-place { + font-size: 16px; + color: $profile-content-color; + margin-top: 4%; + + .placed-on { + display: flex; + flex-direction: column; + + .place-text { + width:100%; + + span { + font-size: 14px; + } + + .processing { + display: block; + float: right; + background: #2ED04C; + height: 25px; + border-radius: 100px; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.12px; + width: 110px; + text-align: center; + padding-top: 3.5px; + padding-left: 5px; + margin-top: 3px; + } + } + + .place-date{ + margin-top: -5px; + } + } + + .payment-status { + display: flex; + flex-direction: column; + + .payment-text { + + span { + font-size: 14px; + } + } + + .status { + margin-top: 2px; + } + } + + .horizontal-rule { + margin-top: 1.1%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + } + + .order-details{ + display: none; + } + + .total { + margin-top: 5%; + height: 130px; + + .calculate { + width: 100%; + float: left; + + .sub-total { + + .left { + margin-left: 0px; + width:100px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .ship-handle { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .discount { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .grand-total { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .due { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + } + } + + .horizontal-rule { + display: none; + } + + .table { + display:none; + } + + .product-config { + border: 1px solid #E8E8E8; + height: 19%; + width:100%; + margin-top: 10px; + display: block; + + .product-attribute { + display: flex; + flex-direction: row; + + .product-property { + width: 30%; + margin-top: 10px; + margin-left: 5px; + + span { + font-size: 14px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + } + + .property-name { + margin-top: 10px; + width:50%; + + span { + font-size: 16px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + } + } + + } + + .order-information { + flex-direction: column; + + .order-address-method { + width : 250px; + } + + .order-address-method:nth-child(3) { + margin-top: 10px; + } + + .order-address-method:nth-child(2) { + margin-top: 10px; + } + + .order-address-method:nth-child(4) { + margin-top: 10px; + } + + } + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + + .order { + margin-left: 0%; + + .order-section-head { + display: none; + } + + .order-section-head-small { + display: block; + margin-top: -15px; + + span { + display:inline-block; + width:33.3%; + } + + .icon { + float: left; + + img { + margin-top: 11px; + } + } + + .order-number { + text-align: center; + font-size: 16px; + color: #242424; + letter-spacing: -0.38px; + text-align: center; + margin-top: 13px; + margin-bottom: 13px; + } + + .cancel { + float: right; + text-align: right; + font-size: 17px; + color: #0031F0; + letter-spacing: -0.11px; + margin-top: 13px; + margin-bottom: 13px; + } + + .horizon-rule { + border: .5px solid #E8E8E8; + width: 150%; + margin-left: -10%; + margin-right: -10%; + } + } + + .payment-place { + font-size: 16px; + color: $profile-content-color; + margin-top: 4%; + + .placed-on { + display: flex; + flex-direction: column; + + .place-text { + width:100%; + + span { + font-size: 14px; + } + + .processing { + display: block; + float: right; + background: #2ED04C; + height: 25px; + border-radius: 100px; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.12px; + width: 110px; + text-align: center; + padding-top: 3.5px; + padding-left: 5px; + margin-top: 3px; + } + } + + .place-date{ + margin-top: -5px; + } + } + + .payment-status { + display: flex; + flex-direction: column; + + .payment-text { + + span { + font-size: 14px; + } + } + + .status { + margin-top: 2px; + } + } + + .horizontal-rule { + margin-top: 1.1%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + } + + .order-details{ + display: none; + } + + .total { + margin-top: 5%; + height: 130px; + + .calculate { + width: 100%; + float: left; + + .sub-total { + + .left { + margin-left: 0px; + width:100px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .ship-handle { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .discount { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .grand-total { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + + .due { + + .left { + margin-left: 0px; + } + + .middle { + display: none; + } + + .right { + float:right; + width:25%; + } + } + } + } + + .horizontal-rule { + display: none; + } + + .table { + display:none; + } + + .product-config { + border: 1px solid #E8E8E8; + height: 19%; + width:100%; + margin-top: 10px; + display: block; + + .product-attribute { + display: flex; + flex-direction: row; + + .product-property { + width: 30%; + margin-top: 10px; + margin-left: 5px; + + span { + font-size: 14px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + } + + .property-name { + margin-top: 10px; + width:50%; + + span { + font-size: 16px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + } + } + + } + + .order-information { + flex-direction: column; + + .order-address-method { + width : 250px; + } + + .order-address-method:nth-child(3) { + margin-top: 10px; + } + + .order-address-method:nth-child(2) { + margin-top: 10px; + } + + .order-address-method:nth-child(4) { + margin-top: 10px; + } + + } + } + +} +// responsive order css end here + // checkout starts here -.checkout-process { +.checkout-process{ display: flex; flex-direction: row; width: 100%; @@ -2133,7 +3205,7 @@ section.cart { justify-content: space-between; width: 100%; padding-bottom: 15px; - border-bottom: 1px solid #E8E8E8; + border-bottom: 1px solid #E8E8E8;; li { height: 48px; @@ -2169,8 +3241,8 @@ section.cart { &.completed { cursor: pointer; - .decorator { - background-image: url('../images/complete.svg'); + img { + margin: auto; } } @@ -2266,6 +3338,14 @@ section.cart { } } + .horizontal-rule { + margin-top: 6%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + .payble-amount { margin-top: 12px; @@ -2280,6 +3360,7 @@ section.cart { } .right { + float:right; font-size: 16px; color: #242424; @@ -2289,8 +3370,341 @@ section.cart { } } } + // checkout ends here +// responsive checkout start here + +@media all and (max-width: 480px) { + .checkout-process{ + width: 100%; + margin-top: 3%; + + .left-side { + width: 100%; + margin-right: 0%; + height: 60px; + + .checkout-menu { + width: 100%; + + ul.checkout-detail { + height: 60px; + width: 100%; + padding: 5px; + + li { + height: 48px; + + .wrapper { + display: flex; + + span { + display: none; + } + } + } + + .line { + margin-top: 23px; + width: 100%; + margin-left: 5px; + margin-right: 5px; + border: 1px solid #E7E7E7; + height: 1px; + } + } + + .horizontal-rule { + display: none; + } + } + } + + .right-side { + display: none; + } + } + + .order-info{ + width: 100%; + margin-right: 0%; + margin-top: 10px; + height:50px; + + .control-group { + + .control{ + width:100%; + } + } + + .different-billing-addr { + margin-top: 5%; + } + + .horizontal-rule { + margin-top: 10%; + } + + .countinue-button { + margin-top: 8%; + } + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + + .checkout-process{ + width: 100%; + margin-top:3%; + + .left-side { + width: 100%; + margin-right: 0%; + height: 60px; + + .checkout-menu { + width: 100%; + + ul.checkout-detail { + height: 60px; + width: 100%; + padding: 5px; + + li { + height: 48px; + + .wrapper { + display:flex; + + span { + display: none; + } + + } + } + + .line { + margin-top: 23px; + width: 100%; + margin-left: 10px; + margin-right: 10px; + border: 1px solid #E7E7E7; + height: 1px; + } + } + + .horizontal-rule { + display: none; + } + } + } + + .right-side { + display:none; + } + } + + .order-info{ + width: 100%; + margin-right: 0%; + margin-top: 10px; + height:50px; + + .control-group { + + .control{ + width:100%; + } + } + + .different-billing-addr { + margin-top: 3%; + } + + .horizontal-rule { + margin-top: 10%; + } + + .countinue-button { + margin-top: 5%; + } + } +} +// responsive checkout end here + + + +//shipment start here +.ship-method { + width: 67%; + margin-right: 6%; + height: 600px; + margin-top: -190px; + + .ship-info { + + .ship-text{ + font-size: 24px; + color: #242424; + letter-spacing: -0.58px; + font-weight: bold; + } + } + + .ship-price { + margin-top: 31px; + + .price-checkbox { + display:flex; + + span { + margin-left: 8px; + font-size: 16px; + color: #242424; + line-height: 22px; + font-weight: bold; + } + + } + + .price-checkbox-text { + margin-left: 25px; + width:580px; + height:44px; + margin-top: 4px; + + b { + font-size: 16px; + } + + span { + font-size: 16px; + color: #242424; + line-height: 22px; + } + } + + + } + + .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + + .countinue-button { + margin-top: 3%; + + button { + background: #0031F0; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.26px; + text-align: center; + height: 38px; + width: 137px; + border: none; + } + } +} +//shipment end here + +// payment method start here +.payment-method { + width: 67%; + margin-right: 6%; + height: 600px; + margin-top: -190px; + + .payment-info { + + .payment-text{ + font-size: 24px; + color: #242424; + letter-spacing: -0.58px; + font-weight: bold; + } + } + + .payment-price { + margin-top: 31px; + + .payment-checkbox { + display:flex; + + span { + margin-left: 8px; + font-size: 16px; + color: #242424; + line-height: 22px; + font-weight: bold; + } + + } + + .payment-checkbox-text { + margin-left: 25px; + width:580px; + height:44px; + margin-top: 4px; + + b { + font-size: 16px; + } + + span { + font-size: 16px; + color: #242424; + line-height: 22px; + } + } + + + } + + .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + + .countinue-button { + margin-top: 3%; + + button { + background: #0031F0; + font-size: 14px; .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + color: #FFFFFF; + letter-spacing: -0.26px; .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + text-align: center; + height: 38px; + width: 137px; + border: none; + } + } +} +// payment method end here + + // complete page start here .complete-page{ width:880px; @@ -2822,4 +4236,59 @@ section.review { } } } -// review page start here \ No newline at end of file + +// review page end here + + +// customer section css start here + +.cusomer-section { + margin-left: 50px; + width:100%; + + .customer-section-info { + display: flex; + flex-direction: row; + border-top: 1px solid #E8E8E8; + + .pro-img { + margin-top: 10px; + margin-bottom: 5px; + + img { + height: 125px; + width: 100px; + } + } + + .pro-discription { + margin-left: 20px; + width: 100%; + + .title { + font-size: 16px; + color: #0031F0; + margin-top: 15px; + } + + .rating { + margin-top: 10px; + + .icon { + height: 16px; + width: 16px; + } + } + + .discription { + margin-top: 15px; + } + } + } + + .customer-section-info:last-child { + border-bottom: 1px solid #e8e8e8; + } +} + +// customer section css end here \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss b/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss index 762f456ae..d4c2de509 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/icons.scss @@ -29,4 +29,28 @@ background-image:URL('../images/icon-list-view.svg'); width: 24px; height: 24px; +} + +.sort-icon { + background-image:URL('../images/icon-sort.svg'); + width: 24px; + height: 24px; +} + +.filter-icon { + background-image:URL('../images/icon-filter.svg'); + width: 24px; + height: 24px; +} + +.whishlist-icon { + background-image:URL('../images/wishlist.svg'); + width: 24px; + height: 24px; +} + +.share-icon { + background-image:URL('../images/icon-share.svg'); + width: 24px; + height: 24px; } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index f183767ed..1ad002407 100644 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -60,7 +60,8 @@ return [ 'checkout' => [ 'cart' => [ - + 'title' => 'Shopping Cart', + 'empty' => 'Shopping Cart Is Empty', ], 'onepage' => [ diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php index e69de29bb..361731c3b 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/cart/index.blade.php @@ -0,0 +1,141 @@ +@extends('shop::layouts.master') + +@section('page_title') + {{ __('shop::app.checkout.cart.title') }} +@stop + +@section('content-wrapper') + + @inject ('productImageHelper', 'Webkul\Product\Product\ProductImage') + +
+ + @if ($cart) + +
+ {{ __('shop::app.checkout.cart.title') }} +
+ +
+ +
+ + @foreach($cart->items as $item) + + product; + + $productBaseImage = $productImageHelper->getProductBaseImage($product); + ?> + +
+
+ +
+ +
+ +
+ {{ $product->name }} +
+ +
+ + {{ $item->price }} + + + $25.00 + + + 10% Off + +
+ +
+ Color : Gray, Size : S +
+ +
+
Quantity
+
{{ $item->quantity }}
+ Remove + Move to Wishlist +
+
+ +
+ @endforeach + +
+ Continue Shopping + +
+
+ +
+
+
+ Price Detail +
+
+ @foreach($cart->items as $item) +
+ {{ $item->product->name }} + $ {{ $item->price }} +
+ @endforeach +
+ +
+ +
+ Amount Payable + $75.00 +
+ +
+
+ + Apply Coupon + +
+ +
+ + + +
+
Coupon Used
+
+ Coupon 1 + $15 +
+
+ Coupon 2 + $5 +
+
+ +
+ +
+ Amount Payable + $75.00 +
+ +
+ +
+ +
+ + @else + +
+ {{ __('shop::app.checkout.cart.empty') }} +
+ + @endif +
+ +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php index 96642d85b..28e088e00 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php @@ -124,7 +124,7 @@ @foreach (country()->all() as $code => $country) - + @endforeach @@ -264,7 +264,7 @@ @foreach (country()->all() as $code => $country) - + @endforeach diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php index 04e2ffe77..6bfb724f0 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php @@ -16,7 +16,7 @@ {{ $rate->method_title }} - {{ $rate->price }} + {{ core()->currency($rate->price) }} @endforeach diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php index 3f4fd72c8..60cdced18 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/reviews/reviews.blade.php @@ -1 +1,44 @@ -

Customer Reviews page

\ No newline at end of file +@inject ('productImageHelper', 'Webkul\Product\Product\ProductImage') + +@extends('shop::layouts.master') +@section('content-wrapper') + +@endsection \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php index 72fa0b8da..78c921a49 100644 --- a/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/header/index.blade.php @@ -147,14 +147,8 @@ -
+
@include('shop::layouts.header.nav-menu.navmenu')
- -@push('scripts') - -@endpush \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/add-to-cart.blade.php b/packages/Webkul/Shop/src/Resources/views/products/add-to-cart.blade.php index b156d03f0..03cb40b04 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/add-to-cart.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/add-to-cart.blade.php @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/buy-now.blade.php b/packages/Webkul/Shop/src/Resources/views/products/buy-now.blade.php new file mode 100644 index 000000000..a46559ed5 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/products/buy-now.blade.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/index.blade.php b/packages/Webkul/Shop/src/Resources/views/products/index.blade.php index 5ba187260..2ccb1f27c 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/index.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/index.blade.php @@ -44,4 +44,90 @@ -@stop \ No newline at end of file +@stop + + +@push('scripts') + + + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/card.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/card.blade.php index fcf42cf63..485a8569a 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/list/card.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/card.blade.php @@ -11,9 +11,9 @@ \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php index ed9764ac9..352acda1d 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php @@ -3,13 +3,13 @@
- +
@push('scripts') + +@endpush + + + diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php index de7dc2f49..bcd24f163 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php @@ -27,10 +27,10 @@
- - + @@ -41,17 +41,17 @@
- getConfigurationConfig($product) ?> + {{-- getConfigurationConfig($product) ?> --}} diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php index 11e8eb560..f877278f7 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/reviews.blade.php @@ -1,5 +1,4 @@ @inject ('reviewHelper', 'Webkul\Product\Product\Review') - @if ($total = $reviewHelper->getTotalReviews($product))
- @foreach ($reviewHelper->getReviews($product)->paginate(5) as $review) + @foreach ($reviewHelper->getReviews($product)->paginate(10) as $review)
{{ $review->title }} @@ -45,7 +46,7 @@ @for ($i = 1; $i <= $review->rating; $i++) - + @endfor @@ -55,7 +56,7 @@
- {{ __('shop::app.products.by', ['name' => $review->customer->name]) }}, + {{ __('shop::app.products.by', ['name' => $review->customer->name]) }}, diff --git a/public/themes/default/assets/css/shop.css b/public/themes/default/assets/css/shop.css index 078ee3a0c..af04610fa 100644 --- a/public/themes/default/assets/css/shop.css +++ b/public/themes/default/assets/css/shop.css @@ -31,6 +31,30 @@ height: 24px; } +.sort-icon { + background-image: URL("../images/icon-sort.svg"); + width: 24px; + height: 24px; +} + +.filter-icon { + background-image: URL("../images/icon-filter.svg"); + width: 24px; + height: 24px; +} + +.whishlist-icon { + background-image: URL("../images/wishlist.svg"); + width: 24px; + height: 24px; +} + +.share-icon { + background-image: URL("../images/icon-share.svg"); + width: 24px; + height: 24px; +} + body { margin: 0; padding: 0; @@ -817,7 +841,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon { - background-image: url("../images/arrow-up.svg") !important; + background-image: url("../images//arrow-up.svg") !important; } .main-container-wrapper { @@ -828,8 +852,14 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } .main-container-wrapper .content-container { - display: inline-block; + display: -webkit-box; + display: -ms-flexbox; + display: flex; width: 100%; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; } .main-container-wrapper .product-grid { @@ -907,6 +937,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { border-radius: 0px; margin-right: 10px; text-transform: uppercase; + white-space: nowrap; } .main-container-wrapper .product-list .product-card { @@ -947,6 +978,14 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { line-height: 45px; } +.main-container-wrapper .top-toolbar .page-info span:first-child { + display: inline; +} + +.main-container-wrapper .top-toolbar .page-info span:last-child { + display: none; +} + .main-container-wrapper .top-toolbar .pager { float: right; } @@ -979,6 +1018,10 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { margin-right: 10px; } +.main-container-wrapper .top-toolbar .pager .view-mode .sort-filter { + display: none; +} + .main-container-wrapper .top-toolbar .pager .sorter { display: inline-block; margin-right: 10px; @@ -988,6 +1031,10 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { display: inline-block; } +.main-container-wrapper .reponsive-sorter-limiter { + display: none; +} + .main-container-wrapper .bottom-toolbar { display: block; margin-top: 40px; @@ -1070,18 +1117,152 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } @media all and (max-width: 480px) { - .main-container-wrapper { - width: 100% !important; - margin-left: auto; - margin-right: auto; + .main-container-wrapper .content-container { + -webkit-box-orient: vertical; + -webkit-box-direction: reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .main-container-wrapper .layered-filter-wrapper { + display: none; + } + .main-container-wrapper .main { + width: 92%; + margin-left: 4%; + } + .main-container-wrapper .product-grid.max-2-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-grid.max-3-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-grid.max-4-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-card .product-ratings .total-reviews { + display: none; + } + .main-container-wrapper .product-card .cart-fav-seg .addtocart { + font-size: 12px; + } + .main-container-wrapper .top-toolbar { + border-bottom: 1px solid #E8E8E8; + margin-bottom: 10px; + } + .main-container-wrapper .top-toolbar .page-info span:first-child { + display: none; + } + .main-container-wrapper .top-toolbar .page-info span:last-child { + display: inline; + font-size: 18px; + } + .main-container-wrapper .top-toolbar .pager .view-mode { + margin-right: 0px; + } + .main-container-wrapper .top-toolbar .pager .view-mode a, .main-container-wrapper .top-toolbar .pager .view-mode span { + display: none; + } + .main-container-wrapper .top-toolbar .pager .view-mode a.grid-view, .main-container-wrapper .top-toolbar .pager .view-mode span.grid-view { + display: none; + } + .main-container-wrapper .top-toolbar .pager .view-mode .sort-filter { + margin-top: 15px; + display: inline-block; + } + .main-container-wrapper .top-toolbar .pager .sorter { + display: none; + } + .main-container-wrapper .top-toolbar .pager .limiter { + display: none; + } + .main-container-wrapper .reponsive-sorter-limiter { + display: none; + } + .main-container-wrapper .reponsive-sorter-limiter select { + background: #FFFFFF; + border: 1px solid #C7C7C7; + border-radius: 3px; + font-size: 16px; + color: #242424; + padding: 10px; + } + .main-container-wrapper .bottom-toolbar { + margin-bottom: 80px; } } @media all and (min-width: 481px) and (max-width: 920px) { - .main-container-wrapper { - width: 90%; - margin-left: auto; - margin-right: auto; + .main-container-wrapper .content-container { + -webkit-box-orient: vertical; + -webkit-box-direction: reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .main-container-wrapper .layered-filter-wrapper { + display: none; + } + .main-container-wrapper .main { + width: 92%; + margin-left: 4%; + } + .main-container-wrapper .product-grid.max-2-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-grid.max-3-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-grid.max-4-col { + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); + } + .main-container-wrapper .product-card .product-ratings .total-reviews { + display: none; + } + .main-container-wrapper .product-card .cart-fav-seg .addtocart { + font-size: 12px; + } + .main-container-wrapper .top-toolbar { + border-bottom: 1px solid #E8E8E8; + margin-bottom: 10px; + } + .main-container-wrapper .top-toolbar .page-info span:first-child { + display: none; + } + .main-container-wrapper .top-toolbar .page-info span:last-child { + display: inline; + font-size: 18px; + } + .main-container-wrapper .top-toolbar .pager .view-mode { + margin-right: 0px; + } + .main-container-wrapper .top-toolbar .pager .view-mode a, .main-container-wrapper .top-toolbar .pager .view-mode span { + display: none; + } + .main-container-wrapper .top-toolbar .pager .view-mode a.grid-view, .main-container-wrapper .top-toolbar .pager .view-mode span.grid-view { + display: none; + } + .main-container-wrapper .top-toolbar .pager .view-mode .sort-filter { + margin-top: 15px; + display: inline-block; + } + .main-container-wrapper .top-toolbar .pager .sorter { + display: none; + } + .main-container-wrapper .top-toolbar .pager .limiter { + display: none; + } + .main-container-wrapper .reponsive-sorter-limiter { + display: none; + } + .main-container-wrapper .reponsive-sorter-limiter select { + background: #FFFFFF; + border: 1px solid #C7C7C7; + border-radius: 3px; + font-size: 16px; + color: #242424; + padding: 10px; + } + .main-container-wrapper .bottom-toolbar { + margin-bottom: 80px; } } @@ -1419,9 +1600,6 @@ section.product-detail div.layouter form { -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; - -webkit-box-pack: justify; - -ms-flex-pack: justify; - justify-content: space-between; width: 100%; } @@ -1508,10 +1686,28 @@ section.product-detail div.layouter form div.product-image-group div .product-he display: block; position: relative; background: #F2F2F2; - width: 480px; + width: 100%; max-height: 480px; } +section.product-detail div.layouter form div.product-image-group div .product-hero-image img { + width: 100%; + height: 480px; + max-height: 480px; +} + +section.product-detail div.layouter form div.product-image-group div .product-hero-image .whishlist-icon { + margin-top: -480px; + float: right; + margin-right: 10px; +} + +section.product-detail div.layouter form div.product-image-group div .product-hero-image .share-icon { + margin-top: -480px; + float: right; + margin-right: 40px; +} + section.product-detail div.layouter form div.product-image-group div .product-hero-image .wishlist { position: absolute; top: 10px; @@ -1526,17 +1722,23 @@ section.product-detail div.layouter form div.product-image-group div .product-he section.product-detail div.layouter form div.product-image-group .cart-fav-seg { display: block; + margin-top: 10px; +} + +section.product-detail div.layouter form div.product-image-group .cart-fav-seg .addtocart { + border-radius: 0px; + width: 49%; + background: black; +} + +section.product-detail div.layouter form div.product-image-group .cart-fav-seg .buynow { + border-radius: 0px; + width: 49%; float: right; } -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%; + width: 47.5%; } section.product-detail div.layouter form .details .product-price { @@ -1597,6 +1799,10 @@ section.product-detail div.layouter form .details .accordian .accordian-header { font-weight: 600; } +section.product-detail div.layouter form .details .accordian .accordian-content { + padding: 20px 0px; +} + section.product-detail div.layouter form .details .attributes { display: block; width: 100%; @@ -1607,6 +1813,104 @@ section.product-detail div.layouter form .details .full-description { font-size: 16px; } +@media all and (max-width: 480px) { + section.product-detail div.category-breadcrumbs { + display: none; + } + section.product-detail div.layouter form { + display: block; + } + section.product-detail div.layouter form div.product-image-group { + margin-right: 0px; + } + section.product-detail div.layouter form div.product-image-group div { + -webkit-box-orient: vertical; + -webkit-box-direction: reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list { + height: 140px; + margin-top: 5px; + width: 100%; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + overflow-x: scroll; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame img { + height: 100%; + width: auto; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control { + display: none; + } + section.product-detail div.layouter form div.product-image-group div .product-hero-image { + width: 100%; + } + section.product-detail div.layouter form div.product-image-group div .product-hero-image img { + width: 100%; + } + section.product-detail div.layouter form .details { + width: 100%; + margin-top: 20px; + border-bottom: 1px solid #e8e8e8e8; + } + section.product-detail div.layouter form .details .attributes { + border-bottom: none; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + section.product-detail div.category-breadcrumbs { + display: none; + } + section.product-detail div.layouter form { + display: block; + } + section.product-detail div.layouter form div.product-image-group { + margin-right: 0px; + } + section.product-detail div.layouter form div.product-image-group div { + -webkit-box-orient: vertical; + -webkit-box-direction: reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list { + height: 140px; + margin-top: 5px; + width: 100%; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + overflow-x: scroll; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list .thumb-frame img { + height: 100%; + width: auto; + } + section.product-detail div.layouter form div.product-image-group div .thumb-list .gallery-control { + display: none; + } + section.product-detail div.layouter form div.product-image-group div .product-hero-image { + width: 100%; + } + section.product-detail div.layouter form div.product-image-group div .product-hero-image img { + width: 100%; + } + section.product-detail div.layouter form .details { + width: 100%; + margin-top: 20px; + border-bottom: 1px solid #e8e8e8e8; + } + section.product-detail div.layouter form .details .attributes { + border-bottom: none; + } +} + .rating-reviews .rating-header { font-weight: 600; padding: 20px 0; @@ -1937,6 +2241,30 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo margin-right: auto; } +@media all and (max-width: 480px) { + .attached-products-wrapper .title .border-bottom { + border-bottom: 1px solid rgba(162, 162, 162, 0.2); + display: inline-block; + width: 100%; + position: initial; + top: 40px; + left: 0%; + margin-left: 0px; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + .attached-products-wrapper .title .border-bottom { + border-bottom: 1px solid rgba(162, 162, 162, 0.2); + display: inline-block; + width: 100%; + position: initial; + top: 40px; + left: 0%; + margin-left: 0px; + } +} + .order { margin-left: 5.5%; margin-top: 1%; @@ -2213,6 +2541,462 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #3A3A3A; } +@media all and (max-width: 480px) { + .order { + margin-left: 0%; + } + .order .order-section-head { + display: none; + } + .order .order-section-head-small { + display: block; + margin-top: -15px; + } + .order .order-section-head-small span { + display: inline-block; + width: 33.3%; + } + .order .order-section-head-small .icon { + float: left; + } + .order .order-section-head-small .icon img { + margin-top: 11px; + } + .order .order-section-head-small .order-number { + text-align: center; + font-size: 16px; + color: #242424; + letter-spacing: -0.38px; + text-align: center; + margin-top: 13px; + margin-bottom: 13px; + } + .order .order-section-head-small .cancel { + float: right; + text-align: right; + font-size: 17px; + color: #0031F0; + letter-spacing: -0.11px; + margin-top: 13px; + margin-bottom: 13px; + } + .order .order-section-head-small .horizon-rule { + border: .5px solid #E8E8E8; + width: 150%; + margin-left: -10%; + margin-right: -10%; + } + .order .payment-place { + font-size: 16px; + color: #5e5e5e; + margin-top: 4%; + } + .order .payment-place .placed-on { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .payment-place .placed-on .place-text { + width: 100%; + } + .order .payment-place .placed-on .place-text span { + font-size: 14px; + } + .order .payment-place .placed-on .place-text .processing { + display: block; + float: right; + background: #2ED04C; + height: 25px; + border-radius: 100px; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.12px; + width: 110px; + text-align: center; + padding-top: 3.5px; + padding-left: 5px; + margin-top: 3px; + } + .order .payment-place .placed-on .place-date { + margin-top: -5px; + } + .order .payment-place .payment-status { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .payment-place .payment-status .payment-text span { + font-size: 14px; + } + .order .payment-place .payment-status .status { + margin-top: 2px; + } + .order .payment-place .horizontal-rule { + margin-top: 1.1%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + .order .order-details { + display: none; + } + .order .total { + margin-top: 5%; + height: 130px; + } + .order .total .calculate { + width: 100%; + float: left; + } + .order .total .calculate .sub-total .left { + margin-left: 0px; + width: 100px; + } + .order .total .calculate .sub-total .middle { + display: none; + } + .order .total .calculate .sub-total .right { + float: right; + width: 25%; + } + .order .total .calculate .ship-handle .left { + margin-left: 0px; + } + .order .total .calculate .ship-handle .middle { + display: none; + } + .order .total .calculate .ship-handle .right { + float: right; + width: 25%; + } + .order .total .calculate .discount .left { + margin-left: 0px; + } + .order .total .calculate .discount .middle { + display: none; + } + .order .total .calculate .discount .right { + float: right; + width: 25%; + } + .order .total .calculate .grand-total .left { + margin-left: 0px; + } + .order .total .calculate .grand-total .middle { + display: none; + } + .order .total .calculate .grand-total .right { + float: right; + width: 25%; + } + .order .total .calculate .due .left { + margin-left: 0px; + } + .order .total .calculate .due .middle { + display: none; + } + .order .total .calculate .due .right { + float: right; + width: 25%; + } + .order .horizontal-rule { + display: none; + } + .order .table { + display: none; + } + .order .product-config { + border: 1px solid #E8E8E8; + height: 19%; + width: 100%; + margin-top: 10px; + display: block; + } + .order .product-config .product-attribute { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .order .product-config .product-attribute .product-property { + width: 30%; + margin-top: 10px; + margin-left: 5px; + } + .order .product-config .product-attribute .product-property span { + font-size: 14px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + .order .product-config .product-attribute .property-name { + margin-top: 10px; + width: 50%; + } + .order .product-config .product-attribute .property-name span { + font-size: 16px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + .order .order-information { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .order-information .order-address-method { + width: 250px; + } + .order .order-information .order-address-method:nth-child(3) { + margin-top: 10px; + } + .order .order-information .order-address-method:nth-child(2) { + margin-top: 10px; + } + .order .order-information .order-address-method:nth-child(4) { + margin-top: 10px; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + .order { + margin-left: 0%; + } + .order .order-section-head { + display: none; + } + .order .order-section-head-small { + display: block; + margin-top: -15px; + } + .order .order-section-head-small span { + display: inline-block; + width: 33.3%; + } + .order .order-section-head-small .icon { + float: left; + } + .order .order-section-head-small .icon img { + margin-top: 11px; + } + .order .order-section-head-small .order-number { + text-align: center; + font-size: 16px; + color: #242424; + letter-spacing: -0.38px; + text-align: center; + margin-top: 13px; + margin-bottom: 13px; + } + .order .order-section-head-small .cancel { + float: right; + text-align: right; + font-size: 17px; + color: #0031F0; + letter-spacing: -0.11px; + margin-top: 13px; + margin-bottom: 13px; + } + .order .order-section-head-small .horizon-rule { + border: .5px solid #E8E8E8; + width: 150%; + margin-left: -10%; + margin-right: -10%; + } + .order .payment-place { + font-size: 16px; + color: #5e5e5e; + margin-top: 4%; + } + .order .payment-place .placed-on { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .payment-place .placed-on .place-text { + width: 100%; + } + .order .payment-place .placed-on .place-text span { + font-size: 14px; + } + .order .payment-place .placed-on .place-text .processing { + display: block; + float: right; + background: #2ED04C; + height: 25px; + border-radius: 100px; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.12px; + width: 110px; + text-align: center; + padding-top: 3.5px; + padding-left: 5px; + margin-top: 3px; + } + .order .payment-place .placed-on .place-date { + margin-top: -5px; + } + .order .payment-place .payment-status { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .payment-place .payment-status .payment-text span { + font-size: 14px; + } + .order .payment-place .payment-status .status { + margin-top: 2px; + } + .order .payment-place .horizontal-rule { + margin-top: 1.1%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; + } + .order .order-details { + display: none; + } + .order .total { + margin-top: 5%; + height: 130px; + } + .order .total .calculate { + width: 100%; + float: left; + } + .order .total .calculate .sub-total .left { + margin-left: 0px; + width: 100px; + } + .order .total .calculate .sub-total .middle { + display: none; + } + .order .total .calculate .sub-total .right { + float: right; + width: 25%; + } + .order .total .calculate .ship-handle .left { + margin-left: 0px; + } + .order .total .calculate .ship-handle .middle { + display: none; + } + .order .total .calculate .ship-handle .right { + float: right; + width: 25%; + } + .order .total .calculate .discount .left { + margin-left: 0px; + } + .order .total .calculate .discount .middle { + display: none; + } + .order .total .calculate .discount .right { + float: right; + width: 25%; + } + .order .total .calculate .grand-total .left { + margin-left: 0px; + } + .order .total .calculate .grand-total .middle { + display: none; + } + .order .total .calculate .grand-total .right { + float: right; + width: 25%; + } + .order .total .calculate .due .left { + margin-left: 0px; + } + .order .total .calculate .due .middle { + display: none; + } + .order .total .calculate .due .right { + float: right; + width: 25%; + } + .order .horizontal-rule { + display: none; + } + .order .table { + display: none; + } + .order .product-config { + border: 1px solid #E8E8E8; + height: 19%; + width: 100%; + margin-top: 10px; + display: block; + } + .order .product-config .product-attribute { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .order .product-config .product-attribute .product-property { + width: 30%; + margin-top: 10px; + margin-left: 5px; + } + .order .product-config .product-attribute .product-property span { + font-size: 14px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + .order .product-config .product-attribute .property-name { + margin-top: 10px; + width: 50%; + } + .order .product-config .product-attribute .property-name span { + font-size: 16px; + color: #5E5E5E; + letter-spacing: -0.11px; + } + .order .order-information { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .order .order-information .order-address-method { + width: 250px; + } + .order .order-information .order-address-method:nth-child(3) { + margin-top: 10px; + } + .order .order-information .order-address-method:nth-child(2) { + margin-top: 10px; + } + .order .order-information .order-address-method:nth-child(4) { + margin-top: 10px; + } +} + .checkout-process { display: -webkit-box; display: -ms-flexbox; @@ -2284,8 +3068,8 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo cursor: pointer; } -.checkout-process .col-main ul.checkout-steps li.completed .decorator { - background-image: url("../images/complete.svg"); +.checkout-process .col-main ul.checkout-steps li.completed img { + margin: auto; } .checkout-process .col-main ul.checkout-steps li span { @@ -2369,6 +3153,14 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #242424; } +.checkout-process .col-right .order-summary .horizontal-rule { + margin-top: 6%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; +} + .checkout-process .col-right .order-summary .payble-amount { margin-top: 12px; } @@ -2390,6 +3182,292 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #242424; } +@media all and (max-width: 480px) { + .checkout-process { + width: 100%; + margin-top: 3%; + } + .checkout-process .left-side { + width: 100%; + margin-right: 0%; + height: 60px; + } + .checkout-process .left-side .checkout-menu { + width: 100%; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail { + height: 60px; + width: 100%; + padding: 5px; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li { + height: 48px; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper span { + display: none; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail .line { + margin-top: 23px; + width: 100%; + margin-left: 5px; + margin-right: 5px; + border: 1px solid #E7E7E7; + height: 1px; + } + .checkout-process .left-side .checkout-menu .horizontal-rule { + display: none; + } + .checkout-process .right-side { + display: none; + } + .order-info { + width: 100%; + margin-right: 0%; + margin-top: 10px; + height: 50px; + } + .order-info .control-group .control { + width: 100%; + } + .order-info .different-billing-addr { + margin-top: 5%; + } + .order-info .horizontal-rule { + margin-top: 10%; + } + .order-info .countinue-button { + margin-top: 8%; + } +} + +@media all and (min-width: 481px) and (max-width: 920px) { + .checkout-process { + width: 100%; + margin-top: 3%; + } + .checkout-process .left-side { + width: 100%; + margin-right: 0%; + height: 60px; + } + .checkout-process .left-side .checkout-menu { + width: 100%; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail { + height: 60px; + width: 100%; + padding: 5px; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li { + height: 48px; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper span { + display: none; + } + .checkout-process .left-side .checkout-menu ul.checkout-detail .line { + margin-top: 23px; + width: 100%; + margin-left: 10px; + margin-right: 10px; + border: 1px solid #E7E7E7; + height: 1px; + } + .checkout-process .left-side .checkout-menu .horizontal-rule { + display: none; + } + .checkout-process .right-side { + display: none; + } + .order-info { + width: 100%; + margin-right: 0%; + margin-top: 10px; + height: 50px; + } + .order-info .control-group .control { + width: 100%; + } + .order-info .different-billing-addr { + margin-top: 3%; + } + .order-info .horizontal-rule { + margin-top: 10%; + } + .order-info .countinue-button { + margin-top: 5%; + } +} + +.ship-method { + width: 67%; + margin-right: 6%; + height: 600px; + margin-top: -190px; +} + +.ship-method .ship-info .ship-text { + font-size: 24px; + color: #242424; + letter-spacing: -0.58px; + font-weight: bold; +} + +.ship-method .ship-price { + margin-top: 31px; +} + +.ship-method .ship-price .price-checkbox { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.ship-method .ship-price .price-checkbox span { + margin-left: 8px; + font-size: 16px; + color: #242424; + line-height: 22px; + font-weight: bold; +} + +.ship-method .ship-price .price-checkbox-text { + margin-left: 25px; + width: 580px; + height: 44px; + margin-top: 4px; +} + +.ship-method .ship-price .price-checkbox-text b { + font-size: 16px; +} + +.ship-method .ship-price .price-checkbox-text span { + font-size: 16px; + color: #242424; + line-height: 22px; +} + +.ship-method .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; +} + +.ship-method .countinue-button { + margin-top: 3%; +} + +.ship-method .countinue-button button { + background: #0031F0; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.26px; + text-align: center; + height: 38px; + width: 137px; + border: none; +} + +.payment-method { + width: 67%; + margin-right: 6%; + height: 600px; + margin-top: -190px; +} + +.payment-method .payment-info .payment-text { + font-size: 24px; + color: #242424; + letter-spacing: -0.58px; + font-weight: bold; +} + +.payment-method .payment-price { + margin-top: 31px; +} + +.payment-method .payment-price .payment-checkbox { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.payment-method .payment-price .payment-checkbox span { + margin-left: 8px; + font-size: 16px; + color: #242424; + line-height: 22px; + font-weight: bold; +} + +.payment-method .payment-price .payment-checkbox-text { + margin-left: 25px; + width: 580px; + height: 44px; + margin-top: 4px; +} + +.payment-method .payment-price .payment-checkbox-text b { + font-size: 16px; +} + +.payment-method .payment-price .payment-checkbox-text span { + font-size: 16px; + color: #242424; + line-height: 22px; +} + +.payment-method .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; +} + +.payment-method .countinue-button { + margin-top: 3%; +} + +.payment-method .countinue-button button { + background: #0031F0; + font-size: 14px; + color: #FFFFFF; + letter-spacing: -0.26px; + text-align: center; + height: 38px; + width: 137px; + border: none; +} + +.payment-method .countinue-button button .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; +} + +.payment-method .countinue-button button .horizontal-rule { + margin-top: 7%; + width: 100%; + height: 1px; + vertical-align: middle; + background: #e8e8e8; +} + .complete-page { width: 880px; height: 1050px; @@ -2925,3 +4003,57 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p width: 20px; border: 1px solid blue; } + +.cusomer-section { + margin-left: 50px; + width: 100%; +} + +.cusomer-section .customer-section-info { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + border-top: 1px solid #E8E8E8; +} + +.cusomer-section .customer-section-info .pro-img { + margin-top: 10px; + margin-bottom: 5px; +} + +.cusomer-section .customer-section-info .pro-img img { + height: 125px; + width: 100px; +} + +.cusomer-section .customer-section-info .pro-discription { + margin-left: 20px; + width: 100%; +} + +.cusomer-section .customer-section-info .pro-discription .title { + font-size: 16px; + color: #0031F0; + margin-top: 15px; +} + +.cusomer-section .customer-section-info .pro-discription .rating { + margin-top: 10px; +} + +.cusomer-section .customer-section-info .pro-discription .rating .icon { + height: 16px; + width: 16px; +} + +.cusomer-section .customer-section-info .pro-discription .discription { + margin-top: 15px; +} + +.cusomer-section .customer-section-info:last-child { + border-bottom: 1px solid #e8e8e8; +} diff --git a/public/themes/default/assets/images/10.jpeg b/public/themes/default/assets/images/10.jpeg new file mode 100644 index 000000000..07783af9e Binary files /dev/null and b/public/themes/default/assets/images/10.jpeg differ diff --git a/public/themes/default/assets/images/icon-filter.svg b/public/themes/default/assets/images/icon-filter.svg new file mode 100644 index 000000000..292a6b68a --- /dev/null +++ b/public/themes/default/assets/images/icon-filter.svg @@ -0,0 +1,10 @@ + + + + icon-filter + Created with Sketch. + + + + + \ No newline at end of file diff --git a/public/themes/default/assets/images/icon-sort.svg b/public/themes/default/assets/images/icon-sort.svg new file mode 100644 index 000000000..f52b8f0da --- /dev/null +++ b/public/themes/default/assets/images/icon-sort.svg @@ -0,0 +1,13 @@ + + + + icon-sort + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/public/themes/default/assets/images/m.jpg b/public/themes/default/assets/images/m.jpg new file mode 100644 index 000000000..e69c95c63 Binary files /dev/null and b/public/themes/default/assets/images/m.jpg differ diff --git a/public/themes/default/assets/images/mobile.jpg b/public/themes/default/assets/images/mobile.jpg new file mode 100644 index 000000000..0c2dcd836 Binary files /dev/null and b/public/themes/default/assets/images/mobile.jpg differ