daily sync
This commit is contained in:
parent
2ef2aa1abf
commit
c0dfae9af4
|
|
@ -162,7 +162,7 @@
|
|||
<select class="control" name="cart_attributes[]" v-model="cart_attrs[index].attribute" v-validate="'required'" title="You Can Make Multiple Selections Here" style="margin-right: 15px;" v-on:change="enableCondition($event, index)">
|
||||
<option disabled="disabled">Select attribute</option>
|
||||
|
||||
<option v-for="(cart_attribute, index1) in cart_attributes" :value="cart_attribute.id" :key="index1">@{{ cart_attribute.name }}</option>
|
||||
<option v-for="(cart_attribute, index1) in cart_attributes" :value="cart_attribute.name" :key="index1">@{{ cart_attribute.name }}</option>
|
||||
</select>
|
||||
|
||||
<div v-if='cart_attrs[index].type == "string"'>
|
||||
|
|
@ -256,11 +256,13 @@
|
|||
apply_prct: false,
|
||||
apply_to_shipping: null,
|
||||
buy_atleast: null,
|
||||
attribute_options: @json($criteria[1]),
|
||||
cart_attributes: @json($criteria[0]).cart,
|
||||
cart_attr: {
|
||||
attribute: null,
|
||||
condition: null,
|
||||
value: null
|
||||
value: null,
|
||||
type: null
|
||||
},
|
||||
cart_attrs: [],
|
||||
cart_attrs_count: 0,
|
||||
|
|
@ -334,8 +336,6 @@
|
|||
this.cart_attrs[pushedIndex].type = this.cart_attributes[i].type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
removeCartAttr(index) {
|
||||
|
|
|
|||
|
|
@ -41,15 +41,16 @@ return [
|
|||
|
||||
'conditions' => [
|
||||
'numeric' => [
|
||||
0 => 'Greater than',
|
||||
1 => 'Lesser than',
|
||||
2 => 'Equals'
|
||||
0 => 'Equals',
|
||||
1 => 'Equals or greater',
|
||||
2 => 'Equals or lesser',
|
||||
3 => 'Greater than',
|
||||
4 => 'Lesser than',
|
||||
],
|
||||
|
||||
'text' => [
|
||||
0 => 'is',
|
||||
1 => 'is any of',
|
||||
2 => 'contains'
|
||||
1 => 'is not'
|
||||
],
|
||||
]
|
||||
];
|
||||
|
|
@ -11,6 +11,7 @@ use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
|
|||
use Webkul\Category\Repositories\CategoryRepository as Category;
|
||||
use Webkul\Product\Repositories\ProductFlatRepository as Product;
|
||||
use Webkul\Discount\Repositories\CartRuleRepository as CartRule;
|
||||
use Webkul\Checkout\Repositories\CartRepository as Cart;
|
||||
|
||||
/**
|
||||
* Cart Rule controller
|
||||
|
|
@ -53,22 +54,22 @@ class CartRuleController extends Controller
|
|||
/**
|
||||
* To hold the Cart repository instance
|
||||
*/
|
||||
protected $CartRule;
|
||||
protected $cartRule;
|
||||
|
||||
public function __construct(Attribute $attribute, AttributeFamily $attributeFamily, Category $category, Product $product, CartRule $CartRule)
|
||||
/**
|
||||
* To hold the cart repository instance
|
||||
*/
|
||||
protected $cart;
|
||||
|
||||
public function __construct(Attribute $attribute, AttributeFamily $attributeFamily, Category $category, Product $product, CartRule $cartRule, Cart $cart)
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
|
||||
$this->attribute = $attribute;
|
||||
|
||||
$this->attributeFamily = $attributeFamily;
|
||||
|
||||
$this->category = $category;
|
||||
|
||||
$this->product = $product;
|
||||
|
||||
$this->CartRule = $CartRule;
|
||||
|
||||
$this->CartRule = $cartRule;
|
||||
$this->cart = $cart;
|
||||
$this->appliedConfig = [
|
||||
0 => trans('admin::app.promotion.Cart.apply-percent'),
|
||||
1 => trans('admin::app.promotion.Cart.apply-fixed'),
|
||||
|
|
@ -84,9 +85,11 @@ class CartRuleController extends Controller
|
|||
|
||||
public function create()
|
||||
{
|
||||
// dd(config('pricerules'));
|
||||
$countries = core()->getAllCountries();
|
||||
|
||||
return view($this->_config['view'])->with('criteria', [config('pricerules')]);
|
||||
$attributesWithOptions = $this->fetchOptionableAttributes();
|
||||
|
||||
return view($this->_config['view'])->with('criteria', [config('pricerules'), $attributesWithOptions]);
|
||||
}
|
||||
|
||||
public function store()
|
||||
|
|
@ -101,11 +104,19 @@ class CartRuleController extends Controller
|
|||
'apply' => 'numeric|min:1|max:4'
|
||||
]);
|
||||
|
||||
$CartRule = $this->CartRule->create(request()->all());
|
||||
$cartRule = $this->cartRule->create(request()->all());
|
||||
}
|
||||
|
||||
public function fetchAttribute()
|
||||
public function fetchOptionableAttributes()
|
||||
{
|
||||
return request()->all();
|
||||
$attributesWithOptions = array();
|
||||
|
||||
foreach($this->attribute->all() as $attribute) {
|
||||
if (($attribute->type == 'select' || $attribute->type == 'multiselect') && $attribute->code != 'tax_category_id') {
|
||||
$attributesWithOptions[$attribute->admin_name] = $attribute->options->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
return $attributesWithOptions;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace Webkul\Discount\Http\Controllers;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
use Webkul\Attribute\Repositories\AttributeRepository as Attribute;
|
||||
use Webkul\Attribute\Repositories\AttributeFamilyRepository as AttributeFamily;
|
||||
|
|
@ -84,9 +83,13 @@ class CatalogRuleController extends Controller
|
|||
'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',
|
||||
'apply' => 'numeric|min:1|max:4'
|
||||
'priority' => 'required|numeric',
|
||||
'criteria' => 'required',
|
||||
'apply' => 'required|numeric|min:1|max:4'
|
||||
]);
|
||||
|
||||
dd(request()->all());
|
||||
|
||||
$catalogRule = $this->catalogRule->create(request()->all());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue