replace new css files location to modules/themeconfigurator/css

This commit is contained in:
Alexander Grosul
2013-11-18 20:07:24 +02:00
parent 36baadad1a
commit b6c5cd7c63
18 changed files with 1619 additions and 107 deletions
@@ -257,13 +257,13 @@ function wishlistProductsIdsRemove(id){
wishlistProductsIds.splice($.inArray(parseInt(id),wishlistProductsIds), 1)
}
function wishlistRefreshStatus(){
$('.addToWishlist').each(function() {
if ($.inArray(parseInt($(this).prop('rel')),wishlistProductsIds)!= -1){
$(this).addClass('ckecked');
}
else
$(this).removeClass('ckecked');
});
$('.addToWishlist').each(function() {
if ($.inArray(parseInt($(this).prop('rel')),wishlistProductsIds)!= -1){
$(this).addClass('checked');
}
else
$(this).removeClass('checked');
});
}
$(document).ready(function() {
if (typeof wishlistProductsIds == 'undefined') {
@@ -23,12 +23,55 @@
* International Registered Trademark & Property of PrestaShop SA
*/
function addToCompare(productId){
var totalValueNow = parseInt($('.bt_compare').next('.compare_product_count').val());
$.inArray(parseInt(productId),comparedProductsIds) == -1?action = 'add':action = 'remove';
$.ajax({
url: 'index.php?controller=products-comparison&ajax=1&action='+action+'&id_product=' + productId,
async: true,
cache: false,
success: function(data){
if (action == 'add' && comparedProductsIds.length < comparator_max_item) {
comparedProductsIds.push(parseInt(productId)),
compareButtonsStatusRefresh(),
totalVal = totalValueNow +1,
$('.bt_compare').next('.compare_product_count').val(totalVal),
totalValue(totalVal)
}
else if (action == 'remove') {
comparedProductsIds.splice($.inArray(parseInt(productId),comparedProductsIds), 1),
compareButtonsStatusRefresh(),
totalVal = totalValueNow -1,
$('.bt_compare').next('.compare_product_count').val(totalVal),
totalValue(totalVal)
}
else {
alert(max_item)
}
},
error: function(){}
});
}
function compareButtonsStatusRefresh(){
$('.addToCompare').each(function() {
if ($.inArray(parseInt($(this).prop('rel')),comparedProductsIds)!= -1){
$(this).addClass('checked');
}
else {
$(this).removeClass('checked');
}
})
}
function totalValue(value) {
$('.bt_compare').find('.total-compare-val').html(value);
}
reloadProductComparison = function() {
$('input:checkbox.comparator').each(function() {
var checkedCheckbox = $(this);
if (checkedCheckbox.is(':checked'))
checkedCheckbox.parent().addClass('checked');
});
$('a.cmp_remove').click(function(){
var idProduct = $(this).prop('rel').replace('ajax_id_product_', '');
@@ -42,57 +85,8 @@ reloadProductComparison = function() {
}
});
});
$('input:checkbox.comparator').click(function(){
var totalValueNow = parseInt($('.bt_compare').next('.compare_product_count').val());
var idProduct = $(this).prop('value').replace('comparator_item_', '');
var checkbox = $(this);
if(checkbox.is(':checked'))
{
$.ajax({
url: 'index.php?controller=products-comparison&ajax=1&action=add&id_product=' + idProduct,
async: true,
cache: false,
success: function(data){
if (data === '0')
{
checkbox.prop('checked', false);
alert(max_item);
}
else {
checkbox.prop('checked', true),
checkbox.parent().addClass('checked'),
totalVal = totalValueNow +1,
$('.bt_compare').next('.compare_product_count').val(totalVal),
totalValue(totalVal)
}
},
error: function(){
checkbox.prop('checked', false);
}
});
}
else
{
$.ajax({
url: 'index.php?controller=products-comparison&ajax=1&action=remove&id_product=' + idProduct,
async: true,
cache: false,
success: function(data){
if (data === '0')
checkbox.prop('checked', true);
checkbox.parent().removeClass('checked');
totalVal = totalValueNow -1;
$('.bt_compare').next('.compare_product_count').val(totalVal),
totalValue(totalVal)
},
error: function(){
checkbox.prop('checked', true);
}
});
}
});
}
function totalValue(value) {
$('.bt_compare').find('.total-compare-val').html(value);
}
$(document).ready(function() {
compareButtonsStatusRefresh();
});