Merge branch 'bagisto/master' into improve-have-product-faker

This commit is contained in:
Herbert Maschke 2020-04-04 11:14:29 +02:00
commit df6dc49313
22 changed files with 180 additions and 149 deletions

56
composer.lock generated
View File

@ -3914,16 +3914,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v4.4.5",
"version": "v4.4.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "7e41b4fcad4619535f45f8bfa7744c4f384e1648"
"reference": "62f92509c9abfd1f73e17b8cf1b72c0bdac6611b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/7e41b4fcad4619535f45f8bfa7744c4f384e1648",
"reference": "7e41b4fcad4619535f45f8bfa7744c4f384e1648",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/62f92509c9abfd1f73e17b8cf1b72c0bdac6611b",
"reference": "62f92509c9abfd1f73e17b8cf1b72c0bdac6611b",
"shasum": ""
},
"require": {
@ -3965,7 +3965,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2020-02-13T19:40:01+00:00"
"time": "2020-03-30T14:07:33+00:00"
},
{
"name": "symfony/http-kernel",
@ -4059,16 +4059,16 @@
},
{
"name": "symfony/mime",
"version": "v5.0.5",
"version": "v5.0.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c"
"reference": "481b7d6da88922fb1e0d86a943987722b08f3955"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/9b3e5b5e58c56bbd76628c952d2b78556d305f3c",
"reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c",
"url": "https://api.github.com/repos/symfony/mime/zipball/481b7d6da88922fb1e0d86a943987722b08f3955",
"reference": "481b7d6da88922fb1e0d86a943987722b08f3955",
"shasum": ""
},
"require": {
@ -4117,7 +4117,7 @@
"mime",
"mime-type"
],
"time": "2020-02-04T09:41:09+00:00"
"time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -4238,16 +4238,16 @@
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a"
"reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6842f1a39cf7d580655688069a03dd7cd83d244a",
"reference": "6842f1a39cf7d580655688069a03dd7cd83d244a",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf",
"shasum": ""
},
"require": {
@ -4261,7 +4261,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.14-dev"
"dev-master": "1.15-dev"
}
},
"autoload": {
@ -4296,20 +4296,20 @@
"portable",
"shim"
],
"time": "2020-01-17T12:01:36+00:00"
"time": "2020-03-09T19:04:49+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2"
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2",
"reference": "34094cfa9abe1f0f14f48f490772db7a775559f2",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"shasum": ""
},
"require": {
@ -4321,7 +4321,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.14-dev"
"dev-master": "1.15-dev"
}
},
"autoload": {
@ -4355,7 +4355,7 @@
"portable",
"shim"
],
"time": "2020-01-13T11:15:53+00:00"
"time": "2020-03-09T19:04:49+00:00"
},
{
"name": "symfony/polyfill-php56",
@ -4415,16 +4415,16 @@
},
{
"name": "symfony/polyfill-php72",
"version": "v1.14.0",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf"
"reference": "37b0976c78b94856543260ce09b460a7bc852747"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf",
"reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747",
"reference": "37b0976c78b94856543260ce09b460a7bc852747",
"shasum": ""
},
"require": {
@ -4433,7 +4433,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.14-dev"
"dev-master": "1.15-dev"
}
},
"autoload": {
@ -4466,7 +4466,7 @@
"portable",
"shim"
],
"time": "2020-01-13T11:15:53+00:00"
"time": "2020-02-27T09:26:54+00:00"
},
{
"name": "symfony/polyfill-php73",

View File

@ -6,7 +6,12 @@
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.sliders.create') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<form
method="POST"
@submit.prevent="onSubmit"
enctype="multipart/form-data"
action="{{ route('admin.sliders.create') }}">
<div class="page-header">
<div class="page-title">
<h1>

View File

@ -471,40 +471,20 @@ class Core
return $formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
}
/**
* Format and convert price with currency symbol
*
* @param float $price
* @param string $currencyCode
* @return string
*/
/**
* Format and convert price with currency symbol
*
* @param float $price
* @return string
*/
public function formatPrice($price, $currencyCode)
{
$code = $this->getCurrentCurrency()->code;
if (is_null($price)) {
if (is_null($price))
$price = 0;
} else {
if ($code != $currencyCode) {
$price = $this->convertPrice($price, $code, $currencyCode);
}
}
$formater = new \NumberFormatter(app()->getLocale(), \NumberFormatter::CURRENCY);
$formatter = new \NumberFormatter( app()->getLocale(), \NumberFormatter::CURRENCY );
$symbol = $this->getCurrentCurrency()->symbol;
if ($symbol) {
if ($this->currencySymbol($currencyCode) == $symbol) {
return $formater->formatCurrency($price, $currencyCode);
} else {
$formater->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, $symbol);
return $formater->format($price); // $this->convertPrice($price, $code)
}
} else {
return $formater->formatCurrency($price, $currencyCode);
}
return $formatter->formatCurrency($price, $currencyCode);
}
/**

View File

@ -6,12 +6,9 @@ use Webkul\Core\Models\Locale;
/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(Locale::class, function (Faker $faker, array $attributes) {
$languageCode = $faker->languageCode;
$locale = Locale::query()->firstWhere('code', $languageCode);
if ($locale !== null) {
return $locale->id;
}
do {
$languageCode = $faker->languageCode;
} while (Locale::query()->where('code', $languageCode)->exists());
return [
'code' => $languageCode,
@ -22,4 +19,4 @@ $factory->define(Locale::class, function (Faker $faker, array $attributes) {
$factory->state(Category::class, 'rtl', [
'direction' => 'rtl',
]);
]);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 185 B

View File

@ -289,6 +289,18 @@
this.disable_button = true;
if (this.allAddress.length > 0) {
let address = this.allAddress.forEach(address => {
if (address.id == this.address.billing.address_id) {
this.address.billing.address1 = [address.address1];
}
if (address.id == this.address.shipping.address_id) {
this.address.shipping.address1 = [address.address1];
}
});
}
this.$http.post("{{ route('shop.checkout.save-address') }}", this.address)
.then(function(response) {
this_this.disable_button = false;

View File

@ -7,7 +7,8 @@ class Tax
/**
* @var int
*/
public const TAX_PRECISION = 4;
private const TAX_RATE_PRECISION = 4;
private const TAX_AMOUNT_PRECISION = 2;
/**
* Returns an array with tax rates and tax amount
@ -20,7 +21,7 @@ class Tax
$taxes = [];
foreach ($that->items as $item) {
$taxRate = (string) round((float) $item->tax_percent, self::TAX_PRECISION);
$taxRate = (string) round((float) $item->tax_percent, self::TAX_RATE_PRECISION);
if (! array_key_exists($taxRate, $taxes)) {
$taxes[$taxRate] = 0;
@ -29,6 +30,11 @@ class Tax
$taxes[$taxRate] += $asBase ? $item->base_tax_amount : $item->tax_amount;
}
// finally round tax amounts now (to reduce rounding differences)
foreach ($taxes as $taxRate => $taxAmount) {
$taxes[$taxRate] = round($taxAmount, self::TAX_AMOUNT_PRECISION);
}
return $taxes;
}
@ -45,7 +51,7 @@ class Tax
$result = 0;
foreach ($taxes as $taxRate => $taxAmount) {
$result += round($taxAmount, 2);
$result += $taxAmount;
}
return $result;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
{
"/js/velocity.js": "/js/velocity.js?id=d1e8a6d2c78f6d0657a7",
"/js/velocity.js": "/js/velocity.js?id=08fbd43328947b542230",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=612d35e452446366eef7",
"/css/velocity.css": "/css/velocity.css?id=16024aee144fa5e1275e"
"/css/velocity.css": "/css/velocity.css?id=9b4ec44f8853ba8be2db"
}

View File

@ -1,16 +1,18 @@
<template>
<div class="modal-container" v-if="isModalOpen">
<div class="modal-header">
<slot name="header">
Default header
</slot>
<i class="icon remove-icon" @click="closeModal"></i>
</div>
<div class="modal-parent scrollable" v-if="isModalOpen">
<div class="modal-container">
<div class="modal-header">
<slot name="header">
Default header
</slot>
<i class="icon remove-icon" @click="closeModal"></i>
</div>
<div class="modal-body">
<slot name="body">
Default body
</slot>
<div class="modal-body">
<slot name="body">
Default body
</slot>
</div>
</div>
</div>
</template>
@ -23,12 +25,8 @@
return {}
},
created () {
this.closeModal();
},
computed: {
isModalOpen () {
isModalOpen: function () {
this.addClassToBody();
return this.isOpen;
@ -36,12 +34,13 @@
},
methods: {
closeModal () {
this.$root.$set(this.$root.modalIds, this.id, true);
closeModal: function () {
this.$root.$set(this.$root.modalIds, this.id, false);
},
addClassToBody () {
addClassToBody: function () {
var body = document.querySelector("body");
if(this.isOpen) {
body.classList.add("modal-open");
} else {

View File

@ -249,9 +249,12 @@ body {
> div:last-child {
height: 32px;
}
* {
// height: 100%;
> div {
.default {
padding: 5px;
font-size: 14px;
}
}
@ -281,7 +284,6 @@ body {
}
}
.dropdown-menu {
border-top: 3px solid $border-primary;
border-radius: 0px;

View File

@ -174,23 +174,25 @@
}
.modal-container {
background: #ffffff;
left: 50%;
top: 100px;
z-index: 11;
width: 600px;
max-width: 80%;
left: 50%;
margin-left: -300px;
max-height: 80%;
position: fixed;
z-index: 11;
font-size: 14px;
overflow-y: auto;
margin-left: -300px;
background: #ffffff;
animation: jelly 0.5s ease-in-out;
animation: fade-in-white 0.3s ease-in-out;
@include border-radius(5px);
@include box-shadow(
0px 15px 25px 0px rgba(0, 0, 0, 0.03),
0px 20px 45px 5px rgba(0, 0, 0, 0.2)
);
animation: fade-in-white 0.3s ease-in-out;
animation: jelly 0.5s ease-in-out;
@include border-radius(5px);
overflow-y: auto;
max-height: 80%;
.modal-header {
padding: 20px;
@ -205,6 +207,15 @@
.icon {
float: right;
cursor: pointer;
&.remove-icon {
width: 24px;
right: 20px;
height: 24px;
margin-right: 0;
position: absolute;
background-image: url(/themes/velocity/assets/images/Icon-remove.svg);
}
}
}
@ -509,6 +520,11 @@
li {
padding: 3px 0;
height: unset !important;
a {
display: block;
padding: 0 20px !important;
}
}
a {
@ -860,7 +876,8 @@
}
input,
select {
select,
textarea {
width: 100%;
resize: none;
font-size: 16px;
@ -872,6 +889,8 @@
input:active,
input:focus,
textarea:active,
textarea:focus,
select:focus,
select:active {
border-color: $theme-color;
@ -1271,18 +1290,15 @@
i {
color: $black-color;
}
i:hover::before {
// content: "\E93D";
}
}
.checkout-process {
padding: 40px 20px;
.col-7 {
> div {
width: 100%;
.col-lg-7 {
.coupon-container,
> div:not(:first-child) {
margin-top: 20px;
}
}

View File

@ -211,7 +211,7 @@ return [
'login' => 'Login',
'become-user' => 'Become User',
'user-registration' => 'User Registration',
'form-sginup-text' => 'If you are new to our store, we glab to have you as member.',
'form-sginup-text' => 'If you are new to our store, we glad to have you as member.',
],
'forget-password' => [
'login' => 'Login',

View File

@ -37,13 +37,13 @@
<label class="switch">
<input
type="checkbox"
class="control"
id="slides"
name="slides"
type="checkbox"
class="control"
data-vv-as="&quot;slides&quot;"
{{ $metaData && $metaData->slider ? 'checked' : ''}} />
<span class="slider round"></span>
</label>
</div>
@ -111,7 +111,11 @@
<div class="control-group">
<label>{{ __('velocity::app.admin.meta-data.advertisement-four') }}</label>
@if(! isset($metaData->advertisement[4]))
@php
$advertisement = json_decode($metaData->get('advertisement')->all()[0]->advertisement, true);
@endphp
@if(! isset($advertisement[4]))
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[4]">
@ -119,14 +123,14 @@
@else
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[4]" :images='@json($metaData->advertisement[4])'>
input-name="images[4]" :images='@json($advertisement[4])'>
</image-wrapper>
@endif
</div>
<div class="control-group">
<label>{{ __('velocity::app.admin.meta-data.advertisement-three') }}</label>
@if(! isset($metaData->advertisement[3]))
@if(! isset($advertisement[3]))
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[3]">
@ -134,7 +138,7 @@
@else
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[3]" :images='@json($metaData->advertisement[3])'>
input-name="images[3]" :images='@json($advertisement[3])'>
</image-wrapper>
@endif
</div>
@ -142,7 +146,7 @@
<div class="control-group">
<label>{{ __('velocity::app.admin.meta-data.advertisement-two') }}</label>
@if(! isset($metaData->advertisement[2]))
@if(! isset($advertisement[2]))
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[2]">
@ -150,7 +154,7 @@
@else
<image-wrapper
:button-label="'{{ __('velocity::app.admin.meta-data.add-image-btn-title') }}'"
input-name="images[2]" :images='@json($metaData->advertisement[2])'>
input-name="images[2]" :images='@json($advertisement[2])'>
</image-wrapper>
@endif
</div>

View File

@ -337,6 +337,18 @@
saveAddress: function() {
this.disable_button = true;
if (this.allAddress.length > 0) {
let address = this.allAddress.forEach(address => {
if (address.id == this.address.billing.address_id) {
this.address.billing.address1 = [address.address1];
}
if (address.id == this.address.shipping.address_id) {
this.address.shipping.address1 = [address.address1];
}
});
}
this.$http.post("{{ route('shop.checkout.save-address') }}", this.address)
.then(response => {
this.disable_button = false;

View File

@ -2,9 +2,11 @@
<div class="form-container">
<accordian :title="'{{ __('shop::app.checkout.payment-methods') }}'" :active="true">
<div class="form-header mb-30" slot="header">
<h3 class="fw6 display-inbl">
{{ __('shop::app.checkout.onepage.payment-methods') }}
</h3>
<i class="rango-arrow"></i>
</div>
@ -17,13 +19,13 @@
<div>
<label class="radio-container">
<input
v-validate="'required'"
type="radio"
id="{{ $payment['method'] }}"
name="payment[method]"
value="{{ $payment['method'] }}"
v-validate="'required'"
v-model="payment.method"
@change="methodSelected()"
id="{{ $payment['method'] }}"
value="{{ $payment['method'] }}"
data-vv-as="&quot;{{ __('shop::app.checkout.onepage.payment-method') }}&quot;" />
<span class="checkmark"></span>

View File

@ -15,7 +15,14 @@
@push('scripts')
<script>
$(document).ready(function() {
let height = $('.customer-sidebar').css('height');
let sidebarHeight = $('.customer-sidebar').css('height');
let contentHeight = $('.account-layout').css('height');
sidebarHeight = parseInt(sidebarHeight.substring(0, sidebarHeight.length - 2));
contentHeight = parseInt(contentHeight.substring(0, contentHeight.length - 2));
let height = sidebarHeight > contentHeight ? sidebarHeight + 30 : contentHeight;
height = height + "px";
$('.account-content').css('height', height);
});

View File

@ -5,25 +5,10 @@
@endsection
@push('css')
<style type="text/css">
<style>
.account-head {
height: 50px;
}
.remove-icon {
right: 15px;
font-size: 22px;
height: 24px;
text-align: center;
position: absolute;
border-radius: 50%;
color: #333;
width: 24px;
padding: 0px;
top: 10px;
}
.remove-icon:before {
content: "x";
}
</style>
@endpush

View File

@ -66,7 +66,12 @@
@section('body-header')
@include('shop::layouts.top-nav.index')
@include('shop::layouts.header.index')
{!! view_render_event('bagisto.shop.layout.header.before') !!}
@include('shop::layouts.header.index')
{!! view_render_event('bagisto.shop.layout.header.after') !!}
<div class="main-content-wrapper col-12 no-padding">
@php

View File

@ -28,10 +28,9 @@
@if (count(core()->getCurrentChannel()->locales) == 1)
disabled="disabled"
@endif>
@foreach (core()->getCurrentChannel()->locales as $locale)
@if (isset($serachQuery))
@dd(app()->getLocale());
<option
value="?{{ $serachQuery }}&locale={{ $locale->code }}"
{{ $locale->code == app()->getLocale() ? 'selected' : '' }}>

View File

@ -72,11 +72,11 @@ class TaxCest
$this->scenario = [
'object' => Cart::getCart(),
'expectedTaxRates' => [
(string)round((float)$tax1->tax_rate, \Webkul\Tax\Helpers\Tax::TAX_PRECISION)
=> round(11 * $product1->price * $tax1->tax_rate / 100, 4),
(string)round((float)$tax1->tax_rate, 4)
=> round(11 * $product1->price * $tax1->tax_rate / 100, 2),
(string)round((float)$tax2->tax_rate, \Webkul\Tax\Helpers\Tax::TAX_PRECISION)
=> round(7 * $product2->price * $tax2->tax_rate / 100, 4),
(string)round((float)$tax2->tax_rate, 4)
=> round(7 * $product2->price * $tax2->tax_rate / 100, 2),
],
'expectedTaxTotal' =>
round(