Example #1
0
 function add_wishlist($wishlist_id, $attributes_id)
 {
     global $customer_id;
     if (!$this->in_wishlist($wishlist_id)) {
         $wishlist_id = tep_get_uprid($wishlist_id, $attributes_id);
         // Insert into session
         $this->wishID[$wishlist_id] = array($wishlist_id);
         if (tep_session_is_registered('customer_id')) {
             // Insert into database
             tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id) values ('" . $customer_id . "', '" . $wishlist_id . "')");
         }
         // Read array of options and values for attributes in id[]
         if (is_array($attributes_id)) {
             reset($attributes_id);
             while (list($option, $value) = each($attributes_id)) {
                 $this->wishID[$wishlist_id]['attributes'][$option] = $value;
                 // Add to customers_wishlist_attributes table
                 if (tep_session_is_registered('customer_id')) {
                     tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $wishlist_id . "', '" . $option . "', '" . $value . "' )");
                 }
             }
             tep_session_unregister('attributes_id');
         }
     }
 }
Example #2
0
 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = '<ul class="shoppingCartList">';
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>' . '</ul>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     $data = '<div class="panel panel-default">' . '  <div class="panel-heading"><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . '</a></div>' . '  <div class="panel-body">' . $cart_contents_string . '</div>' . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
function amSessionUnregister($strSessionVar)
{
    if (amSessionIsRegistered($strSessionVar)) {
        tep_session_unregister($strSessionVar);
    }
    unset($GLOBALS[$strSessionVar]);
}
 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = NULL;
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link('product_info.php', 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     ob_start();
     include 'includes/modules/boxes/templates/shopping_cart.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
function _unregisterSessionVars()
{
    // unregister session variables used during checkout
    tep_session_unregister('sendto');
    tep_session_unregister('billto');
    tep_session_unregister('shipping');
    tep_session_unregister('payment');
    tep_session_unregister('comments');
}
 function messageStack()
 {
     global $messageToStack;
     $this->messages = array();
     if (tep_session_is_registered('messageToStack')) {
         for ($i = 0, $n = sizeof($messageToStack); $i < $n; $i++) {
             $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']);
         }
         tep_session_unregister('messageToStack');
     }
 }
 function execute()
 {
     global $customer_id, $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     /* ** Altered for CCGV **	  
           $cart_contents_string = '';
     */
     if (tep_session_is_registered('customer_id')) {
         $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . (int) $customer_id . "'");
         $gv_result = tep_db_fetch_array($gv_query);
         if ($gv_result['amount'] > 0) {
             $gv_contents_string = '<div class="ui-widget-content infoBoxContents"><div style="float:left;">' . VOUCHER_BALANCE . '</div><div style="float:right;">' . $currencies->format($gv_result['amount']) . '</div><div style="clear:both;"></div>';
             $gv_contents_string .= '<div style="text-align:center; width:100%; margin:auto;"><a href="' . tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></div></div>';
         }
     }
     if (tep_session_is_registered('gv_id')) {
         $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
         $coupon = tep_db_fetch_array($gv_query);
         $gv_contents_string = '<div style="text-align:center; width:100%; margin:auto;">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</div>';
     }
     if (tep_session_is_registered('cc_id') && $cc_id) {
         $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
         $coupon = tep_db_fetch_array($coupon_query);
         $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_id . "' and language_id = '" . $languages_id . "'");
         $coupon_desc = tep_db_fetch_array($coupon_desc_query);
         $text_coupon_help = sprintf("%s", $coupon_desc['coupon_name']);
         $gv_contents_string = '<div style="text-align:center; width:100%; margin:auto;">' . CART_COUPON . $text_coupon_help . '<br>' . '</div>';
     }
     /* ** EOF alterations for CCGV ** */
     if ($cart->count_contents() > 0) {
         $cart_contents_string = NULL;
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     ob_start();
     include DIR_WS_MODULES . 'boxes/templates/shopping_cart.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
Example #8
0
 function after_process()
 {
     global $customer_id, $insert_id, $zp_code, $order;
     if (tep_session_is_registered('zp_code')) {
         tep_session_unregister('zp_code');
     }
     tep_session_register('zp_code');
     $code = md5(md5(microtime()) . md5(rand(0, 100000)));
     $zp_code = base64_encode($code . '-' . $customer_id . '-' . $insert_id . '-' . $order->info['total']);
     //	  echo $zp_code;
     //	  die();
     return false;
 }
 function reset($reset_database = false)
 {
     global $customer_id;
     $this->contents = array();
     $this->total = 0;
     $this->weight = 0;
     $this->content_type = false;
     if (tep_session_is_registered('customer_id') && $reset_database == true) {
         tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int) $customer_id . "'");
         tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int) $customer_id . "'");
     }
     unset($this->cartID);
     if (tep_session_is_registered('cartID')) {
         tep_session_unregister('cartID');
     }
 }
Example #10
0
 function after_process()
 {
     global $customer_id, $insert_id, $order_totals, $rx_code, $currency, $currencies;
     if (tep_session_is_registered('op_code')) {
         tep_session_unregister('op_code');
     }
     tep_session_register('op_code');
     $ot_total_value = 0;
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         if ($order_totals[$i]['code'] == 'ot_total') {
             $ot_total_value = str_replace(',', '.', round($order_totals[$i]['value'], $currencies->get_decimal_places($currency)));
             break;
         }
     }
     $code = md5(md5(microtime()) . md5(rand(0, 100000)));
     $op_code = base64_encode($code . '-' . $customer_id . '-' . $insert_id . '-' . $ot_total_value);
     return false;
 }
 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0" class="ui-widget-content infoBoxContents">';
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<tr><td align="right" valign="top">';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '<span class="newItemInCart">';
             }
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '</span>';
             }
             $cart_contents_string .= '</td><td valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '<span class="newItemInCart">';
             }
             $cart_contents_string .= $products[$i]['name'];
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '</span>';
             }
             $cart_contents_string .= '</a></td></tr>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<tr><td colspan="2" style="padding-top: 5px; padding-bottom: 2px;">' . tep_draw_separator() . '</td></tr>' . '<tr><td colspan="2" align="right">' . $currencies->format($cart->show_total()) . '</td></tr>' . '</table>';
     } else {
         $cart_contents_string .= '<div class="ui-widget-content infoBoxContents">' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</div>';
     }
     $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . '</a></div>' . '  ' . $cart_contents_string . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
Example #12
0
<?php

tep_session_unregister('login_userid');
tep_session_unregister('login_account_number');
tep_session_unregister('login_useremail');
tep_session_unregister('navigation');
tep_session_unregister('login_main_account_info');
// delete the cookie
tep_setcookie("account_number", $account_number, time() - 1, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
tep_setcookie("password", $login_password, time() - 1, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
tep_redirect(get_href_link(PAGE_DEFAULT, '', 'SSL'));
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
    $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object(${$payment})) {
    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
    $payment_class = ${$payment};
    $email_order .= $payment_class->title . "\n\n";
    if ($payment_class->email_footer) {
        $email_order .= $payment_class->email_footer . "\n\n";
    }
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$payment_modules->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
require DIR_WS_INCLUDES . 'application_bottom.php';
                    $reset_shipping = true;
                }
            }
        } else {
            tep_session_register('sendto');
        }
        $sendto = $HTTP_POST_VARS['address'];
        $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $customer_id . "' and address_book_id = '" . (int) $sendto . "'");
        $check_address = tep_db_fetch_array($check_address_query);
        if ($check_address['total'] == '1') {
            if ($reset_shipping == true) {
                tep_session_unregister('shipping');
            }
            tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
        } else {
            tep_session_unregister('sendto');
        }
    } else {
        if (!tep_session_is_registered('sendto')) {
            tep_session_register('sendto');
        }
        $sendto = $customer_default_address_id;
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
}
// if no shipping destination address was selected, use their own address as default
if (!tep_session_is_registered('sendto')) {
    $sendto = $customer_default_address_id;
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
                }
                if (isset($quote['error'])) {
                    tep_session_unregister('shipping');
                } else {
                    if (isset($quote[0]['methods'][0]['title']) && isset($quote[0]['methods'][0]['cost'])) {
                        $shipping = array('id' => $shipping, 'title' => $free_shipping == true ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')', 'cost' => $quote[0]['methods'][0]['cost']);
                        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
                    }
                }
            } else {
                tep_session_unregister('shipping');
            }
        }
    } else {
        if (defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') {
            tep_session_unregister('shipping');
        } else {
            $shipping = false;
            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
        }
    }
}
// get all available shipping quotes
$quotes = $shipping_modules->quote();
// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
if (!tep_session_is_registered('shipping') || tep_session_is_registered('shipping') && $shipping == false && tep_count_shipping_modules() > 1) {
    $shipping = $shipping_modules->cheapest();
}
                    $reset_payment = true;
                }
            }
        } else {
            tep_session_register('billto');
        }
        $billto = $HTTP_POST_VARS['address'];
        $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $customer_id . "' and address_book_id = '" . (int) $billto . "'");
        $check_address = tep_db_fetch_array($check_address_query);
        if ($check_address['total'] == '1') {
            if ($reset_payment == true) {
                tep_session_unregister('payment');
            }
            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
        } else {
            tep_session_unregister('billto');
        }
        // no addresses to select from - customer decided to keep the current assigned address
    } else {
        if (!tep_session_is_registered('billto')) {
            tep_session_register('billto');
        }
        $billto = $customer_default_address_id;
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
}
// if no billing destination address was selected, use their own address as default
if (!tep_session_is_registered('billto')) {
    $billto = $customer_default_address_id;
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
Example #17
0
 function before_process()
 {
     global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID;
     global ${$payment};
     $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-') + 1);
     $check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     if (tep_db_num_rows($check_query)) {
         $check = tep_db_fetch_array($check_query);
         if ($check['orders_status'] == MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID) {
             $sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => '');
             tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
         }
     }
     tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
     $sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $order->info['comments']);
     tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
     // initialized for the email confirmation
     $products_ordered = '';
     $subtotal = 0;
     $total_tax = 0;
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         // Stock Update - Joao Correia
         if (STOCK_LIMITED == 'true') {
             if (DOWNLOAD_ENABLED == 'true') {
                 $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename\n                                FROM " . TABLE_PRODUCTS . " p\n                                LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                ON p.products_id=pa.products_id\n                                LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                ON pa.products_attributes_id=pad.products_attributes_id\n                                WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
                 // Will work with only one option for downloadable products
                 // otherwise, we have to build the query dynamically with a loop
                 $products_attributes = $order->products[$i]['attributes'];
                 if (is_array($products_attributes)) {
                     $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
                 }
                 $stock_query = tep_db_query($stock_query_raw);
             } else {
                 $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
             }
             if (tep_db_num_rows($stock_query) > 0) {
                 $stock_values = tep_db_fetch_array($stock_query);
                 // do not decrement quantities if products_attributes_filename exists
                 if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
                     $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
                 } else {
                     $stock_left = $stock_values['products_quantity'];
                 }
                 tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
                 if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
                     tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
                 }
             }
         }
         // Update products_ordered (for bestsellers list)
         tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
         //------insert customer choosen option to order--------
         $attributes_exist = '0';
         $products_ordered_attributes = '';
         if (isset($order->products[$i]['attributes'])) {
             $attributes_exist = '1';
             for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
                 if (DOWNLOAD_ENABLED == 'true') {
                     $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n                                   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                   on pa.products_attributes_id=pad.products_attributes_id\n                                   where pa.products_id = '" . $order->products[$i]['id'] . "'\n                                   and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                   and pa.options_id = popt.products_options_id\n                                   and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                   and pa.options_values_id = poval.products_options_values_id\n                                   and popt.language_id = '" . $languages_id . "'\n                                   and poval.language_id = '" . $languages_id . "'";
                     $attributes = tep_db_query($attributes_query);
                 } else {
                     $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
                 }
                 $attributes_values = tep_db_fetch_array($attributes);
                 $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
             }
         }
         //------insert customer choosen option eof ----
         $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
         $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
         $total_cost += $total_products_price;
         $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
     }
     // lets start with the email confirmation
     $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
     if ($order->info['comments']) {
         $email_order .= tep_db_output($order->info['comments']) . "\n\n";
     }
     $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
     }
     if ($order->content_type != 'virtual') {
         $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
     }
     $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
     if (is_object(${$payment})) {
         $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
         $payment_class = ${$payment};
         $email_order .= $payment_class->title . "\n\n";
         if ($payment_class->email_footer) {
             $email_order .= $payment_class->email_footer . "\n\n";
         }
     }
     tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     // send emails to other people
     if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
         tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     }
     // load the after_process function from the payment modules
     $this->after_process();
     $cart->reset(true);
     // unregister session variables used during checkout
     tep_session_unregister('sendto');
     tep_session_unregister('billto');
     tep_session_unregister('shipping');
     tep_session_unregister('payment');
     tep_session_unregister('comments');
     tep_session_unregister('cart_PayPal_Standard_ID');
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
 }
Example #18
0
 function apply_credit()
 {
     global $insert_id, $customer_id, $REMOTE_ADDR, $cc_id;
     //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
     if ($this->deduction != 0) {
         tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, redeem_date, redeem_ip, customer_id, order_id) values ('" . $cc_id . "', now(), '" . $REMOTE_ADDR . "', '" . $customer_id . "', '" . $insert_id . "')");
     }
     tep_session_unregister('cc_id');
 }
                        $error = true;
                        $messageStack->add('header', ENTRY_REVIEW_EMAIL_ERROR);
                    } elseif (REVIEW_TEXT_MIN_LENGTH > 0 && mb_strlen($review_text, 'CP1251') < REVIEW_TEXT_MIN_LENGTH) {
                        $error = true;
                        $messageStack->add('header', ENTRY_REVIEW_TEXT_ERROR);
                    } elseif (tep_validate_email($customers_email) == false) {
                        $error = true;
                        $messageStack->add('header', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
                    } else {
                        $reviews_status = 1;
                        tep_db_query("insert into " . TABLE_REVIEWS . " (reviews_types_id, products_id, customers_id, reviews_vote, customers_name, customers_email, reviews_text, date_added, reviews_ip, reviews_agent, shops_id, reviews_status) values ('1', '" . (int) $HTTP_GET_VARS['products_id'] . "', '" . (int) $customers_id . "', '" . (int) $review_rating . "', '" . tep_db_input($customers_name) . "', '" . tep_db_input($customers_email) . "', '" . tep_db_input($review_text) . "', now(), '" . tep_db_input($remote_addr) . "', '" . tep_db_input(tep_db_prepare_input($_SERVER['HTTP_USER_AGENT'])) . "', '" . (int) SHOP_ID . "', '" . (int) $reviews_status . "')");
                        if ($reviews_status > 0) {
                            tep_db_query("update " . TABLE_PRODUCTS . " set products_rating = (select sum(reviews_vote)/count(*) from " . TABLE_REVIEWS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and reviews_status = '1') where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'");
                        }
                        $messageStack->add_session('header', TEXT_REVIEW_SUCCESS_ADDED, 'success');
                        tep_session_unregister('captcha_value');
                    }
                }
            }
            if (!$error) {
                tep_redirect(PHP_SELF);
            }
            break;
    }
}
if (!tep_session_is_registered('customer_id') && isset($_COOKIE['remember_customer'])) {
    list($cookie_customer_password, $cookie_customer_id) = explode('||', $_COOKIE['remember_customer']);
    $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, customers_type from " . TABLE_CUSTOMERS . " where customers_password = '******' and customers_id = '" . (int) $cookie_customer_id . "'");
    if (tep_db_num_rows($check_customer_query) > 0) {
        $check_customer = tep_db_fetch_array($check_customer_query);
        $check_country_query = tep_db_query("(select address_book_id, entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id = '" . (int) $check_customer['customers_default_address_id'] . "' and entry_country_id in (select countries_id from " . TABLE_COUNTRIES . ")) union (select address_book_id, entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id <> '" . (int) $check_customer['customers_default_address_id'] . "' and entry_country_id in (select countries_id from " . TABLE_COUNTRIES . ") order by address_book_id desc) order by '" . (int) $check_customer['customers_default_address_id'] . "'");
  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if ($_POST['action'] == 'process') {
    tep_db_query(" delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
    tep_db_query(" delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int) $customer_id . "'");
    tep_db_query(" delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int) $customer_id . "'");
    tep_db_query(" delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int) $customer_id . "'");
    tep_session_unregister('customer_id');
    $messageStack->add_session('header', TEXT_ACCOUNT_DELETED);
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_DELETE;
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT_DELETE));
require DIR_WS_INCLUDES . 'template_top.php';
?>

<h1><?php 
echo HEADING_TITLE;
?>
</h1>

<?php 
echo tep_draw_form('delete_account', tep_href_link(FILENAME_ACCOUNT_DELETE, '', 'SSL'), 'post') . tep_draw_hidden_field('action', 'process');
Example #21
0
    //delete the temporary account
    tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $customer_id . "'");
}
// PWA EOF 2b
tep_session_unregister('customer_id');
tep_session_unregister('customer_default_address_id');
tep_session_unregister('customer_first_name');
// BOF: MOD - Separate Pricing per Customer
tep_session_unregister('sppc_customer_group_id');
tep_session_unregister('sppc_customer_group_show_tax');
tep_session_unregister('sppc_customer_group_tax_exempt');
// EOF: MOD - Separate Pricing per Customer
tep_session_unregister('customer_country_id');
tep_session_unregister('customer_zone_id');
tep_session_unregister('comments');
// PWA BOF
tep_session_unregister('customer_is_guest');
// PWA EOF
// BOF - MOD: CREDIT CLASS Gift Voucher Contribution
tep_session_unregister('gv_id');
tep_session_unregister('cot_gv');
tep_session_unregister('cc_id');
// EOF - MOD: CREDIT CLASS Gift Voucher Contribution
$cart->reset();
// BOF: MOD - Wishlist 3.5
$wishList->reset();
// EOF: MOD - Wishlist 3.5
$content = CONTENT_LOGOFF;
include bts_select('main');
// BTSv1.5
require DIR_WS_INCLUDES . 'application_bottom.php';
Example #22
0
 function after_process()
 {
     if (tep_session_is_registered('sage_pay_direct_acsurl')) {
         tep_session_unregister('sage_pay_direct_acsurl');
         tep_session_unregister('sage_pay_direct_pareq');
         tep_session_unregister('sage_pay_direct_md');
     }
 }
Example #23
0
<?php

if (tep_session_is_registered('signup_info')) {
    tep_session_unregister('signup_info');
}
if ($_POST['action'] == 'process') {
    $security_code = db_prepare_input($_POST['security_code']);
    if ($security_code == $secure_image_hash_string) {
        $security_question = $_POST['security_question'];
        $firstname = db_prepare_input($_POST['firstname']);
        $lastname = db_prepare_input($_POST['lastname']);
        $email = db_prepare_input($_POST['email']);
        $confirm_email = db_prepare_input($_POST['confirm_email']);
        $welcome_message = db_prepare_input($_POST['welcome_message']);
        $security_answer = db_prepare_input($_POST['security_answer']);
        $custom_question = db_prepare_input($_POST['custom_question']);
        $validator->validateGeneral('First Name', $firstname, _ERROR_FIELD_EMPTY);
        $validator->validateGeneral('Last Name', $lastname, _ERROR_FIELD_EMPTY);
        if ($validator->validateEmail('Email', $email, ERROR_EMAIL_ADDRESS)) {
            if ($email != $confirm_email) {
                $validator->addError('Email/Confirm Email', ERROR_EMAIL_CONFIRM_EMAIL_MATCH);
            } else {
                // check if the email avaible
                $sql_check_email = "SELECT user_id\tFROM " . _TABLE_USERS . " WHERE email='" . $email . "'";
                if (db_num_rows(db_query($sql_check_email)) > 0) {
                    // email existed
                    $validator->addError('Email', 'This e-mail already exists in our database. Please use a different e-mail address or login if you already have an OOKCASH account. ');
                }
            }
        }
        if ($security_question == -1) {
Example #24
0
}
//**********
/*******************************************************
****  create_account.php  ***********************************
*******************************************************/
//before: tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
//---------
//add these:
if (tep_session_is_registered('floating_gv_code')) {
    $gv_query = tep_db_query("SELECT c.coupon_id, c.coupon_amount, IF(rt.coupon_id>0, 'true', 'false') AS redeemed FROM " . TABLE_COUPONS . " c LEFT JOIN " . TABLE_COUPON_REDEEM_TRACK . " rt USING(coupon_id), " . TABLE_COUPON_EMAIL_TRACK . " et WHERE c.coupon_code = '" . $floating_gv_code . "' AND c.coupon_id = et.coupon_id");
    // check if coupon exist
    if (tep_db_num_rows($gv_query) > 0) {
        $coupon = tep_db_fetch_array($gv_query);
        // check if coupon_id exist and coupon not redeemed
        if ($coupon['coupon_id'] > 0 && $coupon['redeemed'] == 'false') {
            tep_session_unregister('floating_gv_code');
            $gv_query = tep_db_query("insert into  " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");
            $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
            tep_gv_account_update($customer_id, $coupon['coupon_id']);
        }
    }
}
/*******************************************************
****  /includes/languages/english/gv_redeem.php ******************
*******************************************************/
// add:
define('TEXT_NEEDS_TO_LOGIN', 'We are sorry but we are unable to process your Gift Voucher claim at this time. You need to login first or create an account with us, if you don\'t already have one, before you can claim your Gift Voucher. Please <a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">click here to login or create an account.</a> ');
$breadcrumb->add(NAVBAR_TITLE);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
Example #25
0
                        $get_string = '';
                        if (function_exists('http_build_query')) {
                            $get_string = http_build_query($redirect_origin['get']);
                        }
                        tep_session_unregister('redirect_origin');
                        tep_redirect(tep_href_link($page, $get_string));
                    } else {
                        tep_redirect(tep_href_link(FILENAME_DEFAULT));
                    }
                }
            }
            $messageStack->add(ERROR_INVALID_ADMINISTRATOR, 'error');
            break;
        case 'logoff':
            tep_session_unregister('selected_box');
            tep_session_unregister('admin');
            tep_redirect(tep_href_link(FILENAME_DEFAULT));
            break;
        case 'create':
            $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");
            if (tep_db_num_rows($check_query) == 0) {
                $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
                $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
                tep_db_query('insert into ' . TABLE_ADMINISTRATORS . ' (user_name, user_password) values ("' . $username . '", "' . tep_encrypt_password($password) . '")');
            }
            tep_redirect(tep_href_link(FILENAME_LOGIN));
            break;
    }
}
$languages = tep_get_languages();
$languages_array = array();
 function after_process()
 {
     global $HTTP_GET_VARS, $HTTP_POST_VARS, $customer_id, $insert_id, $sage_pay_response;
     $result = array();
     if (isset($sage_pay_response['VPSTxId'])) {
         $result['ID'] = $sage_pay_response['VPSTxId'];
     }
     if (isset($sage_pay_response['SecurityKey'])) {
         $result['Security Key'] = $sage_pay_response['SecurityKey'];
     }
     if (isset($sage_pay_response['AVSCV2'])) {
         $result['AVS/CV2'] = $sage_pay_response['AVSCV2'];
     }
     if (isset($sage_pay_response['AddressResult'])) {
         $result['Address'] = $sage_pay_response['AddressResult'];
     }
     if (isset($sage_pay_response['PostCodeResult'])) {
         $result['Post Code'] = $sage_pay_response['PostCodeResult'];
     }
     if (isset($sage_pay_response['CV2Result'])) {
         $result['CV2'] = $sage_pay_response['CV2Result'];
     }
     if (isset($sage_pay_response['3DSecureStatus'])) {
         $result['3D Secure'] = $sage_pay_response['3DSecureStatus'];
     }
     if (isset($sage_pay_response['Token']) && tep_session_is_registered('sagepay_token_cc_number')) {
         global $sagepay_token_cc_type, $sagepay_token_cc_number, $sagepay_token_cc_expiry_date;
         $check_query = tep_db_query("select id from customers_sagepay_tokens where customers_id = '" . (int) $customer_id . "' and sagepay_token = '" . tep_db_input($sage_pay_response['Token']) . "' limit 1");
         if (tep_db_num_rows($check_query) < 1) {
             $sql_data_array = array('customers_id' => $customer_id, 'sagepay_token' => $sage_pay_response['Token'], 'card_type' => $sagepay_token_cc_type, 'number_filtered' => $sagepay_token_cc_number, 'expiry_date' => $sagepay_token_cc_expiry_date, 'date_added' => 'now()');
             tep_db_perform('customers_sagepay_tokens', $sql_data_array);
         }
         $result['Token Created'] = 'Yes';
         tep_session_unregister('sagepay_token_cc_type');
         tep_session_unregister('sagepay_token_cc_number');
         tep_session_unregister('sagepay_token_cc_expiry_date');
     }
     if (isset($HTTP_GET_VARS['check']) && $HTTP_GET_VARS['check'] == 'PAYPAL' && isset($HTTP_POST_VARS['Status']) && $HTTP_POST_VARS['Status'] == 'PAYPALOK' && isset($HTTP_POST_VARS['VPSTxId']) && isset($sage_pay_response['VPSTxId']) && $HTTP_POST_VARS['VPSTxId'] == $sage_pay_response['VPSTxId']) {
         $result['PayPal Payer E-Mail'] = $HTTP_POST_VARS['CustomerEMail'];
         $result['PayPal Payer Status'] = $HTTP_POST_VARS['PayerStatus'];
         $result['PayPal Payer ID'] = $HTTP_POST_VARS['PayerID'];
         $result['PayPal Payer Address'] = $HTTP_POST_VARS['AddressStatus'];
     }
     $result_string = '';
     foreach ($result as $k => $v) {
         $result_string .= $k . ': ' . $v . "\n";
     }
     $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => trim($result_string));
     tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
     if (tep_session_is_registered('sage_pay_direct_acsurl')) {
         tep_session_unregister('sage_pay_direct_acsurl');
         tep_session_unregister('sage_pay_direct_pareq');
         tep_session_unregister('sage_pay_direct_md');
     }
     $sage_pay_response = null;
 }
Example #27
0
        }
    }
}
// if no billing destination address was selected, use the customers own address as default
if (!tep_session_is_registered('billto')) {
    tep_session_register('billto');
    $billto = $customer_default_address_id;
} else {
    // verify the selected billing address
    if (is_array($billto) && empty($billto) || is_numeric($billto)) {
        $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $customer_id . "' and address_book_id = '" . (int) $billto . "'");
        $check_address = tep_db_fetch_array($check_address_query);
        if ($check_address['total'] != '1') {
            $billto = $customer_default_address_id;
            if (tep_session_is_registered('payment')) {
                tep_session_unregister('payment');
            }
        }
    }
}
require DIR_WS_CLASSES . 'order.php';
$order = new order();
if (!tep_session_is_registered('comments')) {
    tep_session_register('comments');
}
if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
    $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
}
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
// load all enabled payment modules
Example #28
0
    for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
        $cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';
        if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
            $cart_contents_string .= '<span class="newItemInCart">';
        } else {
            $cart_contents_string .= '<span class="infoBoxContents">';
        }
        $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;</span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
        if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
            $cart_contents_string .= '<span class="newItemInCart">';
        } else {
            $cart_contents_string .= '<span class="infoBoxContents">';
        }
        $cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';
        if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
            tep_session_unregister('new_products_id_in_cart');
        }
    }
    $cart_contents_string .= '</table>';
} else {
    $cart_contents_string .= BOX_SHOPPING_CART_EMPTY;
}
$info_box_contents = array();
$info_box_contents[] = array('text' => $cart_contents_string);
if ($cart->count_contents() > 0) {
    $info_box_contents[] = array('text' => tep_draw_separator());
    $info_box_contents[] = array('align' => 'right', 'text' => $currencies->format($cart->show_total()));
}
new infoBox($info_box_contents);
?>
            </td>
Example #29
0
 public function torchCartForCustomer($customer)
 {
     $customerID = $customer['customers_id'];
     $productsQuery = tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int) $customerID . "'");
     $productsQuery = tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int) $customerID . "'");
     if (tep_session_is_registered('cartID')) {
         tep_session_unregister('cartID');
     }
 }
Example #30
0
                tep_session_register('gv_id');
            }
            $gv_id = $coupon['coupon_id'];
            $error = false;
        } else {
            $error = true;
        }
    }
} else {
    tep_redirect(FILENAME_DEFAULT);
}
if (!$error && tep_session_is_registered('customer_id')) {
    $gv_query = tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $_SERVER['REMOTE_ADDR'] . "')");
    $gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");
    tep_gv_account_update($customer_id, $gv_id);
    tep_session_unregister('gv_id');
}
$breadcrumb->add(Translate('Redeem Gift Certificate'));
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'column_left.php';
?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
	<tr>
		<td>
			<h1><?php 
echo Translate('Validate Cadeaubon');
?>
</h1>
		</td>
	</tr>
	<tr>