<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

  require("includes/application_top.php");

  if ($cart->count_contents() > 0) {
    include(DIR_WS_CLASSES . 'payment.php');
    $payment_modules = new payment;
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));

  // START DELETE PAYPAL TEMP ORDER
  // Check to see if customer has cancelled a paypal_ipn process
  if ( $HTTP_GET_VARS['ipn']== 'cancel_ipn' && tep_not_null($HTTP_GET_VARS['order']) ) {
    // Make sure that this order is THIS customers' order
    // We don't want anybody to pass order numbers to here and delete other people's orders!!!!
    $delete_order_query = tep_db_query("SELECT customers_id FROM " . TABLE_ORDERS . " WHERE `orders_id`='" . (int)$HTTP_GET_VARS['order'] . "'");
    $delete_order = tep_db_fetch_array($delete_order_query);

    //echo "DEBUG - delete_order=".$delete_order['customers_id']."<br />";
    //echo "DEBUG - customer id in session=".$customer_id."<br />";
    if ( $delete_order['customers_id']==$customer_id ) {
      // Delete the order
      //echo "DEBUG - about to delete order!!!<br />";
      tep_remove_order($HTTP_GET_VARS['order'], '');
    }
  }
  // END DELETE PAYPAL TEMP ORDER

  $content = CONTENT_SHOPPING_CART;

  include (bts_select('main', $content_template)); // BTSv1.5

  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
