start or resume session PERFORM HTM2COB-SESS-START DISPLAY "

    HTM2COB-HIDDEN-SESSION-ID: " HTM2COB-HIDDEN-SESSION-ID"

" *> save all items in session PERFORM WRITE-CART-ITEMS-IN-SESS ?>

## Mars Planet Webshop

##### Sorry, there is no return ticket back to Earth...

### Cart Contents

Item-Nr. | Item | Price ($) | Quantity | Subtotal Price ($)
--- | --- | --- | --- | ---

Total Price ($):

Mars Planet Webshop start page

------------------------------------------------------------------------------ WRITE-CART-ITEMS-IN-SESS SECTION. *>------------------------------------------------------------------------------ INITIALIZE WS-TOTAL-PRICE PERFORM VARYING WS-IND FROM 1 BY 1 UNTIL WS-IND > CAT-ITEM-MAX-IND MOVE WS-CAT-NR OF WS-CAT-ITEM-TAB(WS-IND) TO WS-SEL-CAT-NR MOVE WS-CAT-ITEM-NR OF WS-CAT-ITEM-TAB(WS-IND) TO WS-SEL-ITEM-NR CALL "HTM2COB-POST" USING WS-SEL-CAT-ITEM, WS-QTY END-CALL IF FUNCTION TEST-NUMVAL(WS-QTY) = ZEROES THEN *> save in session MOVE WS-SEL-CAT-ITEM TO HTM2COB-SESS-VAR-NAME MOVE FUNCTION NUMVAL(WS-QTY) TO HTM2COB-SESS-VAR-VALUE PERFORM HTM2COB-SESS-SET END-IF END-PERFORM EXIT SECTION . *>------------------------------------------------------------------------------ READ-CART-ITEMS-FROM-SESS SECTION. *>------------------------------------------------------------------------------ INITIALIZE WS-TOTAL-PRICE PERFORM VARYING WS-IND FROM 1 BY 1 UNTIL WS-IND > CAT-ITEM-MAX-IND MOVE WS-CAT-NR OF WS-CAT-ITEM-TAB(WS-IND) TO WS-SEL-CAT-NR MOVE WS-CAT-ITEM-NR OF WS-CAT-ITEM-TAB(WS-IND) TO WS-SEL-ITEM-NR *> read from session MOVE WS-SEL-CAT-ITEM TO HTM2COB-SESS-VAR-NAME PERFORM HTM2COB-SESS-GET IF V-OK OF LNK-RESULT OF LNK-HTM2COB-SESSION THEN MOVE HTM2COB-SESS-VAR-VALUE TO WS-QTY IF FUNCTION TEST-NUMVAL(WS-QTY) = ZEROES AND FUNCTION NUMVAL(WS-QTY) > ZEROES THEN MOVE WS-CAT-ITEM-PRICE OF WS-CAT-ITEM-TAB(WS-IND) TO WS-PRICE-DISP COMPUTE WS-SUBTOTAL-PRICE = WS-CAT-ITEM-PRICE OF WS-CAT-ITEM-TAB(WS-IND) * FUNCTION NUMVAL(WS-QTY) END-COMPUTE COMPUTE WS-TOTAL-PRICE = WS-TOTAL-PRICE + WS-SUBTOTAL-PRICE END-COMPUTE MOVE WS-QTY TO WS-QTY-DISP MOVE WS-SUBTOTAL-PRICE TO WS-SUBTOTAL-PRICE-DISP MOVE WS-TOTAL-PRICE TO WS-TOTAL-PRICE-DISP DISPLAY "
" "Cat"WS-CAT-NR OF WS-CAT-ITEM-TAB(WS-IND) "-Item" WS-CAT-ITEM-NR OF WS-CAT-ITEM-TAB(WS-IND)"" ""FUNCTION TRIM(WS-CAT-ITEM-NAME OF WS-CAT-ITEM-TAB(WS-IND))"" ""WS-PRICE-DISP"" ""WS-QTY-DISP"" ""WS-SUBTOTAL-PRICE-DISP"" "
" END-DISPLAY END-IF END-IF END-PERFORM EXIT SECTION . ?>