Add Item to Cart via a Form Examples

Items can be added to the cart using either data hard coded into a model file or data retrieved from a html form or a database query.

This demo page shows how the data of items added to the cart can be set via data obtained from a html form submission, allowing a customer to select item quantities and options before they have added the item to the cart.

Item Form Examples

Item Link Examples | Item Ajax Examples | Item Discount Examples | Item Database Examples
Add an item via a form
Example #201
This example allows a user to select the quantity of items that they wish to add to the cart.
  • £59.95

Add an item with options via a form
Example #202
This example allows for multiple options per item to be selected.
An array of all the option data is then also added to the item data, which can enable the user to change options after the item has been added to the cart.

  • £27.50

Example #203
This example updates the items price depending on the option selected.
The example does not submit an array of the items options, so the user cannot change the selected option once added to the cart.


Add multiple items via a form
This example allows a user to add multiple items to the cart at the same time just by checking each items checkbox.
  • Example #204
  • Price: £18.25
  • Example #205
  • Price: £39.95
  • Example #206
  • Price: £30.00

Add checked items to cart :