Ejemplo n.º 1
0
require DT_ROOT . '/module/' . $module . '/common.inc.php';
require DT_ROOT . '/include/post.func.php';
require DT_ROOT . '/module/' . $module . '/cart.class.php';
include load('misc.lang');
include load('member.lang');
include load('order.lang');
$back_link = mobileurl($moduleid, 0, $itemid);
$head_name = $L['cart_title'];
$head_title = $head_name . $DT['seo_delimiter'] . $MOD['name'] . $DT['seo_delimiter'] . $head_title;
$foot = '';
$do = new cart();
$do->max = intval($MOD['max_cart']);
$cart = $do->get();
switch ($action) {
    case 'clear':
        $do->clear();
        exit('ok');
        break;
    case 'delete':
        isset($key) && $key && is_array($key) or exit('ko');
        foreach ($key as $k) {
            if (isset($cart[$k])) {
                unset($cart[$k]);
            }
        }
        $do->set($cart);
        exit('ok');
        break;
    default:
        if (isset($_POST['ok'])) {
            $ids = '';