This commit is contained in:
Prashant Singh 2019-09-02 19:53:25 +05:30
commit 108795778b
19 changed files with 358 additions and 130 deletions

View File

@ -0,0 +1,66 @@
<html>
<head>
<title>Feature</title>
<style>
.bagisto
{
color: blue;
}
</style>
</head>
<body>
<div>
<h3>Title</h3>
<hr>
<p class="bagisto">
A well written title should contain a clear, brief explanation of the Feature, making emphasis on the most important points.
</p>
</div>
<div>
<h3>Preconditions</h3>
<hr>
<p class="bagisto">Please provide as detailed information about your environment as possible.</p>
<ul>
<li> framework Version:</li>
<li>Commit id:</li>
</ul>
</div>
<div>
<h3>Description</h3>
<hr>
<p class="bagisto">Description helps the developer to understand the Feature.
</p>
</div>
<div>
<h3>Steps to reproduce</h3>
<hr>
<p class="bagisto">It is important to provide a set of clear steps to that location where feature need to be added. If relevant please include code samples.</p>
<ol>
<li> step1</li>
<li> step2</li>
</ol>
</div>

29
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,29 @@
# Bug report
### Title
**Title is a vital part of bug report for developer and triager to quickly identify a unique issue.**
A well written title should contain a clear, brief explanation of the issue, making emphasis on the most important points.
### Issue Description
**Bug description helps the developer to understand the bug.It describes the problem encountered.**
### Preconditions
**Please provide as detailed information about your environment as possible.**
1. framework Version.
2. Commit id.
### Steps to reproduce
**It is important to provide a set of clear steps to reproduce this bug.If relevant please include code samples.**
1. step1
2. step2
### Expected result
**Tell us what should happen.**
* [Screenshots, logs or description]
### Actual result
**Tell us what happens instead.**
* [Tell us what happens instead]

View File

@ -48,6 +48,7 @@ It packs in lots of demanding features that allows your business to scale in no
* Customer Cart, Wishlist, Product Reviews.
* Simple and Configurable Products.
* Price rules (Discount) inbuilt.
* CMS Pages.
* Check out [click here](https://bagisto.com/features/).
**For Developers**:

48
SUPPORT_TEMPLATE.md Normal file
View File

@ -0,0 +1,48 @@
<html>
<head>
<title>Support</title>
<style>
.bagisto
{
color: blue;
}
</style>
</head>
<body>
<div>
<h3>Title</h3>
<hr>
<p class="bagisto">
Title is a vital part of bug report for developer and triager to quickly identify a unique issue.
<br>
A well written title should contain a clear, brief explanation of the issue, making emphasis on the most important points.
</p>
</div>
<div>
<h3>Preconditions</h3>
<hr>
<p class="bagisto">Please provide as detailed information about your environment as possible.</p>
<ul>
<li> framework Version:</li>
<li>Commit id:</li>
</ul>
</div>
<div>
<h3>Description</h3>
<hr>
<p class="bagisto">Description helps the developer to understand the exact scenario.It describes the problem encountered.</p>
</div>
<div>
<h3>Steps to reproduce</h3>
<hr>
<p class="bagisto">It is important to provide a set of clear steps to reproduce that scenario. If relevant please include code samples.</p>
<ol>
<li> step1</li>
<li> step2</li>
</ol>
</div>

View File

@ -113,7 +113,8 @@
"extra": {
"laravel": {
"dont-discover": [
"barryvdh/laravel-debugbar"
"barryvdh/laravel-debugbar",
"laravel/dusk"
]
}
},

View File

@ -42,7 +42,7 @@ return [
'key' => 'catalog.products',
'name' => 'admin::app.layouts.products',
'route' => 'admin.catalog.products.index',
'sort' => 4,
'sort' => 1,
'icon-class' => ''
], [
'key' => 'catalog.categories',
@ -54,13 +54,13 @@ return [
'key' => 'catalog.attributes',
'name' => 'admin::app.layouts.attributes',
'route' => 'admin.catalog.attributes.index',
'sort' => 1,
'sort' => 2,
'icon-class' => ''
], [
'key' => 'catalog.families',
'name' => 'admin::app.layouts.attribute-families',
'route' => 'admin.catalog.families.index',
'sort' => 2,
'sort' => 4,
'icon-class' => ''
], [
'key' => 'customers',

View File

@ -991,6 +991,8 @@ return [
'cms' => [
'pages' => [
'general' => 'General',
'seo' => 'SEO',
'pages' => 'Page',
'title' => 'pages',
'add-title' => 'Add Page',
@ -998,7 +1000,7 @@ return [
'url-key' => 'URL Key',
'channel' => 'Channel',
'locale' => 'Locale',
'create-btn-title' => 'Add Page',
'create-btn-title' => 'Save Page',
'edit-title' => 'Edit Page',
'edit-btn-title' => 'Save Page',
'create-success' => 'Page created successfully',

View File

@ -28,91 +28,98 @@
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.cms.pages.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
<label for="page_title" class="required">{{ __('admin::app.cms.pages.page-title') }}</label>
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
<label for="page_title" class="required">{{ __('admin::app.cms.pages.page-title') }}</label>
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ old('page_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.page-title') }}&quot;">
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ old('page_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.page-title') }}&quot;">
<span class="control-error" v-if="errors.has('page_title')">@{{ errors.first('page_title') }}</span>
</div>
<span class="control-error" v-if="errors.has('page_title')">@{{ errors.first('page_title') }}</span>
</div>
<div class="control-group" :class="[errors.has('url_key') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.url-key') }}</label>
<div class="control-group" :class="[errors.has('url_key') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.url-key') }}</label>
<input type="text" class="control" name="url_key" v-validate="'required'" value="{{ old('url-key') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.url-key') }}&quot;" v-slugify>
<input type="text" class="control" name="url_key" v-validate="'required'" value="{{ old('url-key') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.url-key') }}&quot;" v-slugify>
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
</div>
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
</div>
@inject('channels', 'Webkul\Core\Repositories\ChannelRepository')
@inject('locales', 'Webkul\Core\Repositories\LocaleRepository')
@inject('channels', 'Webkul\Core\Repositories\ChannelRepository')
@inject('locales', 'Webkul\Core\Repositories\LocaleRepository')
<div class="control-group" :class="[errors.has('channels[]') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.channel') }}</label>
<div class="control-group" :class="[errors.has('channels[]') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.channel') }}</label>
<select type="text" class="control" name="channels[]" v-validate="'required'" value="{{ old('channel[]') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.channel') }}&quot;" multiple="multiple">
@foreach($channels->all() as $channel)
<option value="{{ $channel->id }}">{{ $channel->name }}</option>
@endforeach
</select>
<select type="text" class="control" name="channels[]" v-validate="'required'" value="{{ old('channel[]') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.channel') }}&quot;" multiple="multiple">
@foreach($channels->all() as $channel)
<option value="{{ $channel->id }}">{{ $channel->name }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channels[]')">@{{ errors.first('channels[]') }}</span>
</div>
<span class="control-error" v-if="errors.has('channels[]')">@{{ errors.first('channels[]') }}</span>
</div>
<div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.locale') }}</label>
<div class="control-group" :class="[errors.has('locales[]') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.locale') }}</label>
<select type="text" class="control" name="locales[]" v-validate="'required'" value="{{ old('locale[]') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.locale') }}&quot;" multiple="multiple">
@foreach($locales->all() as $locale)
<option value="{{ $locale->id }}">{{ $locale->name }}</option>
@endforeach
</select>
<select type="text" class="control" name="locales[]" v-validate="'required'" value="{{ old('locale[]') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.locale') }}&quot;" multiple="multiple">
@foreach($locales->all() as $locale)
<option value="{{ $locale->id }}">{{ $locale->name }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('locales[]')">@{{ errors.first('locales[]') }}</span>
</div>
<span class="control-error" v-if="errors.has('locales[]')">@{{ errors.first('locales[]') }}</span>
</div>
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" value="{{ old('html_content') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;"></textarea>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" value="{{ old('html_content') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;"></textarea>
{!! __('admin::app.cms.pages.one-col') !!}
{!! __('admin::app.cms.pages.two-col') !!}
{!! __('admin::app.cms.pages.three-col') !!}
{!! __('admin::app.cms.pages.one-col') !!}
{!! __('admin::app.cms.pages.two-col') !!}
{!! __('admin::app.cms.pages.three-col') !!}
<div class="mt-10 mb-10">
<a target="_blank" href="{{ route('ui.helper.classes') }}" class="btn btn-sm btn-primary">
{{ __('admin::app.cms.pages.helper-classes') }}
</a>
</div>
<div class="mt-10 mb-10">
<a target="_blank" href="{{ route('ui.helper.classes') }}" class="btn btn-sm btn-primary">
{{ __('admin::app.cms.pages.helper-classes') }}
</a>
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
</div>
</div>
</accordian>
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
</div>
<accordian :title="'{{ __('admin::app.cms.pages.seo') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('meta_title') ? 'has-error' : '']">
<label for="meta_title" class="required">{{ __('admin::app.cms.pages.meta_title') }}</label>
<div class="control-group" :class="[errors.has('meta_title') ? 'has-error' : '']">
<label for="meta_title" class="required">{{ __('admin::app.cms.pages.meta_title') }}</label>
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ old('meta_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_title') }}&quot;">
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ old('meta_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_title') }}&quot;">
<span class="control-error" v-if="errors.has('meta_title')">@{{ errors.first('meta_title') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_title')">@{{ errors.first('meta_title') }}</span>
</div>
<div class="control-group" :class="[errors.has('meta_keywords') ? 'has-error' : '']">
<label for="meta_keywords" class="required">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<div class="control-group" :class="[errors.has('meta_keywords') ? 'has-error' : '']">
<label for="meta_keywords" class="required">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" value="{{ old('meta_keywords') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_keywords') }}&quot;"></textarea>
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" value="{{ old('meta_keywords') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_keywords') }}&quot;"></textarea>
<span class="control-error" v-if="errors.has('meta_keywords')">@{{ errors.first('meta_keywords') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_keywords')">@{{ errors.first('meta_keywords') }}</span>
</div>
<div class="control-group" :class="[errors.has('meta_description') ? 'has-error' : '']">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<div class="control-group" :class="[errors.has('meta_description') ? 'has-error' : '']">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<textarea type="text" class="control" name="meta_description" value="{{ old('meta_description') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_description') }}&quot;"></textarea>
<textarea type="text" class="control" name="meta_description" value="{{ old('meta_description') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_description') }}&quot;"></textarea>
<span class="control-error" v-if="errors.has('meta_description')">@{{ errors.first('meta_description') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_description')">@{{ errors.first('meta_description') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>

View File

@ -32,64 +32,71 @@
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.cms.pages.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
<label for="page_title" class="required">{{ __('admin::app.cms.pages.page-title') }}</label>
<div class="control-group" :class="[errors.has('page_title') ? 'has-error' : '']">
<label for="page_title" class="required">{{ __('admin::app.cms.pages.page-title') }}</label>
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ $page->page_title ?? old('page_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.page-title') }}&quot;">
<input type="text" class="control" name="page_title" v-validate="'required'" value="{{ $page->page_title ?? old('page_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.page-title') }}&quot;">
<span class="control-error" v-if="errors.has('page_title')">@{{ errors.first('page_title') }}</span>
</div>
<span class="control-error" v-if="errors.has('page_title')">@{{ errors.first('page_title') }}</span>
</div>
<div class="control-group" :class="[errors.has('url_key') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.url-key') }}</label>
<div class="control-group" :class="[errors.has('url_key') ? 'has-error' : '']">
<label for="url-key" class="required">{{ __('admin::app.cms.pages.url-key') }}</label>
<input type="text" class="control" name="url_key" v-validate="'required'" value="{{ $page->url_key ?? old('url_key') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.url-key') }}&quot;" disabled>
<input type="text" class="control" name="url_key" v-validate="'required'" value="{{ $page->url_key ?? old('url_key') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.url-key') }}&quot;" disabled>
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
</div>
<span class="control-error" v-if="errors.has('url_key')">@{{ errors.first('url_key') }}</span>
</div>
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<div class="control-group" :class="[errors.has('html_content') ? 'has-error' : '']">
<label for="html_content" class="required">{{ __('admin::app.cms.pages.content') }}</label>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;">{{ $page->html_content ?? old('html_content') }}</textarea>
<textarea type="text" class="control" id="content" name="html_content" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.content') }}&quot;">{{ $page->html_content ?? old('html_content') }}</textarea>
{!! __('admin::app.cms.pages.one-col') !!}
{!! __('admin::app.cms.pages.two-col') !!}
{!! __('admin::app.cms.pages.three-col') !!}
{!! __('admin::app.cms.pages.one-col') !!}
{!! __('admin::app.cms.pages.two-col') !!}
{!! __('admin::app.cms.pages.three-col') !!}
<div class="mt-10 mb-10">
<a target="_blank" href="{{ route('ui.helper.classes') }}" class="btn btn-sm btn-primary">
{{ __('admin::app.cms.pages.helper-classes') }}
</a>
</div>
<div class="mt-10 mb-10">
<a target="_blank" href="{{ route('ui.helper.classes') }}" class="btn btn-sm btn-primary">
{{ __('admin::app.cms.pages.helper-classes') }}
</a>
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
</div>
</div>
</accordian>
<span class="control-error" v-if="errors.has('html_content')">@{{ errors.first('html_content') }}</span>
</div>
<accordian :title="'{{ __('admin::app.cms.pages.seo') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('meta_title') ? 'has-error' : '']">
<label for="meta_title" class="required">{{ __('admin::app.cms.pages.meta_title') }}</label>
<div class="control-group" :class="[errors.has('meta_title') ? 'has-error' : '']">
<label for="meta_title" class="required">{{ __('admin::app.cms.pages.meta_title') }}</label>
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ $page->meta_title ?? old('meta_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_title') }}&quot;">
<input type="text" class="control" name="meta_title" v-validate="'required'" value="{{ $page->meta_title ?? old('meta_title') }}" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_title') }}&quot;">
<span class="control-error" v-if="errors.has('meta_title')">@{{ errors.first('meta_title') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_title')">@{{ errors.first('meta_title') }}</span>
</div>
<div class="control-group" :class="[errors.has('meta_keywords') ? 'has-error' : '']">
<label for="meta_keywords" class="required">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<div class="control-group" :class="[errors.has('meta_keywords') ? 'has-error' : '']">
<label for="meta_keywords" class="required">{{ __('admin::app.cms.pages.meta_keywords') }}</label>
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_keywords') }}&quot;">{{ $page->meta_keywords ?? old('meta_keywords') }}</textarea>
<textarea type="text" class="control" name="meta_keywords" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_keywords') }}&quot;">{{ $page->meta_keywords ?? old('meta_keywords') }}</textarea>
<span class="control-error" v-if="errors.has('meta_keywords')">@{{ errors.first('meta_keywords') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_keywords')">@{{ errors.first('meta_keywords') }}</span>
</div>
<div class="control-group" :class="[errors.has('meta_description') ? 'has-error' : '']">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<div class="control-group" :class="[errors.has('meta_description') ? 'has-error' : '']">
<label for="meta_description">{{ __('admin::app.cms.pages.meta_description') }}</label>
<textarea type="text" class="control" name="meta_description" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_description') }}&quot;">{{ $page->meta_description ?? old('meta_description') }}</textarea>
<textarea type="text" class="control" name="meta_description" data-vv-as="&quot;{{ __('admin::app.cms.pages.meta_description') }}&quot;">{{ $page->meta_description ?? old('meta_description') }}</textarea>
<span class="control-error" v-if="errors.has('meta_description')">@{{ errors.first('meta_description') }}</span>
</div>
<span class="control-error" v-if="errors.has('meta_description')">@{{ errors.first('meta_description') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>

View File

@ -100,6 +100,10 @@
<input type="password" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as="&quot;{{ trans($field['title']) }}&quot;">
@elseif ($field['type'] == 'color')
<input type="color" v-validate="'{{ $validations }}'" class="control" id="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" name="{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]" value="{{ old($name) ?: core()->getConfigData($name) }}" data-vv-as="&quot;{{ trans($field['title']) }}&quot;">
@elseif ($field['type'] == 'textarea')

View File

@ -313,6 +313,10 @@ class Cart {
$weight = ($product->type == 'configurable' ? $childProduct->weight : $product->weight);
if (gettype($weight)) {
$weight = floatval($weight);
}
$parentData = [
'sku' => $product->sku,
'quantity' => $data['quantity'],

View File

@ -12,6 +12,6 @@ return [
'remove-all-success' => 'All The Items From Your Wishlist Have Been Removed',
],
'reviews' => [
'empty' => 'You Have Not Reviewed Any Of Product Yet'
'empty' => 'You have not reviewed any of product yet'
]
];

View File

@ -36,20 +36,24 @@ class FixedAmount extends Action
if ($discQuantity > 1) {
if ($itemQuantity >= $discQuantity) {
if ($rule->disc_amount > $itemPrice) {
$discount = round(($itemPrice - $rule->disc_amount), 4) * $discQuantity;
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $itemPrice;
$discount = $rule->disc_amount;
}
} else if ($itemQuantity < $discQuantity) {
if ($rule->disc_amount > $itemPrice) {
$discount = round(($itemPrice - $rule->disc_amount), 4) * $itemQuantity;
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $itemPrice;
$discount = $rule->disc_amount;
}
}
} else {
$discount = round(($itemPrice - $rule->disc_amount), 4);
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $rule->disc_amount;
}
}
if ($itemProductId == $productID) {
@ -78,12 +82,24 @@ class FixedAmount extends Action
if ($discQuantity > 1) {
if ($itemQuantity >= $discQuantity) {
$discount = round(($itemPrice - $rule->disc_amount), 4) * $discQuantity;
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $rule->disc_amount;
}
} else if ($itemQuantity < $discQuantity) {
$discount = round(($itemPrice - $rule->disc_amount), 4) * $itemQuantity;
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $rule->disc_amount;
}
}
} else {
$discount = round(($itemPrice - $rule->disc_amount), 4);
if ($rule->disc_amount >= $itemPrice) {
$discount = round($itemPrice * $discQuantity, 4);
} else {
$discount = $rule->disc_amount;
}
}
$totalDiscount = $totalDiscount + $discount;

View File

@ -53,11 +53,23 @@ class PercentOfProduct extends Action
if ($discQuantity > 1) {
if ($itemQuantity >= $discQuantity) {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4) * $discQuantity;
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
} else if ($itemQuantity < $discQuantity) {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4) * $itemQuantity;
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
}
} else {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4);
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
}
if ($itemProductId == $productID) {
@ -87,11 +99,23 @@ class PercentOfProduct extends Action
if ($discQuantity > 1) {
if ($itemQuantity >= $discQuantity) {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4) * $discQuantity;
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
} else if ($itemQuantity < $discQuantity) {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4) * $itemQuantity;
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
}
} else {
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4);
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
}
$totalDiscount = $totalDiscount + $discount;

View File

@ -47,6 +47,10 @@ class WholeCartToPercent extends Action
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4);
if ($discount >= $itemPrice) {
$discount = $itemPrice;
}
$totalDiscount = $totalDiscount + $discount;
if ($item->product_id == $productID) {
@ -76,26 +80,28 @@ class WholeCartToPercent extends Action
$discount = round(($itemPrice * $rule->disc_amount) / 100, 4);
if ($discount > $itemPrice) {
$discount = $itemPrice;
}
$totalDiscount = $totalDiscount + $discount;
if ($item->product_id == $productID) {
$report = array();
$report = array();
$report['item_id'] = $item->id;
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
$report['item_id'] = $item->id;
$report['product_id'] = $item->child ? $item->child->product_id : $item->product_id;
if ($discount <= $itemPrice) {
$report['discount'] = $discount;
} else {
$report['discount'] = $itemPrice;
}
$report['formatted_discount'] = core()->currency(round($discount, 4));
$impact->push($report);
unset($report);
if ($discount <= $itemPrice) {
$report['discount'] = $discount;
} else {
$report['discount'] = $itemPrice;
}
$report['formatted_discount'] = core()->currency(round($discount, 4));
$impact->push($report);
unset($report);
}
}

View File

@ -70,9 +70,16 @@ class ConvertXToProductId
$this->conditionSymbols = config('pricerules.cart.conditions.symbols');
}
/**
* Collects the attribute and category conditions
*
* @param Integer $ruleId
*
* @param Object $attrribute_conditions
*/
public function convertX($ruleId, $attribute_conditions)
{
$attributeConditions = json_decode($attribute_conditions);
$attributeConditions = $attribute_conditions;
$categoryValues = $attributeConditions->categories ?? null;

View File

@ -668,7 +668,7 @@ abstract class Discount
if (! $result) {
$this->clearDiscount();
$alreadyAppliedRule->delete();
$alreadyAppliedRule->first()->delete();
} else {
$this->reassess($alreadyAppliedCartRule);
}

View File

@ -269,6 +269,7 @@ class CartRuleController extends Controller
// $coupons['limit'] = $data['usage_limit'];
// }
// create a cart rule
$ruleCreated = $this->cartRule->create($data);

View File

@ -13,10 +13,15 @@
<p>{{ __('shop::app.checkout.success.info') }}</p>
{{ view_render_event('bagisto.shop.checkout.continue-shopping.before', ['order' => $order]) }}
<div class="misc-controls">
<a style="display: inline-block" href="{{ route('shop.home.index') }}" class="btn btn-lg btn-primary">
{{ __('shop::app.checkout.cart.continue-shopping') }}
</a>
</div>
{{ view_render_event('bagisto.shop.checkout.continue-shopping.after', ['order' => $order]) }}
</div>
@endsection
@endsection