var env = window.theme.env
var apiUrl = window.theme.apiUrl
var apiV3Url = window.theme.apiV3Url
var appUrl = window.theme.appUrl
var selOptsCount = 11;
function addModel() {
var $e = $('#default-model-row-id .model-row-div.hidden').clone();
$e.find('select[name="quantity-select"]').attr('disabled', true);
$('#default-model-row-id').append($e.removeClass('hidden'));
showHideAddButton();
}
function removeModel(e) {
var selected = $(e).closest('.model-row-div').find('select');
if (selected) {
//$('select[name*="warranty-frame-model"] option').removeAttr('disabled');
$(e).closest('.model-row-div').remove();
}
checkSelects();
//showHideAddButton();
}
function showHideAddButton(){
if(selOptsCount > $(document).find('select[name*="warranty-frame-model"]').length - 1){
$('#add-button').show();
}else{
$('#add-button').hide();
}
}
function quantitySelect(element) {
$('select[name*="warranty-frame-model"]').change(function(){
if($('select[name*="warranty-frame-model"]').length === 1 && $(this).val ) {
$('#add-button').show();
}
// start by setting everything to enabled
$('select[name*="warranty-frame-model"] option').attr('disabled',false);
$(".add-container").css({"display":"flex"});
// loop each select and set the selected value to disabled in all other selects
$('select[name*="warranty-frame-model"]').each(function(){
var limit = 5;
var $this = $(this);
$('select[name*="warranty-frame-model"]').not($this).find('option').each(function(){
if($(this).attr('value') == $this.val())
$(this).attr('disabled',true);
});
});
});
}
function checkSelects(e){
//if(e.type == 'click')
var checks = {};
$('select[name="warranty-frame-model-default"] option').each(function(){
if($(this).val() != ''){
checks[$(this).val()] = '';
}
});
$('select[name="warranty-frame-model-default"] option:selected').val() != '' ? checks[$('select[name="warranty-frame-model-default"] option:selected').val()] = 'set' : '';
$('select[name="warranty-frame-model-clone"] option:selected').each(function(){
$(this).val() != '' ? checks[$(this).val()] = 'set' : '';
});
var allSelected = 1;
for (var option in checks){
if(checks[option] != 'set'){
allSelected = 0;
break;
}
}
if(allSelected)
$('#add-button').hide();
else{
showHideAddButton();
//$('#add-button').show();
}
$('select[name*="warranty-frame-model"] option').attr('disabled', false);
$('select[name="warranty-frame-model-clone"] option').each(function(){
if($(this).val() != '')
if(checks[$(this).val()] == 'set'){
$(this).attr('disabled', true);
}
});
$(document).find('select[name*="warranty-frame-model"] option:first-child').attr('disabled', true);
}
$(document).ready(function () {
var invalidClassName = 'invalid'
var inputs = document.querySelectorAll('input, select, textarea')
var errMsgEle = $(this).find('.warranty-error-message');
var serErrMsgEle = $(this).find('.warranty-server-error-message');
var submitBtnEle = $(this).find('.warranty-submit-btn');
inputs.forEach(function (input) {
input.addEventListener('invalid', function () {
input.classList.add(invalidClassName)
errMsgEle.removeClass('hide');
serErrMsgEle.addClass('hide');
submitBtnEle.removeAttr('disabled').removeClass('disabled');
})
input.addEventListener('input', function () {
if (input.validity.valid) {
input.classList.remove(invalidClassName)
}
})
})
// $('#warranty-form-id').on('valid.fndtn.abide', function (e) {
$('#warranty-form-id').on('submit', function (e) {
e.preventDefault();
var errMsgEle = $(this).find('.warranty-error-message');
var serErrMsgEle = $(this).find('.warranty-server-error-message');
var submitBtnEle = $(this).find('.warranty-submit-btn');
var data = {};
_.forEach(_.fromPairs(_.map($(this).serializeArray(), function (x) {
return _.values(x)
})), function (v, k) {
_.set(data, k, v);
});
data.frameModel = _.omitBy(_.mapValues(data.frameModel, function (x) {
return parseInt(x)
}), _.isNaN);
//dataObj = data;
//check if required fields entered
var requiredFields = $(this).find('input[required], select[required]');
for (var i = 0; i < requiredFields.length; i++) {
if (!$(requiredFields[i]).val()) {
errMsgEle.removeClass('hide');
return;
}
}
//check if frame models entered
/*if (!(_.sum(_.values(data.frameModel)))) {
errMsgEle.removeClass('hide');
//console.log('this one');
return;
}*/
$(document).find('.warranty-frame').each(function(){
if($(this).find('select[name*="warranty-frame-model"]').length > 0){
var frModel = '';
if($(this).find('select[name="warranty-frame-model-default"]').length > 0)
frModel = $(this).find('select[name="warranty-frame-model-default"] option:selected').val();
else
frModel = $(this).find('select[name="warranty-frame-model-clone"] option:selected').val();
/*var $this = $(this), quantity = '';
$(document).find('select[name="quantity-select"]').each(function(){
if($(this).parents('.warranty-frame') == $this){
console.log('yup');
quantity = $(this).val();
}
});*/
if(frModel != '' && typeof frModel != null)
data.frameModel[frModel] = $(this).next().find('select[name="quantity-select"] option:selected').val();
}
});
//if(data['warranty-frame-model-clone'].length > 0)
delete data['warranty-frame-model-clone'];
if(data['warranty-frame-model-default'].length > 0)
delete data['warranty-frame-model-default'];
if(data['quantity-select'].length > 0)
delete data['quantity-select'];
//console.log(data);
//return;
if (!$('#warranty-terms').is(':checked')) return;
errMsgEle.addClass('hide');
serErrMsgEle.addClass('hide');
submitBtnEle.attr('disabled', 'disabled').addClass('disabled');
$.ajax({
url: apiV3Url + '/warranty',
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify(_(data).omit('tnc')),
type: "POST",
success: function (res) {
$('#warranty-form-id').trigger('reset');
window.location.pathname = "/pages/warranty-submitted";
},
error: function (req, status, err) {
if (status === 400) {
errMsgEle.removeClass('hide');
} else {
serErrMsgEle.removeClass('hide');
}
submitBtnEle.removeAttr("disabled").removeClass('disabled');
}
});
});
$(document).on('change', 'select[name*="warranty-frame-model-default"]', function(e){
$(this).val() != '' ? $('select[name="warranty-frame-model-clone"] option:selected[value="'+$(this).val()+'"]').parents('.model-row-div').remove() : '';
});
$(document).on('change', 'select[name*="warranty-frame-model"]', function(e){checkSelects(e);});
$(document).on('click', '.expand.button.alert.remove', function(e){checkSelects(e);});
// Disable default quantity select on dom ready
$(document).find('select[name="quantity-select"]').first().attr('disabled', true);
// Disable first empty option in all frmae model selects on dom ready
$(document).find('select[name*="warranty-frame-model"] option:first-child').attr('disabled', true);
// Enable/Disable Quantity Selects
$(document).find('select[name="warranty-frame-model-default"] option').each(function(){
if($(this).val() != '')
selOptsCount++;
});
//console.log('count '+selOptsCount);
$(document).on('change', 'select[name*="warranty-frame-model"]', function(){
if($(this).val() == '')
$(this).parents('.warranty-frame').next().find('select[name="quantity-select"]').attr('disabled', true);
else
$(this).parents('.warranty-frame').next().find('select[name="quantity-select"]').attr('disabled', false);
});
});
Multi-shipping FAQ
When and where will I see the multi-shipping option during my order journey?
When more than one (1) digital photo frame is added to cart, a checkbox will appear on the cart slider/cart page.
This option will allow you to order 2 or more frames and send them to different locations at the same time through the same checkout experience without having to enter different shipping addresses one by one.
The multi-shipping option is not showing up / greyed out. Why is that?
This can happen due to 3 reasons:
When only one (1) digital photo frame is added to cart.
When a print store product is added to cart. Please note print products are not supported for delivery through multi-shipping and need to be ordered separately.
When Nixplay Plus subscription is added to cart together with more than one (1) digital photo frame.
At this step, the multi-shipping option will show as “Not applicable - Learn More”. To avoid this:
Simply purchase the Nixplay Plus subscription separately first and activate your account.
Next login to your account directly at Nixplay store and enjoy 25% off the digital photo frames and you will notice the multi-shipping option is now available.
Why can’t I order both the Nixplay Plus subscription and use multi-shipping option at the same time?
This is because the multi-shipping option cannot recognize subscription-based products and therefore the Nixplay Plus subscription needs to be ordered separately.
We apologize for any inconvenience this may cause you. Rest assure, our engineers are working hard to find a solution and make this a 1 step journey. In the meantime, please follow the steps shared above to place your order while using the multi-shipping option.