From 837c5d44fab695cbee77f72bba8c6bcc8a91eca0 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Tue, 28 Apr 2020 08:14:53 +0530 Subject: [PATCH] fix category issue and change country,state order --- .../src/Repositories/ProductRepository.php | 14 ++-- .../checkout/onepage/customer-info.blade.php | 76 +++++++++---------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 4a9acacaf..a68aaa0a0 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -145,14 +145,16 @@ class ProductRepository extends Repository if (isset($params['sort'])) { $attribute = $this->attributeRepository->findOneByField('code', $params['sort']); - if ($params['sort'] == 'price') { - if ($attribute->code == 'price') { - $qb->orderBy('min_price', $params['order']); + if ($attribute) { + if ($params['sort'] == 'price') { + if ($attribute->code == 'price') { + $qb->orderBy('min_price', $params['order']); + } else { + $qb->orderBy($attribute->code, $params['order']); + } } else { - $qb->orderBy($attribute->code, $params['order']); + $qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $params['order']); } - } else { - $qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $params['order']); } } 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 5214f57c0..90fa8652c 100755 --- 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 @@ -161,6 +161,26 @@ +
+ + + + + + @{{ errors.first('address-form.billing[country]') }} + +
+
-
- - - - - - @{{ errors.first('address-form.billing[country]') }} - -
-
+
+ + + + + + @{{ errors.first('address-form.shipping[country]') }} + +
+
-
- - - - - - @{{ errors.first('address-form.shipping[country]') }} - -
-