diff --git a/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php b/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php index 8a74c6dfe..c4b626801 100755 --- a/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/dashboard/index.blade.php @@ -379,13 +379,15 @@ template: '#date-filter-template', - data: () => ({ - start: "{{ $startDate->format('Y-m-d') }}", - end: "{{ $endDate->format('Y-m-d') }}", - }), + data: function() { + return { + start: "{{ $startDate->format('Y-m-d') }}", + end: "{{ $endDate->format('Y-m-d') }}", + } + }, methods: { - applyFilter(field, date) { + applyFilter: function(field, date) { this[field] = date; window.location.href = "?start=" + this.start + '&end=' + this.end; diff --git a/packages/Webkul/Shop/package.json b/packages/Webkul/Shop/package.json index 43461c32f..b9aec46f8 100755 --- a/packages/Webkul/Shop/package.json +++ b/packages/Webkul/Shop/package.json @@ -18,9 +18,9 @@ "vue": "^2.1.10" }, "dependencies": { + "ez-plus": "^1.2.1", "vee-validate": "2.0.0-rc.26", "vue-flatpickr": "^2.3.0", - "vue-slider-component": "^2.7.5", - "ez-plus": "^1.2.1" + "vue-slider-component": "^2.7.5" } } 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 61d50b7b0..5230ba93b 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php @@ -116,7 +116,7 @@ var shippingHtml = ''; var paymentHtml = ''; var reviewHtml = ''; - var summaryHtml = Vue.compile(` $cart])->render(); ?>`); + var summaryHtml = ''; var customerAddress = null; @auth('customer') @@ -132,7 +132,7 @@ template: '#checkout-template', inject: ['$validator'], - data() { + data: function() { return { currentStep: 1, completedStep: 0, @@ -159,7 +159,7 @@ } }, - created() { + created: function() { if(! customerAddress) { this.new_shipping_address = true; this.new_billing_address = true; @@ -184,35 +184,37 @@ }, methods: { - navigateToStep (step) { + navigateToStep: function(step) { if (step <= this.completedStep) { this.currentStep = step this.completedStep = step - 1; } }, - haveStates(addressType) { + haveStates: function(addressType) { if (this.countryStates[this.address[addressType].country] && this.countryStates[this.address[addressType].country].length) return true; return false; }, - validateForm: function (scope) { - this.$validator.validateAll(scope).then((result) => { + validateForm: function(scope) { + var this_this = this; + + this.$validator.validateAll(scope).then(function (result) { if (result) { if (scope == 'address-form') { - this.saveAddress() + this_this.saveAddress(); } else if (scope == 'shipping-form') { - this.saveShipping() + this_this.saveShipping(); } else if (scope == 'payment-form') { - this.savePayment() + this_this.savePayment(); } } }); }, - saveAddress () { + saveAddress: function() { var this_this = this; this.disable_button = true; @@ -234,7 +236,7 @@ }) }, - saveShipping () { + saveShipping: function() { var this_this = this; this.disable_button = true; @@ -256,7 +258,7 @@ }) }, - savePayment () { + savePayment: function() { var this_this = this; this.disable_button = true; @@ -278,7 +280,7 @@ }) }, - placeOrder () { + placeOrder: function() { var this_this = this; this.disable_button = true; @@ -302,7 +304,7 @@ }) }, - handleErrorResponse (response, scope) { + handleErrorResponse: function(response, scope) { if (response.status == 422) { serverErrors = response.data.errors; this.$root.addServerErrors(scope) @@ -313,19 +315,19 @@ } }, - shippingMethodSelected (shippingMethod) { + shippingMethodSelected: function(shippingMethod) { this.selected_shipping_method = shippingMethod; }, - paymentMethodSelected (paymentMethod) { + paymentMethodSelected: function(paymentMethod) { this.selected_payment_method = paymentMethod; }, - newBillingAddress() { + newBillingAddress: function() { this.new_billing_address = true; }, - newShippingAddress() { + newShippingAddress: function() { this.new_shipping_address = true; } } @@ -335,7 +337,7 @@ Vue.component('summary-section', { inject: ['$validator'], - data() { + data: function() { return { templateRender: null } @@ -343,7 +345,7 @@ staticRenderFns: summaryTemplateRenderFns, - mounted() { + mounted: function() { this.templateRender = summaryHtml.render; for (var i in summaryHtml.staticRenderFns) { @@ -351,7 +353,7 @@ } }, - render(h) { + render: function(h) { return h('div', [ (this.templateRender ? this.templateRender() : @@ -364,7 +366,7 @@ Vue.component('shipping-section', { inject: ['$validator'], - data() { + data: function() { return { templateRender: null, selected_shipping_method: '', @@ -373,7 +375,7 @@ staticRenderFns: shippingTemplateRenderFns, - mounted() { + mounted: function() { this.templateRender = shippingHtml.render; for (var i in shippingHtml.staticRenderFns) { shippingTemplateRenderFns.push(shippingHtml.staticRenderFns[i]); @@ -382,7 +384,7 @@ eventBus.$emit('after-checkout-shipping-section-added'); }, - render(h) { + render: function(h) { return h('div', [ (this.templateRender ? this.templateRender() : @@ -391,7 +393,7 @@ }, methods: { - methodSelected () { + methodSelected: function() { this.$emit('onShippingMethodSelected', this.selected_shipping_method) eventBus.$emit('after-shipping-method-selected'); @@ -403,7 +405,7 @@ Vue.component('payment-section', { inject: ['$validator'], - data() { + data: function() { return { templateRender: null, @@ -415,7 +417,7 @@ staticRenderFns: paymentTemplateRenderFns, - mounted() { + mounted: function() { this.templateRender = paymentHtml.render; for (var i in paymentHtml.staticRenderFns) { @@ -425,7 +427,7 @@ eventBus.$emit('after-checkout-payment-section-added'); }, - render(h) { + render: function(h) { return h('div', [ (this.templateRender ? this.templateRender() : @@ -434,7 +436,7 @@ }, methods: { - methodSelected () { + methodSelected: function() { this.$emit('onPaymentMethodSelected', this.payment) eventBus.$emit('after-payment-method-selected'); @@ -444,7 +446,7 @@ var reviewTemplateRenderFns = []; Vue.component('review-section', { - data() { + data: function() { return { templateRender: null } @@ -452,7 +454,7 @@ staticRenderFns: reviewTemplateRenderFns, - mounted() { + mounted: function() { this.templateRender = reviewHtml.render; for (var i in reviewHtml.staticRenderFns) { @@ -460,7 +462,7 @@ } }, - render(h) { + render: function(h) { return h('div', [ (this.templateRender ? this.templateRender() : diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/header/nav-menu/navmenu.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/header/nav-menu/navmenu.blade.php index 268bd6277..c0e357257 100755 --- a/packages/Webkul/Shop/src/Resources/views/layouts/header/nav-menu/navmenu.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/layouts/header/nav-menu/navmenu.blade.php @@ -42,20 +42,22 @@ foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCateg categories: { type: [Array, String, Object], required: false, - default: () => ([]) + default: (function () { + return []; + }) }, url: String }, - data(){ + data: function(){ return { items_count:0 }; }, computed: { - items () { + items: function() { return JSON.parse(this.categories) } }, @@ -93,7 +95,7 @@ foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCateg url: String, }, - data() { + data: function() { return { items_count:0, show: false, @@ -107,11 +109,11 @@ foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCateg }, computed: { - haveChildren() { + haveChildren: function() { return this.item.children.length ? true : false; }, - name() { + name: function() { if (this.item.translations && this.item.translations.length) { this.item.translations.forEach(function(translation) { if (translation.locale == document.documentElement.lang) diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php index b4ee472e3..8392ac58f 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php @@ -81,25 +81,25 @@ template: '#layered-navigation-template', - data() { + data: function() { return { attributes: @json($attributeRepository->getFilterAttributes()), appliedFilters: {} } }, - created () { + created: function () { var urlParams = new URLSearchParams(window.location.search); var entries = urlParams.entries(); - for(pair of entries) { - this.appliedFilters[pair[0]] = pair[1].split(','); + for (pair of entries) { + this.appliedFilters[pair[0]] = pair[1].split(','); } }, methods: { - addFilters (attributeCode, filters) { + addFilters: function (attributeCode, filters) { if (filters.length) { this.appliedFilters[attributeCode] = filters; } else { @@ -109,7 +109,7 @@ this.applyFilter() }, - applyFilter () { + applyFilter: function () { var params = []; for(key in this.appliedFilters) { @@ -128,28 +128,30 @@ props: ['index', 'attribute', 'appliedFilterValues'], - data: () => ({ - appliedFilters: [], + data: function() { + return { + appliedFilters: [], - active: false, + active: false, - sliderConfig: { - value: [ - 0, - 0 - ], - max: 500, - processStyle: { - "backgroundColor": "#FF6472" - }, - tooltipStyle: { - "backgroundColor": "#FF6472", - "borderColor": "#FF6472" + sliderConfig: { + value: [ + 0, + 0 + ], + max: 500, + processStyle: { + "backgroundColor": "#FF6472" + }, + tooltipStyle: { + "backgroundColor": "#FF6472", + "borderColor": "#FF6472" + } } } - }), + }, - created () { + created: function () { if (!this.index) this.active = true; @@ -165,17 +167,17 @@ }, methods: { - addFilter (e) { + addFilter: function (e) { this.$emit('onFilterAdded', this.appliedFilters) }, - priceRangeUpdated (value) { + priceRangeUpdated: function (value) { this.appliedFilters = value; this.$emit('onFilterAdded', this.appliedFilters) }, - clearFilters () { + clearFilters: function () { if (this.attribute.type == 'price') { this.sliderConfig.value = [0, 0]; } diff --git a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php index 8e55f6f6a..f26b42104 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php @@ -123,19 +123,19 @@ inject: ['$validator'], methods: { - onSubmit (e) { + onSubmit: function(e) { if (e.target.getAttribute('type') != 'submit') return; e.preventDefault(); - this.$validator.validateAll().then(result => { + this.$validator.validateAll().then(function (result) { if (result) { - if (e.target.getAttribute('data-href')) { - window.location.href = e.target.getAttribute('data-href'); - } else { - document.getElementById('product-form').submit(); - } + if (e.target.getAttribute('data-href')) { + window.location.href = e.target.getAttribute('data-href'); + } else { + document.getElementById('product-form').submit(); + } } }); } diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/attributes.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/attributes.blade.php index 71c4748f2..19ccb5b74 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/view/attributes.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/attributes.blade.php @@ -20,7 +20,7 @@ @else