Abo: Fix Checkout-Rücksprung bei Einmalprodukten in der Bestellstrecke
Die Submit-Validierung checkSendYardForPayment() prüfte jede Cart-Zeile gegen das Abo-Sortiment (12/13) – Einmal-Zeilen (show_on 3) fielen durch und der Checkout-Klick sprang per back() kommentarlos auf die Bestellseite zurück. Einmal-Zeilen werden jetzt gegen das Einmal-Sortiment validiert (manipulierte Zeilen weiterhin abgewiesen). Zusätzlich zeigt list.blade.php jetzt alle Validierungsfehler an (vorher nur Comp-Produkt-Fehler → Fehler blieb unsichtbar). Tests: 2 neue Regressionstests in AboCreateOneTimeCartTest (19 grün). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
cdb121fde0
commit
657d4bd5b7
4 changed files with 93 additions and 1 deletions
|
|
@ -476,6 +476,14 @@ class OrderController extends Controller
|
|||
if (! $product) {
|
||||
continue;
|
||||
}
|
||||
if ($isAbo && ($row->options->abo_addon ?? false)) {
|
||||
// Einmal-Zeilen (nur erste Lieferung) gehören zum Einmal-Sortiment, nicht zum Abo-Sortiment
|
||||
if (! ProductOrderContext::productMatchesShowOn($product, ProductOrderContext::oneTimeShowOnIds())) {
|
||||
throw new \Exception(__('msg.cart_product_not_allowed_for_order_type'));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
if (! ProductOrderContext::isProductAllowedInContext($product, $isAbo, $data['shipping_is_for'])) {
|
||||
throw new \Exception(__('msg.cart_product_not_allowed_for_order_type'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue