From dbfe16e3bdb3fdfea085a4f9fe3c3706d11d3f95 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Sat, 15 Sep 2018 14:46:16 +0530 Subject: [PATCH 1/5] Rework the merge function else all would be fine --- packages/Webkul/Cart/src/Cart.php | 223 +++++++++++------- .../Shop/src/Resources/assets/sass/app.scss | 6 + .../Resources/views/products/add-to.blade.php | 6 +- public/themes/default/assets/css/shop.css | 6 + 4 files changed, 148 insertions(+), 93 deletions(-) diff --git a/packages/Webkul/Cart/src/Cart.php b/packages/Webkul/Cart/src/Cart.php index 9145f8c18..6df54b6e0 100644 --- a/packages/Webkul/Cart/src/Cart.php +++ b/packages/Webkul/Cart/src/Cart.php @@ -297,103 +297,146 @@ class Cart { public function mergeCart() { if(Cookie::has('cart_session_id')) { + /* + Check for previous cart of customer and + pull products from that cart instance + and then check for unique products + and delete the record with session id + and increase the quantity of the products + that are added again before deleting the + guest cart record. + */ + //To hold the customer ID which is currently logged in + $customer_id = auth()->guard('customer')->user()->id; + + //having the session id saved in the cart. $cart_session_id = Cookie::get('cart_session_id'); - $current_cart = $this->cart->findOneByField('session_id', $cart_session_id); + //pull the record from cart table for above session id. + $guest_cart = $this->cart->findOneByField($cart_session_id); - //it is impossible to not have an entry in cart table and cart_products. - //will later handle the exceoption. - $current_cart_id = $current_cart['id'] ?? $current_cart->id; + if(!isset($guest_cart)) { + dd('Some One Deleted Cart or it wasn\'t there from the start'); - $current_cart_session_id = $current_cart['session_id'] ?? $current_cart->session_id; - - $current_cart_products = $this->cart->getProducts($current_cart_id); - - $customer_id = auth()->guard('customer')->user()->id; //working - - if($cart_session_id == $current_cart_session_id) { - $current_cart_products = array(); - - $customer_cart = $this->cart->findByField(['customer_id'=> $customer_id]); - - //check previous saved cart of customer. - if(!$customer_cart->isEmpty()) { - - $customer_cart_id = $customer_cart->id; - - $customer_cart_products = $this->cart->getProducts($customer_cart_id); - - foreach($current_cart_products as $key => $value) { - - $product_id = $value['id'] ?? $value->id; - - foreach($current_cart_products as $key => $current_cart_product) { - - $current_product_id = $current_cart_product['id'] ?? $current_cart_product->id; - - if($current_product_id == $product_id) { - - unset($current_cart_products[$key]); - } - } - } - - - foreach($current_cart_products as $current_cart_product) { - - $current_cart_product_id = $current_cart_product['id'] ?? $current_cart_product->id; - - $this->cart->attach($current_cart_id, $current_cart_product_id, 1); - } - - $this->cart->update(['customer_id' => $customer_id], $current_cart_id); - - $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); - - $customer_cart_id = $customer_cart->id; - - if($this->cart->getProducts($customer_cart_id) && isset($current_cart_products)) { - foreach($current_cart_products as $key => $value) { - - array_push($cart_products, $current_cart_product); - } - } - - session()->put('cart_data', [$customer_cart, $cart_products]); - - session()->flash('Success', 'Item Added In Cart'); - - dump($cart_products); - - return redirect()->back(); - } else { - - $session_id = session()->getId(); - - $customer_id = auth()->guard('customer')->user()->id; - - $updated_cart = $this->cart->update(['customer_id' => $customer_id, 'session_id' => $session_id], $current_cart_id); - - $updated_cart_products = $this->cart->getProducts($updated_cart->id); - - Cookie::queue('cart_session_id', $session_id, 120); - - session()->put('cart_session_id', $session_id); - - session('cart_data', [$updated_cart, $updated_cart_products]); - - return redirect()->back(); - } - } else { - throw new \Exception('Error, Session discrepancies found.'); - - $this->repairCart($cart_session_id, $id); + return redirect()->back(); } - } else { - throw new \Exception('Nothing found'); - return redirect()->back(); + //check if the current logged in customer is also + //having any previously saved cart instances. + $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); + + } + + // if(Cookie::has('cart_session_id')) { + + // /* + // Check for previous cart of customer and + // pull products from that cart instance + // and then check for unique products + // and delete the record with session id + // and increase the quantity of the products + // that are added again before deleting the + // guest cart record. + // */ + + // $cart_session_id = Cookie::get('cart_session_id'); + + // $current_cart = $this->cart->findOneByField('session_id', $cart_session_id); + + // //it is impossible to not have an entry in cart table and cart_products. + // //will later handle the exceoption. + // $current_cart_id = $current_cart['id'] ?? $current_cart->id; + + // $current_cart_session_id = $current_cart['session_id'] ?? $current_cart->session_id; + + // $current_cart_products = $this->cart->getProducts($current_cart_id); + + // $customer_id = auth()->guard('customer')->user()->id; //working + + // if($cart_session_id == $current_cart_session_id) { + // $current_cart_products = array(); + + // $customer_cart = $this->cart->findByField(['customer_id'=> $customer_id]); + + // //check previous saved cart of customer. + // if(!$customer_cart->isEmpty()) { + + // $customer_cart_id = $customer_cart->id; + + // $customer_cart_products = $this->cart->getProducts($customer_cart_id); + + // foreach($current_cart_products as $key => $value) { + + // $product_id = $value['id'] ?? $value->id; + + // foreach($current_cart_products as $key => $current_cart_product) { + + // $current_product_id = $current_cart_product['id'] ?? $current_cart_product->id; + + // if($current_product_id == $product_id) { + + // unset($current_cart_products[$key]); + // } + // } + // } + + + // foreach($current_cart_products as $current_cart_product) { + + // $current_cart_product_id = $current_cart_product['id'] ?? $current_cart_product->id; + + // $this->cart->attach($current_cart_id, $current_cart_product_id, 1); + // } + + // $this->cart->update(['customer_id' => $customer_id], $current_cart_id); + + // $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); + + // $customer_cart_id = $customer_cart->id; + + // if($this->cart->getProducts($customer_cart_id) && isset($current_cart_products)) { + // foreach($current_cart_products as $key => $value) { + + // array_push($cart_products, $current_cart_product); + // } + // } + + // session()->put('cart_data', [$customer_cart, $cart_products]); + + // session()->flash('Success', 'Item Added In Cart'); + + // dump($cart_products); + + // return redirect()->back(); + // } else { + + // $session_id = session()->getId(); + + // $customer_id = auth()->guard('customer')->user()->id; + + // $updated_cart = $this->cart->update(['customer_id' => $customer_id, 'session_id' => $session_id], $current_cart_id); + + // $updated_cart_products = $this->cart->getProducts($updated_cart->id); + + // Cookie::queue('cart_session_id', $session_id, 120); + + // session()->put('cart_session_id', $session_id); + + // session('cart_data', [$updated_cart, $updated_cart_products]); + + // return redirect()->back(); + // } + // } else { + // throw new \Exception('Error, Session discrepancies found.'); + + // $this->repairCart($cart_session_id, $id); + // } + // } else { + // throw new \Exception('Nothing found'); + + // return redirect()->back(); + // } } } \ 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 2fbcbcb14..799e0760b 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -1412,6 +1412,12 @@ section.product-detail { .cart-fav-seg { display: block; float: right; + + .wishlist { + position: absolute; + margin-top: -500px; + margin-right: -100px; + } } } diff --git a/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php b/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php index 1839cb16b..1ebdd16b1 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/add-to.blade.php @@ -1,7 +1,7 @@
- + @include ('shop::products.add-to-cart', ['product' => $product]) - - + +
\ No newline at end of file diff --git a/public/themes/default/assets/css/shop.css b/public/themes/default/assets/css/shop.css index f15ae984f..b674c2995 100644 --- a/public/themes/default/assets/css/shop.css +++ b/public/themes/default/assets/css/shop.css @@ -1501,6 +1501,12 @@ section.product-detail div.layouter form div.product-image-group .cart-fav-seg { 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%; } From ec6d777b25aa36eb11cf63894e59fd14c0b44f07 Mon Sep 17 00:00:00 2001 From: prashant-webkul Date: Mon, 17 Sep 2018 13:57:32 +0530 Subject: [PATCH 2/5] Cart Working by adding the products as guest and logged in user and merging in case of guest user to logged in. Ready for next phase of checkouts. --- packages/Webkul/Cart/src/Cart.php | 178 ++++++------------ .../src/Http/Controllers/CartController.php | 19 +- packages/Webkul/Cart/src/Models/Cart.php | 2 +- .../Cart/src/Repositories/CartRepository.php | 41 +++- packages/Webkul/Shop/src/Http/routes.php | 2 + 5 files changed, 113 insertions(+), 129 deletions(-) diff --git a/packages/Webkul/Cart/src/Cart.php b/packages/Webkul/Cart/src/Cart.php index 6df54b6e0..9969c4f23 100644 --- a/packages/Webkul/Cart/src/Cart.php +++ b/packages/Webkul/Cart/src/Cart.php @@ -45,7 +45,7 @@ class Cart { $products = array(); - $minutes = 10; + $minutes = 150; if(Cookie::has('cart_session_id')) { @@ -95,21 +95,16 @@ class Cart { return redirect()->back(); } else { - // throw new \Exception('Error, Many or Few Session discrepancies found.'); - + //repair the cart $this->repairCart($cart_session_id, $id); } } else { + //create a new cart instance. $this->createNewCart($id); } } /*helpers*/ - public function makeCartSession($to_process) { - session()->put('cart_session_id', $to_process); - - return session()->get('cart_session_id'); - } /** * Create New Cart @@ -156,6 +151,17 @@ class Cart { return redirect()->back(); } + /** + * This makes session + * cart. + */ + public function makeCartSession($cart_session_id) { + session()->put('cart_session_id', $cart_session_id); + + return session()->get('cart_session_id'); + } + + /** * Reset Session and * Cookie values @@ -296,6 +302,7 @@ class Cart { public function mergeCart() { + //considering cookie as a source of truth. if(Cookie::has('cart_session_id')) { /* Check for previous cart of customer and @@ -314,7 +321,7 @@ class Cart { $cart_session_id = Cookie::get('cart_session_id'); //pull the record from cart table for above session id. - $guest_cart = $this->cart->findOneByField($cart_session_id); + $guest_cart = $this->cart->findOneByField('session_id', $cart_session_id); if(!isset($guest_cart)) { dd('Some One Deleted Cart or it wasn\'t there from the start'); @@ -322,121 +329,54 @@ class Cart { return redirect()->back(); } + $guest_cart_products = $this->cart->getProducts($guest_cart->id); + //check if the current logged in customer is also //having any previously saved cart instances. $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); + if(isset($customer_cart)) { + $customer_cart_products = $this->cart->getProducts($customer_cart->id); + foreach($guest_cart_products as $key => $guest_cart_product) { + + foreach($customer_cart_products as $customer_cart_product) { + + if($guest_cart_product->id == $customer_cart_product->id) { + + $quantity = $guest_cart_product->toArray()['pivot']['quantity'] + 1; + + $pivot = $guest_cart_product->toArray()['pivot']; + + $saveQuantity = $this->cart->updateRelatedForMerge($pivot, 'quantity', $quantity); + + unset($guest_cart_products[$key]); + } + } + } + + //insert the new products here. + foreach ($guest_cart_products as $key => $guest_cart_product) { + $product = $guest_cart_product->toArray(); + + $this->cart->updateRelatedForMerge($product['pivot'], 'cart_id', $customer_cart->id); + } + + //detach with guest cart records + $this->cart->detachAndDeleteParent($guest_cart->id); + + Cookie::queue(Cookie::forget('cart_session_id')); + + return redirect()->back(); + } else { + //this will just update the customer id column in the cart table + $this->cart->update(['customer_id' => $customer_id], $guest_cart->id); + + Cookie::queue(Cookie::forget('cart_session_id')); + + return redirect()->back(); + } } - - // if(Cookie::has('cart_session_id')) { - - // /* - // Check for previous cart of customer and - // pull products from that cart instance - // and then check for unique products - // and delete the record with session id - // and increase the quantity of the products - // that are added again before deleting the - // guest cart record. - // */ - - // $cart_session_id = Cookie::get('cart_session_id'); - - // $current_cart = $this->cart->findOneByField('session_id', $cart_session_id); - - // //it is impossible to not have an entry in cart table and cart_products. - // //will later handle the exceoption. - // $current_cart_id = $current_cart['id'] ?? $current_cart->id; - - // $current_cart_session_id = $current_cart['session_id'] ?? $current_cart->session_id; - - // $current_cart_products = $this->cart->getProducts($current_cart_id); - - // $customer_id = auth()->guard('customer')->user()->id; //working - - // if($cart_session_id == $current_cart_session_id) { - // $current_cart_products = array(); - - // $customer_cart = $this->cart->findByField(['customer_id'=> $customer_id]); - - // //check previous saved cart of customer. - // if(!$customer_cart->isEmpty()) { - - // $customer_cart_id = $customer_cart->id; - - // $customer_cart_products = $this->cart->getProducts($customer_cart_id); - - // foreach($current_cart_products as $key => $value) { - - // $product_id = $value['id'] ?? $value->id; - - // foreach($current_cart_products as $key => $current_cart_product) { - - // $current_product_id = $current_cart_product['id'] ?? $current_cart_product->id; - - // if($current_product_id == $product_id) { - - // unset($current_cart_products[$key]); - // } - // } - // } - - - // foreach($current_cart_products as $current_cart_product) { - - // $current_cart_product_id = $current_cart_product['id'] ?? $current_cart_product->id; - - // $this->cart->attach($current_cart_id, $current_cart_product_id, 1); - // } - - // $this->cart->update(['customer_id' => $customer_id], $current_cart_id); - - // $customer_cart = $this->cart->findOneByField('customer_id', $customer_id); - - // $customer_cart_id = $customer_cart->id; - - // if($this->cart->getProducts($customer_cart_id) && isset($current_cart_products)) { - // foreach($current_cart_products as $key => $value) { - - // array_push($cart_products, $current_cart_product); - // } - // } - - // session()->put('cart_data', [$customer_cart, $cart_products]); - - // session()->flash('Success', 'Item Added In Cart'); - - // dump($cart_products); - - // return redirect()->back(); - // } else { - - // $session_id = session()->getId(); - - // $customer_id = auth()->guard('customer')->user()->id; - - // $updated_cart = $this->cart->update(['customer_id' => $customer_id, 'session_id' => $session_id], $current_cart_id); - - // $updated_cart_products = $this->cart->getProducts($updated_cart->id); - - // Cookie::queue('cart_session_id', $session_id, 120); - - // session()->put('cart_session_id', $session_id); - - // session('cart_data', [$updated_cart, $updated_cart_products]); - - // return redirect()->back(); - // } - // } else { - // throw new \Exception('Error, Session discrepancies found.'); - - // $this->repairCart($cart_session_id, $id); - // } - // } else { - // throw new \Exception('Nothing found'); - - // return redirect()->back(); - // } + return redirect()->back(); } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Http/Controllers/CartController.php b/packages/Webkul/Cart/src/Http/Controllers/CartController.php index 972719384..101d28b9a 100644 --- a/packages/Webkul/Cart/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Cart/src/Http/Controllers/CartController.php @@ -42,7 +42,7 @@ class CartController extends Controller public function __construct(CartRepository $cart, CartProductRepository $cartProduct, CustomerRepository $customer) { - $this->middleware('customer')->except(['add', 'remove']); + $this->middleware('customer')->except(['add', 'remove', 'test']); $this->customer = $customer; @@ -80,4 +80,21 @@ class CartController extends Controller return redirect()->back(); } + + // public function test() { + // $cookie = Cookie::get('cart_session_id'); + + // $cart = $this->cart->findOneByField('session_id', $cookie); + + // $cart_products = $this->cart->getProducts($cart->id); + + // foreach($cart_products as $cart_product) { + // $quantity = $cart_product->toArray()['pivot']['quantity'] + 1; + + // $pivot = $cart_product->toArray()['pivot']; + + // $saveQuantity = $this->cart->saveRelated($pivot, 'quantity', $quantity+1); + // } + // dd('done'); + // } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Models/Cart.php b/packages/Webkul/Cart/src/Models/Cart.php index f03c3a82f..20f376f67 100644 --- a/packages/Webkul/Cart/src/Models/Cart.php +++ b/packages/Webkul/Cart/src/Models/Cart.php @@ -15,6 +15,6 @@ class Cart extends Model protected $hidden = ['coupon_code']; public function with_products() { - return $this->belongsToMany(Product::class, 'cart_products'); + return $this->belongsToMany(Product::class, 'cart_products')->withPivot('id', 'product_id','quantity', 'cart_id'); } } diff --git a/packages/Webkul/Cart/src/Repositories/CartRepository.php b/packages/Webkul/Cart/src/Repositories/CartRepository.php index 0ba0e4b07..e7f951abd 100644 --- a/packages/Webkul/Cart/src/Repositories/CartRepository.php +++ b/packages/Webkul/Cart/src/Repositories/CartRepository.php @@ -16,7 +16,7 @@ class CartRepository extends Repository /** * Specify Model class name * - * @return mixed + * @return Mixed */ function model() @@ -26,7 +26,7 @@ class CartRepository extends Repository /** * @param array $data - * @return mixed + * @return Mixed */ public function create(array $data) @@ -40,7 +40,7 @@ class CartRepository extends Repository * @param array $data * @param $id * @param string $attribute - * @return mixed + * @return Mixed */ public function update(array $data, $id, $attribute = "id") @@ -61,18 +61,43 @@ class CartRepository extends Repository * Method to attach * associations * - * @return Eloquent + * @return Mixed */ public function attach($cart_id, $product_id, $quantity) { - $this->model->findOrFail($cart_id)->with_products()->attach($cart_id, ['product_id' => $product_id, 'cart_id' => $cart_id, 'quantity' => $quantity]); + return $this->model->findOrFail($cart_id)->with_products()->attach($cart_id, ['product_id' => $product_id, 'cart_id' => $cart_id, 'quantity' => $quantity]); } /** - * Method to detach - * associations + * This will update the + * quantity of product + * for the customer, + * in case of merge. * - * @return Eloquent + * @return Mixed */ + public function updateRelatedForMerge($pivot, $column, $value) { + $cart_product = $this->model->findOrFail($pivot['cart_id']); + + return $cart_product->with_products()->updateExistingPivot($pivot['product_id'], array($column => $value)); + } + + /** + * Method to detach + * associations. + * + * Use this only with + * guest cart only. + * + * @return Mixed + */ + public function detachAndDeleteParent($cart_id) { + $cart = $this->model->find($cart_id); + + //apply strict check for verifying guest ownership on this record. + $cart->with_products()->detach(); + + return $this->model->destroy($cart_id); + } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 2f4382ce2..faf6223fc 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -2,6 +2,8 @@ Route::group(['middleware' => ['web']], function () { + Route::get('/test', 'Webkul\Cart\Http\Controllers\CartController@test'); + Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [ 'view' => 'shop::home.index' ])->name('store.home'); From acd048aaf63a3528baf6378500fdc3a6be993319 Mon Sep 17 00:00:00 2001 From: jitendra Date: Wed, 19 Sep 2018 12:28:15 +0530 Subject: [PATCH 3/5] Checkout page --- config/carrier.php | 51 - config/carriers.php | 18 + .../views/catalog/attributes/create.blade.php | 1 - .../products/accordians/inventories.blade.php | 2 + .../views/layouts/nav-left.blade.php | 2 +- .../views/users/users/index.blade.php | 3 +- .../Http/Controllers/CheckoutController.php | 17 +- .../src/Providers/CartServiceProvider.php | 14 +- packages/Webkul/Core/src/Core.php | 4 +- ...083025_create_customer_addresses_table.php | 1 + .../src/{Carrier => Carriers}/FlatRate.php | 9 +- .../src/Contracts/AbstractShipping.php | 2 - packages/Webkul/Shipping/src/Helper/Rate.php | 31 - packages/Webkul/Shipping/src/Helpers/Rate.php | 29 + .../src/Providers/ShippingServiceProvider.php | 8 - packages/Webkul/Shop/src/Http/routes.php | 4 +- .../Shop/src/Resources/assets/js/app.js | 2 + .../assets/js/components/category-item.vue | 1 - .../Shop/src/Resources/assets/sass/app.scss | 289 +-- .../Webkul/Shop/src/Resources/lang/en/app.php | 33 + .../index.blade.php => cart.blade.php} | 0 .../views/checkout/onepage.blade.php | 121 ++ .../checkout/onepage/customer-info.blade.php | 278 +++ .../views/checkout/onepage/payment.blade.php | 0 .../views/checkout/onepage/review.blade.php | 0 .../views/checkout/onepage/shipping.blade.php | 0 .../views/checkout/onepage/summary.blade.php | 37 + .../views/checkout/success.blade.php | 0 .../checkout/common/nav-right.blade.php | 36 +- .../views/customers/checkout/index.blade.php | 3 - .../views/products/reviews/index.blade.php | 1 - .../Resources/views/products/view.blade.php | 5 + .../view/configurable-options.blade.php | 15 +- .../views/products/view/gallery.blade.php | 1 - .../Ui/src/Resources/assets/sass/app.scss | 5 + public/themes/default/assets/css/shop.css | 221 +-- public/themes/default/assets/js/shop.js | 1578 ++++++++++++++++- .../themes/default/assets/mix-manifest.json | 2 +- 38 files changed, 2263 insertions(+), 561 deletions(-) delete mode 100644 config/carrier.php create mode 100644 config/carriers.php rename packages/Webkul/Shipping/src/{Carrier => Carriers}/FlatRate.php (64%) delete mode 100644 packages/Webkul/Shipping/src/Helper/Rate.php create mode 100644 packages/Webkul/Shipping/src/Helpers/Rate.php rename packages/Webkul/Shop/src/Resources/views/checkout/{onepage/index.blade.php => cart.blade.php} (100%) create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage/payment.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage/review.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/onepage/summary.blade.php create mode 100644 packages/Webkul/Shop/src/Resources/views/checkout/success.blade.php diff --git a/config/carrier.php b/config/carrier.php deleted file mode 100644 index c6da8a2f0..000000000 --- a/config/carrier.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - [ - 'code' => 'flatrate_one', - 'title' => 'Flatrate One', - 'name' => 'fixed 20% discount for today', - 'description' => 'this is a flat rate', - 'status' => '1', - 'price' => '10', - 'type' => [ - 'per_unit' => 'Per Unit', - 'per order' => 'Per Order', - ], - 'class' => 'Webkul\Shipping\Helper\Rate', - ], - - [ - 'code' => 'flatrate_two', - 'title' => 'Flatrate Two', - 'name' => 'fixed 50% discount till 10/10/2018', - 'description' => 'this is a flat rate', - 'status' => '1', - 'price' => '100', - 'type' => [ - 'per unit' => 'Per Unit', - 'per order' => 'Per Order', - ], - 'class' => 'Webkul\Shipping\Helper\Rate', - ], - - [ - 'code' => 'flatrate_three', - 'title' => 'Flatrate Three', - 'name' => 'fixed 30% discount', - 'description' => 'this is a flat rate', - 'status' => '1', - 'price' => '1000', - 'type' => [ - 'per unit' => 'Per Unit', - 'per order' => 'Per Order', - ], - 'class' => 'Webkul\Shipping\Helper\Rate', - ] - ] - -] - -?> \ No newline at end of file diff --git a/config/carriers.php b/config/carriers.php new file mode 100644 index 000000000..87ef4edc0 --- /dev/null +++ b/config/carriers.php @@ -0,0 +1,18 @@ + [ + 'code' => 'flatrate', + 'title' => 'Flatrate', + 'description' => 'This is a flat rate', + 'status' => '1', + 'default_rate' => '10', + 'type' => [ + 'per_unit' => 'Per Unit', + 'per order' => 'Per Order', + ], + 'class' => 'Webkul\Shipping\Carriers\FlatRate', + ] +]; + +?> \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php index 836447e9d..6c9b5c3fc 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/attributes/create.blade.php @@ -4,7 +4,6 @@ {{ __('admin::app.catalog.attributes.add-title') }} @stop - @section('content')
diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/products/accordians/inventories.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/products/accordians/inventories.blade.php index 7c273c1e6..284ae0cb0 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/products/accordians/inventories.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/products/accordians/inventories.blade.php @@ -18,7 +18,9 @@ ?>
+ + @{{ errors.first('inventories[{!! $inventorySource->id !!}]') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/nav-left.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/nav-left.blade.php index b1e948f9b..5abedf148 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/nav-left.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/nav-left.blade.php @@ -2,7 +2,7 @@