From 3bea1b7e0e76c3a443c9e3f69cadffba7094eb05 Mon Sep 17 00:00:00 2001 From: "shubhammehrotra.symfony@webkul.com" Date: Fri, 27 Dec 2019 17:39:19 +0530 Subject: [PATCH] Misc. updates --- .../publishable/assets/css/velocity.css | 5 - .../publishable/assets/js/velocity.js | 15 +- .../Webkul/Velocity/src/Helpers/Helper.php | 90 +++---- .../Controllers/Shop/SearchController.php | 4 +- .../assets/js/UI/components/carousel.vue | 4 - .../js/UI/components/content-header.vue | 9 +- .../Resources/assets/sass/components/app.scss | 4 +- .../Velocity/src/Resources/lang/en/app.php | 1 + .../content/content-type/product.blade.php | 35 ++- .../views/checkout/onepage.blade.php | 42 ++-- .../onepage/customer-new-form.blade.php | 102 ++++---- .../views/checkout/onepage/review.blade.php | 4 +- .../src/Resources/views/errors/404.blade.php | 2 +- .../src/Resources/views/home/index.blade.php | 4 + .../views/layouts/footer/index.blade.php | 4 +- .../views/layouts/footer/top-brands.blade.php | 62 ++--- .../views/layouts/header/index.blade.php | 10 - .../Resources/views/layouts/master.blade.php | 35 +-- .../views/layouts/top-nav/index.blade.php | 2 +- .../layouts/top-nav/login-section.blade.php | 220 +++++++++--------- .../products/view/related-products.blade.php | 2 +- 21 files changed, 333 insertions(+), 323 deletions(-) diff --git a/packages/Webkul/Velocity/publishable/assets/css/velocity.css b/packages/Webkul/Velocity/publishable/assets/css/velocity.css index 640d0bf2f..42db69056 100644 --- a/packages/Webkul/Velocity/publishable/assets/css/velocity.css +++ b/packages/Webkul/Velocity/publishable/assets/css/velocity.css @@ -1708,11 +1708,6 @@ justify-content: center; } -.slides-container { - top: -70px; - position: relative; -} - #address-section .form-header h3 { margin-bottom: 20px; } diff --git a/packages/Webkul/Velocity/publishable/assets/js/velocity.js b/packages/Webkul/Velocity/publishable/assets/js/velocity.js index d9d2d9d5a..0645b79e1 100644 --- a/packages/Webkul/Velocity/publishable/assets/js/velocity.js +++ b/packages/Webkul/Velocity/publishable/assets/js/velocity.js @@ -35325,11 +35325,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // /* harmony default export */ __webpack_exports__["default"] = ({ - props: ['slidesCount', 'slidesPerPage', 'navigationEnabled', 'paginationEnabled', 'addClass'], - - data: function data() { - return {}; - } + props: ['slidesCount', 'slidesPerPage', 'navigationEnabled', 'paginationEnabled', 'addClass'] }); /***/ }), @@ -36708,6 +36704,9 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // // // +// +// +// /* harmony default export */ __webpack_exports__["default"] = ({ props: ['heading', 'headerContent', 'isEnabled'] @@ -36731,7 +36730,11 @@ var render = function() { "rango-view-list " + (_vm.isEnabled == "0" ? "" : "cursor-pointer") + " align-vertical-top", - on: { click: _vm.toggleSidebar } + on: { + click: function($event) { + _vm.isEnabled == "0" ? "" : _vm.toggleSidebar() + } + } }), _vm._v(" "), _c("span", { diff --git a/packages/Webkul/Velocity/src/Helpers/Helper.php b/packages/Webkul/Velocity/src/Helpers/Helper.php index 2fa57df63..871bf8a6e 100644 --- a/packages/Webkul/Velocity/src/Helpers/Helper.php +++ b/packages/Webkul/Velocity/src/Helpers/Helper.php @@ -8,6 +8,13 @@ use Webkul\Velocity\Repositories\OrderBrandsRepository; use Webkul\Attribute\Repositories\AttributeOptionRepository; use Webkul\Product\Repositories\ProductRepository as ProductRepository; +/** + * Search controller + * + * @author Shubham Mehrotra @shubhwebkul + * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + class Helper extends Review { @@ -37,29 +44,28 @@ class Helper extends Review * * @var object */ - protected $AttributeOption; + protected $attributeOption; public function __construct( - OrderBrandsRepository $OrderBrandsRepository, + OrderBrandsRepository $orderBrandsRepository, ProductRepository $productRepository, ProductModel $productModel, - AttributeOptionRepository $AttributeOption + AttributeOptionRepository $attributeOption ) { - $this->OrderBrandsRepository = $OrderBrandsRepository; - - $this->productRepository = $productRepository; - $this->productModel = $productModel; - - $this->AttributeOption = $AttributeOption; + $this->attributeOption = $attributeOption; + $this->productRepository = $productRepository; + $this->orderBrandsRepository = $orderBrandsRepository; } public function topBrand($order) { $orderItems = $order->items; + foreach ($orderItems as $key => $orderItem) { - $products[]= $orderItem->product; - $this->OrderBrandsRepository->create([ + $products[] = $orderItem->product; + + $this->orderBrandsRepository->create([ 'order_id' => $orderItem->order_id, 'order_item_id' => $orderItem->id, 'product_id' => $orderItem->product_id, @@ -72,52 +78,52 @@ class Helper extends Review public function getBrandsWithCategories() { try { - $orderBrand = $this->OrderBrandsRepository->get()->toArray(); - // $orderBrand = $this->arrangeWithMaxBrandOrder($orderBrandData); + $orderBrand = $this->orderBrandsRepository->get()->toArray(); - foreach ($orderBrand as $product) { - $product_id[] = $product['product_id']; + if (isset($orderBrand) && ! empty($orderBrand)) { + foreach ($orderBrand as $product) { + $product_id[] = $product['product_id']; - $product_categories = $this->productRepository->with('categories')->findWhereIn('id', $product_id)->toArray(); - } + $product_categories = $this->productRepository->with('categories')->findWhereIn('id', $product_id)->toArray(); + } - foreach($product_categories as $totalData) { - $brand = $this->AttributeOption->findOneWhere(['id' => $totalData['brand']]); + $categoryName = $brandName = $brandImplode = []; + foreach($product_categories as $totalData) { + $brand = $this->attributeOption->findOneWhere(['id' => $totalData['brand']]); - foreach ($totalData['categories'] as $categories) { - foreach($categories['translations'] as $catName) { - $brandData[$brand->admin_name][] = $catName['name']; - $categoryName[] = $catName['name']; + foreach ($totalData['categories'] as $categories) { + foreach($categories['translations'] as $catName) { + $brandData[$brand->admin_name][] = $catName['name']; + $categoryName[] = $catName['name']; + } } } - } - $uniqueCategoryName = array_unique($categoryName); + $uniqueCategoryName = array_unique($categoryName); - foreach($uniqueCategoryName as $key => $categoryNameValue) { - foreach($brandData as $brandDataKey => $brandDataValue) { - if(in_array($categoryNameValue,$brandDataValue)) { - $brandName[$categoryNameValue][] = $brandDataKey; + foreach($uniqueCategoryName as $key => $categoryNameValue) { + foreach($brandData as $brandDataKey => $brandDataValue) { + if(in_array($categoryNameValue,$brandDataValue)) { + $brandName[$categoryNameValue][] = $brandDataKey; + } } } - } - foreach($brandName as $brandKey => $brandvalue) { - $brandImplode[$brandKey][] = implode(' | ',array_map("ucfirst", $brandvalue)); - } + foreach($brandName as $brandKey => $brandvalue) { + $brandImplode[$brandKey][] = implode(' | ',array_map("ucfirst", $brandvalue)); + } - return $brandImplode; - } catch (Exception $e){ - throw $e; + return $brandImplode; + } + } catch (Exception $exception){ + throw $exception; } } - public function arrangeWithMaxBrandOrder($orderBrandData) { } - /** * Returns the count rating of the product * @@ -127,10 +133,10 @@ class Helper extends Review public function getCountRating($product) { $reviews = $product->reviews()->where('status', 'approved') - ->select('rating', \DB::raw('count(*) as total')) - ->groupBy('rating') - ->orderBy('rating','desc') - ->get(); + ->select('rating', \DB::raw('count(*) as total')) + ->groupBy('rating') + ->orderBy('rating','desc') + ->get(); $totalReviews = $this->getTotalReviews($product); diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Shop/SearchController.php b/packages/Webkul/Velocity/src/Http/Controllers/Shop/SearchController.php index 54eb96646..046ccf4b9 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Shop/SearchController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Shop/SearchController.php @@ -8,8 +8,8 @@ use Webkul\Velocity\Http\Shop\Controllers; /** * Search controller * - * @author Prashant Singh @prashant-webkul - * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + * @author Shubham Mehrotra @shubhwebkul + * @copyright 2019 Webkul Software Pvt Ltd (http://www.webkul.com) */ class SearchController extends Controller { diff --git a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/carousel.vue b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/carousel.vue index 2130382ff..ff5977013 100644 --- a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/carousel.vue +++ b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/carousel.vue @@ -26,9 +26,5 @@ 'paginationEnabled', 'addClass' ], - - data: function () { - return {} - } } \ No newline at end of file diff --git a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue index 0622704df..39f1fca47 100644 --- a/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue +++ b/packages/Webkul/Velocity/src/Resources/assets/js/UI/components/content-header.vue @@ -2,7 +2,10 @@
- + +
@@ -13,8 +16,8 @@ v-if="(content['content_type'] == 'link')" href="content['page_link']" :target="content['link_target'] ? '_blank' : '_self'" - v-text="content.title" - > + v-text="content.title"> + diff --git a/packages/Webkul/Velocity/src/Resources/assets/sass/components/app.scss b/packages/Webkul/Velocity/src/Resources/assets/sass/components/app.scss index 455806a40..2b0fdd652 100644 --- a/packages/Webkul/Velocity/src/Resources/assets/sass/components/app.scss +++ b/packages/Webkul/Velocity/src/Resources/assets/sass/components/app.scss @@ -997,8 +997,8 @@ } .slides-container { - top: -70px; - position: relative; + // top: -70px; + // position: relative; } #address-section { diff --git a/packages/Webkul/Velocity/src/Resources/lang/en/app.php b/packages/Webkul/Velocity/src/Resources/lang/en/app.php index 1a865ced4..0a0643526 100644 --- a/packages/Webkul/Velocity/src/Resources/lang/en/app.php +++ b/packages/Webkul/Velocity/src/Resources/lang/en/app.php @@ -215,6 +215,7 @@ return [ 'enter-current-password' => 'Enter your current password', 'new-password' => 'New password', 'confirm-new-password' => 'Confirm new password', + 'top-brands' => 'Top Brands', ], ], ] diff --git a/packages/Webkul/Velocity/src/Resources/views/admin/content/content-type/product.blade.php b/packages/Webkul/Velocity/src/Resources/views/admin/content/content-type/product.blade.php index 4c85633be..d59d3cabd 100644 --- a/packages/Webkul/Velocity/src/Resources/views/admin/content/content-type/product.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/admin/content/content-type/product.blade.php @@ -33,25 +33,6 @@ - - @endpush \ No newline at end of file diff --git a/packages/Webkul/Velocity/src/Resources/views/checkout/onepage.blade.php b/packages/Webkul/Velocity/src/Resources/views/checkout/onepage.blade.php index 56856d89a..f2153fd99 100644 --- a/packages/Webkul/Velocity/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/checkout/onepage.blade.php @@ -76,13 +76,13 @@ - -@push('scripts') - -@endpush + +@endpush \ No newline at end of file diff --git a/packages/Webkul/Velocity/src/Resources/views/products/view/related-products.blade.php b/packages/Webkul/Velocity/src/Resources/views/products/view/related-products.blade.php index 7570fbef6..a7713b4c7 100644 --- a/packages/Webkul/Velocity/src/Resources/views/products/view/related-products.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/products/view/related-products.blade.php @@ -11,7 +11,7 @@