【发布时间】:2014-09-03 02:13:32
【问题描述】:
function addToCart(product_id, quantity, main) {
quantity = typeof(quantity) != 'undefined' ? quantity : 1;
main = typeof(main) != 'undefined' ? main : 0;
view1 = $("#view1").val();
cv_page = $("#cv_page").val();
order_id = $("#order_id").val();
$.ajax({
url: 'index.php?option=com_payment&task=cart',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + quantity + '&main=' + main + '&view1=' + view1 + '&cv_page=' + cv_page + '&order_id=' + order_id,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error, .fail').remove();
if (json['success']) {
$('#cart-total').html(json['total']);
if (main == "1") {
window.location =$('#order-url').val();
} else {
window.location =$('#form-url').val();
}
} else {
$('#notification').html(json['message']);
}
}
});
}
如何在mysql数据库中添加这个文件以及如何定义这个
url: 'index.php?option=com_payment&task=cart',
以及如何调用它
<input type="hidden" id="order-url" value ="order.html?cv_page=1#order-title" />
<input type="hidden" id="form-url" value ="form.html?cv_page=1#form_mark" />
谁能帮帮我,我只知道运行这个站点需要 index.php 文件。
【问题讨论】: