Merge branch 'development' of https://github.com/prashant-webkul/bagisto into development

This commit is contained in:
Prashant Singh 2019-05-21 14:03:10 +05:30
commit e161394c73
5 changed files with 23 additions and 11 deletions

View File

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

View File

@ -59,7 +59,7 @@
<div class="control-group" :class="[errors.has('customer_groups[]') ? 'has-error' : '']">
<label for="customer_groups" class="required">{{ __('admin::app.promotion.general-info.cust-groups') }}</label>
<select type="text" class="control" name="customer_groups[]" v-model="customer_groups" v-validate="'required'" value="{{ old('customer_groups') }}" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.cust-groups') }}&quot;" multiple="multiple">
<select type="text" class="control" name="customer_groups[]" v-model="customer_groups" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.cust-groups') }}&quot;" multiple="multiple">
<option disabled="disabled">Select Customer Groups</option>
@foreach(app('Webkul\Customer\Repositories\CustomerGroupRepository')->all() as $channel)
<option value="{{ $channel->id }}">{{ $channel->name }}</option>
@ -72,7 +72,7 @@
<div class="control-group" :class="[errors.has('channels[]') ? 'has-error' : '']">
<label for="channels" class="required">{{ __('admin::app.promotion.general-info.channels') }}</label>
<select type="text" class="control" name="channels[]" v-model="channels" v-validate="'required'" value="{{ old('channels') }}" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.channels') }}&quot;" multiple="multiple">
<select type="text" class="control" name="channels[]" v-model="channels" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.channels') }}&quot;" multiple="multiple">
<option disabled="disabled">Select Channels</option>
@foreach(app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}">{{ $channel->name }}</option>
@ -118,7 +118,7 @@
<div class="control-group" :class="[errors.has('criteria') ? 'has-error' : '']">
<label for="criteria" class="required">{{ __('admin::app.promotion.general-info.add-condition') }}</label>
<select type="text" class="control" name="criteria" v-model="criteria" v-validate="'required'" value="{{ old('channels') }}" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.cust-groups') }}&quot;">
<select type="text" class="control" name="criteria" v-model="criteria" v-validate="'required'" value="" data-vv-as="&quot;{{ __('admin::app.promotion.general-info.cust-groups') }}&quot;">
<option value="condition_combination">Condition Combination</option>
<option value="attribute">Attribute</option>
{{-- <option value="category">Category</option> --}}
@ -245,6 +245,8 @@
</div>
</div>
</div>
<input type="hidden" name="all_conditions[]" v-model="all_conditions">
</div>
</div>
</accordian>
@ -323,7 +325,8 @@
end_other_rules: null,
name: null,
priority: 0,
starts_from: null
starts_from: null,
all_conditions: []
}
},
@ -397,6 +400,10 @@
removeCat(index) {
this.cats.splice(index, 1);
},
beforeOnSubmit() {
this.all_conditions = JSON.stringify(this.attributes_list);
}
}
});

View File

@ -45,12 +45,14 @@ return [
1 => 'Equals or greater',
2 => 'Equals or lesser',
3 => 'Greater than',
4 => 'Lesser than',
4 => 'Lesser than'
],
'text' => [
0 => 'is',
1 => 'is not'
1 => 'is not',
2 => 'contains',
3 => 'does not contains'
],
]
];

View File

@ -90,6 +90,7 @@ class CartRuleController extends Controller
public function store()
{
dd(request()->all());
$this->validate(request(), [
'name' => 'required|string',
'description' => 'string',

View File

@ -76,20 +76,21 @@ class CatalogRuleController extends Controller
public function store()
{
// dd(request()->all());
$this->validate(request(), [
'name' => 'required|string',
'description' => 'string',
'customer_groups' => 'required|array',
'channels' => 'required|array',
'starts_from' => 'required|date_format:Y-m-d H:i:s',
'ends_till' => 'required|date_format:Y-m-d H:i:s',
'customer_groups' => 'required',
'channels' => 'required',
'starts_from' => 'required|date',
'ends_till' => 'required|date',
'priority' => 'required|numeric',
'criteria' => 'required',
'apply' => 'required|numeric|min:1|max:4'
]);
dd(request()->all());
$catalogRule = $this->catalogRule->create(request()->all());
}