function add_gift_to_cart($act_id, $id, $price)
{
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('cart') . " (" .
"user_id, session_id, goods_id, goods_sn, goods_name, market_price, goods_price, ".
"goods_number, is_real, extension_code, parent_id, is_gift, rec_type, is_shipping ) ".
"SELECT '$_SESSION[user_id]', '" . SESS_ID . "', goods_id, goods_sn, goods_name, market_price, ".
"'$price', 1, is_real, extension_code, 0, '$act_id', '" . CART_GENERAL_GOODS . "', is_shipping " .
"FROM " . $GLOBALS['ecs']->table('goods') .
" WHERE goods_id = '$id'";
$GLOBALS['db']->query($sql);
}
|