This commit is contained in:
Kevin Adametz 2020-07-01 13:21:35 +02:00
parent 9ed251820e
commit da08e9ff37
13 changed files with 378 additions and 56 deletions

43
.idea/workspace.xml generated
View file

@ -4,8 +4,16 @@
<list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment=""> <list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/Api/ShoppingUserController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Api/ShoppingUserController.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Http/Controllers/Api/ShoppingUserController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Api/ShoppingUserController.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/Models/Product.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Product.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$/resources/views/admin/product/form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/product/form.blade.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.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$/resources/views/emails/checkout_status.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/emails/checkout_status.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$/resources/views/web/templates/produkte-show.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/produkte-show.blade.php" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -474,6 +482,10 @@
<workItem from="1592134604562" duration="347000" /> <workItem from="1592134604562" duration="347000" />
<workItem from="1592134995936" duration="7000" /> <workItem from="1592134995936" duration="7000" />
<workItem from="1592135066330" duration="179000" /> <workItem from="1592135066330" duration="179000" />
<workItem from="1592831744708" duration="9000" />
<workItem from="1592831761021" duration="3000" />
<workItem from="1592905155133" duration="2081000" />
<workItem from="1593539130650" duration="5379000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -506,14 +518,6 @@
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </state>
<state x="880" y="397" key="#Deployment/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587107443381" /> <state x="880" y="397" key="#Deployment/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587107443381" />
<state x="880" y="409" key="#JSHint" timestamp="1584782937961">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="880" y="409" key="#JSHint/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1584782937961" />
<state x="754" y="395" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1583573436293">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="754" y="395" key="#com.intellij.execution.impl.EditConfigurationsDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1583573436293" />
<state x="1219" y="419" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog" timestamp="1589898669859"> <state x="1219" y="419" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog" timestamp="1589898669859">
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </state>
@ -524,18 +528,10 @@
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1591964088698" /> <state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1591964088698" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585733837456" /> <state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585733837456" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587109063136" /> <state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1587109063136" />
<state width="239" height="457" key="HiddenNamespacesPopup" timestamp="1583573337041">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="239" height="457" key="HiddenNamespacesPopup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1583573337041" />
<state x="1002" y="464" key="NewPhpClassDialog" timestamp="1589893405691"> <state x="1002" y="464" key="NewPhpClassDialog" timestamp="1589893405691">
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </state>
<state x="1002" y="464" key="NewPhpClassDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1589893405691" /> <state x="1002" y="464" key="NewPhpClassDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1589893405691" />
<state x="1143" y="547" key="com.intellij.database.view.ui.DbObjectDialog" timestamp="1583573350583">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1143" y="547" key="com.intellij.database.view.ui.DbObjectDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1583573350583" />
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1591963287409"> <state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1591963287409">
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </state>
@ -545,18 +541,18 @@
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </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="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="805" y="444" width="1115" height="793" key="find.popup" timestamp="1592134685315"> <state x="805" y="444" width="1115" height="793" key="find.popup" timestamp="1593544315663">
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </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="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="-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="805" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1592134685315" /> <state x="805" y="444" width="1115" height="793" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1593544315663" />
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585758694219" /> <state x="863" y="438" width="1115" height="793" key="find.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585758694219" />
<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="1587109016568" /> <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="1587109016568" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup" timestamp="1592134877398"> <state x="945" y="377" width="670" height="676" key="search.everywhere.popup" timestamp="1593542096563">
<screen x="0" y="23" width="2560" height="1417" /> <screen x="0" y="23" width="2560" height="1417" />
</state> </state>
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1592134877398" /> <state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1593542096563" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585408665805" /> <state x="945" y="377" width="670" height="676" key="search.everywhere.popup/2560.-493.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1585408665805" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
@ -567,11 +563,6 @@
<line>15</line> <line>15</line>
<option name="timeStamp" value="1" /> <option name="timeStamp" value="1" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/resources/views/web/templates/card.blade.php</url>
<line>135</line>
<option name="timeStamp" value="2" />
</line-breakpoint>
<line-breakpoint enabled="true" type="php"> <line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/resources/views/emails/checkout.blade.php</url> <url>file://$PROJECT_DIR$/resources/views/emails/checkout.blade.php</url>
<line>360</line> <line>360</line>

View file

@ -56,13 +56,14 @@ class ShoppingUserController extends Controller
], 400); ], 400);
} }
$status = []; $status = [];
//TODO Status
foreach ($wp_order_numbers as $wp_order_number){ foreach ($wp_order_numbers as $wp_order_number){
$shopping_user = ShoppingUser::where('wp_order_number', '=', $wp_order_number)->first(); $shopping_user = ShoppingUser::where('wp_order_number', '=', $wp_order_number)->first();
$status[] = [ $status[] = [
'wp_order_number' => $wp_order_number, 'wp_order_number' => $wp_order_number,
'user' => $shopping_user ? true : false, 'user' => $shopping_user ? true : false,
'order' => ($shopping_user && $shopping_user->shopping_order) ? true : false, 'order' => ($shopping_user && $shopping_user->shopping_order) ? true : false,
'status' => 'open | sent | ...', 'status' => 'free',
]; ];
} }
return response()->json([ return response()->json([
@ -109,13 +110,15 @@ class ShoppingUserController extends Controller
$user = $this->prepareForShow($shopping_user); $user = $this->prepareForShow($shopping_user);
$order = $this->prepareForShowOrder($shopping_user->shopping_order); $order = $this->prepareForShowOrder($shopping_user->shopping_order);
} }
//TODO Status
$data[] = [ $data[] = [
'wp_order_number' => $wp_order_number, 'wp_order_number' => $wp_order_number,
'user' => $user, 'user' => $user,
'order' => $order, 'order' => $order,
'customer_number' => $shopping_user ? $shopping_user->number : false, 'customer_number' => $shopping_user ? $shopping_user->number : false,
'member_email' => ($shopping_user && $shopping_user->member) ? $shopping_user->member->email : false, 'member_email' => ($shopping_user && $shopping_user->member) ? $shopping_user->member->email : false,
'status' => 'open | sent | ...', 'status' => 'free',
]; ];
} }
return response()->json([ return response()->json([
@ -195,7 +198,7 @@ class ShoppingUserController extends Controller
$priority = CustomerPriority::checkChangeOne($shopping_user, $data, true); $priority = CustomerPriority::checkChangeOne($shopping_user, $data, true);
$updated = $shopping_user->fill($data)->save(); $updated = $shopping_user->fill($data)->save();
\App\Services\Shop::newUserOrder($shopping_user->number); \App\Services\Shop::newUserOrder($shopping_user->number);
//TODO Status
if ($updated){ if ($updated){
$user = $this->prepareForShow($shopping_user); $user = $this->prepareForShow($shopping_user);
$order = $this->prepareForShowOrder($shopping_user->shopping_order); $order = $this->prepareForShowOrder($shopping_user->shopping_order);
@ -208,7 +211,7 @@ class ShoppingUserController extends Controller
'customer_priority' => $priority, 'customer_priority' => $priority,
'customer_number' => $shopping_user ? $shopping_user->number : false, 'customer_number' => $shopping_user ? $shopping_user->number : false,
'member_email' => ($shopping_user && $shopping_user->member) ? $shopping_user->member->email : false, 'member_email' => ($shopping_user && $shopping_user->member) ? $shopping_user->member->email : false,
'status' => 'open | sent | ...', 'status' => 'free',
], ],
'time' => Carbon::now()->toDateTimeString() 'time' => Carbon::now()->toDateTimeString()
], 200); ], 200);
@ -249,6 +252,7 @@ class ShoppingUserController extends Controller
$wp_order = $request->wp_order; $wp_order = $request->wp_order;
} }
$wp_order = $this->prepareOrder($wp_order, $shopping_user); $wp_order = $this->prepareOrder($wp_order, $shopping_user);
//TODO Status
if ($wp_order){ if ($wp_order){
$user = $this->prepareForShow($shopping_user); $user = $this->prepareForShow($shopping_user);
$order = $this->prepareForShowOrder($shopping_user->shopping_order); $order = $this->prepareForShowOrder($shopping_user->shopping_order);
@ -261,6 +265,7 @@ class ShoppingUserController extends Controller
'order' => $order, 'order' => $order,
'customer_number' => $shopping_user->number, 'customer_number' => $shopping_user->number,
'member_email' => $shopping_user->member->email, 'member_email' => $shopping_user->member->email,
'status' => 'free',
], ],
'time' => Carbon::now()->toDateTimeString() 'time' => Carbon::now()->toDateTimeString()
], 200); ], 200);
@ -291,6 +296,8 @@ class ShoppingUserController extends Controller
} }
$shopping_order->delete(); $shopping_order->delete();
} }
$shopping_user->wp_order_number = time();
$shopping_user->save();
if ($shopping_user->delete()) { if ($shopping_user->delete()) {
return response()->json([ return response()->json([
'success' => true 'success' => true
@ -368,7 +375,7 @@ class ShoppingUserController extends Controller
//$salutation = array(1 => 'mr', 2 => 'ms', 3=>null); //$salutation = array(1 => 'mr', 2 => 'ms', 3=>null);
$ret = []; $ret = [];
$needs = [ 'billing_salutation', 'billing_company', 'billing_firstname', 'billing_lastname', 'billing_address', 'billing_address_2', 'billing_zipcode', 'billing_city', 'billing_phone', 'billing_email', $needs = [ 'billing_salutation', 'billing_company', 'billing_firstname', 'billing_lastname', 'billing_address', 'billing_address_2', 'billing_zipcode', 'billing_city', 'billing_phone', 'billing_email', 'same_as_billing',
'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_phone']; 'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_phone'];
foreach ($data as $key=>$value){ foreach ($data as $key=>$value){
@ -404,7 +411,7 @@ class ShoppingUserController extends Controller
$ret = []; $ret = [];
$needs = [ 'billing_salutation', 'billing_company', 'billing_firstname', 'billing_lastname', 'billing_address', 'billing_address_2', 'billing_zipcode', 'billing_city', 'billing_country_id', 'billing_phone', 'billing_email', $needs = [ 'billing_salutation', 'billing_company', 'billing_firstname', 'billing_lastname', 'billing_address', 'billing_address_2', 'billing_zipcode', 'billing_city', 'billing_country_id', 'billing_phone', 'billing_email',
'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_country_id', 'shipping_phone', 'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_country_id', 'shipping_phone',
//'same_as_billing', 'has_buyed', 'subscribed', 'same_as_billing', //'has_buyed', 'subscribed',
'wp_order_number', 'wp_order_date']; 'wp_order_number', 'wp_order_date'];
foreach ($needs as $need){ foreach ($needs as $need){
@ -432,10 +439,10 @@ class ShoppingUserController extends Controller
if ($need === 'wp_order_date') { if ($need === 'wp_order_date') {
$ret['wp_order_date'] = Carbon::parse($ret['wp_order_date'])->toDateTimeString(); $ret['wp_order_date'] = Carbon::parse($ret['wp_order_date'])->toDateTimeString();
} }
if ($need === 'same_as_billing') {
$ret['same_as_billing'] = isset($data['same_as_billing']) ? $data['same_as_billing'] : true;
}
} }
$ret['same_as_billing'] = $ret['shipping_lastname'] !== null ? true : false;
$ret['has_buyed'] = true; $ret['has_buyed'] = true;
$ret['subscribed'] = false; $ret['subscribed'] = false;
return $ret; return $ret;
@ -490,7 +497,7 @@ class ShoppingUserController extends Controller
'total' => Yard::instance('shopping')->total(2, '.', ''), 'total' => Yard::instance('shopping')->total(2, '.', ''),
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','), 'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''), 'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''),
'tax_rate' => Yard::getTaxRate(), //'tax_rate' => Yard::getTaxRate(),
'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''), 'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''),
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''), 'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
'weight' => Yard::instance('shopping')->weight(), 'weight' => Yard::instance('shopping')->weight(),
@ -516,6 +523,7 @@ class ShoppingUserController extends Controller
'product_id' => $item->id, 'product_id' => $item->id,
'qty' => $item->qty, 'qty' => $item->qty,
'price' => $item->price, 'price' => $item->price,
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug, 'slug' => $item->options->slug,
])->save(); ])->save();
return false; return false;
@ -533,6 +541,7 @@ class ShoppingUserController extends Controller
'product_id' => $item->id, 'product_id' => $item->id,
'qty' => $item->qty, 'qty' => $item->qty,
'price' => $item->price, 'price' => $item->price,
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug 'slug' => $item->options->slug
]); ]);
} }

View file

@ -32,7 +32,8 @@ class CardController extends Controller
if($product->images->count()){ if($product->images->count()){
$image = $product->images->first()->slug; $image = $product->images->first()->slug;
} }
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product_slug, 'weight' => $product->weight]); $cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product_slug, 'weight' => $product->weight]);
Yard::setTax($cartItem->rowId, $product->tax);
Yard::instance('shopping')->reCalculateShippingPrice(); Yard::instance('shopping')->reCalculateShippingPrice();
\Session()->flash('show-card-after-add', true); \Session()->flash('show-card-after-add', true);
@ -53,7 +54,8 @@ class CardController extends Controller
$image = $product->images->first()->slug; $image = $product->images->first()->slug;
} }
$quantity = Request::get('quantity') ? Request::get('quantity') : 1; $quantity = Request::get('quantity') ? Request::get('quantity') : 1;
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]); $cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
Yard::setTax($cartItem->rowId, $product->tax);
Yard::instance('shopping')->reCalculateShippingPrice(); Yard::instance('shopping')->reCalculateShippingPrice();
\Session()->flash('show-card-after-add', true); \Session()->flash('show-card-after-add', true);

View file

@ -168,7 +168,7 @@ class CheckoutController extends Controller
if(Request::get('payment_method') === 'elv' && is_null(Request::get('mandate_identification'))){ if(Request::get('payment_method') === 'elv' && is_null(Request::get('mandate_identification'))){
$pay = new PayoneController(); $pay = new PayoneController();
$pay->init($shopping_user, $shopping_order); $pay->init($shopping_user, $shopping_order);
$amount = (int) (float) Yard::instance('shopping')->totalWithShipping(2, '.', '') *100; $amount = Yard::instance('shopping')->totalWithShipping(2, '.', '') * 100;
$ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user); $ret['elv'] = $pay->checkBankAccount($data, $amount, 'EUR', $shopping_user);
if($ret['elv']['status'] === 'ERROR' || $ret['elv']['status'] === 'INVALID'){ if($ret['elv']['status'] === 'ERROR' || $ret['elv']['status'] === 'INVALID'){
@ -214,7 +214,7 @@ class CheckoutController extends Controller
//other //other
$pay = new PayoneController(); $pay = new PayoneController();
$pay->init($shopping_user, $shopping_order); $pay->init($shopping_user, $shopping_order);
$amount = (int) (float) Yard::instance('shopping')->totalWithShipping(2, '.', '') * 100; $amount = Yard::instance('shopping')->totalWithShipping(2, '.', '') * 100;
$reference = $pay->setPrePayment(Request::get('payment_method'), $amount, 'EUR', $ret); $reference = $pay->setPrePayment(Request::get('payment_method'), $amount, 'EUR', $ret);
$this->putPayments('payment_reference', $reference); $this->putPayments('payment_reference', $reference);
$pay->setPersonalData(); $pay->setPersonalData();
@ -333,7 +333,7 @@ class CheckoutController extends Controller
'total' => Yard::instance('shopping')->total(2, '.', ''), 'total' => Yard::instance('shopping')->total(2, '.', ''),
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','), 'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''), 'subtotal' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''),
'tax_rate' => Yard::getTaxRate(), //'tax_rate' => Yard::getTaxRate(),
'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''), 'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''),
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''), 'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
'weight' => Yard::instance('shopping')->weight(), 'weight' => Yard::instance('shopping')->weight(),
@ -364,6 +364,7 @@ class CheckoutController extends Controller
'product_id' => $item->id, 'product_id' => $item->id,
'qty' => $item->qty, 'qty' => $item->qty,
'price' => $item->price, 'price' => $item->price,
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug, 'slug' => $item->options->slug,
])->save(); ])->save();
return false; return false;
@ -380,6 +381,7 @@ class CheckoutController extends Controller
'product_id' => $item->id, 'product_id' => $item->id,
'qty' => $item->qty, 'qty' => $item->qty,
'price' => $item->price, 'price' => $item->price,
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug 'slug' => $item->options->slug
]); ]);
}; };

View file

@ -263,7 +263,7 @@ class Product extends Model
public function getFormattedTax() public function getFormattedTax()
{ {
return isset($this->attributes['tax']) ? Util::formatNumber($this->attributes['tax']) : ""; return isset($this->attributes['tax']) ? Util::formatNumber($this->attributes['tax'], 0) : "";
} }
public function getFormattedPriceOld() public function getFormattedPriceOld()

View file

@ -84,7 +84,7 @@ class ShoppingOrder extends Model
'total', 'total',
'shipping', 'shipping',
'subtotal', 'subtotal',
'tax_rate', //'tax_rate',
'tax', 'tax',
'total_shipping', 'total_shipping',
'weight', 'weight',

View file

@ -46,6 +46,7 @@ class ShoppingOrderItem extends Model
'product_id', 'product_id',
'qty', 'qty',
'price', 'price',
'tax_rate',
'slug', 'slug',
]; ];

View file

@ -43,6 +43,7 @@ class Yard extends Cart
public static function getTaxRate() public static function getTaxRate()
{ {
return config('cart.tax'); return config('cart.tax');
} }
@ -121,7 +122,6 @@ class Yard extends Cart
//sec by weight //sec by weight
if(!$price){ if(!$price){
$price = $this->shippingPriceByWeight($shipping->prices, intval($this->weight())); $price = $this->shippingPriceByWeight($shipping->prices, intval($this->weight()));
} }
//default //default
if(!$price){ if(!$price){
@ -182,18 +182,20 @@ class Yard extends Cart
public function subtotalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null) public function subtotalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{ {
$taxRate =config('cart.tax'); $subtotal = $this->subtotal(2, '.', '') + $this->shipping;
$total = (float) ($this->total(2, '.', '')) + $this->shipping; //$taxRate =config('cart.tax');
$totalTax = $total/ (100 + $taxRate) * $taxRate; /*$total = (float) ($this->total(2, '.', '')) + $this->shipping;
return $this->numberFormat(($total - $totalTax), $decimals, $decimalPoint, $thousandSeperator); $totalTax = $total/ (100 + $taxRate) * $taxRate;*/
return $this->numberFormat($subtotal, $decimals, $decimalPoint, $thousandSeperator);
} }
public function taxWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null) public function taxWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{ {
$taxRate =config('cart.tax'); $totalTax = $this->tax(2, '.', '');
/* $taxRate =config('cart.tax');
$total = (float) ($this->total(2, '.', '')) + $this->shipping; $total = (float) ($this->total(2, '.', '')) + $this->shipping;
$totalTax = $total/ (100 + $taxRate) * $taxRate; $totalTax = $total/ (100 + $taxRate) * $taxRate; */
return $this->numberFormat($totalTax, $decimals, $decimalPoint, $thousandSeperator); return $this->numberFormat($totalTax, $decimals, $decimalPoint, $thousandSeperator);
} }

314
public/wartung.html Normal file
View file

@ -0,0 +1,314 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Wartungsmodus</title>
<style>
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display:block
}
audio, canvas, video {
display:inline-block
}
audio:not([controls]) {
display: none;
height:0
}
[hidden] {
display:none
}
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust:100%
}
body {
margin:0
}
a:focus {
outline:thin dotted
}
a:active, a:hover {
outline:0
}
h1 {
font-size: 2em;
margin:.67em 0
}
abbr[title] {
border-bottom:1px dotted
}
b, strong {
font-weight:700
}
dfn {
font-style:italic
}
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height:0
}
mark {
background: #ff0;
color:#000
}
code, kbd, pre, samp {
font:1em monospace, serif
}
pre {
white-space:pre-wrap
}
q {
quotes: "\201C" "\201D" "\2018" "\2019"
}
small {
font-size:80%
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align:baseline
}
sup {
top:-.5em
}
sub {
bottom:-.25em
}
img {
border:0
}
svg:not(:root) {
overflow:hidden
}
figure {
margin:0
}
fieldset {
border: 1px solid silver;
margin: 0 2px;
padding:.35em .625em .75em
}
legend {
border: 0;
padding:0
}
button, input, select, textarea {
font-family: inherit;
font-size: 100%;
margin:0
}
button, input {
line-height:normal
}
button, select {
text-transform: none
}
button, html input[type="button"], input[type="reset"], input[type="submit"] {
-webkit-appearance: button;
cursor:pointer
}
button[disabled], html input[disabled] {
cursor: default
}
input[type="checkbox"], input[type="radio"] {
box-sizing: border-box;
padding: 0
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box
}
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
-webkit-appearance:none
}
button::-moz-focus-inner, input::-moz-focus-inner {
border: 0;
padding:0
}
textarea {
overflow: auto;
vertical-align:top
}
table {
border-collapse: collapse;
border-spacing: 0
}
body, html {
min-height: 100%;
background: #e9ebed;
}
.maintenance-container {
position: relative;
background: #fff;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin: 50px auto;
width: 475px;
padding: 30px;
text-align: center;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, .5);
-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, .5);
-ms-box-shadow: 0px 1px 3px rgba(0, 0, 0, .5);
box-shadow: 0px 1px 3px rgba(0, 0, 0, .5);
}
.maintenance-headline {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
margin: 0 0 .8em;
}
.maintenance-text {
font-size: 13px
}
.maintenance-progress {
border-top: 1px solid #529e52;
height: 4px;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
background-color: #5eb95e;
-webkit-background-size: 40px 40px;
-moz-background-size: 40px 40px;
-o-background-size: 40px 40px;
background-size: 40px 40px;
-webkit-animation: progress-bar-stripes 2s linear infinite;
-moz-animation: progress-bar-stripes 2s linear infinite;
-ms-animation: progress-bar-stripes 2s linear infinite;
-o-animation: progress-bar-stripes 2s linear infinite;
animation: progress-bar-stripes 2s linear infinite;
background-color: #62C462;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, rgba(0, 0, 0, 0)), color-stop(0.5, rgba(0, 0, 0, 0)), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0)));
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0));
}
hr {
background: transparent url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAHUlEQVR42q3IoREAAACCQHdy/91IFrLcfSGqc5wAdFYCZQo/LFUAAAAASUVORK5CYII=") repeat-x;
border: 0 none;
color: #CCC;
height: 4px;
padding: 0;
margin: 30px 0;
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-moz-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-ms-keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
@-o-keyframes progress-bar-stripes {
from {
background-position: 0 0;
}
to {
background-position: 40px 0;
}
}
@keyframes progress-bar-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
</style>
</head>
<body>
<div class="maintenance-container">
<h1 class="maintenance-headline">Unsere Website befindet sich gerade in der Wartung.</h1>
<p class="maintenance-text">
Wir stehen Ihnen bald wieder zur Verfügung. Entschuldigen Sie etwaige Unannehmlichkeiten.
</p>
<hr/>
<h1 class="maintenance-headline">Our website is currently undergoing maintenance.</h1>
<p class="maintenance-text">
We'll be back very soon. Sorry for any inconvenience.
</p>
<div class="maintenance-progress"></div>
</div>
</body>
</html>

View file

@ -169,7 +169,7 @@
<b>{{__('email.checkout_mail_bank_iban')}}</b> {{ $pay_trans->transmitted_data['clearing_bankiban'] }} <br> <b>{{__('email.checkout_mail_bank_iban')}}</b> {{ $pay_trans->transmitted_data['clearing_bankiban'] }} <br>
<b>{{__('email.checkout_mail_bank_bic')}}</b> {{ $pay_trans->transmitted_data['clearing_bankbic'] }} <br> <b>{{__('email.checkout_mail_bank_bic')}}</b> {{ $pay_trans->transmitted_data['clearing_bankbic'] }} <br>
<b>{{__('email.checkout_mail_bank_name')}}</b> {{ $pay_trans->transmitted_data['clearing_bankname'] }} <br> <b>{{__('email.checkout_mail_bank_name')}}</b> {{ $pay_trans->transmitted_data['clearing_bankname'] }} <br>
<b>{{__('email.checkout_mail_bank_total')}}</b> {{ number_format( floatval($pay_trans->shopping_payment->amount/100), 2, ",", ".") }} EUR<br> <b>{{__('email.checkout_mail_bank_total')}}</b> {{ number_format( (float) ($pay_trans->shopping_payment->amount/100), 2, ",", ".") }} EUR<br>
<b>{{__('email.checkout_mail_bank_code')}}</b> {{ $pay_trans->transmitted_data['txid'] }} <b>{{__('email.checkout_mail_bank_code')}}</b> {{ $pay_trans->transmitted_data['txid'] }}
</p> </p>
<hr /> <hr />

View file

@ -146,7 +146,9 @@
<tbody> <tbody>
@foreach(Yard::instance('shopping')->content() as $row) @foreach(Yard::instance('shopping')->content() as $row)
@php($product = \App\Models\Product::find($row->id)) @php($product = \App\Models\Product::find($row->id))
<tr class="item yard"> <tr class="item yard">
<td> <td>
@if($row->options->has('image')) @if($row->options->has('image'))
@ -167,7 +169,7 @@
<td class="text-right font-weight-semibold align-middle p-2"> <td class="text-right font-weight-semibold align-middle p-2">
<span>{{ $row->price() }} </span> <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;">{{$product->getBasePriceFormattedFull()}}</div>
<div style="font-size: 11px; color:#1d1d1d; font-weight: 500;">inkl. {{ number_format($row->taxRate, 0)}}% MwSt.</div>
</td> </td>
<td class="align-middle p-2"> <td class="align-middle p-2">
<input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" /> <input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" />
@ -278,10 +280,9 @@
<span class="pull-right small">{{ Yard::instance('shopping')->subtotalWithShipping() }} </span> <span class="pull-right small">{{ Yard::instance('shopping')->subtotalWithShipping() }} </span>
<span class="pull-left small">Summe ohne MwSt:</span> <span class="pull-left small">Summe ohne MwSt:</span>
</div> </div>
<div class="clearfix mb-2" style="font-size: 90%"> <div class="clearfix mb-2" style="font-size: 90%">
<span class="pull-right small">{{ Yard::instance('shopping')->taxWithShipping() }} </span> <span class="pull-right small">{{ Yard::instance('shopping')->taxWithShipping() }} </span>
<span class="pull-left small"> zzgl. {{ Yard::getTaxRate() }} % MwSt:</span> <span class="pull-left small"> zzgl. {{-- Yard::getTaxRate() --}} MwSt:</span>
</div> </div>
<hr /> <hr />
<span class="clearfix "> <span class="clearfix ">

View file

@ -670,7 +670,7 @@
<div class="clearfix mb-2" style="font-size: 90%"> <div class="clearfix mb-2" style="font-size: 90%">
<span class="pull-right small">{{ Yard::instance('shopping')->taxWithShipping() }} </span> <span class="pull-right small">{{ Yard::instance('shopping')->taxWithShipping() }} </span>
<span class="pull-left small"> zzgl. {{ Yard::getTaxRate() }} % MwSt:</span> <span class="pull-left small"> zzgl. {{-- Yard::getTaxRate() --}} MwSt:</span>
</div> </div>
<hr /> <hr />

View file

@ -104,7 +104,7 @@
{{ $product->getFormattedPrice() }} {{ $product->getFormattedPrice() }}
@endif<br> @endif<br>
<span style="font-size: 13px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</span><br> <span style="font-size: 13px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</span><br>
<span style="font-size: 13px; color:#6e6e6e; font-weight: 500;"><em>inkl. 19% MwSt. zzgl. Versandkosten</em></span> <span style="font-size: 13px; color:#6e6e6e; font-weight: 500;"><em>inkl. {{$product->getFormattedTax()}}% MwSt. zzgl. Versandkosten</em></span>
</div> </div>
<hr> <hr>