Merge branch 'master' of https://github.com/bagisto/bagisto into development
This commit is contained in:
commit
9eef8aed0a
|
|
@ -62,41 +62,41 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
||||||
$this->comment($APP_URL ?? 'localhost');
|
$this->comment($APP_URL ?? 'localhost');
|
||||||
$this->changeEnvironmentVariable('APP_URL', $APP_URL);
|
$this->changeEnvironmentVariable('APP_URL', $APP_URL ?? 'http://localhost');
|
||||||
|
|
||||||
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
||||||
$this->comment($DB_CONNECTION ?? 'mysql');
|
$this->comment($DB_CONNECTION ?? 'mysql');
|
||||||
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION);
|
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION ?? 'mysql');
|
||||||
|
|
||||||
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
||||||
$this->comment($DB_HOST ?? '127.0.0.1');
|
$this->comment($DB_HOST ?? '127.0.0.1');
|
||||||
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST);
|
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST ?? '127.0.0.1');
|
||||||
|
|
||||||
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
||||||
$this->comment($DB_PORT ?? '3306');
|
$this->comment($DB_PORT ?? '3306');
|
||||||
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT);
|
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT ?? '3306');
|
||||||
|
|
||||||
$DB_DATABASE = null;
|
$DB_DATABASE = null;
|
||||||
|
|
||||||
while(! isset($DB_DATABASE)) {
|
while (!isset($DB_DATABASE)) {
|
||||||
$DB_DATABASE = $this->ask('[KEY = "DB_DATABASE"] Enter name of database?');
|
$DB_DATABASE = $this->ask('[KEY = "DB_DATABASE"] Enter name of database?');
|
||||||
$this->comment($DB_DATABASE ?? 'forge');
|
$this->comment($DB_DATABASE ?? 'forge');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE);
|
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE ?? 'forge');
|
||||||
|
|
||||||
$DB_USERNAME = null;
|
$DB_USERNAME = null;
|
||||||
|
|
||||||
while(! isset($DB_USERNAME)) {
|
while (!isset($DB_USERNAME)) {
|
||||||
$DB_USERNAME = $this->ask('Enter database username?');
|
$DB_USERNAME = $this->ask('Enter database username?');
|
||||||
$this->comment($DB_USERNAME ?? 'root');
|
$this->comment($DB_USERNAME ?? 'root');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->changeEnvironmentVariable('[KEY = "DB_USERNAME"] DB_USERNAME', $DB_USERNAME);
|
$this->changeEnvironmentVariable('DB_USERNAME', $DB_USERNAME ?? root);
|
||||||
|
|
||||||
$DB_PASSWORD = $this->ask('Please enter database password?');
|
$DB_PASSWORD = $this->ask('Please enter database password?');
|
||||||
$this->comment($DB_PASSWORD);
|
$this->comment($DB_PASSWORD);
|
||||||
$this->changeEnvironmentVariable('[KEY = "DB_PASSWORD"] DB_PASSWORD', $DB_PASSWORD);
|
$this->changeEnvironmentVariable('DB_PASSWORD', $DB_PASSWORD);
|
||||||
|
|
||||||
$this->info('We are done with application and database params, good job!');
|
$this->info('We are done with application and database params, good job!');
|
||||||
|
|
||||||
|
|
@ -116,11 +116,11 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
||||||
$this->comment($MAIL_USERNAME ?? null);
|
$this->comment($MAIL_USERNAME ?? null);
|
||||||
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME);
|
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME ?? null);
|
||||||
|
|
||||||
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
||||||
$this->comment($MAIL_PASSWORD ?? null);
|
$this->comment($MAIL_PASSWORD ?? null);
|
||||||
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD);
|
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD ?? null);
|
||||||
|
|
||||||
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
||||||
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
||||||
|
|
@ -128,18 +128,18 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
||||||
$this->comment($SHOP_MAIL_FROM ?? null);
|
$this->comment($SHOP_MAIL_FROM ?? null);
|
||||||
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM);
|
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM ?? null);
|
||||||
|
|
||||||
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
||||||
$this->comment($ADMIN_MAIL_TO ?? null);
|
$this->comment($ADMIN_MAIL_TO ?? null);
|
||||||
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO);
|
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO ?? null);
|
||||||
|
|
||||||
$this->info('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
$this->line('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
||||||
|
|
||||||
\Artisan::call('config:cache');
|
|
||||||
|
|
||||||
$this->info('Running migrations...');
|
$this->info('Running migrations...');
|
||||||
|
|
||||||
|
\Artisan::call('key:generate');
|
||||||
|
|
||||||
\Artisan::call('migrate');
|
\Artisan::call('migrate');
|
||||||
|
|
||||||
$this->info('Migration completed.');
|
$this->info('Migration completed.');
|
||||||
|
|
@ -160,13 +160,16 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$this->info('Installation completed.');
|
$this->info('Installation completed.');
|
||||||
|
|
||||||
$this->info('Please write us: SUPPORT@BAGISTO.COM');
|
$this->Line('Please write us: SUPPORT@BAGISTO.COM');
|
||||||
|
|
||||||
$this->info('Thank you!!!');
|
$this->Line('Thank you!!!');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function changeEnvironmentVariable($key, $value)
|
public static function changeEnvironmentVariable($key, $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
\Artisan::call('config:cache');
|
||||||
|
|
||||||
$path = base_path('.env');
|
$path = base_path('.env');
|
||||||
|
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
|
|
@ -177,5 +180,7 @@ class BagistoInstall extends Command
|
||||||
file_get_contents($path)
|
file_get_contents($path)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\Artisan::call('config:cache');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ __('admin::app.sales.orders.discount') }}</td>
|
<td>{{ __('admin::app.sales.orders.discount') }}</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>-{{ core()->formatBasePrice($invoice->base_discount_amount) }}</td>
|
<td>{{ core()->formatBasePrice($invoice->base_discount_amount) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ __('admin::app.sales.orders.discount') }}</td>
|
<td>{{ __('admin::app.sales.orders.discount') }}</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>-{{ core()->formatBasePrice($order->base_discount_amount) }}</td>
|
<td>{{ core()->formatBasePrice($order->base_discount_amount) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ class ConvertXToProductId
|
||||||
foreach ($attributeOptions as $attributeOption) {
|
foreach ($attributeOptions as $attributeOption) {
|
||||||
$selectedOptions = $attributeOption->value;
|
$selectedOptions = $attributeOption->value;
|
||||||
|
|
||||||
if ($attributeOption->type == 'select' || $attributeOption->type == 'multiselect') {
|
if (isset($attributeOption->type) && ($attributeOption->type == 'select' || $attributeOption->type == 'multiselect')) {
|
||||||
$attribute = $this->attribute->findWhere([
|
$attribute = $this->attribute->findWhere([
|
||||||
'code' => $attributeOption->attribute
|
'code' => $attributeOption->attribute
|
||||||
]);
|
]);
|
||||||
|
|
@ -164,6 +164,8 @@ class ConvertXToProductId
|
||||||
|
|
||||||
$selectedAttributeValues = collect();
|
$selectedAttributeValues = collect();
|
||||||
|
|
||||||
|
$foundProducts = collect();
|
||||||
|
|
||||||
if ($attributeOption->attribute == 'sku') {
|
if ($attributeOption->attribute == 'sku') {
|
||||||
$testValue = $attributeOption->value;
|
$testValue = $attributeOption->value;
|
||||||
$testCondition = $attributeOption->condition;
|
$testCondition = $attributeOption->condition;
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,9 @@ class CartRuleController extends Controller
|
||||||
// unset labels
|
// unset labels
|
||||||
unset($data['label']);
|
unset($data['label']);
|
||||||
|
|
||||||
|
while (gettype($attribute_conditions) == 'string') {
|
||||||
$attribute_conditions = json_decode($attribute_conditions);
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
||||||
$data['uses_attribute_conditions'] = 0;
|
$data['uses_attribute_conditions'] = 0;
|
||||||
|
|
@ -405,6 +407,10 @@ class CartRuleController extends Controller
|
||||||
// prepare actions from data for json action
|
// prepare actions from data for json action
|
||||||
$attribute_conditions = json_decode($attribute_conditions);
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
|
||||||
|
while (gettype($attribute_conditions) == 'string') {
|
||||||
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
||||||
$data['uses_attribute_conditions'] = 0;
|
$data['uses_attribute_conditions'] = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ Vue.component("image-slider", require("./components/image-slider.vue"));
|
||||||
Vue.component("vue-slider", require("vue-slider-component"));
|
Vue.component("vue-slider", require("vue-slider-component"));
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<div class="item-detail" id="discount-detail" @if ($cart->discount_amount && $cart->discount_amount > 0) style="display: block;" @else style="display: none;" @endif>
|
<div class="item-detail" id="discount-detail" @if ($cart->base_discount_amount && $cart->base_discount_amount > 0) style="display: block;" @else style="display: none;" @endif>
|
||||||
<label>
|
<label>
|
||||||
<b>{{ __('shop::app.checkout.total.disc-amount') }}</b>
|
<b>{{ __('shop::app.checkout.total.disc-amount') }}</b>
|
||||||
</label>
|
</label>
|
||||||
<label class="right">
|
<label class="right">
|
||||||
<b id="discount-detail-discount-amount">
|
<b id="discount-detail-discount-amount">
|
||||||
{{ core()->currency($cart->discount_amount) }}
|
{{ core()->currency($cart->base_discount_amount) }}
|
||||||
</b>
|
</b>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue