// Fix backOffice order cart rules management

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14201 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-03-15 14:42:57 +00:00
parent 9b907fbd31
commit 82e0beb63d
6 changed files with 83 additions and 34 deletions
@@ -116,36 +116,7 @@
)
.result(function(event, data, formatted) {
$('#voucher').val(data.name);
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
ajax: "1",
token: "{getAdminToken tab='AdminCarts'}",
tab: "AdminCarts",
action: "addVoucher",
id_cart_rule: data.id_cart_rule,
id_cart: id_cart,
id_customer: id_customer
},
success : function(res)
{
displaySummary(res);
$('#voucher').val('');
var errors = '';
if (res.errors.length > 0)
{
$.each(res.errors, function() {
errors += this+'<br/>';
});
$('#vouchers_err').html(errors).show();
}
else
$('#vouchers_err').hide();
}
});
add_cart_rule(data.id_cart_rule);
});
{if $cart->id}
setupCustomer('{$cart->id_customer}');
@@ -244,6 +215,40 @@
onClosed: useCart(id_cart)
});*/
}
function add_cart_rule(id_cart_rule)
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
ajax: "1",
token: "{getAdminToken tab='AdminCarts'}",
tab: "AdminCarts",
action: "addVoucher",
id_cart_rule: id_cart_rule,
id_cart: id_cart,
id_customer: id_customer
},
success : function(res)
{
displaySummary(res);
$('#voucher').val('');
var errors = '';
if (res.errors.length > 0)
{
$.each(res.errors, function() {
errors += this+'<br/>';
});
$('#vouchers_err').html(errors).show();
}
else
$('#vouchers_err').hide();
}
});
}
function updateProductPrice(id_product, id_product_attribute, new_price)
{