';
html += '
';
html += '
- Fără giranți sau garanții
- Fără adeverință de venit
- Fără hârtii, totul e online
';
html += '
';
$(html).hide().appendTo('.box-cart-bottom').fadeIn(400);
}, 2000);
}
add_to_recently_viewed(jQuery('#product_page_product_id').val());
jQuery('.share_trigger').click(function(){
jQuery('.share_wrap').toggleClass('db');
return false;
});
$('.accordion').accordion({
"transitionSpeed": 400
});
jQuery('body').on('click', '#sign_to_price_alert', function(){
var email = jQuery('#email_price_alert').val();
if(!email)
{
display_error(email_is_not_valid);
return false;
}
var answer = ajax_call( { action: 'create_price_altert', email: email, id_product: jQuery('#product_page_product_id').val(), id_lang: ID_LANG, token: TOKEN }, false);
if(answer.error == 0)
{
jQuery('#price_alert_wrapper').html('
'+email_price_alert_sign_up+'
');
}
return true;
});
jQuery('.advancedwishlist_button_new').click(function(){
var html = '
';
$.fancybox(
html,
{
'autoDimensions' : false,
'width' : 650,
'height' : 'auto',
'transitionIn' : 'none',
'transitionOut' : 'none'
}
);
return false;
});
$('#thumbs_list_frame').bxSlider({mode:'vertical',slideMargin:5,minSlides:3,maxSlides:3,infiniteLoop:false});;
jQuery('.load_more_comments').click(function(){
var total_comments = jQuery('#total_comments').val();
var current_comments = jQuery('.comment').length;
if(current_comments < total_comments)
{
var answer = ajax_call( {
action: 'load_comments',
id_product: jQuery('#id_product_comment_send').val(),
token: TOKEN,
offset: current_comments,
id_lang: ID_LANG
}, false);
if(answer.error == 0)
{
var html = '';
answer.error_msg.forEach(function(entry) {
var stars = '';
for(i = 1; i<= entry.rating; i++)
stars += '
';
for(i = 1; i<= (5 - entry.rating); i++)
stars += '
';
html += '';
});
jQuery('#product_comments_block_tab').append(html);
current_comments = jQuery('.comment').length;
if(current_comments >= total_comments)
{
jQuery('.load_more_comments').remove();
}
}
}
else
{
jQuery('.load_more_comments').remove();
}
});
jQuery('.trigger_supplier_description, .trigger_return_policy, .trigger_term_conditions').click(function(){
if(jQuery('.supplier_description').text().length >= 2)
return;
var id = jQuery(this).attr('rel');
var answer = ajax_call( {
action: 'get_supplier_description',
id_supplier: id,
token: TOKEN,
id_lang: ID_LANG
}, false);
if(answer.error == 0)
{
jQuery('.supplier_description').html(answer.info.shipping.replace(/\\/g, ''));
jQuery('.return_policy').html(answer.info.return_policy.replace(/\\/g, ''));
jQuery('.term_conditions').html(answer.info.term_conditions.replace(/\\/g, ''));
}
return false;
});
jQuery('#submitReview').click(function(){
var rating = 4;
var comment_title = jQuery('#comment_title').val();
var comment_content = jQuery('#comment_content').val();
var customer_name = jQuery('#customer_name').val();
var id_product = jQuery('#id_product_comment_send').val();
if(comment_title.length == 0 || comment_content.length == 0 || customer_name.length == 0)
{
display_error('All fields are mandatory');
return false;
}
rating = $(".star_comment[type='radio']:checked").val();
var answer = ajax_call( {
action: 'add_comment',
comment_title: comment_title,
comment_content: comment_content,
customer_name: customer_name,
id_product: id_product,
token: TOKEN,
rating: rating,
id_lang: ID_LANG
}, false);
if(answer.error == 0)
{
jQuery('#id_new_comment_form').html('');
}
return false;
});
if(has_ga)
{
jQuery('.go_to_shop').click(function(){
gtag('event', 'go_to_shop_single', {'product': jQuery(this).attr('pn')});
});
}
jQuery('.open-comment-form').click(function(){
jQuery('#show_comment_form').fadeIn();
$([document.documentElement, document.body]).animate({
scrollTop: $("#show_comment_form").offset().top
}, 300);
return false;
});
}
jQuery('body').on('click','.like-element', function(){
like_product(this);
});
jQuery('body').on('click','.save-element', function(){
save_product(this);
});
jQuery('body').on('click','.collection_submit', function(){
add_to_collection(this);
});
jQuery('body').on('click','#create_collection', function(){
create_collection();
});
jQuery('body').on('keypress','#new_collection_name', function(e){
if(e.keyCode == 13)
{
create_collection();
}
});
jQuery('body').on('click','#close_global_pop, #global_pop_overlay', function(e){
jQuery('#global_pop').fadeOut();
if(outerWidth <= 480)
{
jQuery('#global_pop_overlay').hide();
}
setTimeout(function(){ jQuery('#global_icon').fadeIn(); }, 400);
setCookie('hook_cookie',1,1);
});
jQuery('body').on('click','.close_detailed', function(e){
jQuery('.active_li').removeClass('active_li').removeClass('loaded_li');
jQuery('.loaded_jax_pi').remove();
window.history.pushState('', '', load_url);
return false;
});
jQuery('body').on('click','.ajax_load_pi', function(e){
var el = jQuery(this)
jQuery('.active_li').removeClass('active_li').removeClass('loaded_li');
jQuery('.loaded_jax_pi').remove();
jQuery('.loading_li').remove();
el.closest('.ajax_block_product').addClass('active_li');
jQuery('.ajax_block_product.active_li').prepend('
![]('+SITE_URL+'/img/loading.gif'+')
');
var per_row = 3;
if(jQuery('#center_column').hasClass('per_row_4'))
per_row = 4;
var current_pos = parseInt($(".desktopHover .ajax_block_product").index($(".desktopHover .ajax_block_product.active_li"))) + 1;
var current_dif = current_pos % per_row;
window.history.pushState('', '', el.attr('href'));
if(current_dif > 0)
var pos = current_pos + ( per_row - (current_dif % per_row)) - 1 ;
else
var pos = current_pos - 1 ;
if(pos >= $(".ajax_block_product").length)
pos = $(".ajax_block_product").length - 1;
$.ajax({
url: el.attr('href'),
type:'GET',
success: function(data){
var date_html = $(data).find('.product_detailed_parent').html();
$('.desktopHover').children('.ajax_block_product:eq('+pos+')').after('
'+date_html+'');
jQuery('.loading_li').remove();
jQuery('.ajax_block_product.active_li').addClass('loaded_li');
$([document.documentElement, document.body]).animate({
scrollTop: $(".ajax_block_product.active_li").offset().top - 100
}, 200);
}
});
return false;
});
jQuery('body').on('click','#global_icon', function(e){
jQuery('#global_pop').fadeIn();
MagicScroll.start();
remove_trial();
jQuery('#global_icon').hide();
if(outerWidth <= 480)
{
jQuery('#global_pop_overlay').show();
}
setCookie('hook_cookie',1,-1);
});
if(!hook_cookie || hook_cookie == 'false')
{
if(outerWidth <= 480)
{
setTimeout(function(){ jQuery('#global_icon').fadeIn(); }, 1000);
}
else
{
setTimeout(function(){ jQuery('#global_pop').fadeIn(); remove_trial();
}, 1000);
}
}
else
{
setTimeout(function(){ jQuery('#global_icon').fadeIn(); }, 1000);
}
if(FB_APP_IP && FB_LOGIN)
{
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
window.fbAsyncInit = function() {
FB.init({
appId : FB_APP_IP, // Set YOUR APP ID
channelUrl : SITE_URL, // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
/*
FB.Event.subscribe('auth.authResponseChange', function(response)
{
if (response.status === 'connected')
{
}
}); */
};
}
});
'+entry.title+'
'+entry.comment+'