SummaryFormTrait
Step 3: recap and binding order submit.
IMPORTANT: a double click must not create two orders. The form carries a one-time token issued when the step is shown (CartManager::issueToken()); submitting burns it, so a second attempt (double click, reload, back button) creates no order and only redirects to the one that already exists. The PHP session lock also serializes concurrent requests of one session, so both cannot pass.
Api errors are translated into a clear message and a way out:
insufficientStock: back to the cart with the list of goods.sellerRequiredandpaymentCallbackMisconfigured: an operational error the customer cannot fix (logged in theeshoplog for the operator).voucherInvalid: back to the cart, where vouchers are entered.shippingInvalidandpaymentInvalid: back to step 2.
Table of Contents
Methods
- onSummarySuccess() : void
- summaryRows() : array<int, array<string, mixed>>
- createComponentSummaryForm() : Form
- controlString() : string
- handlePlaceFailure() : void
- redirectToDone() : void
- summaryStr() : string
Methods
onSummarySuccess()
public
onSummarySuccess(Form $form) : void
Parameters
- $form : Form
summaryRows()
public
summaryRows() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>> —recap rows for the template
createComponentSummaryForm()
protected
createComponentSummaryForm() : Form
Return values
FormcontrolString()
private
controlString(Form $form, string $name) : string
Parameters
- $form : Form
- $name : string
Return values
stringhandlePlaceFailure()
private
handlePlaceFailure(array<string, mixed> $result) : void
Parameters
- $result : array<string, mixed>
redirectToDone()
private
redirectToDone(int $orderId, int|null $paymentId) : void
Parameters
- $orderId : int
- $paymentId : int|null
summaryStr()
private
summaryStr(mixed $value) : string
Parameters
- $value : mixed