");
xajax_UpdateAttributeFieldsFloatingBasket(xajax.getFormValues('AttributeBasketForm'), '', '', $('#ProductAmount').val());
}
function updateQuotationCount(value) {
$('.QuotationCountInner').find('small').html(value);
}
Product toegevoegd aan jouw offerte. Ga naar de offerte pagina om jouw offerte aan te vragen, dan nemen wij zo spoedig mogelijk contact met je op.
',
prevArrow: '
',
infinite: false
});
$('.product__image').lightGallery({
selector: '.product__image span'
});
}
function InitViewedRecently() {
$('.product__viewed').not('.slick-initialized').slick({
nextArrow: '
',
prevArrow: '
',
slidesToShow: 4,
slidesToScroll: 1,
infinite: false,
responsive: [
{
breakpoint: 1024,
settings: {
nextArrow: '
',
prevArrow: '
',
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 768,
settings: {
slidesToScroll: 2,
slidesToShow: 2,
infinite: false,
}
},
{
breakpoint: 480,
settings: {
slidesToScroll: 1,
slidesToShow: 1,
}
}
]
});
InitHeight();
}
function InitProductRelevant() {
$('.product__related').not('.slick-initialized').slick({
nextArrow: '
',
prevArrow: '
',
slidesToShow: 4,
slidesToScroll: 1,
infinite: false,
responsive: [
{
breakpoint: 1024,
settings: {
nextArrow: '
',
prevArrow: '
',
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 768,
settings: {
slidesToScroll: 2,
slidesToShow: 2,
infinite: false,
}
},
{
breakpoint: 480,
settings: {
slidesToScroll: 1,
slidesToShow: 1,
}
}
]
});
InitHeight();
}
function InitMostViewed() {
$('.product__mostviewed').not('.slick-initialized').slick({
nextArrow: '
',
prevArrow: '
',
slidesToShow: 4,
slidesToScroll: 1,
infinite: false,
responsive: [
{
breakpoint: 1024,
settings: {
nextArrow: '
',
prevArrow: '
',
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 768,
settings: {
slidesToScroll: 2,
slidesToShow: 2,
infinite: false,
}
},
{
breakpoint: 480,
settings: {
slidesToScroll: 1,
slidesToShow: 1,
}
}
]
});
InitHeight();
}
function InitViewedByOthers() {
$('.product__others').not('.slick-initialized').slick({
nextArrow: '
',
prevArrow: '
',
slidesToShow: 4,
slidesToScroll: 1,
infinite: false,
responsive: [
{
breakpoint: 1024,
settings: {
nextArrow: '
',
prevArrow: '
',
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 2,
infinite: false,
}
},
{
breakpoint: 768,
settings: {
slidesToScroll: 2,
slidesToShow: 2,
infinite: false,
}
},
{
breakpoint: 480,
settings: {
slidesToScroll: 1,
slidesToShow: 1,
}
}
]
});
InitHeight();
}
$(document).on('click', '.reviews__count', function (e) {
e.preventDefault();
$('html, body').animate({
scrollTop: $('#product__reviews').offset().top - 24
}, 500);
});
$(document).on('click', '.button--compare', function () {
$(this).find('.compare__box').toggleClass('checked');
$(this).next().toggle();
});
function SortReviews(sType) {
// Alle reviews ophalen.
var Reviews = $('.product__review');
// Alles even tonen. later kunnen we op basis van de instelling dit weer juist zetten.
Reviews.removeClass('hideByStart');
if($('.product__block--reviews').hasClass('toggled') === true) {
Reviews.attr('style', 'display:block');
} else {
Reviews.removeAttr('style');
}
// Sorteren.
switch (sType) {
case 'DateCreatedNew':
// Nieuwste datum eerst (hoogste id)
Reviews.sort(function (a, b) {
return $(b).attr("data-review-id") - $(a).attr("data-review-id")
});
break;
case 'DateCreatedOld':
// Oudste datum eerst (laagste id)
Reviews.sort(function (a, b) {
return $(a).attr("data-review-id") - $(b).attr("data-review-id")
});
break;
case 'PointsHigh':
// Hoogste score eerst
Reviews.sort(function (a, b) {
return $(b).attr("data-review-points") - $(a).attr("data-review-points")
});
break;
case 'PointsLow':
// Laagste score eerst
Reviews.sort(function (a, b) {
return $(a).attr("data-review-points") - $(b).attr("data-review-points")
});
break;
}
// Items per page weer toepassen.
Reviews.each(function (index) {
if (index >= 5) {
$(this).addClass('hideByStart');
}
});
// Gesoorteerde waarden teruggeven.
$("#reviews").html(Reviews);
}
/* File upload */
$(document).on('change', 'input[name=filename]', function (e) {
$('.error__upload').hide();
$('.product-upload__loader').show();
let self = $(this);
// Build the form data that will be send using Ajax
let formData = new FormData();
formData.append('uploadfile', $(this)[0].files[0]);
formData.append('product_upload_id', $(this).attr('data-id'));
// Do the upload using Ajax so we dont end up having a form inside of a form
$.ajax({
url: '/website/TreeItems/Product/OrderUpload.php',
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function (data) {
// The success callback returns JavaScript, which should be rendered in the iframe to execute it
var context = $('iframe[name=product-upload__iframe]')[0].contentWindow.document;
var $body = $('body', context);
$body.html(data);
// Display the filename of the uploaded file in the front-end
$('span.file-chosen[data-id='+self.attr('data-id')+']').text(self[0].files[0].name);
$('.product-upload__loader').hide();
}
})
});