diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index 1ac188592..862e73a87 100644 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -90,6 +90,12 @@ class OrderDataGrid 'wrapper' => function ($value) { return core()->currency($value); } + ], [ + 'name' => 'or.created_at', + 'alias' => 'created_at', + 'type' => 'string', + 'label' => 'Order Date', + 'sortable' => false, ], [ 'name' => 'or.status', 'alias' => 'orstatus', diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index c2ba72402..8e7ad4477 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -184,10 +184,10 @@ class DashboardController extends Controller foreach (core()->getTimeInterval($this->startDate, $this->endDate) as $interval) { $statistics['sale_graph']['label'][] = $interval['start']->format('d M'); - $total = number_format($this->order->scopeQuery(function($query) use($interval) { + $total = $this->order->scopeQuery(function($query) use($interval) { return $query->where('orders.created_at', '>=', $interval['start']) ->where('orders.created_at', '<=', $interval['end']); - })->sum('base_grand_total'), 2); + })->sum('base_grand_total'); $statistics['sale_graph']['total'][] = $total; $statistics['sale_graph']['formated_total'][] = core()->formatBasePrice($total); diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index f9bb47978..845e050c3 100644 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -10,6 +10,7 @@ use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Product\Repositories\ProductRepository; use Webkul\Tax\Repositories\TaxCategoryRepository; use Webkul\Checkout\Models\CartPayment; +use Webkul\Customer\Repositories\WishlistRepository; /** * Facade for all the methods to be implemented in Cart. @@ -62,6 +63,13 @@ class Cart { */ protected $taxCategory; + /** + * WishlistRepository model + * + * @var mixed + */ + protected $wishlist; + /** * Create a new controller instance. * @@ -79,7 +87,8 @@ class Cart { CartAddressRepository $cartAddress, CustomerRepository $customer, ProductRepository $product, - TaxCategoryRepository $taxCategory + TaxCategoryRepository $taxCategory, + WishlistRepository $wishlist ) { $this->customer = $customer; @@ -93,6 +102,8 @@ class Cart { $this->product = $product; $this->taxCategory = $taxCategory; + + $this->wishlist = $wishlist; } /** @@ -298,6 +309,7 @@ class Cart { * @return Booleans */ public function createNewCart($id, $data, $prepared = false, $preparedData = []) { + // dd($id, $data, $prepared,$preparedData); if($prepared == false) { if(isset($data['selected_configurable_option'])) { $canAdd = $this->canAdd($data['selected_configurable_option'], $data['quantity']); @@ -357,8 +369,6 @@ class Cart { //parent item entry if($prepared == false) { $itemData['parent']['additional'] = json_encode($data); - } else { - $itemData['parent']['additional'] = json_encode($preparedData); } if($parent = $this->cartItem->create($itemData['parent'])) { @@ -700,6 +710,7 @@ class Cart { $labels = []; + $attribute = $product->parent->super_attributes; foreach($product->parent->super_attributes as $attribute) { $option = $attribute->options()->where('id', $product->{$attribute->code})->first(); @@ -1128,11 +1139,12 @@ class Cart { $result = $this->moveConfigurableFromWishlistToCart($product->parent_id, $product->id); if(is_array($result)) { + $data['_token'] = 'null'; $data['quantity'] = 1; + $data['product'] = $product->parent_id; + $data['selected_configurable_option'] = $product->id; - $data['selected_configurable_option'] = $product->parent_id; - - $moved = $this->add($data['selected_configurable_option'], $data, true, $result); + $moved = $this->add($product->parent_id, $data, true, $result); if($moved) { return true; @@ -1149,7 +1161,7 @@ class Cart { * @return mixed */ public function moveConfigurableFromWishlistToCart($configurableproductId, $productId) { - // dd('moving configurable'); + // dd($configurableproductId, $productId); $product = $this->product->find($configurableproductId); $canAdd = $this->product->find($productId)->haveSufficientQuantity(1); @@ -1165,7 +1177,7 @@ class Cart { $child = $this->product->findOneByField('id', $productId); $childData = [ - 'product_id' => $configurableproductId, + 'product_id' => $productId, 'sku' => $child->sku, 'name' => $child->name, 'type' => 'simple' @@ -1181,12 +1193,12 @@ class Cart { $additional = [ 'request' => $childData, 'variant_id' => $productId, - 'attributes' => $productAddtionalData + 'attributes' => $productAddtionalData['attributes'] ]; $parentData = [ 'sku' => $product->sku, - 'product_id' => $productId, + 'product_id' => $configurableproductId, 'quantity' => 1, 'type' => $product->type, 'name' => $product->name, @@ -1199,10 +1211,27 @@ class Cart { 'base_total_weight' => $weight, 'additional' => $additional ]; - + // dd(['parent' => $parentData, 'child' => $childData]); return ['parent' => $parentData, 'child' => $childData]; } + /** + * Function to move a already added product to wishlist + * will run only on customer authentication. + * + * @param instance cartItem $id + */ + public function moveToWishlist($itemId) { + $item = $this->cartItem->findOneByField('id', $itemId); + dd($item->cart); + if(!$item) + return false; + + // $wishlist[ + // 'channel_id' => + // ]; + } + /** * Handle the buy now process for simple as well as configurable products * diff --git a/packages/Webkul/Core/src/Models/Search.php b/packages/Webkul/Core/src/Models/Search.php deleted file mode 100644 index 218bb83f9..000000000 --- a/packages/Webkul/Core/src/Models/Search.php +++ /dev/null @@ -1,9 +0,0 @@ -belongsTo(self::class); + return $this->belongsTo(self::class, 'parent_id'); } /** @@ -133,10 +133,10 @@ class Product extends Model { if(!$this->status) return false; - + if($this->haveSufficientQuantity(1)) return true; - + return false; } @@ -247,5 +247,5 @@ class Product extends Model { return new \Webkul\Product\Database\Eloquent\Builder($query); } - + } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Repositories/SearchRepository.php b/packages/Webkul/Product/src/Repositories/SearchRepository.php similarity index 93% rename from packages/Webkul/Core/src/Repositories/SearchRepository.php rename to packages/Webkul/Product/src/Repositories/SearchRepository.php index 37d4dabb6..0b1e1eea2 100644 --- a/packages/Webkul/Core/src/Repositories/SearchRepository.php +++ b/packages/Webkul/Product/src/Repositories/SearchRepository.php @@ -1,6 +1,6 @@ product->searchProductByAttribute($term); - dd($products); + return $products; } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index 5bd465823..682cf0026 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -150,4 +150,16 @@ class CartController extends Controller return redirect()->back(); } } + + /** + * Function to move a already added product to wishlist + * will run only on customer authentication. + * + * @param instance cartItem $id + */ + public function moveToWishlist($id) { + $result = Cart::moveToWishlist($id); + + dd($result); + } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/Controllers/SearchController.php b/packages/Webkul/Shop/src/Http/Controllers/SearchController.php index 9733142a1..d03ca4989 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/SearchController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/SearchController.php @@ -6,7 +6,7 @@ use Webkul\Shop\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Http\Response; -use Webkul\Core\Repositories\SearchRepository as Search; +use Webkul\Product\Repositories\SearchRepository as Search; /** * Search controller @@ -31,15 +31,16 @@ use Webkul\Core\Repositories\SearchRepository as Search; /** * Index to handle the view loaded with the search results */ - public function index() { + public function index() + { $results = null; $results = $this->search->search(request()->all()); if($results) { - return view($this->_config['view'])->with('results', $results); + return view($this->_config['view'])->with('products', $results); } else { - return view($this->_config['view'])->with('results', null); + return view($this->_config['view'])->with('products', null); } } diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 4b896280d..979582677 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -67,6 +67,9 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function //Shop buynow button action Route::get('buynow/{id}', 'Webkul\Shop\Http\Controllers\CartController@test')->name('shop.product.buynow'); + //Shop buynow button action + Route::get('move/cart/{id}', 'Webkul\Shop\Http\Controllers\CartController@moveToWishlist')->name('shop.movetowishlist'); + //Show Product Details Page(For individually Viewable Product) Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [ 'view' => 'shop::products.view' diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index 8b56d9f3b..cb70ff285 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -316,6 +316,14 @@ input { display: block; width: 100%; } +//no search results +.search-result-status { + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} //main store front layouting .main-container-wrapper { @@ -346,27 +354,6 @@ input { grid-auto-rows: auto; } - @media only screen and (max-width: 551px) { - .product-grid-3 { - grid-template-columns: 48.5% 48.5%; - grid-column-gap: 20px; - } - } - - @media only screen and (max-width: 854px) { - .product-grid-4 { - grid-template-columns: 29.5% 29.5% 29.5%; - grid-column-gap: 35px; - } - } - - @media only screen and (max-width: 653px) { - .product-grid-4 { - grid-template-columns: 48.5% 48.5%; - grid-column-gap: 17px; - } - } - .product-card { position: relative; @@ -442,6 +429,33 @@ input { } } + @media only screen and (max-width: 580px) { + .main-container-wrapper { + padding: 0px; + } + } + //product components + @media only screen and (max-width: 551px) { + .product-grid-3 { + grid-template-columns: 48.5% 48.5%; + grid-column-gap: 20px; + } + } + + @media only screen and (max-width: 854px) { + .product-grid-4 { + grid-template-columns: 29.5% 29.5% 29.5%; + grid-column-gap: 35px; + } + } + + @media only screen and (max-width: 653px) { + .product-grid-4 { + grid-template-columns: 48.5% 48.5%; + grid-column-gap: 17px; + } + } + @media only screen and (max-width: 425px) { .product-card { font-size: 90%; @@ -561,6 +575,13 @@ input { } } +@media only screen and (max-width: 530px) { + .main-container-wrapper { + padding-left: 0px; + padding-right: 0px; + } +} + //slider styles section.slider-block { display: block; @@ -600,10 +621,15 @@ section.slider-block { flex-direction: row; justify-content: center; align-items: center; - color: white; + color: $font-color; height: 100%; width: 100%; top: 0px; + + // * { + // color: blue; + // font-size: 112px; + // } } } @@ -907,6 +933,10 @@ section.slider-block { justify-content: space-between; align-items: center; margin-bottom: 8px; + + .btn { + margin: 0; + } } .dropdown-footer .btn { @@ -1162,7 +1192,7 @@ section.slider-block { } } -//footer responsive with out media query. +//footer .footer { background-color: $background-color; padding-left: 10%; @@ -1264,6 +1294,18 @@ section.slider-block { } } +.footer-bottom { + margin-top: -16px; + width: 100%; + height: 120px; + font-size: 16px; + color: #A5A5A5; + letter-spacing: -0.26px; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} //category page .main { @@ -1727,6 +1769,7 @@ section.product-detail { margin-right: 0px; max-width: none; width: auto; + height: auto; .loader { margin-left: 47%; @@ -2652,7 +2695,7 @@ section.review { border: 1px solid $border-color; flex-direction: column; - max-width: 530px; + max-width: 500px; min-width: 380px; padding: 25px; @@ -2786,6 +2829,64 @@ section.review { } } +//address holder and address card +.address-holder { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + flex-wrap: wrap; + width: 100%; +} + +.address-card-1 { + width: 260px; + border: 1px solid #E8E8E8; + display: flex; + position: relative; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + padding: 25px 1px 22px 15px; + margin-right: 15px; + margin-bottom: 15px; + + .control-group { + width: 15px; + height: 15px; + margin-top: 10px; + } + + .details { + font-weight: lighter; + margin-left: 15px; + + span { + display: block; + margin: 8px; + } + + .control-links { + width: 90%; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + + .btn { + height: 30px; + } + } + + .default-address { + position: absolute; + top: -3px; + right: -3px; + } + } +} + .edit-form { display: flex; border: 1px solid $border-color; @@ -2796,6 +2897,7 @@ section.review { //customer account page responsive layout @media only screen and (max-width: 770px) { + .account-content { flex-direction: column; @@ -2909,6 +3011,7 @@ section.review { width: 100%; } } + } .sale-container { diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index 6867aa0e0..90334ace8 100644 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -27,7 +27,9 @@ return [ 'search' => [ 'no-results' => 'No Results Found.', - 'page-title' => 'Bagisto - Search' + 'page-title' => 'Bagisto - Search', + 'found-results' => 'Search Results Found', + 'found-result' => 'Search Result Found' ], 'reviews' => [ @@ -380,4 +382,8 @@ return [ 'thanks' => 'Thanks!' ] ], + + 'webkul' => [ + 'copy-right' => '© Copyright 2018 Webkul Software, All rights reserved.' + ] ]; \ No newline at end of file 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 000577c97..f1adab0a1 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 @@ -67,9 +67,16 @@ @{{ errors.first('qty') }} - {{ __('shop::app.checkout.cart.remove-link') }} + + {{ __('shop::app.checkout.cart.remove-link') }} - {{ __('shop::app.checkout.cart.move-to-wishlist') }} + + @if($item->parent_id != 'null' ||$item->parent_id != null) + {{ __('shop::app.checkout.cart.move-to-wishlist') }} + @else + {{ __('shop::app.checkout.cart.move-to-wishlist') }} + @endif + @if (!cart()->isItemHaveQuantity($item)) diff --git a/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php b/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php index d153158cb..bb4fe94ff 100644 --- a/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/customers/account/address/address.blade.php @@ -34,7 +34,7 @@ @else