Cron Jobs, Reminder, Fonts, Members / Wizard / Price, Credit and Promotion
This commit is contained in:
parent
a0f4eda6ea
commit
6167273a48
204 changed files with 8746 additions and 215 deletions
|
|
@ -167,21 +167,24 @@ class OrderController extends Controller
|
|||
|
||||
$data = Request::all();
|
||||
$user = User::find(Auth::user()->id);
|
||||
|
||||
$rules = array(
|
||||
'shipping_salutation' => 'required',
|
||||
'shipping_firstname'=>'required',
|
||||
'shipping_lastname'=>'required',
|
||||
'shipping_address'=>'required',
|
||||
'shipping_zipcode'=>'required',
|
||||
'shipping_firstname' => 'required',
|
||||
'shipping_lastname' => 'required',
|
||||
'shipping_address' => 'required',
|
||||
'shipping_zipcode' => 'required',
|
||||
'shipping_city' => 'required',
|
||||
'shipping_state' => 'required',
|
||||
);
|
||||
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
if(Yard::instance('shopping')->getNumComp() > 0){
|
||||
|
||||
if(Yard::instance('shopping')->getNumComp() > 0){
|
||||
if(!isset($data['switchers-comp-product'])){
|
||||
$validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus'));
|
||||
}else{
|
||||
|
|
@ -198,9 +201,12 @@ class OrderController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
/*do {
|
||||
/*
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );*/
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
*/
|
||||
|
||||
$identifier = Util::getToken();
|
||||
$data['is_from'] = 'user_order';
|
||||
$data['is_for'] = $for;
|
||||
|
|
@ -219,7 +225,6 @@ class OrderController extends Controller
|
|||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'shopping_data' => $data,
|
||||
'back' => url()->previous(),
|
||||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
*/
|
||||
|
|
@ -301,7 +306,6 @@ class OrderController extends Controller
|
|||
return \DataTables::eloquent($query)
|
||||
|
||||
->addColumn('product', function (Product $product) {
|
||||
|
||||
$cartItem = Yard::instance('shopping')->getCartItemByProduct($product->id);
|
||||
$qty = isset($cartItem->qty) ? $cartItem->qty : 0;
|
||||
$rowId = isset($cartItem->rowId) ? $cartItem->rowId : '';
|
||||
|
|
@ -318,7 +322,6 @@ class OrderController extends Controller
|
|||
</div>';
|
||||
})
|
||||
/*
|
||||
|
||||
->addColumn('add_card', function (Product $product) {
|
||||
return '<button type="button" class="btn btn-sm btn-md-extra btn-secondary add-product-basket" data-product-id="'.$product->id.'">
|
||||
<strong>€ '.$product->getFormattedPriceWith().'</strong> +<span class="ion ion-md-cart"></span>
|
||||
|
|
@ -455,6 +458,16 @@ class OrderController extends Controller
|
|||
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
|
||||
}
|
||||
}
|
||||
if($data['action'] === 'reCalculateCart') {
|
||||
//set use_payment_credit
|
||||
$data['reduce_payment_credit'] = $data['reduce_payment_credit'] == 'true' ? true: false;
|
||||
Yard::instance('shopping')->setReducePaymentCredit($data['reduce_payment_credit']);
|
||||
Yard::instance('shopping')->reCalculate();
|
||||
$html_card = view("user.order.yard_view_form", $data)->render();
|
||||
$html_comp = view("user.order.comp_product", $data)->render();
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
|
||||
}
|
||||
|
||||
if($data['action'] === 'clearCart') {
|
||||
Yard::instance('shopping')->destroy();
|
||||
return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html_card'=>'', 'html_comp'=>'']);
|
||||
|
|
@ -507,27 +520,27 @@ class OrderController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($data['comp_product_id'])) {
|
||||
if ($product = Product::find($data['comp_product_id'])) {
|
||||
$image = "";
|
||||
if ($product->images->count()) {
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, 0,
|
||||
[
|
||||
'image' => $image,
|
||||
'slug' => $product->slug,
|
||||
'weight' => 0,
|
||||
'single_commission' => 0,
|
||||
'amount_commission' => 0,
|
||||
'value_commission' => 0,
|
||||
'partner_commission' => 0,
|
||||
'comp' => $data['comp_num'],
|
||||
'product_id' => $product->id
|
||||
]);
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
if(isset($data['comp_product_id'])) {
|
||||
if ($product = Product::find($data['comp_product_id'])) {
|
||||
$image = "";
|
||||
if ($product->images->count()) {
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, 0,
|
||||
[
|
||||
'image' => $image,
|
||||
'slug' => $product->slug,
|
||||
'weight' => 0,
|
||||
'single_commission' => 0,
|
||||
'amount_commission' => 0,
|
||||
'value_commission' => 0,
|
||||
'partner_commission' => 0,
|
||||
'comp' => $data['comp_num'],
|
||||
'product_id' => $product->id
|
||||
]);
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getCompProducts($for){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue