Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
+1
-1
@@ -2557,7 +2557,7 @@ exit;
|
|||||||
$fileAttachment = null;
|
$fileAttachment = null;
|
||||||
if (isset($_FILES[$input]['name']) && !empty($_FILES[$input]['name']) && !empty($_FILES[$input]['tmp_name']))
|
if (isset($_FILES[$input]['name']) && !empty($_FILES[$input]['name']) && !empty($_FILES[$input]['tmp_name']))
|
||||||
{
|
{
|
||||||
$fileAttachment['rename'] = uniqid(). self::strtolower(substr($_FILES[$input]['name'], -5));
|
$fileAttachment['rename'] = uniqid(). Tools::strtolower(substr($_FILES[$input]['name'], -5));
|
||||||
$fileAttachment['content'] = file_get_contents($_FILES[$input]['tmp_name']);
|
$fileAttachment['content'] = file_get_contents($_FILES[$input]['tmp_name']);
|
||||||
$fileAttachment['tmp_name'] = $_FILES[$input]['tmp_name'];
|
$fileAttachment['tmp_name'] = $_FILES[$input]['tmp_name'];
|
||||||
$fileAttachment['name'] = $_FILES[$input]['name'];
|
$fileAttachment['name'] = $_FILES[$input]['name'];
|
||||||
|
|||||||
@@ -87,11 +87,7 @@ class AdminCarriersControllerCore extends AdminController
|
|||||||
'is_free' => array(
|
'is_free' => array(
|
||||||
'title' => $this->l('Free Shipping'),
|
'title' => $this->l('Free Shipping'),
|
||||||
'align' => 'center',
|
'align' => 'center',
|
||||||
'icon' => array(
|
'active' => 'isFree',
|
||||||
0 => 'disabled.gif',
|
|
||||||
1 => 'enabled.gif',
|
|
||||||
'default' => 'disabled.gif'
|
|
||||||
),
|
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'orderby' => false,
|
'orderby' => false,
|
||||||
'width' => 150
|
'width' => 150
|
||||||
@@ -534,6 +530,10 @@ class AdminCarriersControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
|
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
|
||||||
}
|
}
|
||||||
|
else if (isset($_GET['isFree'.$this->table]))
|
||||||
|
{
|
||||||
|
$this->processIsFree();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
|
if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
|
||||||
@@ -566,6 +566,17 @@ class AdminCarriersControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function processIsFree()
|
||||||
|
{
|
||||||
|
$carrier = new Carrier($this->id_object);
|
||||||
|
if (!Validate::isLoadedObject($carrier))
|
||||||
|
$this->errors[] = Tools::displayError('An error occurred while updating carrier information.');
|
||||||
|
$carrier->is_free = $carrier->is_free ? 0 : 1;
|
||||||
|
if (!$carrier->update())
|
||||||
|
$this->errors[] = Tools::displayError('An error occurred while updating carrier information.');
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overload the property $fields_value
|
* Overload the property $fields_value
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -767,6 +767,11 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
Tools::redirectAdmin('index.php?controller=adminmodules&configure='.Tools::getValue('module_name').'&token='.Tools::getValue('token').'&module_name='.Tools::getValue('module_name').$params);
|
Tools::redirectAdmin('index.php?controller=adminmodules&configure='.Tools::getValue('module_name').'&token='.Tools::getValue('token').'&module_name='.Tools::getValue('module_name').$params);
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
|
Tools::redirectAdmin(self::$currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_GET['update']))
|
||||||
|
{
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&updated=1tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
@@ -1013,6 +1018,14 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
// Browse modules list
|
// Browse modules list
|
||||||
foreach ($modules as $km => $module)
|
foreach ($modules as $km => $module)
|
||||||
{
|
{
|
||||||
|
//Add succes message for one module update
|
||||||
|
if (Tools::getValue('updated') && Tools::getValue('module_name'))
|
||||||
|
{
|
||||||
|
if ($module->name === (string)Tools::getValue('module_name'))
|
||||||
|
$module_success[] = array('name' => $module->displayName, 'message' => array(
|
||||||
|
0 => $this->l('Current version:').$module->version));
|
||||||
|
}
|
||||||
|
|
||||||
//if we are in favorites view we only display installed modules
|
//if we are in favorites view we only display installed modules
|
||||||
if (Tools::getValue('select') == 'favorites' && !$module->id)
|
if (Tools::getValue('select') == 'favorites' && !$module->id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ function changeAddressDelivery(obj)
|
|||||||
|
|
||||||
if (new_id_address_delivery == old_id_address_delivery)
|
if (new_id_address_delivery == old_id_address_delivery)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (new_id_address_delivery > 0) // Change the delivery address
|
if (new_id_address_delivery > 0) // Change the delivery address
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -86,24 +86,24 @@ function changeAddressDelivery(obj)
|
|||||||
async: true,
|
async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: 'controller=cart&ajax=true&changeAddressDelivery=1&summary=1&id_product='+id_product
|
data: 'controller=cart&ajax=true&changeAddressDelivery=1&summary=1&id_product=' + id_product
|
||||||
+'&id_product_attribute='+id_product_attribute
|
+ '&id_product_attribute='+id_product_attribute
|
||||||
+'&old_id_address_delivery='+old_id_address_delivery
|
+ '&old_id_address_delivery='+old_id_address_delivery
|
||||||
+'&new_id_address_delivery='+new_id_address_delivery
|
+ '&new_id_address_delivery='+new_id_address_delivery
|
||||||
+'&token='+static_token
|
+ '&token='+static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (typeof(jsonData.hasErrors) != 'undefined' && jsonData.hasErrors)
|
if (typeof(jsonData.hasErrors) != 'undefined' && jsonData.hasErrors)
|
||||||
{
|
{
|
||||||
alert(jsonData.error);
|
alert(jsonData.error);
|
||||||
// Reset the old address
|
// Reset the old address
|
||||||
$('#select_address_delivery_'+id_product+'_'+id_product_attribute+'_'+old_id_address_delivery).val(old_id_address_delivery);
|
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).val(old_id_address_delivery);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The product exist
|
// The product exist
|
||||||
if ($('#product_'+id_product+'_'+id_product_attribute+'_0_'+new_id_address_delivery).length)
|
if ($('#product_' + id_product + '_' + id_product_attribute + '_0_' + new_id_address_delivery).length)
|
||||||
{
|
{
|
||||||
updateCartSummary(jsonData.summary);
|
updateCartSummary(jsonData.summary);
|
||||||
if (window.ajaxCart != undefined)
|
if (window.ajaxCart != undefined)
|
||||||
@@ -116,10 +116,10 @@ function changeAddressDelivery(obj)
|
|||||||
|
|
||||||
// @todo reverse the remove order
|
// @todo reverse the remove order
|
||||||
// This effect remove the current line, but it's better to remove the other one, and refresshing this one
|
// This effect remove the current line, but it's better to remove the other one, and refresshing this one
|
||||||
$('#product_'+id_product+'_'+id_product_attribute+'_0_'+old_id_address_delivery).remove();
|
$('#product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery).remove();
|
||||||
|
|
||||||
// @todo improve customization upgrading
|
// @todo improve customization upgrading
|
||||||
$('.product_'+id_product+'_'+id_product_attribute+'_0_'+old_id_address_delivery).remove();
|
$('.product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery).remove();
|
||||||
}
|
}
|
||||||
if (window.ajaxCart != undefined)
|
if (window.ajaxCart != undefined)
|
||||||
ajaxCart.updateCart(jsonData);
|
ajaxCart.updateCart(jsonData);
|
||||||
@@ -142,7 +142,7 @@ function changeAddressDelivery(obj)
|
|||||||
|
|
||||||
// Get new address to deliver
|
// Get new address to deliver
|
||||||
var id_address_delivery = 0;
|
var id_address_delivery = 0;
|
||||||
var options = $('#select_address_delivery_'+id_product+'_'+id_product_attribute+'_'+old_id_address_delivery+' option');
|
var options = $('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery + ' option');
|
||||||
$.each(options, function(i) {
|
$.each(options, function(i) {
|
||||||
// Check the address is not already used for a similare products
|
// Check the address is not already used for a similare products
|
||||||
if ($(options[i]).val() > 0 && $(options[i]).val() !== old_id_address_delivery && $('#product_' + id_product + '_' + id_product_attribute + '_0_' + $(options[i]).val()).length == 0)
|
if ($(options[i]).val() > 0 && $(options[i]).val() !== old_id_address_delivery && $('#product_' + id_product + '_' + id_product_attribute + '_0_' + $(options[i]).val()).length == 0)
|
||||||
@@ -161,13 +161,13 @@ function changeAddressDelivery(obj)
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
context: obj,
|
context: obj,
|
||||||
data: 'controller=cart'
|
data: 'controller=cart'
|
||||||
+'&ajax=true&duplicate=true&summary=true'
|
+ '&ajax=true&duplicate=true&summary=true'
|
||||||
+'&id_product='+id_product
|
+ '&id_product='+id_product
|
||||||
+'&id_product_attribute='+id_product_attribute
|
+ '&id_product_attribute='+id_product_attribute
|
||||||
+'&id_address_delivery='+old_id_address_delivery
|
+ '&id_address_delivery='+old_id_address_delivery
|
||||||
+'&new_id_address_delivery='+id_address_delivery
|
+ '&new_id_address_delivery='+id_address_delivery
|
||||||
+'&token='+static_token
|
+ '&token='+static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (jsonData.error)
|
if (jsonData.error)
|
||||||
@@ -176,16 +176,16 @@ function changeAddressDelivery(obj)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var line = $('#product_' + id_product+'_' + id_product_attribute + '_0_' + old_id_address_delivery);
|
var line = $('#product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery);
|
||||||
var new_line = line.clone();
|
var new_line = line.clone();
|
||||||
updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, new_line);
|
updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, new_line);
|
||||||
line.after(new_line);
|
line.after(new_line);
|
||||||
new_line.find('input[name=quantity_' + id_product+'_' + id_product_attribute + '_0_' + old_id_address_delivery + '_hidden]')
|
new_line.find('input[name=quantity_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery + '_hidden]')
|
||||||
.val(1);
|
.val(1);
|
||||||
new_line.find('.cart_quantity_input')
|
new_line.find('.cart_quantity_input')
|
||||||
.val(1);
|
.val(1);
|
||||||
$('#select_address_delivery_' + id_product+'_' + id_product_attribute + '_' + old_id_address_delivery).val(old_id_address_delivery);
|
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).val(old_id_address_delivery);
|
||||||
$('#select_address_delivery_' + id_product+'_' + id_product_attribute + '_' + id_address_delivery).val(id_address_delivery);
|
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + id_address_delivery).val(id_address_delivery);
|
||||||
|
|
||||||
|
|
||||||
cleanSelectAddressDelivery();
|
cleanSelectAddressDelivery();
|
||||||
@@ -201,7 +201,6 @@ function changeAddressDelivery(obj)
|
|||||||
|
|
||||||
function updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, line)
|
function updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, line)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (typeof(line) == 'undefined' || line.length == 0)
|
if (typeof(line) == 'undefined' || line.length == 0)
|
||||||
line = $('#cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_0_], #cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_nocustom_]');
|
line = $('#cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_0_], #cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_nocustom_]');
|
||||||
|
|
||||||
@@ -253,8 +252,8 @@ function updateQty(val, cart, el)
|
|||||||
|
|
||||||
if (exp.test(val) == true)
|
if (exp.test(val) == true)
|
||||||
{
|
{
|
||||||
var hidden = $(prefix+'input[name='+ id +'_hidden]').val();
|
var hidden = $(prefix + 'input[name=' + id + '_hidden]').val();
|
||||||
var input = $(prefix+'input[name='+ id +']').val();
|
var input = $(prefix + 'input[name=' + id + ']').val();
|
||||||
var QtyToUp = parseInt(input) - parseInt(hidden);
|
var QtyToUp = parseInt(input) - parseInt(hidden);
|
||||||
|
|
||||||
if (parseInt(QtyToUp) > 0)
|
if (parseInt(QtyToUp) > 0)
|
||||||
@@ -263,7 +262,7 @@ function updateQty(val, cart, el)
|
|||||||
downQuantity(id.replace('quantity_', ''), QtyToUp);
|
downQuantity(id.replace('quantity_', ''), QtyToUp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$(prefix+'input[name='+ id +']').val($(prefix+'input[name='+ id +'_hidden]').val());
|
$(prefix + 'input[name=' + id + ']').val($(prefix + 'input[name=' + id + '_hidden]').val());
|
||||||
|
|
||||||
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||||
getCarrierListAndUpdate();
|
getCarrierListAndUpdate();
|
||||||
@@ -292,13 +291,13 @@ function deleteProductFromSummary(id)
|
|||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: 'controller=cart'
|
data: 'controller=cart'
|
||||||
+'&ajax=true&delete=true&summary=true'
|
+ '&ajax=true&delete=true&summary=true'
|
||||||
+'&id_product='+productId
|
+ '&id_product='+productId
|
||||||
+'&ipa='+productAttributeId
|
+ '&ipa='+productAttributeId
|
||||||
+'&id_address_delivery='+id_address_delivery
|
+ '&id_address_delivery='+id_address_delivery
|
||||||
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
||||||
+'&token=' + static_token
|
+ '&token=' + static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (jsonData.hasError)
|
if (jsonData.hasError)
|
||||||
@@ -333,7 +332,7 @@ function deleteProductFromSummary(id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#product_'+ id).fadeOut('slow', function() {
|
$('#product_' + id).fadeOut('slow', function() {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
cleanSelectAddressDelivery();
|
cleanSelectAddressDelivery();
|
||||||
if (!customizationId)
|
if (!customizationId)
|
||||||
@@ -437,17 +436,17 @@ function upQuantity(id, qty)
|
|||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: 'controller=cart'
|
data: 'controller=cart'
|
||||||
+'&ajax=true'
|
+ '&ajax=true'
|
||||||
+'&add=true'
|
+ '&add=true'
|
||||||
+'&getproductprice=true'
|
+ '&getproductprice=true'
|
||||||
+'&summary=true'
|
+ '&summary=true'
|
||||||
+'&id_product=' + productId
|
+ '&id_product=' + productId
|
||||||
+'&ipa=' + productAttributeId
|
+ '&ipa=' + productAttributeId
|
||||||
+'&id_address_delivery=' + id_address_delivery
|
+ '&id_address_delivery=' + id_address_delivery
|
||||||
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
|
||||||
+'&qty=' + qty
|
+ '&qty=' + qty
|
||||||
+'&token=' + static_token
|
+ '&token=' + static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (jsonData.hasError)
|
if (jsonData.hasError)
|
||||||
@@ -486,7 +485,7 @@ function upQuantity(id, qty)
|
|||||||
|
|
||||||
function downQuantity(id, qty)
|
function downQuantity(id, qty)
|
||||||
{
|
{
|
||||||
var val = $('input[name=quantity_'+id+']').val();
|
var val = $('input[name=quantity_' + id + ']').val();
|
||||||
var newVal = val;
|
var newVal = val;
|
||||||
if(typeof(qty) == 'undefined' || !qty)
|
if(typeof(qty) == 'undefined' || !qty)
|
||||||
{
|
{
|
||||||
@@ -511,7 +510,7 @@ function downQuantity(id, qty)
|
|||||||
if (typeof(ids[3]) !== 'undefined')
|
if (typeof(ids[3]) !== 'undefined')
|
||||||
id_address_delivery = parseInt(ids[3]);
|
id_address_delivery = parseInt(ids[3]);
|
||||||
|
|
||||||
if (newVal > 0 || $('#product_'+id+'_gift').length)
|
if (newVal > 0 || $('#product_' + id + '_gift').length)
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -521,18 +520,18 @@ function downQuantity(id, qty)
|
|||||||
cache: false,
|
cache: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: 'controller=cart'
|
data: 'controller=cart'
|
||||||
+'&ajax=true'
|
+ '&ajax=true'
|
||||||
+'&add=true'
|
+ '&add=true'
|
||||||
+'&getproductprice=true'
|
+ '&getproductprice=true'
|
||||||
+'&summary=true'
|
+ '&summary=true'
|
||||||
+'&id_product='+productId
|
+ '&id_product='+productId
|
||||||
+'&ipa='+productAttributeId
|
+ '&ipa='+productAttributeId
|
||||||
+'&id_address_delivery='+id_address_delivery
|
+ '&id_address_delivery='+id_address_delivery
|
||||||
+'&op=down'
|
+ '&op=down'
|
||||||
+ ((customizationId !== 0) ? '&id_customization='+customizationId : '')
|
+ ((customizationId !== 0) ? '&id_customization='+customizationId : '')
|
||||||
+'&qty='+qty
|
+ '&qty='+qty
|
||||||
+'&token='+static_token
|
+ '&token='+static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (jsonData.hasError)
|
if (jsonData.hasError)
|
||||||
@@ -543,7 +542,7 @@ function downQuantity(id, qty)
|
|||||||
if(error !== 'indexOf')
|
if(error !== 'indexOf')
|
||||||
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
|
||||||
alert(errors);
|
alert(errors);
|
||||||
$('input[name=quantity_'+ id +']').val($('input[name=quantity_'+ id +'_hidden]').val());
|
$('input[name=quantity_' + id + ']').val($('input[name=quantity_' + id + '_hidden]').val());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -558,7 +557,7 @@ function downQuantity(id, qty)
|
|||||||
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
|
||||||
|
|
||||||
if (newVal == 0)
|
if (newVal == 0)
|
||||||
$('#product_'+id).hide();
|
$('#product_' + id).hide();
|
||||||
|
|
||||||
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||||
getCarrierListAndUpdate();
|
getCarrierListAndUpdate();
|
||||||
@@ -591,18 +590,18 @@ function updateCartSummary(json)
|
|||||||
$('div.error').fadeOut();
|
$('div.error').fadeOut();
|
||||||
|
|
||||||
for (i=0;i<json.products.length;i++)
|
for (i=0;i<json.products.length;i++)
|
||||||
product_list[json.products[i].id_product+'_'+json.products[i].id_product_attribute+'_'+json.products[i].id_address_delivery] = json.products[i];
|
product_list[json.products[i].id_product + '_' + json.products[i].id_product_attribute + '_' + json.products[i].id_address_delivery] = json.products[i];
|
||||||
|
|
||||||
if (!$('.multishipping-cart:visible').length)
|
if (!$('.multishipping-cart:visible').length)
|
||||||
{
|
{
|
||||||
for (i=0;i<json.gift_products.length;i++)
|
for (i=0;i<json.gift_products.length;i++)
|
||||||
if (typeof(product_list[json.gift_products[i].id_product+'_'+json.gift_products[i].id_product_attribute+'_'+json.gift_products[i].id_address_delivery]) !== 'undefined')
|
if (typeof(product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery]) !== 'undefined')
|
||||||
product_list[json.gift_products[i].id_product+'_'+json.gift_products[i].id_product_attribute+'_'+json.gift_products[i].id_address_delivery].quantity -= json.gift_products[i].cart_quantity;
|
product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery].quantity -= json.gift_products[i].cart_quantity;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for (i=0;i<json.gift_products.length;i++)
|
for (i=0;i<json.gift_products.length;i++)
|
||||||
if (typeof(product_list[json.gift_products[i].id_product+'_'+json.gift_products[i].id_product_attribute+'_'+json.gift_products[i].id_address_delivery]) == 'undefined')
|
if (typeof(product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery]) == 'undefined')
|
||||||
product_list[json.gift_products[i].id_product+'_'+json.gift_products[i].id_product_attribute+'_'+json.gift_products[i].id_address_delivery] = json.gift_products[i];
|
product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery] = json.gift_products[i];
|
||||||
|
|
||||||
for (i in product_list)
|
for (i in product_list)
|
||||||
{
|
{
|
||||||
@@ -719,7 +718,7 @@ function updateCartSummary(json)
|
|||||||
$('.ajax_cart_quantity').html(nbrProducts);
|
$('.ajax_cart_quantity').html(nbrProducts);
|
||||||
|
|
||||||
// Cart summary
|
// Cart summary
|
||||||
$('#summary_products_quantity').html(nbrProducts+' '+(nbrProducts > 1 ? txtProducts : txtProduct));
|
$('#summary_products_quantity').html(nbrProducts + ' ' + (nbrProducts > 1 ? txtProducts : txtProduct));
|
||||||
if (priceDisplayMethod !== 0)
|
if (priceDisplayMethod !== 0)
|
||||||
$('#total_product').html(formatCurrency(json.total_products, currencyFormat, currencySign, currencyBlank));
|
$('#total_product').html(formatCurrency(json.total_products, currencyFormat, currencySign, currencyBlank));
|
||||||
else
|
else
|
||||||
@@ -772,8 +771,8 @@ function updateCustomizedDatas(json)
|
|||||||
for(var l in json[i][j][k])
|
for(var l in json[i][j][k])
|
||||||
{
|
{
|
||||||
var quantity = json[i][j][k][l]['quantity'];
|
var quantity = json[i][j][k][l]['quantity'];
|
||||||
$('input[name=quantity_'+i+'_'+j+'_'+l+'_'+k+'_hidden]').val(quantity);
|
$('input[name=quantity_' + i + '_' + j + '_' + l + '_' + k + '_hidden]').val(quantity);
|
||||||
$('input[name=quantity_'+i+'_'+j+'_'+l+'_'+k+']').val(quantity);
|
$('input[name=quantity_' + i + '_' + j + '_' + l + '_' + k + ']').val(quantity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -797,7 +796,7 @@ function refreshDeliveryOptions()
|
|||||||
carrier_id_list.pop();
|
carrier_id_list.pop();
|
||||||
var it = this;
|
var it = this;
|
||||||
$(carrier_id_list).each(function() {
|
$(carrier_id_list).each(function() {
|
||||||
$(it).parent().find('input[value="'+this.toString()+'"]').change();
|
$(it).parent().find('input[value="' + this.toString() + '"]').change();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -820,9 +819,9 @@ $(document).ready(function() {
|
|||||||
async: true,
|
async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
data: 'controller=cart&ajax=true&allowSeperatedPackage=true&value='
|
data: 'controller=cart&ajax=true&allowSeperatedPackage=true&value='
|
||||||
+($(this).prop('checked') ? '1' : '0')
|
+ ($(this).prop('checked') ? '1' : '0')
|
||||||
+'&token='+static_token
|
+ '&token='+static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
if (typeof(getCarrierListAndUpdate) !== 'undefined')
|
||||||
@@ -862,14 +861,14 @@ function updateExtraCarrier(id_delivery_option, id_address)
|
|||||||
cache: false,
|
cache: false,
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
data: 'ajax=true'
|
data: 'ajax=true'
|
||||||
+'&method=updateExtraCarrier'
|
+ '&method=updateExtraCarrier'
|
||||||
+'&id_address='+id_address
|
+ '&id_address='+id_address
|
||||||
+'&id_delivery_option='+id_delivery_option
|
+ '&id_delivery_option='+id_delivery_option
|
||||||
+'&token='+static_token
|
+ '&token='+static_token
|
||||||
+'&allow_refresh=1',
|
+ '&allow_refresh=1',
|
||||||
success: function(jsonData)
|
success: function(jsonData)
|
||||||
{
|
{
|
||||||
$('#HOOK_EXTRACARRIER_'+id_address).html(jsonData['content']);
|
$('#HOOK_EXTRACARRIER_' + id_address).html(jsonData['content']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} />
|
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} />
|
||||||
{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}
|
{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}
|
||||||
</a>
|
</a>
|
||||||
<h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h3>
|
<h3>{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}<a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h3>
|
||||||
<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
|
<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="right_block">
|
<div class="right_block">
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ var fieldRequired = '{l s='Please fill in all the required fields before saving
|
|||||||
{if $field.type == 1}
|
{if $field.type == 1}
|
||||||
<li class="customizationUploadLine{if $field.required} required{/if}">
|
<li class="customizationUploadLine{if $field.required} required{/if}">
|
||||||
<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
|
<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
|
||||||
<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
|
<textarea name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
|
||||||
</li>
|
</li>
|
||||||
{counter}
|
{counter}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user