diff --git a/composer.json b/composer.json index 80feca52c..e4e05d0e3 100755 --- a/composer.json +++ b/composer.json @@ -99,7 +99,6 @@ "extra": { "laravel": { "dont-discover": [ - "laravel/dusk", "barryvdh/laravel-debugbar" ] } diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 8de3b2f50..9eaf1850d 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -818,7 +818,10 @@ return [ 'select-attr' => 'Select Attribute', 'select-attr-fam' => 'Select Attribute Family', 'select-cart-attr' => 'Select Cart Attribute', + 'select-products' => 'Select product attributes', + 'select-category' => 'Select Categories', 'general-info' => [ + 'sku-like' => 'SKU Like', 'on-shipping' => 'If applied on shipping', 'discount' => 'Discount', 'to-be-applied' => 'Applied On', diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php index 7a71f39c8..5150a89bd 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php @@ -341,6 +341,30 @@ + +
+
+ + + + +
+                                            @{{ value }}
+                                        
+
+ +
+ + + + +
+                                            @{{ value }}
+                                        
+
+
+
+
@@ -380,6 +404,10 @@ data () { return { + options: [ + 1, 2, 3, 4, 5, 6 + ], + categories: null, name: null, description: null, conditions_list: [], @@ -441,6 +469,16 @@ methods: { + addTag (newTag) { + const tag = { + name: newTag, + code: newTag.substring(0, 2) + Math.floor((Math.random() * 10000000)) + } + + this.options.push(tag) + this.value.push(tag) + }, + addCondition () { if (this.criteria == 'product_subselection' || this.criteria == 'cart') { this.condition_on = this.criteria; @@ -524,5 +562,11 @@ } }); + + @endpush @stop \ No newline at end of file diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 8ff4aa314..b82b4b26e 100755 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -394,9 +394,9 @@ class Core if (is_null($amount)) $amount = 0; - $formater = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); + $formatter = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); - return $formater->formatCurrency($this->convertPrice($amount), $this->getCurrentCurrency()->code); + return $formatter->formatCurrency($this->convertPrice($amount), $this->getCurrentCurrency()->code); } /** @@ -424,9 +424,9 @@ class Core if (is_null($price)) $price = 0; - $formater = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); + $formatter = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); - return $formater->formatCurrency($price, $currencyCode); + return $formatter->formatCurrency($price, $currencyCode); } /** @@ -439,10 +439,10 @@ class Core { if (is_null($price)) $price = 0; - - $formater = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); - return $formater->formatCurrency($price, $this->getBaseCurrencyCode()); + $formatter = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY ); + + return $formatter->formatCurrency($price, $this->getBaseCurrencyCode()); } /** diff --git a/packages/Webkul/Discount/src/Config/system.php b/packages/Webkul/Discount/src/Config/system.php index 5e8709876..b422047b4 100644 --- a/packages/Webkul/Discount/src/Config/system.php +++ b/packages/Webkul/Discount/src/Config/system.php @@ -36,30 +36,8 @@ return [ 'value' => null ] ], + 'info' => 'admin::app.promotion.general-info.applied-on-info' - ], [ - 'name' => 'on_shipping', - 'title' => 'admin::app.promotion.general-info.on-shipping', - 'type' => 'select', - 'validation' => 'required', - 'channel_based' => true, - 'locale_based' => false, - 'options' => [ - [ - 'title' => 'On grand-total', - 'value' => 0 - ], [ - 'title' => 'On selected item', - 'value' => 1 - ], [ - 'title' => 'On sub-total', - 'value' => 2 - ], [ - 'title' => 'Please select an option', - 'value' => null - ] - ], - 'info' => 'admin::app.promotion.general-info.shipping-apply-info' ] ] ], diff --git a/packages/Webkul/Ui/package.json b/packages/Webkul/Ui/package.json index 4345927d8..798f7716e 100755 --- a/packages/Webkul/Ui/package.json +++ b/packages/Webkul/Ui/package.json @@ -23,6 +23,7 @@ "tooltip.js": "^1.3.1", "url-polyfill": "^1.1.5", "url-search-params-polyfill": "^6.0.0", + "vue-multiselect": "^2.1.6", "vue-swatches": "^1.0.3" } } diff --git a/packages/Webkul/Ui/src/Resources/assets/js/app.js b/packages/Webkul/Ui/src/Resources/assets/js/app.js index 26fd98acc..315a480c7 100755 --- a/packages/Webkul/Ui/src/Resources/assets/js/app.js +++ b/packages/Webkul/Ui/src/Resources/assets/js/app.js @@ -19,10 +19,15 @@ Vue.component("date", require("./components/date")); Vue.component("swatch-picker", require("./components/swatch-picker")); Vue.directive("debounce", require("./directives/debounce")); +import { Multiselect } from 'vue-multiselect'; +Vue.component('multiselect', Multiselect); + require('flatpickr/dist/flatpickr.css'); require('vue-swatches/dist/vue-swatches.min.css'); +require('vue-multiselect/dist/vue-multiselect.min.css'); + require("@babel/polyfill"); require('url-search-params-polyfill'); diff --git a/tests/Browser/ExampleTest.php b/tests/Browser/ExampleTest.php index a6ea53903..8aa739cfe 100644 --- a/tests/Browser/ExampleTest.php +++ b/tests/Browser/ExampleTest.php @@ -15,12 +15,18 @@ class ExampleTest extends DuskTestCase */ public function testBasicExample() { - $this->browse(function (Browser $browser) { + $customer = app('Webkul\Customer\Repositories\CustomerRepository'); + + $customer = $customer->all(); + + $customer = $customer->first(); + + $this->browse(function (Browser $browser) use($customer) { $browser->visit('/customer/login') - ->type('email', 'john@doe.net') - ->type('password', '12345678') - ->click('input[type="submit"]') - ->screenshot('error'); + ->type('email', $customer->email) + ->type('password', $customer->password) + ->click('input[type="submit"]') + ->screenshot('error'); }); } } diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index 547152f6a..8d8a77e99 100755 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -19,4 +19,4 @@ trait CreatesApplication return $app; } -} +} \ No newline at end of file diff --git a/tests/Feature/Auth/AuthTest.php b/tests/Feature/Auth/AuthTest.php index 2d7926c61..cacb2e6e7 100644 --- a/tests/Feature/Auth/AuthTest.php +++ b/tests/Feature/Auth/AuthTest.php @@ -24,7 +24,7 @@ class AuthTest extends TestCase */ public function testCustomerLoginPage() { - config(['app.url' => 'http://127.0.0.1:8000']); + config(['app.url' => 'http://prashant.com']); $response = $this->get('/customer/login'); @@ -33,8 +33,9 @@ class AuthTest extends TestCase $response->assertViewIs('shop::customers.session.index'); } - public function testCustomerResgistrationPage() { - config(['app.url' => 'http://127.0.0.1:8000']); + public function testCustomerResgistrationPage() + { + config(['app.url' => 'http://prashant.com']); $response = $this->get('/customer/register'); @@ -64,8 +65,9 @@ class AuthTest extends TestCase $this->assertEquals($created->id, $created->id); } - public function testCustomerLogin() { - config(['app.url' => 'http://127.0.0.1:8000']); + public function testCustomerLogin() + { + config(['app.url' => 'http://prashant.com']); $customers = app(Customer::class); $customer = $customers->findOneByField('email', 'john@doe.net'); @@ -115,8 +117,6 @@ class AuthTest extends TestCase { $customer = auth()->guard('customer')->user(); - // dd('logout test', $customer); - $this->get(route('customer.session.destroy')); $this->assertGuest(); diff --git a/tests/Feature/GeneralTest.php b/tests/Feature/GeneralTest.php index 5aefcd930..55cbc0bde 100644 --- a/tests/Feature/GeneralTest.php +++ b/tests/Feature/GeneralTest.php @@ -21,7 +21,7 @@ class GeneralTest extends TestCase */ public function testHomePage() { - config(['app.url' => 'http://127.0.0.1:8000']); + config(['app.url' => 'http://prashant.com']); $response = $this->get('/'); @@ -35,7 +35,7 @@ class GeneralTest extends TestCase */ public function testCustomerLoginPage() { - config(['app.url' => 'http://127.0.0.1:8000']); + config(['app.url' => 'http://prashant.com']); $response = $this->get('/customer/login'); @@ -51,7 +51,7 @@ class GeneralTest extends TestCase { $categoryUrlSlug = 'marvel-figurines'; - config(['app.url' => 'http://127.0.0.1:8000']); + config(['app.url' => 'http://prashant.com']); $response = $this->get("/categories/{$categoryUrlSlug}"); @@ -65,7 +65,7 @@ class GeneralTest extends TestCase */ public function testCustomerRegistrationPage() { - config(['app.url' => 'http://127.0.0.1:8000']); + // config(['app.url' => 'http://127.0.0.1:8000']); $response = $this->get("/customer/register"); @@ -79,7 +79,7 @@ class GeneralTest extends TestCase */ public function testCartPage() { - config(['app.url' => 'http://127.0.0.1:8000']); + // config(['app.url' => 'http://127.0.0.1:8000']); $response = $this->get("/checkout/cart");