Ver Mensaje Individual
  #8 (permalink)  
Antiguo 24/06/2015, 23:12
pumi
 
Fecha de Ingreso: marzo-2007
Mensajes: 127
Antigüedad: 17 años, 1 mes
Puntos: 2
Respuesta: Problema con el plugin woozone

Hola de nuevo.

He encontrado por casualidad el script que se ejecuta al seleccionar o deselecionar uno de los artículos de la venta cruzada, pero no se que cambiar para que me respete el formato decimal español. Si alguien me lo puede decir se lo agradezco. El código del script es el siguiente (pongo en negrita donde yo creo que hay que tocar algo):

-----------------------------------------------------------------------------

(function ($) {
var multiple_asins = [];

// cross sell
$(".cross-sell").on("change", 'input', function(e){
var that = $(this),
row = that.parents('li').eq(0),
asin = that.val()
the_thumb = $('#cross-sell-thumb-' + asin).parents('li'),
buy_block = $('li.cross-sell-buy-btn');

buy_block.fadeOut('fast');
if( that.is(':checked') ){
row.attr('class', '');
the_thumb.fadeIn('fast');
}
else{
row.attr('class', '');
row.addClass('cross-sale-uncheck');

the_thumb.fadeOut('fast');
}

var _total_price = 0,
remaining_items = 0;
$(".cross-sell ul.cross-sell-items li:not(.cross-sale-uncheck)").each(function(){
var that = $(this),

price = that.find('.cross-sell-item-price').text().replace(/[^-\d\.]/g, '');
_total_price = _total_price + parseFloat(price);
remaining_items++;
});// FIN DE LLAVE DE '$(".cross-sell").on("change", 'input', function(e)'

if( _total_price > 0 ){

_total_price = _total_price.toFixed(2);
$("#feq-products").show();
var curr_price = $("#cross-sell-buying-price").text().match(/\d.+/);
$("#cross-sell-buying-price").text( $("#cross-sell-buying-price").text().replace(curr_price, _total_price) )
}

else{
$("#feq-products").fadeOut('fast');
}


buy_block.fadeIn('fast');


}).on("click", 'a#cross-sell-add-to-cart', function(e){
e.preventDefault();

var that = $(this);

// get all selected products
var totals_checked = $(".cross-sell ul.cross-sell-items li:not(.cross-sale-uncheck)").size();
$(".cross-sell ul.cross-sell-items li:not(.cross-sale-uncheck)").each(function(){
var that = $(this),
q = 1,
asin = that.find('input').val();

multiple_asins.push(asin);
});

if( totals_checked > 0 ){
window.location = that.attr('href') + '?amz_cross_sell=yes&asins=' + multiple_asins.join(',');
}
});
}(jQuery));

-----------------------------------------------------------------------------

Gracias de nuevo y un saludo