CoolCMS API

FormTrait

Cart form: quantities, bulk removal, voucher code redemption and the step to checkout.

Single rows (remove, plus/minus, voucher removal) are handled by signals in the component.

IMPORTANT: values are read from the controls, never through getValues(). The helper buttons use setValidationScope([]), so Nette marks controls outside the scope as omitted and getValues() skips them.

Table of Contents

Methods

onSuccess()  : void
createComponentForm()  : Form
applyQuantities()  : void
Stores quantities of all rows (read from the controls, see the trait docblock).
isSubmittedBy()  : bool
removeSelectedRows()  : void
submitVoucher()  : void

Methods

applyQuantities()

Stores quantities of all rows (read from the controls, see the trait docblock).

private applyQuantities(Form $form) : void
Parameters
$form : Form

isSubmittedBy()

private isSubmittedBy(Form $form, string $name) : bool
Parameters
$form : Form
$name : string
Return values
bool

removeSelectedRows()

private removeSelectedRows(Form $form) : void
Parameters
$form : Form
On this page

Search results