Código PHP:
// include server parameters
require('modulos/catalogo/includes/configure.php');
// include shopping cart class
require(DIR_CLASSES . 'shopping_cart.php');
// create the shopping cart & fix the cart if necesary
if (tep_session_is_registered('cart') && is_object($cart)) {
if (PHP_VERSION < 4) {
$broken_cart = $cart;
$cart = new shoppingCart;
$cart->unserialize($broken_cart);
}
} else {
tep_session_register('cart');
$cart = new shoppingCart;
}
switch ($HTTP_GET_VARS['action']) {
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
.
.
.
etc...