';
var $messages = $('[data-placeholder="messages"]');
var stickyOffset = 150;
if (type === 'sample') {
message = 'You can either add product or sample to the cart. Please remove the product from cart and then add sample.';
} else if (type === 'product') {
message = 'You can either add product or sample to the cart. Please remove the sample from cart and then add product.';
}
html = '
' + message + '
';
if (!$messages.length) {
$messages = $('.page.messages .messages').first();
}
if (!$messages.length) {
$messages = $('').prependTo('.page-main');
}
$messages.html(html);
$('html, body').animate({ scrollTop: Math.max(0, $messages.offset().top - stickyOffset) }, 220);
dismissTransientMessages(4600);
}
function applySpecVisibilityByStyleRows() {
var $spec = $('#tblSpec');
var $cells = $('.color-swatch td:visible');
var rows = {};
if (!$spec.length || !$cells.length) {
return;
}
$cells.each(function () {
rows[Math.round($(this).position().top)] = true;
});
if (Object.keys(rows).length > 4) {
$spec.hide();
return;
}
$spec.show();
}
$(function () {
initMessageObserver();
setTimeout(syncSampleButtonState, 400);
setTimeout(syncSampleButtonState, 1400);
setTimeout(applySpecVisibilityByStyleRows, 100);
setTimeout(applySpecVisibilityByStyleRows, 700);
scheduleTransientDismissals();
$('#product-addtocart-button')
.off('click.merolaSampleConflict')
.on('click.merolaSampleConflict', function (e) {
if (getCartMatchState().sampleInCart || $('#sample-product-button').prop('disabled')) {
e.preventDefault();
e.stopImmediatePropagation();
showSampleConflictMessage('product');
}
});
$('#sample-product-button')
.off('click.merolaProductConflict')
.on('click.merolaProductConflict', function (e) {
if (getCartMatchState().productInCart) {
e.preventDefault();
e.stopImmediatePropagation();
showSampleConflictMessage('sample');
}
});
$(document)
.off('click.merolaSpecStyle', '.swatch-option, .sizeopt, .finishopt, .coloropt')
.on('click.merolaSpecStyle', '.swatch-option, .sizeopt, .finishopt, .coloropt', function () {
setTimeout(applySpecVisibilityByStyleRows, 260);
});
});
$(document)
.off('contentUpdated.merolaSampleState', '[data-block="minicart"]')
.on('contentUpdated.merolaSampleState', '[data-block="minicart"]', function () {
setTimeout(syncSampleButtonState, 120);
});
$(document)
.off('contentUpdated.merolaMessageDismiss', '[data-placeholder="messages"], .page.messages')
.on('contentUpdated.merolaMessageDismiss', '[data-placeholder="messages"], .page.messages', function () {
dismissTransientMessages(4200);
});
// The modal should open only after confirmed AJAX add-to-cart success.
// This prevents "added" UX before minicart/cart sections have refreshed.
$('#product-addtocart-button').off('click.merolaXsell');
$(document).off('ajax:addToCart.merolaPdpSync').on('ajax:addToCart.merolaPdpSync', function (event, payload) {
var form = payload && payload.form ? payload.form : null;
var isPdpForm = form && form.attr && form.attr('id') === 'product_addtocart_form';
var response = payload && payload.response ? payload.response : null;
var hasMinicartHtml = !!(response && response.minicart);
var isSampleSubmit = !!(form && form.data && form.data('merolaWasSampleSubmit'));
if (!isPdpForm) {
return;
}
// Keep a loading signal visible immediately. Native Magento add-to-cart
// updates minicart from response HTML when available.
$('[data-block="minicart"]').trigger('contentLoading');
// Fallback only when response doesn't include minicart payload.
if (!hasMinicartHtml) {
customerData.invalidate(['cart']);
setTimeout(function () {
customerData.reload(['cart'], true);
}, 250);
}
setTimeout(syncSampleButtonState, 180);
setTimeout(syncSampleButtonState, 1200);
setTimeout(applySpecVisibilityByStyleRows, 260);
scheduleTransientDismissals();
if (!isSampleSubmit && M && M.open) {
setTimeout(function () {
M.open();
}, 120);
}
if (form && form.removeData) {
form.removeData('merolaWasSampleSubmit');
form.removeData('merolaSubmitterId');
}
});
});
✔Your item has been added to the cart
Braid 1"x2" Marmara And Thassos Marble Polished Mosaic
If you're aiming for a timeless floor or wall mosaic, then this one's for you! Our Marble Mosaics series allows you to see the beautiful textures of natural marble with a smooth finish.