cart responsive, Checkout from cart
This commit is contained in:
parent
bde1095014
commit
fb27009339
17 changed files with 501 additions and 319 deletions
46
.idea/workspace.xml
generated
46
.idea/workspace.xml
generated
|
|
@ -5,32 +5,23 @@
|
|||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/public/js/iq-shopping-cart.js" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/resources/views/user/order/comp_product.blade.php" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/resources/views/user/order/yard_view_form.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/CustomerController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/CustomerController.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/OrderController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/OrderController.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Models/Product.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Product.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Services/Shop.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Shop.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/CardController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/CardController.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/CheckoutController.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Http/Middleware/Checkout.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Middleware/Checkout.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingInstance.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingInstance.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingUser.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingUser.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Services/HTMLHelper.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/HTMLHelper.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Services/Util.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Util.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/Services/Yard.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Yard.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/helpers.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/helpers.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/public/js/custom.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/custom.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/lang/de/validation.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/validation.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/admin/customer/_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/customer/_detail.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/admin/modal/show_product.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/modal/show_product.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/admin/shipping/edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/shipping/edit.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/customer/detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/customer/detail.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/membership/index.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/membership/index.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/order/delivery.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/delivery.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/order/list_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/list_form.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/order/shipping_me.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/shipping_me.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/user/order/shipping_ot.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/shipping_ot.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_21_195012_create_shopping_instances_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_21_195012_create_shopping_instances_table.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_161530_create_shopping_users_table.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/card.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/checkout.blade.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/web/user/layouts/application.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/user/layouts/application.blade.php" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -532,6 +523,9 @@
|
|||
<workItem from="1596873885106" duration="22962000" />
|
||||
<workItem from="1597138806746" duration="5000" />
|
||||
<workItem from="1597216110022" duration="32246000" />
|
||||
<workItem from="1597299830339" duration="2158000" />
|
||||
<workItem from="1597313688277" duration="5656000" />
|
||||
<workItem from="1597410738317" duration="11162000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
@ -612,21 +606,21 @@
|
|||
<screen x="0" y="23" width="2560" height="1417" />
|
||||
</state>
|
||||
<state x="758" y="370" key="SettingsEditor/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1596269067229" />
|
||||
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1596109164818">
|
||||
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1597415323689">
|
||||
<screen x="0" y="23" width="2560" height="1417" />
|
||||
</state>
|
||||
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1596109164818" />
|
||||
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1597415323689" />
|
||||
<state x="951" y="549" key="com.jetbrains.php.test.PhpNewTestDialog" timestamp="1591961096724">
|
||||
<screen x="0" y="23" width="2560" height="1417" />
|
||||
</state>
|
||||
<state x="951" y="549" key="com.jetbrains.php.test.PhpNewTestDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1591961096724" />
|
||||
<state x="531" y="536" width="1497" height="794" key="find.popup" timestamp="1597252813961">
|
||||
<state x="531" y="536" width="1497" height="794" key="find.popup" timestamp="1597421601104">
|
||||
<screen x="0" y="23" width="2560" height="1417" />
|
||||
</state>
|
||||
<state x="805" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1589024021327" />
|
||||
<state x="-1755" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@-2560.23.2560.1417" timestamp="1589974580416" />
|
||||
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1597252813961" />
|
||||
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595682561944" />
|
||||
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1597421601104" />
|
||||
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1597301750195" />
|
||||
<state width="600" height="428" key="javadoc.popup" timestamp="1594733832314">
|
||||
<screen x="0" y="23" width="2560" height="1417" />
|
||||
</state>
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ class CustomerController extends Controller
|
|||
if(old('switcher-without-email') === 'true'){
|
||||
$step = 1;
|
||||
$shopping_user->same_as_billing = true;
|
||||
$shopping_user->faker_mail = true;
|
||||
$billing_email = time()."@faker-mivita.care";
|
||||
}
|
||||
}
|
||||
|
|
@ -170,6 +171,7 @@ class CustomerController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$data['faker_mail'] = isset($data['faker_mail']) ? true : false;
|
||||
$data['has_buyed'] = isset($data['has_buyed']) ? true : false;
|
||||
$data['subscribed'] = isset($data['subscribed']) ? true : false;
|
||||
//subscribed can only true when has_buyed ist active
|
||||
|
|
|
|||
|
|
@ -5,8 +5,11 @@ namespace App\Http\Controllers\User;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShippingCountry;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\ShoppingUser;
|
||||
use App\Models\UserHistory;
|
||||
use App\Services\Util;
|
||||
use App\User;
|
||||
use Auth;
|
||||
use Request;
|
||||
|
|
@ -113,7 +116,6 @@ class OrderController extends Controller
|
|||
}
|
||||
|
||||
public function payment($for, $id=null){
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
$user = User::find(Auth::user()->id);
|
||||
|
|
@ -131,79 +133,39 @@ class OrderController extends Controller
|
|||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
|
||||
if($for === 'me'){
|
||||
if(Request::get('switchers-comp-product')) {
|
||||
$product = Product::find(Request::get('switchers-comp-product'));
|
||||
Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, ['image' => '', 'slug' => $product->slug, 'weight' => 0]);
|
||||
}
|
||||
|
||||
}
|
||||
// Yard::instance('shopping')->destroy();
|
||||
|
||||
return back()->withInput(Request::all());
|
||||
|
||||
if($for === 'ot' && $id){
|
||||
dd($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Yard::instance('shopping')->destroy();
|
||||
$product = Product::find(Request::get('switchers-package-wizard'));
|
||||
$showAboOptions = false;
|
||||
if(Request::get('abo_options')){
|
||||
$showAboOptions = true;
|
||||
$user->abo_options = true;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
if($product && $product->active && $product->show_at == 3){
|
||||
//set membership product
|
||||
$image = "";
|
||||
if($product->images->count()){
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
|
||||
|
||||
//set onboarding products
|
||||
if(Request::get('products_on_board')){
|
||||
foreach (Request::get('products_on_board') as $product_on_board_id){
|
||||
$product_on_board = Product::find($product_on_board_id);
|
||||
$image = "";
|
||||
if($product_on_board->images->count()){
|
||||
$image = $product_on_board->images->first()->slug;
|
||||
}
|
||||
Yard::instance('shopping')->add($product_on_board->id, $product_on_board->getLang('name'), 1, $product_on_board->price, ['image' => $image, 'slug' => $product_on_board->slug, 'weight' => $product_on_board->weight]);
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
$data['is_from'] = 'user_order';
|
||||
$data['is_for'] = $for;
|
||||
$data['shopping_user_id'] = $id;
|
||||
unset($data['quantity']);
|
||||
unset($data['_token']);
|
||||
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => 1, //is first faker shop for buy intern
|
||||
'auth_user_id' => Auth::user()->id,
|
||||
'payment' => 4, //Berater Wizard
|
||||
'payment' => 2, //Berater Shop
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'shopping_data' => $data,
|
||||
'back' => url()->previous(),
|
||||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
|
||||
|
||||
//add to DB
|
||||
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>'wizard_payment', 'status'=>1, 'product_id'=>$product->id, 'identifier'=>$identifier, 'abo_options'=>$showAboOptions]);
|
||||
UserHistory::create(['user_id' => $user->id, 'action'=>'user_order_payment', 'status'=>1, 'product_id'=>null, 'identifier'=>$identifier, 'abo_options'=>0]);
|
||||
//$path = str_replace('http', 'https', $path);
|
||||
return redirect()->secure($path);
|
||||
|
||||
}
|
||||
|
||||
\Session()->flash('alert-error', "Fehler beim Produkt");
|
||||
return back();
|
||||
}
|
||||
|
||||
private function checkShoppingCountry($for, $id=null){
|
||||
|
||||
$country_id = null;
|
||||
if($for === 'me'){
|
||||
$user = User::find(\Auth::user()->id);
|
||||
|
|
|
|||
|
|
@ -101,12 +101,17 @@ class CardController extends Controller
|
|||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
|
||||
$data = [];
|
||||
$data['is_from'] = 'shopping';
|
||||
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
'user_shop_id' => $user_shop->id,
|
||||
'payment' => 1,
|
||||
'subdomain' => url('/'),
|
||||
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
|
||||
'shopping_data' => $data,
|
||||
'back' => url()->previous(),
|
||||
|
||||
]);
|
||||
Yard::instance('shopping')->store($identifier);
|
||||
|
|
|
|||
|
|
@ -37,19 +37,69 @@ class CheckoutController extends Controller
|
|||
|
||||
public function checkout(){
|
||||
|
||||
// dd("back");
|
||||
// $user_shop = Util::getUserShop();
|
||||
$shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data');
|
||||
|
||||
$is_from = isset($shopping_data['is_from']) ? $shopping_data['is_from'] : 'shopping';
|
||||
$is_for = isset($shopping_data['is_for']) ? $shopping_data['is_for'] : false;
|
||||
$shopping_user = null;
|
||||
|
||||
if($shopping_data && $is_from !== 'shopping'){
|
||||
//$shopping_user_id = isset($shopping_data['shopping_user_id']) ? $shopping_data['shopping_user_id'] : false;
|
||||
$shopping_user = $this->shoppingUserAuthData($is_from, $is_for, $shopping_data);
|
||||
|
||||
}elseif($is_from === 'shopping') {
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->is_for = $is_for;
|
||||
$shopping_user->is_from = $is_from;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(Request::get('selected_country')){
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country'));
|
||||
//Yard::instance('shopping')->setShippingCountryWithPrice(Request::get('selected_country'), $is_for);
|
||||
}else{
|
||||
$shopping_user->billing_state = Yard::instance('shopping')->getShippingCountryId();
|
||||
$shopping_user->shipping_state = Yard::instance('shopping')->getShippingCountryId();
|
||||
// $ShippingCountry = ShippingCountry::where('country_id', 1)->first();
|
||||
// $selected_country = $ShippingCountry->id;
|
||||
}
|
||||
|
||||
if(!$this->getPayments('shopping_user_id') && Util::getAuthUser()){
|
||||
//$user->email;
|
||||
|
||||
// $shopping_user->save();
|
||||
// $this->putPayments('shopping_user_id', $shopping_user->id);
|
||||
}else{
|
||||
//$shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id'));
|
||||
}
|
||||
|
||||
if(Util::getAuthUser()){
|
||||
$shopping_user->abo_options = Util::getUserHistoryValue('abo_options');
|
||||
//$shopping_user->save();
|
||||
}
|
||||
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = true;
|
||||
}
|
||||
$data = [
|
||||
'is_from' => $is_from,
|
||||
'is_for' => $is_for,
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'shopping_user' => $shopping_user,
|
||||
'shopping_mode' => Util::getUserShoppingMode(),
|
||||
];
|
||||
return view('web.templates.checkout', $data);
|
||||
}
|
||||
|
||||
private function shoppingUserAuthData($is_from, $is_for, $data = []){
|
||||
|
||||
$user = Util::getAuthUser();
|
||||
$user->email;
|
||||
$shopping_user = new ShoppingUser();
|
||||
$shopping_user->auth_user_id = $user->id;
|
||||
|
||||
$shopping_user->billing_salutation = $user->account->salutation;
|
||||
$shopping_user->billing_company = $user->account->company;
|
||||
$shopping_user->billing_firstname = $user->account->first_name;
|
||||
|
|
@ -61,7 +111,43 @@ class CheckoutController extends Controller
|
|||
$shopping_user->billing_country_id = $user->account->country_id;
|
||||
$shopping_user->billing_phone = $user->account->phone;
|
||||
$shopping_user->billing_email = $user->email;
|
||||
$shopping_user->faker_mail = false;
|
||||
$shopping_user->accepted_data_checkbox = 1;
|
||||
$shopping_user->is_for = $is_for;
|
||||
$shopping_user->is_from = $is_from;
|
||||
//Lieferadresse
|
||||
if($is_from === 'user_order'){
|
||||
if(isset($data['shopping_user_id']) && $data['is_for'] === 'ot'){
|
||||
$s_user = ShoppingUser::findOrFail($data['shopping_user_id']);
|
||||
$shopping_user->billing_salutation = $s_user->billing_salutation;
|
||||
$shopping_user->billing_company = $s_user->billing_company;
|
||||
$shopping_user->billing_firstname = $s_user->billing_firstname;
|
||||
$shopping_user->billing_lastname = $s_user->billing_lastname;
|
||||
$shopping_user->billing_address = $s_user->billing_address;
|
||||
$shopping_user->billing_address_2 = $s_user->billing_address_2;
|
||||
$shopping_user->billing_zipcode = $s_user->billing_zipcode;
|
||||
$shopping_user->billing_city = $s_user->billing_city;
|
||||
$shopping_user->billing_country_id = $s_user->billing_country_id;
|
||||
$shopping_user->billing_phone = $s_user->billing_phone;
|
||||
$shopping_user->billing_email = $s_user->billing_email;
|
||||
$shopping_user->faker_mail = $s_user->faker_mail;
|
||||
$shopping_user->shopping_user_id = $data['shopping_user_id'];
|
||||
$shopping_user->member_id = $s_user->member_id;
|
||||
}
|
||||
|
||||
$shopping_user->same_as_billing = false;
|
||||
$shopping_user->shipping_salutation = isset($data['shipping_salutation']) ? $data['shipping_salutation'] : '';
|
||||
$shopping_user->shipping_company = isset($data['shipping_company']) ? $data['shipping_company'] : '';
|
||||
$shopping_user->shipping_firstname = isset($data['shipping_firstname']) ? $data['shipping_firstname'] : '';
|
||||
$shopping_user->shipping_lastname = isset($data['shipping_lastname']) ? $data['shipping_lastname'] : '';
|
||||
$shopping_user->shipping_address = isset($data['shipping_address']) ? $data['shipping_address'] : '';
|
||||
$shopping_user->shipping_address_2 = isset($data['shipping_address_2']) ? $data['shipping_address_2'] : '';
|
||||
$shopping_user->shipping_zipcode = isset($data['shipping_zipcode']) ? $data['shipping_zipcode'] : '';
|
||||
$shopping_user->shipping_city = isset($data['shipping_city']) ? $data['shipping_city'] : '';
|
||||
$shopping_user->shipping_country_id = isset($data['shipping_state']) ? $data['shipping_state'] : '';
|
||||
$shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : '';
|
||||
|
||||
}else{
|
||||
$shopping_user->same_as_billing = $user->account->same_as_billing;
|
||||
$shopping_user->shipping_salutation = $user->account->shipping_salutation;
|
||||
$shopping_user->shipping_company = $user->account->shipping_company;
|
||||
|
|
@ -73,29 +159,28 @@ class CheckoutController extends Controller
|
|||
$shopping_user->shipping_city = $user->account->shipping_city;
|
||||
$shopping_user->shipping_country_id = $user->account->shipping_country_id;
|
||||
$shopping_user->shipping_phone = $user->account->shipping_phone;
|
||||
$shopping_user->save();
|
||||
$this->putPayments('shopping_user_id', $shopping_user->id);
|
||||
}else{
|
||||
$shopping_user = ShoppingUser::findOrNew($this->getPayments('shopping_user_id'));
|
||||
}
|
||||
if(Util::getAuthUser()){
|
||||
$shopping_user->abo_options = Util::getUserHistoryValue('abo_options');
|
||||
$shopping_user->save();
|
||||
}
|
||||
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = true;
|
||||
}
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'shopping_user' => $shopping_user,
|
||||
'shopping_mode' => Util::getUserShoppingMode(),
|
||||
];
|
||||
return view('web.templates.checkout', $data);
|
||||
return $shopping_user;
|
||||
}
|
||||
|
||||
public function checkoutFinal(){
|
||||
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
if(isset($data['selected_country']) && $data['selected_country'] === 'change'){
|
||||
|
||||
if(Request::get('same_as_billing')){
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($data['billing_state'], $data['is_for']);
|
||||
}else{
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']);
|
||||
}
|
||||
return back()->withInput(Request::all());
|
||||
|
||||
}
|
||||
|
||||
dd('ads');
|
||||
$rules = array(
|
||||
'billing_salutation' => 'required',
|
||||
'billing_firstname'=>'required',
|
||||
|
|
@ -299,8 +384,6 @@ class CheckoutController extends Controller
|
|||
|
||||
private function makeShoppingUser($data){
|
||||
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
|
||||
$data['accepted_data_checkbox'] = isset($data['accepted_data_checkbox']) ? true : false;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,17 @@ class Checkout
|
|||
\Session::put('auth_user', $shopping_instance->auth_user);
|
||||
}
|
||||
}
|
||||
if($shopping_instance->back){
|
||||
\Session::put('back_link', $shopping_instance->back);
|
||||
}
|
||||
Yard::instance('shopping')->destroy();
|
||||
//restore yard
|
||||
Yard::instance('shopping')->restore($request->route('identifier'));
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id);
|
||||
|
||||
Yard::instance('shopping')->putYardExtra('shopping_data', $shopping_instance->shopping_data);
|
||||
$is_for = isset($shopping_instance->shopping_data['is_for']) ? $shopping_instance->shopping_data['is_for'] : 'ot';
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($shopping_instance->country_id, $is_for);
|
||||
|
||||
|
||||
ShoppingInstance::where('identifier', $request->route('identifier'))->delete();
|
||||
$request->route()->forgetParameter('identifier');
|
||||
|
|
|
|||
|
|
@ -43,9 +43,10 @@ class ShoppingInstance extends Model
|
|||
|
||||
protected $table = 'shopping_instances';
|
||||
|
||||
protected $casts = ['shopping_data' => 'array'];
|
||||
|
||||
protected $fillable = [
|
||||
'identifier', 'user_shop_id', 'auth_user_id', 'payment', 'subdomain', 'country_id'
|
||||
'identifier', 'user_shop_id', 'auth_user_id', 'payment', 'subdomain', 'country_id', 'shopping_data', 'back'
|
||||
];
|
||||
|
||||
public function user_shop()
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ class ShoppingUser extends Model
|
|||
'billing_country_id',
|
||||
'billing_phone',
|
||||
'billing_email',
|
||||
'faker_mail',
|
||||
'accepted_data_checkbox',
|
||||
'same_as_billing',
|
||||
'shipping_salutation',
|
||||
|
|
@ -145,6 +146,9 @@ class ShoppingUser extends Model
|
|||
'subscribed',
|
||||
'notice',
|
||||
'mode',
|
||||
'is_for',
|
||||
'is_from',
|
||||
'shopping_user_id',
|
||||
'wp_order_number',
|
||||
'wp_order_date',
|
||||
];
|
||||
|
|
@ -152,6 +156,7 @@ class ShoppingUser extends Model
|
|||
protected $casts = [
|
||||
'notice' => 'array',
|
||||
'is_like' => 'bool',
|
||||
'faker_mail' => 'bool',
|
||||
'accepted_data_checkbox' => 'bool',
|
||||
'same_as_billing' => 'bool',
|
||||
'has_buyed' => 'bool',
|
||||
|
|
|
|||
|
|
@ -317,4 +317,15 @@ class HTMLHelper
|
|||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getOptionRange($select, $from=1, $to=50){
|
||||
$values = range($from, $to);
|
||||
$ret = "";
|
||||
foreach ($values as $value){
|
||||
$attr = ($value == $select) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$value.'" '.$attr.'>'.$value.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +181,9 @@ class Util
|
|||
|
||||
if(\Session::has('user_shop')){
|
||||
if(\Session::has('user_shop_domain')){
|
||||
|
||||
if(\Session::has('back_link')){
|
||||
return \Session::get('back_link');
|
||||
}
|
||||
if(self::getUserPaymentFor() === 3){
|
||||
return \Session::get('user_shop_domain')."/user/membership";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,25 +21,26 @@ class Yard extends Cart
|
|||
private $shipping_is_for;
|
||||
private $ysession;
|
||||
private $yinstance;
|
||||
private $shopping_data = [];
|
||||
|
||||
public function __construct(SessionManager $session, Dispatcher $events)
|
||||
{
|
||||
$this->ysession = $session;
|
||||
$this->yinstance = sprintf('%s.%s', 'cart', 'shipping_extras');
|
||||
if($this->getShippingExtra('shipping_price')){
|
||||
$this->shipping_price = (float) ($this->getShippingExtra('shipping_price'));
|
||||
if($this->getYardExtra('shipping_price')){
|
||||
$this->shipping_price = (float) ($this->getYardExtra('shipping_price'));
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_tax')){
|
||||
$this->shipping_tax = (float) ($this->getShippingExtra('shipping_tax'));
|
||||
if($this->getYardExtra('shipping_tax')){
|
||||
$this->shipping_tax = (float) ($this->getYardExtra('shipping_tax'));
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_country_id')){
|
||||
$this->shipping_country_id = $this->getShippingExtra('shipping_country_id');
|
||||
if($this->getYardExtra('shipping_country_id')){
|
||||
$this->shipping_country_id = $this->getYardExtra('shipping_country_id');
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_is_for')){
|
||||
$this->shipping_is_for = $this->getShippingExtra('shipping_is_for');
|
||||
if($this->getYardExtra('shipping_is_for')){
|
||||
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -62,14 +63,14 @@ class Yard extends Cart
|
|||
return config('cart.tax');
|
||||
}
|
||||
|
||||
public function putShippingExtra($key, $value){
|
||||
public function putYardExtra($key, $value){
|
||||
|
||||
$content = $this->getYContent();
|
||||
$content->put($key, $value);
|
||||
$this->ysession->put($this->yinstance, $content);
|
||||
}
|
||||
|
||||
public function getShippingExtra($key){
|
||||
public function getYardExtra($key){
|
||||
$content = $this->getYContent();
|
||||
if ($content->has($key)){
|
||||
return $content->get($key);
|
||||
|
|
@ -116,10 +117,10 @@ class Yard extends Cart
|
|||
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot')
|
||||
{
|
||||
$this->shipping_country_id = $shipping_country_id;
|
||||
$this->putShippingExtra('shipping_country_id', $shipping_country_id);
|
||||
$this->putYardExtra('shipping_country_id', $shipping_country_id);
|
||||
|
||||
$this->shipping_is_for = $shipping_is_for;
|
||||
$this->putShippingExtra('shipping_is_for', $shipping_is_for);
|
||||
$this->putYardExtra('shipping_is_for', $shipping_is_for);
|
||||
|
||||
$this->calculateShippingPrice();
|
||||
|
||||
|
|
@ -160,10 +161,10 @@ class Yard extends Cart
|
|||
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
|
||||
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
|
||||
|
||||
$this->putShippingExtra('shipping_price', $this->shipping_price);
|
||||
$this->putShippingExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putShippingExtra('shipping_tax', $this->shipping_tax);
|
||||
$this->putShippingExtra('shipping_price_net', $this->shipping_price_net);
|
||||
$this->putYardExtra('shipping_price', $this->shipping_price);
|
||||
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putYardExtra('shipping_tax', $this->shipping_tax);
|
||||
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class CreateShoppingInstancesTable extends Migration
|
|||
$table->unsignedTinyInteger('payment');
|
||||
$table->unsignedInteger('country_id');
|
||||
$table->string('subdomain');
|
||||
$table->text('shopping_data')->nullable();
|
||||
$table->string('back');
|
||||
|
||||
|
||||
$table->primary(['identifier']);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class CreateShoppingUsersTable extends Migration
|
|||
$table->unsignedInteger('billing_country_id');
|
||||
$table->string('billing_phone')->nullable();
|
||||
$table->string('billing_email')->nullable();
|
||||
$table->boolean('faker_mail')->default(false);
|
||||
|
||||
$table->unsignedSmallInteger('orders')->nullable()->default(1);
|
||||
|
||||
|
|
@ -59,6 +60,11 @@ class CreateShoppingUsersTable extends Migration
|
|||
|
||||
$table->char('mode', 4)->nullable();
|
||||
|
||||
$table->char('is_for', 2)->nullable();
|
||||
$table->string('is_from', 10)->nullable();
|
||||
$table->unsignedInteger('shopping_user_id')->index()->nullable();
|
||||
|
||||
|
||||
$table->unsignedInteger('wp_order_number')->nullable();
|
||||
$table->timestamp('wp_order_date')->nullable();
|
||||
|
||||
|
|
|
|||
|
|
@ -255,6 +255,8 @@
|
|||
@if($isView === 'customer-add')
|
||||
{{ Form::hidden('billing_email_1', $billing_email) }}
|
||||
{{ Form::hidden('billing_email-confirm_1', $billing_email) }}
|
||||
{{ Form::hidden('faker_mail', $shopping_user->faker_mail) }}
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
|
|
@ -271,6 +273,7 @@
|
|||
<div class="form-group col-md-6">
|
||||
<label class="form-label" for="billing_email">{{ __('E-Mail Address') }}*</label>
|
||||
{{ Form::text('billing_email', $shopping_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email')) }}
|
||||
faker_mail
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="form-label" for="billing_email-confirm">{{ __('Confirm E-Mail') }}</label>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<!-- /PAGE HEADER -->
|
||||
|
||||
<style>
|
||||
div.shop-item {
|
||||
/* div.shop-item {
|
||||
margin-bottom:30px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
|
@ -52,7 +52,8 @@
|
|||
color: #9aa983;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
|
||||
|
||||
.table-mi-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
|
||||
border: 1px solid #ddd !important;
|
||||
}
|
||||
|
||||
|
|
@ -97,13 +98,85 @@
|
|||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
select.form-control:not([size]):not([multiple]) {
|
||||
height: 38px;
|
||||
color: #6f6f6f;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.yard-items-head {
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.yard-item {
|
||||
position: relative;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding-bottom: 8px;
|
||||
|
||||
}
|
||||
.yard-item a.shop-item-hl {
|
||||
color: #9aa983;
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.yard-item .options {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.yard-item a.auto-delete-product {
|
||||
font-size: 0.7em;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.yard-item .quantity {
|
||||
position: relative;
|
||||
}
|
||||
.quantity-select {
|
||||
text-align: right;
|
||||
}
|
||||
.quantity-select select.form-control:not([size]):not([multiple]) {
|
||||
width: auto;
|
||||
min-width: 5em;
|
||||
display: inline-block;
|
||||
}
|
||||
.yard-item .price-total {
|
||||
margin-top: 6px;
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
.yard-item .font-semi-bold {
|
||||
color: #393939;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.yard-item .font-semi-bold .small {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.yard-item .font-bold {
|
||||
color:#393939;
|
||||
font-weight: bold;
|
||||
}
|
||||
.price-single {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-default {
|
||||
border: none;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<!-- -->
|
||||
<section>
|
||||
<div class="container">
|
||||
|
||||
<h1>Warenkorb</h1>
|
||||
<h1 class="mb-0">Warenkorb</h1>
|
||||
|
||||
<!-- EMPTY CART -->
|
||||
<!-- <div class="panel panel-default">
|
||||
|
|
@ -119,9 +192,11 @@
|
|||
<div class="row">
|
||||
|
||||
<!-- LEFT -->
|
||||
<div class="col-lg-9 col-sm-7">
|
||||
<div class="col-lg-9 col-md-8 col-sm-12">
|
||||
|
||||
<h4 class="weight-400">Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</h4>
|
||||
|
||||
|
||||
<h3>Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</h3>
|
||||
|
||||
@if(Yard::instance('shopping')->content()->count())
|
||||
<!-- CART -->
|
||||
|
|
@ -130,101 +205,90 @@
|
|||
<!-- cart content -->
|
||||
<div id="cartContent">
|
||||
|
||||
<!-- Shopping cart table -->
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered m-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- Set columns width -->
|
||||
<th colspan="2" class="text-left py-3 px-4" style="min-width: 400px;">Produkt</th>
|
||||
<th class="text-right py-3 px-4" style="width: 120px;">Preis</th>
|
||||
<th class="text-center py-3 px-4" style="width: 60px;">Anzahl</th>
|
||||
<th class="text-right py-3 px-4" style="width: 100px;">Summe</th>
|
||||
<th class="text-center align-middle py-3 px-0" style="width: 40px;">#</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<div class="yard-items-head">
|
||||
<div class="row hidden-sm-down">
|
||||
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-9 col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-7">
|
||||
Artikel
|
||||
</div>
|
||||
<div class="col-sm-3 col-md-2 text-left">
|
||||
Einzelpreis
|
||||
</div>
|
||||
<div class="ol-sm-3 col-md-3 text-right">
|
||||
Anzahl
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@foreach(Yard::instance('shopping')->content() as $row)
|
||||
|
||||
@php($product = \App\Models\Product::find($row->id))
|
||||
<tr class="item yard">
|
||||
<td>
|
||||
|
||||
<div class="row yard-item">
|
||||
|
||||
<div class="col-xs-3 col-sm-2">
|
||||
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" title="" class="image">
|
||||
@if($row->options->has('image'))
|
||||
<img src="{{ route('product_image', [$row->options->image]) }}" width="80" alt="">
|
||||
<img src="{{ route('product_image', [$row->options->image]) }}" class="img-responsive" alt="">
|
||||
@else
|
||||
<img src="{{ asset('/assets/images/1x1.png') }}" width="80" alt="">
|
||||
@endif
|
||||
</td>
|
||||
<td class="p-4">
|
||||
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="shop-item-hl ">
|
||||
<span>{{ $row->name }}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-9 col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 col-md-7 description">
|
||||
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="shop-item-hl"><span>{{ $row->name }}</span></a>
|
||||
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Inhalt: {{ $product->contents }}</div>
|
||||
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Art.-Nr.: {{ $product->number }}</div>
|
||||
<div style="font-size: 13px; color:#6e6e6e; font-weight: 400;"><em>Lieferzeit: 1-3 Werktage</em></div>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td class="text-right font-weight-semibold align-middle p-2">
|
||||
<span>{{ $row->price() }} </span> €
|
||||
<div style="font-size: 11px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</div>
|
||||
<div style="font-size: 11px; color:#1d1d1d; font-weight: 500;">inkl. {{ number_format($row->taxRate, 0)}}% MwSt.</div>
|
||||
</td>
|
||||
<td class="align-middle p-2">
|
||||
<input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" />
|
||||
</td>
|
||||
<td class="text-right font-weight-semibold align-middle p-2">
|
||||
<div class=""><strong>{{ $row->subtotal() }} €</strong></div>
|
||||
</td>
|
||||
<td class="text-left p-2">
|
||||
<a style="margin: 0" href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}" class="remove_item"><i class="fa fa-times"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="options">
|
||||
<a class="auto-delete-product" href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}"><i class="fa fa-times"></i> Artikel entfernen</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <div class="box-border-shadow">
|
||||
|
||||
|
||||
<!-- cart header -->
|
||||
<div class="item head clearfix">
|
||||
<span class="cart_img"></span>
|
||||
<span class="product_name size-15 bold">Produkt</span>
|
||||
<span class="remove_item size-15 bold"></span>
|
||||
<span class="total_price size-15 bold">Preis</span>
|
||||
<span class="qty size-15 bold">Anzahl</span>
|
||||
<div class="col-xs-6 col-sm-3 col-md-2 text-left font-semi-bold price-single">
|
||||
<div style="">{{ $row->price() }} €</div>
|
||||
<div class="small">{{$product->getBasePriceFormattedFull()}}</div>
|
||||
<div class="small">inkl. {{ number_format($row->taxRate, 0)}}% MwSt.</div>
|
||||
<!---->
|
||||
</div>
|
||||
|
||||
|
||||
@foreach(Yard::instance('shopping')->content() as $row)
|
||||
@php($product = \App\Models\Product::find($row->id))
|
||||
<div class="item yard">
|
||||
<div class="cart_img pull-left width-100 padding-10 text-left">
|
||||
@if($row->options->has('image'))
|
||||
<img src="{{ route('product_image', [$row->options->image]) }}" width="80" alt="">
|
||||
@else
|
||||
<img src="{{ asset('/assets/images/1x1.png') }}" width="80" alt="">
|
||||
@endif
|
||||
<div class="col-xs-6 col-sm-3 col-md-3 quantity">
|
||||
<div class="quantity-select">
|
||||
<select class="form-control" name="quantity[{{$row->rowId}}]" onchange="this.form.submit()">
|
||||
{!! HTMLHelper::getOptionRange($row->qty, 1, 50) !!}
|
||||
</select>
|
||||
</div>
|
||||
<div class="price-total text-right">
|
||||
<span class="font-bold text-price-total">{{ $row->subtotal() }}</span> €
|
||||
</div>
|
||||
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="product_name">
|
||||
<span>{{ $row->name }}</span>
|
||||
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</div>
|
||||
<div style="font-size: 13px; color:#6e6e6e; font-weight: 400;"><em>Lieferzeit: 1-3 Werktage</em></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
<a href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}" class="remove_item"><i class="fa fa-times"></i></a>
|
||||
|
||||
<div class="total_price"><span>{{ $row->subtotal() }} </span> €</div>
|
||||
<div class="qty"><input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" /> × {{ $row->price() }} € </div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
</div>--}}
|
||||
<a href="{{url(Util::getPostRoute().'card/delete')}}" class="btn btn-default btn-sm margin-top-20 margin-right-10 pull-left"><i class="glyphicon glyphicon-remove"></i> Warenkorb löschen</a>
|
||||
<button type="submit" class="btn btn-sm btn-default margin-top-20 margin-left-0 pull-right pull-left-xs"><i class="glyphicon glyphicon-refresh"></i> Warenkorb aktualisieren</button>
|
||||
|
||||
|
||||
<a href="{{url(Util::getPostRoute().'card/delete')}}" class="btn btn-default btn-xs pull-left"><i class="glyphicon glyphicon-remove"></i> Warenkorb löschen</a>
|
||||
<button type="submit" class="btn btn-xs btn-default pull-right "><i class="glyphicon glyphicon-refresh"></i> Warenkorb aktualisieren</button>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
|
@ -233,25 +297,15 @@
|
|||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.select2-container{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.select2-container .select2-selection--single .select2-selection__rendered
|
||||
{
|
||||
padding: 8px 20px;
|
||||
height: 36px;
|
||||
}
|
||||
</style>
|
||||
<!-- RIGHT -->
|
||||
<div class="col-lg-3 col-sm-5">
|
||||
<div class="col-sm-8 col-sm-offset-4 col-md-4 col-md-offset-0 col-lg-3 col-lg-offset-0">
|
||||
|
||||
@if(Yard::instance('shopping')->content()->count())
|
||||
<h3>Warenkorb Summe</h3>
|
||||
|
||||
|
||||
<div class="toggle-transparent toggle-bordered-full clearfix">
|
||||
<div class="toggle active">
|
||||
<div class="toggle active cart-content">
|
||||
<div class="toggle-content">
|
||||
|
||||
<div class="clearfix mb-2">
|
||||
|
|
@ -264,8 +318,8 @@
|
|||
<div class=" small">Versandland:</div>
|
||||
<div class="small">
|
||||
<form action="{{ url(Util::getPostRoute().'card/show') }}" method="GET" style="margin-bottom: 0;">
|
||||
<select name="selected_country" class="select2" onchange="this.form.submit()">
|
||||
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
|
||||
<select name="selected_country" class="form-control" onchange="this.form.submit()">
|
||||
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId(), false) !!}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -98,6 +98,17 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
select.form-control:not([size]):not([multiple]) {
|
||||
height: 38px;
|
||||
color: #6f6f6f;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.info-small {
|
||||
font-size: 0.8em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<section>
|
||||
|
|
@ -135,7 +146,11 @@
|
|||
|
||||
|
||||
<div class="m-checkout">
|
||||
{!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'']) !!}
|
||||
{!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'checkout_card_final']) !!}
|
||||
|
||||
{!! Form::hidden('selected_country') !!}
|
||||
{!! Form::hidden('is_for', $shopping_user->is_for) !!}
|
||||
{!! Form::hidden('is_from', $shopping_user->is_from) !!}
|
||||
|
||||
@if (\Session::has('elv-managemandate'))
|
||||
|
||||
|
|
@ -243,11 +258,12 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label class="mt-0 fs-14 fw-400" for="billing_state">Land *</label>
|
||||
<select id="billing_state" name="billing_state" class="form-control select2 required" disabled="true">
|
||||
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
|
||||
<label class="mt-0 fs-14 fw-400" for="billing_state">Land * {{$shopping_user->billing_state}}</label>
|
||||
<select id="billing_state" name="billing_state" class="form-control required">
|
||||
{!! HTMLHelper::getCountriesForShipping($shopping_user->billing_state) !!}
|
||||
</select>
|
||||
<input type="hidden" name="billing_country_id" value="{{Yard::instance('shopping')->getShippingCountryCountryId()}}">
|
||||
<span class="info-small" id="show_shipping_country_info">Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -398,11 +414,12 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label class="mt-0 fs-14 fw-400" for="shipping_state">Land *</label>
|
||||
<select id="shipping_state" name="shipping_state" class="form-control select2 required" disabled="true">
|
||||
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
|
||||
<label class="mt-0 fs-14 fw-400" for="shipping_state">Land * {{$shopping_user->shipping_state}}</label>
|
||||
<select id="shipping_state" name="shipping_state" class="form-control required">
|
||||
{!! HTMLHelper::getCountriesForShipping($shopping_user->shipping_state) !!}
|
||||
</select>
|
||||
<input type="hidden" name="shipping_country_id" value="{{Yard::instance('shopping')->getShippingCountryCountryId()}}">
|
||||
<span class="info-small">Bei der Änderung des Landes werden die Versandkosten neu berechnet.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -681,9 +698,6 @@
|
|||
<button type="submit" class="btn btn-primary btn-lg btn-block size-18 btn-text-500 mt-4 faa-parent animated-hover"><i class="fa fa-mail-forward faa-horizontal"></i> Jetzt kaufen</button>
|
||||
<hr><p class="text-center" style="line-height: 1.2em;"><em class="small text-center"> <i class="fa fa-lock"></i> Sind alle Deine Angaben vollsätndig ausgefüllt, klicke auf "Jetzt kaufen" und Du wist zu unserem Zahlungsanbieter weitergeleitet, die Verbindung wird ist SSL verschlüsselt.</em></p>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -697,4 +711,90 @@
|
|||
<!-- /CART -->
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
|
||||
<script>
|
||||
/** CHECKOUT
|
||||
** *********************** **/
|
||||
// New Account show|hide
|
||||
jQuery("#accountswitch").bind("click", function() {
|
||||
jQuery('#newaccount').slideToggle(200);
|
||||
});
|
||||
|
||||
|
||||
$('#billing_state').on('change', function (){
|
||||
$('input[name="selected_country"]').val('change');
|
||||
$('form#checkout_card_final').submit();
|
||||
});
|
||||
$('#shipping_state').on('change', function (){
|
||||
$('input[name="selected_country"]').val('change');
|
||||
$('form#checkout_card_final').submit();
|
||||
});
|
||||
function showShippingCountryFor($for){
|
||||
if($for === 'billing'){
|
||||
$('#show_shipping_country_info').show();
|
||||
}
|
||||
if($for === 'shipping'){
|
||||
$('#show_shipping_country_info').hide();
|
||||
}
|
||||
}
|
||||
// Shipping Address show|hide
|
||||
jQuery("#shipswitch").bind("click", function() {
|
||||
jQuery('#shipping').slideToggle(200, function() {
|
||||
// scroll down to shipping area.
|
||||
if(jQuery('#shipping').is(":visible")) {
|
||||
_scrollTo('#shipping', 150);
|
||||
showShippingCountryFor('shipping');
|
||||
}else{
|
||||
showShippingCountryFor('billing');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(!jQuery('#shipswitch').is(':checked')){
|
||||
jQuery('#shipping').show();
|
||||
showShippingCountryFor('shipping');
|
||||
|
||||
}else{
|
||||
showShippingCountryFor('billing');
|
||||
}
|
||||
|
||||
|
||||
jQuery('.quick-cart-box-close').on('click', function () {
|
||||
jQuery('.quick-cart-box').css('display', 'none');
|
||||
});
|
||||
|
||||
|
||||
function showCreditCardPayment(val){
|
||||
if(val === 'cc'){
|
||||
$('#creditcard-box-holder').show('slow');
|
||||
}else{
|
||||
$('#creditcard-box-holder').hide('slow');
|
||||
}
|
||||
|
||||
}
|
||||
showCreditCardPayment(jQuery('input[name="payment_method"]:checked').val());
|
||||
jQuery('input[name="payment_method"]').on('change', function () {
|
||||
showCreditCardPayment($(this).val());
|
||||
});
|
||||
|
||||
function showSEPAPayment(val){
|
||||
if(val === 'elv'){
|
||||
$('#sepa-box-holder').show('slow');
|
||||
}else{
|
||||
$('#sepa-box-holder').hide('slow');
|
||||
}
|
||||
|
||||
}
|
||||
showSEPAPayment(jQuery('input[name="payment_method"]:checked').val());
|
||||
jQuery('input[name="payment_method"]').on('change', function () {
|
||||
showSEPAPayment($(this).val());
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
@ -78,63 +78,7 @@
|
|||
<script type="text/javascript" src="{{ asset('/assets/plugins/slider.revolution/js/jquery.themepunch.revolution.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('/assets/js/view/demo.revolution_slider.js') }}"></script>
|
||||
@yield('scripts')
|
||||
<script>
|
||||
/** CHECKOUT
|
||||
** *********************** **/
|
||||
// New Account show|hide
|
||||
jQuery("#accountswitch").bind("click", function() {
|
||||
jQuery('#newaccount').slideToggle(200);
|
||||
});
|
||||
|
||||
// Shipping Address show|hide
|
||||
jQuery("#shipswitch").bind("click", function() {
|
||||
jQuery('#shipping').slideToggle(200, function() {
|
||||
// scroll down to shipping area.
|
||||
if(jQuery('#shipping').is(":visible")) {
|
||||
_scrollTo('#shipping', 150);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(!jQuery('#shipswitch').is(':checked')){
|
||||
jQuery('#shipping').show();
|
||||
}
|
||||
|
||||
|
||||
jQuery('.quick-cart-box-close').on('click', function () {
|
||||
jQuery('.quick-cart-box').css('display', 'none');
|
||||
});
|
||||
|
||||
|
||||
function showCreditCardPayment(val){
|
||||
if(val === 'cc'){
|
||||
$('#creditcard-box-holder').show('slow');
|
||||
}else{
|
||||
$('#creditcard-box-holder').hide('slow');
|
||||
}
|
||||
|
||||
}
|
||||
showCreditCardPayment(jQuery('input[name="payment_method"]:checked').val());
|
||||
jQuery('input[name="payment_method"]').on('change', function () {
|
||||
showCreditCardPayment($(this).val());
|
||||
});
|
||||
|
||||
function showSEPAPayment(val){
|
||||
if(val === 'elv'){
|
||||
$('#sepa-box-holder').show('slow');
|
||||
}else{
|
||||
$('#sepa-box-holder').hide('slow');
|
||||
}
|
||||
|
||||
}
|
||||
showSEPAPayment(jQuery('input[name="payment_method"]:checked').val());
|
||||
jQuery('input[name="payment_method"]').on('change', function () {
|
||||
showSEPAPayment($(this).val());
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
{{--
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue