From 06a4f1216b8131f7cf66831297d14c58bfda83cf Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 9 Aug 2019 19:29:28 +0530 Subject: [PATCH 01/11] Dead code removal --- config/services.php | 20 +------------------ packages/Webkul/Admin/src/Config/menu.php | 16 +++++++-------- .../views/checkout/onepage.blade.php | 3 --- .../js/components/datagrid/datetime.vue | 2 +- 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/config/services.php b/config/services.php index 456421a1a..22a2286f8 100755 --- a/config/services.php +++ b/config/services.php @@ -42,23 +42,5 @@ return [ 'model' => App\User::class, 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), - ], - - 'facebook' => [ - 'client_id' => env('FACEBOOK_CLIENT_ID'), - 'client_secret' => env('FACEBOOK_CLIENT_SECRET'), - 'redirect' => env('FACEBOOK_URL'), - ], - - 'twitter' => [ - 'client_id' => env('TWITTER_CLIENT_ID'), - 'client_secret' => env('TWITTER_CLIENT_SECRET'), - 'redirect' => env('TWITTER_URL'), - ], - - 'google' => [ - 'client_id' => env('GOOGLE_CLIENT_ID'), - 'client_secret' => env('GOOGLE_CLIENT_SECRET'), - 'redirect' => env('GOOGLE_URL'), - ], + ] ]; diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php index 1091a60fb..2c73ae44d 100755 --- a/packages/Webkul/Admin/src/Config/menu.php +++ b/packages/Webkul/Admin/src/Config/menu.php @@ -188,15 +188,13 @@ return [ 'route' => 'admin.cart-rule.index', 'sort' => 1, 'icon-class' => '', - ], - // [ - // 'key' => 'promotions.catalog-rule', - // 'name' => 'admin::app.promotion.catalog-rule', - // 'route' => 'admin.catalog-rule.index', - // 'sort' => 1, - // 'icon-class' => '', - // ], - [ + ], [ + 'key' => 'promotions.catalog-rule', + 'name' => 'admin::app.promotion.catalog-rule', + 'route' => 'admin.catalog-rule.index', + 'sort' => 1, + 'icon-class' => '', + ], [ 'key' => 'cms', 'name' => 'admin::app.layouts.cms', 'route' => 'admin.cms.index', diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php index 2240c9a6c..0e7a4f16a 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php @@ -409,8 +409,6 @@ mounted: function() { this.templateRender = paymentHtml.render; - console.log(paymentHtml.render); - for (var i in paymentHtml.staticRenderFns) { paymentTemplateRenderFns.push(paymentHtml.staticRenderFns[i]); } @@ -535,7 +533,6 @@ }, changeCoupon: function() { - console.log('called'); if (this.couponChanged == true && this.changeCount == 0) { this.changeCount++; diff --git a/packages/Webkul/Ui/src/Resources/assets/js/components/datagrid/datetime.vue b/packages/Webkul/Ui/src/Resources/assets/js/components/datagrid/datetime.vue index 60d67f16c..b4cf9df7a 100755 --- a/packages/Webkul/Ui/src/Resources/assets/js/components/datagrid/datetime.vue +++ b/packages/Webkul/Ui/src/Resources/assets/js/components/datagrid/datetime.vue @@ -11,7 +11,7 @@ Vue.use(VueFlatpickr); export default { data() { const now = new Date(); - console.log(now); + return { fpOptions: { utc: false, From da093662dbfd7d07b37fe8b7f9dcb72f56ec1775 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Mon, 12 Aug 2019 06:56:21 +0530 Subject: [PATCH 02/11] Catalog rule implementation in progress --- .../promotions/catalog-rule/create.blade.php | 12 +- .../promotions/catalog-rule/edit.blade.php | 43 ++- .../Http/Controllers/CustomerController.php | 2 +- .../Discount/src/Config/rule-conditions.php | 20 +- .../{ => Cart}/ConvertXToProductId.php | 11 +- .../src/Helpers/{ => Cart}/CouponAbleRule.php | 4 +- .../src/Helpers/{ => Cart}/Discount.php | 45 ++- .../Helpers/{ => Cart}/NonCouponAbleRule.php | 4 +- .../Helpers/{ => Cart}/ValidatesDiscount.php | 2 +- .../Discount/src/Helpers/Catalog/Apply.php | 68 +++++ .../Helpers/Catalog/ConvertXToProductId.php | 272 ++++++++++++++++++ .../Discount/src/Helpers/Catalog/Sale.php | 107 +++++++ .../src/Helpers/Catalog/SyncPreviousRules.php | 0 .../Discount/src/Helpers/FindProducts.php | 71 ----- .../Http/Controllers/CartRuleController.php | 2 +- .../Controllers/CatalogRuleController.php | 38 +-- .../src/Models/CatalogRuleCustomerGroups.php | 6 +- .../Http/Controllers/OnepageController.php | 9 +- .../assets/js/components/datetime.vue | 4 + 19 files changed, 562 insertions(+), 158 deletions(-) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/ConvertXToProductId.php (96%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/CouponAbleRule.php (95%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/Discount.php (97%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/NonCouponAbleRule.php (88%) rename packages/Webkul/Discount/src/Helpers/{ => Cart}/ValidatesDiscount.php (97%) create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/Apply.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/ConvertXToProductId.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/Sale.php create mode 100644 packages/Webkul/Discount/src/Helpers/Catalog/SyncPreviousRules.php delete mode 100644 packages/Webkul/Discount/src/Helpers/FindProducts.php diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php index e6032fd8b..1e9df1516 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php @@ -136,7 +136,11 @@ - + + + + @@ -159,7 +163,7 @@ - Add Attribute Condition + {{ __('admin::app.promotion.add-attr-condition') }} @@ -256,6 +260,7 @@ }, mounted () { + console.log(this.attribute_input); }, methods: { @@ -336,6 +341,7 @@ for(i in this.attribute_input) { if (i == selectedIndex) { if (this.attribute_input[i].has_options == true) { + this.selectedIndex this.attribute_values[index].options = this.attribute_input[i].options; } @@ -355,7 +361,7 @@ }, removeAttr(index) { - this.conditions_list.splice(index, 1); + this.attribute_values.splice(index, 1); }, removeCat(index) { diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php index 3bd7b26d7..91db3e8be 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/edit.blade.php @@ -12,7 +12,7 @@ @push('scripts')