Skip to main content

Shopping cart

In this learning path you will execute the "shopping cart" mechanism. You will be able to add products from the list of available products, specifying their quantity, modify the number of products in the basket and remove them. Each operation will be accompanied by updating the quantity of available products and validating the correctness of the entered values.

Below is the material presenting the resulting functionality.

Issues presented in the current article​

DATA STRUCTURE

  1. Building a data structure
  2. Building relations of data structures

LIST

  1. Building a list
  2. Defining action columns in a list
  3. Actions in a list

FORM

  1. Form without a base structure
  2. Defining the form data schema using initial mappings
  3. Actions on forms
  4. Validations on controls

MAPPINGS

  1. Performing several operations using mappings on the form and actions

OTHER

  1. Importing data using an SQL script

STEP 1 - DATA STRUCTURE AND IMPORT DATA​

In this step:

  1. You will create data structures that are related
  2. You will load the data into the database using a SQL script (the script used in the tutorial can be found under the movie)

Script used in the material above:

INSERT INTO [dbo].[PRODUCT] ([P\_NAME], [P\_PRICE], [P\_AVAILABLE]) VALUES ('banana', 2.99, 100)
INSERT INTO [dbo].[PRODUCT] ([P\_NAME], [P\_PRICE], [P\_AVAILABLE]) VALUES ('orange', 1.99, 100)
INSERT INTO [dbo].[PRODUCT] ([P\_NAME], [P\_PRICE], [P\_AVAILABLE]) VALUES ('watermelon', 5.99, 100)
INSERT INTO [dbo].[PRODUCT] ([P\_NAME], [P\_PRICE], [P\_AVAILABLE]) VALUES ('apple', 0.99, 100)

STEP 2 - PRODUCTS LIST AND THE FORM OF THEIR ADDING​

In this step:

  1. You will create a list of product
  2. You will create a form for adding products
  3. You will create a data container in "read-only" mode
  4. You will define additional fields with initial mappings
  5. You will define an action on the form

STEP 3 - MAIN FORM AND INITIAL MAPPINGS​

In this step:

  1. You will create a form without data structure
  2. You will use initial mappings to define the data schema for the form
  3. You will add temporary fields, the source of which you define with expressions
  4. You will build the form layout using the controls in the Toolbox

STEP 4 - ACTIONS: ADDING AND REMOVING PRODUCTS​

In this step:

  1. You will add the action of adding a product to the cart on the list
  2. You will add an action of removing a product from the cart on the form
  3. You will define additional mappings for the above actions

STEP 5 - UPDATING THE QUANTITY OF PRODUCTS​

In this step:

  1. You will update action mappings of adding, removing and changing the quantity of products in the basket for recalculation of the quantity of available products

STEP 6 - VALIDATION​

In this step:

  1. You will add validation rules to the edit fields on the forms