New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store checkout and validation updates #3213
Store checkout and validation updates #3213
Conversation
since it's only 1 line after that
otherwise it defaults to 1 and the subtotal is wrong.
app/Libraries/OrderCheckout.php
Outdated
} | ||
|
||
if ($item->quantity > $item->product->max_quantity) { | ||
$messages[] = [trans_choice('model_validation/store/product.too_many', $item->product->max_quantity)]; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
app/Libraries/OrderCheckout.php
Outdated
} | ||
|
||
foreach ($messages as $array) { | ||
// merge with existing errors, if any. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -1,65 +0,0 @@ | |||
<?php |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
switch ($order->status) { | ||
case 'checkout': | ||
case 'processing': | ||
return 'You cannot modify your order while it is being processed.'; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -78,7 +78,7 @@ public function show() | |||
|
|||
// using $errors will conflict with laravel's default magic MessageBag/ViewErrorBag that doesn't act like | |||
// an array and will cause issues in shared views. | |||
$flash = session('checkout.error.errors') ?? []; | |||
$flash = session('checkout.error.errors') ?? $checkout->validate(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
padding: 10px; | ||
margin: 0 0 5px; | ||
|
||
// flex-wrap: wrap; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
app/Models/Store/Order.php
Outdated
@@ -587,6 +528,7 @@ private function newOrderItem(array $params) | |||
} | |||
|
|||
$item = new OrderItem(); | |||
$item->order_id = $this->order_id; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
return $this->order; | ||
} | ||
|
||
private static function buildMessage(Order $order) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -464,27 +421,11 @@ public function switchItems($orderItem, $newProduct) | |||
|
|||
public static function cart($user) | |||
{ | |||
$cart = static::query() | |||
return static::query() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
resources/lang/en/store.php
Outdated
@@ -23,11 +23,29 @@ | |||
'warehouse' => 'Warehouse', | |||
], | |||
|
|||
'cart' => [ | |||
'errors_no_checkout' => [ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Order::updateItem
Some of the view parts and styles need consolidating but that's a different mess to be done separately.