Orders CRUD

This form is complicated. It has a repeater field for adding product lines. And it also has javascript to calculate Totals.

All other things (Adding controller, routes, etc are the same as explained in Brands CRUD tutorial)

Add form fields

All other fields are simple. Please note how we added the repeater field (id = order_lines). All the repeater fields (product, quantity, price, taxes, total) have their parent_id set to the id of repeater i.e. order_lines

Also, note that we added custom HTML for showing order TOTALS.

Add Javascript

Adding javascript to forms is simple. Please see the following sample code

Following is the actual javascript for Orders Form

Last updated