@Override
	public void actionPerformed(ActionEvent e) {
		String response;
		Product product = null;

		String action = ((JButton) e.getSource()).getActionCommand();

		/* EDIT QUANTITY of items in the shopping cart */

		if (action.equals(ViewFrame.ACTION_EDIT_QUANTITY)) {
			// resolve the choice to a Product
			product = resolveCartChoiceToProduct();
			if (product == null)
				JOptionPane.showMessageDialog(null, USE_LIST_WARNING, "Error",
						JOptionPane.WARNING_MESSAGE);
			// edit the quantity of that Product
			else
				this.editQuantity(product);

			mViewFrame.showCart(mCheckOut);
		}
		/* REMOVE ALL ITEMS (of selected product type) from the shopping cart */

		if (action.equals(ViewFrame.ACTION_REMOVE_ALL)) {
			// resolve the choice to a product
			product = resolveCartChoiceToProduct();
			if (product == null)
				JOptionPane.showMessageDialog(null, USE_LIST_WARNING, "Error",
						JOptionPane.WARNING_MESSAGE);
			// remove Product from appropriate Basket
			else
				ShoppingBasket.getBasketInstance().removeProductByType(product);
			// refresh the cart as displayed in the UI
			mViewFrame.showCart(mCheckOut);
			// remove 'edit cart' buttons if basket is empty
			if (ShoppingBasket.getBasketInstance().size() < 1)
				mViewFrame.showCartEditButtons(false);
		}
		/* ADD ITEMS TO CART */

		if (action.equals(ViewFrame.ACTION_ADD_TO_CART)) {
			/*
			 * The list of items on sale is generated from the product
			 * catalogue, so the sequence in the list should be the same as in
			 * the product catalogue
			 */
			product = mProductCatalogue.getCatalogue().get(
					product_panel_choice);
			boolean nothing_entered = false;
			// create the appropriate input dialog + validate response
			do {
				response = JOptionPane
						.showInputDialog(createAddProductPrompt(product));
				if (response == null | response == "")
					nothing_entered = true;
			} while (!validateAlterCartQuantity(response, product));

			/*
			 * add the items to the cart if !nothing_entered (i.e. user HAS
			 * entered a valid quantity/weight to add)
			 */

			if (!nothing_entered) {
				int amount = Integer.parseInt(response);
				ShoppingBasket.getBasketInstance().addProduct(product, amount);
			}
		}
	}