From 17ae225444c5ef04d03b45362ead78a5c38d9d59 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Wed, 20 May 2020 16:19:25 +0530 Subject: [PATCH 1/2] Issue #3067 fixed --- .../Core/src/Console/Commands/Install.php | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/Webkul/Core/src/Console/Commands/Install.php b/packages/Webkul/Core/src/Console/Commands/Install.php index b655aa00f..83fe509cf 100644 --- a/packages/Webkul/Core/src/Console/Commands/Install.php +++ b/packages/Webkul/Core/src/Console/Commands/Install.php @@ -77,7 +77,7 @@ class Install extends Command public function checkForEnvFile() { $envExists = File::exists(base_path() . '/.env'); - if (!$envExists) { + if (! $envExists) { $this->info('Creating the environment configuration file.'); $this->createEnvFile(); } else { @@ -93,7 +93,7 @@ class Install extends Command try { File::copy('.env.example', '.env'); Artisan::call('key:generate'); - $this->envUpdate('APP_URL=http://localhost', ':8000'); + $this->envUpdate('APP_URL=', 'http://localhost:8000'); $locale = $this->choice('Please select the default locale or press enter to continue', ['ar', 'en', 'fa', 'nl', 'pt_BR'], 1); $this->envUpdate('APP_LOCALE=', $locale); @@ -131,11 +131,31 @@ class Install extends Command */ public static function envUpdate($key, $value) { - $path = base_path() . '/.env'; - file_put_contents($path, str_replace( - $key, - $key . $value, - file_get_contents($path) - )); + $path = base_path() . '/.env'; + $data = file($path); + $keyValueData = $changedData = []; + + if ($data) { + foreach ($data as $line) { + $line = preg_replace('/\s+/', '', $line); + $rowValues = explode('=', $line); + + if (strlen($line) !== 0) { + $keyValueData[$rowValues[0]] = $rowValues[1]; + + if (strpos($key, $rowValues[0]) !== false) { + $keyValueData[$rowValues[0]] = $value; + } + } + } + } + + foreach ($keyValueData as $key => $value) { + $changedData[] = $key . '=' . $value; + } + + $changedData = implode(PHP_EOL, $changedData); + + file_put_contents($path, $changedData); } } From 4cf8b7cddb9a17fa3a422f1ff63fcc62512798a5 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Wed, 20 May 2020 17:15:10 +0530 Subject: [PATCH 2/2] Issue #3089 --- .../views/shop/products/view/configurable-options.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php index 43e07592c..5b620cb60 100755 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php @@ -323,7 +323,7 @@ }, changeStock: function (productId) { - var inStockElement = document.querySelector('.stock-status'); + var inStockElement = document.querySelector('.disable-box-shadow'); if (productId) { inStockElement.style.display= "block";