basket-add.sh Script Documentation

This document describes the functionality and usage of the basket-add.sh script found in the cruiseappy/scripts folder.

Purpose

This script adds items to a basket based on a search ID.

Usage

./basket-add.sh <search_id>

Arguments

  • search_id: The ID of the search to add items to the basket.

Description

The script performs the following steps: 1. Sources the functions.sh script for utility functions. 2. Retrieves various details (hotel_resultno, flight_resultno, sessionkey, search_type) from the database using the search_id. 3. Determines the appropriate ca_tt_sid based on the search_type. 4. Empties the current basket by removing all items associated with the sessionkey. 5. Adds hotel items to the basket if hotel_resultno is present. 6. Adds flight items to the basket if flight_resultno is present. 7. Calls the basket-get.sh script to retrieve the updated basket. 8. Optionally prompts the user to view debug information.

Environment Variables

  • ca_db_name: The name of the database to use.
  • ca_tt_sid_flight_b2c: The SID for flight B2C.
  • ca_tt_sid_hotel_b2c: The SID for hotel B2C.
  • ca_tt_sid_flight_and_hotel_b2c: The SID for flight and hotel B2C.
  • ca_tt_username: The username for authentication.
  • ca_tt_password: The password for authentication.
  • ca_tt_endpoint: The endpoint URL for API requests.
  • ca_tt_language: The language parameter for API requests.

Dependencies

  • functions.sh: A script containing utility functions.
  • basket-get.sh: A script to retrieve the updated basket.
  • xmlstarlet: A command-line XML toolkit.
  • mysql: A command-line client for MySQL.
  • curl: A command-line tool for transferring data with URLs.

For further details, refer to the comments in the script or contact the development team.