// 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:
@@ -0,0 +1,35 @@
|
||||
{*
|
||||
* 2007-2012 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 10891 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
{block name='override_header'}
|
||||
{if $submit_form_ajax}
|
||||
<script type="text/javascript">
|
||||
$('#voucher', window.parent.document).val('{$new_cart_rule->code|escape:htmlall}');
|
||||
parent.add_cart_rule({$new_cart_rule->id|intval});
|
||||
parent.$.fancybox.close();
|
||||
</script>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user