Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.9 kB
0
Indexable
Never
.selector-products .products-row .product-tile:nth-child(n+10){
    display: none !important;
}

.yankee-pdp-wrapper .product-tile-wrap {
    height: 130px;
}

#prodSelecDesktop{
    display: none !important;
}

#maincontent div.row.tile > div.pdp-tile > div.attributes > div > div > div.row > div.more-products-link {
    display: none !important;
}


.promotion-msg.promotion-primary {
    display: none !important;
}


#prodSelecMob {
	display: none;
}

div.yankee-pdp-wrapper {
	display: flex;
	flex-wrap: wrap;
	margin-top: -4%;
}

div.yankee-pdp-wrapper > div {
	padding: none !important;
}

div.yankee-pdp-wrapper > div > div > div {
	border: none !important;
	box-shadow: none !important;
	border-radius: unset !important;
	height: initial !important;
	min-height: initial !important;
}

div.yankee-pdp-wrapper > div > div > div a.product-tile-link:hover {
	border-radius: inherit !important;
	border-width: 0.1rem !important;
}

#maincontent  div.tile-body.product-tile-addtocart > div.product-primary-category {
    display: none !important;
}

.color-swatches {
    display: none !important;
}

.price.non-sale-value {
    display: none !important;
}

.row.add-to-cart-wrapper {
    display: none !important;
}

/*hiding star rating div*/
div.yankee-pdp-wrapper > div > div > div > div.tile-body.product-tile-addtocart > div:first-child {
	display: none;
}

div.yankee-pdp-wrapper > div > div > div > div.tile-body.product-tile-addtocart {
	padding: 0.3rem !important;
}

div.yankee-pdp-wrapper > div > div > div > div.tile-body.product-tile-addtocart > .pdp-link > .link {
	font-size: 0.75rem;
	font-weight: 800;
	text-align: center;
	word-break: break-word;
	overflow-wrap: break-word;
}

div.yankee-pdp-wrapper > div > div > div > div.tile-body.product-tile-addtocart > .pdp-link {
	padding-top: .1rem !important;
	min-height: 1.3rem !important;
}

.product .product-tile .image-container .badge {
    display: none !important;
}

@media (min-width:768px) and (max-width: 991px) {
    .product-tile {
        min-height: 10em;
    }
.image-container  img {
        margin: auto;
        margin-top: 20px;
    }
.image-container {
        margin-block: -5px !important;
}
.product .tile-body.product-tile-addtocart {
    padding-bottom: 0;
    margin-bottom: -30px;
}
}


@media screen and (max-width: 768px) {
    .product-presentation .product-tile:nth-child(n+10){
        display: none;
    }
}

















(function() {
    var debug = false;
    try {
        function waitForElement(selector, callback) {
            var maxCheck = 200;
            var interval = window.setInterval(function() {
                if (document.querySelectorAll(selector).length > 0) {
                    callback();
                    window.clearInterval(interval);
                } else if (--maxCheck < 0) {
                    window.clearInterval(interval);
                }
            }, 50);
        }

        function addProductsToPDP(products) {
            for (var i = 0; i < products.length; i++) {
                if (products[i].getAttribute('data-tile-position') < 10) {
                    document.querySelectorAll('.yankee-pdp-wrapper').forEach(function(item, index) {
                        console.log(item);
                        item.insertAdjacentElement('beforeend', products[i].cloneNode(true));
                    });
                }
            }
        }

        function init() {
            document.querySelectorAll('.pdp-tile > .attributes .pdp-selector').forEach(function(item, index) {
                item.insertAdjacentHTML('beforeend', '<div class="yankee-pdp-wrapper"></div>');
            });

            // changing product tile title
            document.querySelectorAll("#productTileTitle").forEach(title => {
                title.textContent = "Style (1 of 9)";
            })

            var xhr = new XMLHttpRequest();
            var url = document.querySelector('.breadcrumb > .breadcrumb-item:nth-child(3) a').getAttribute('href');
            xhr.open('GET', url, true);
            xhr.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    var customEl = document.createElement('div');
                    customEl.innerHTML = this.responseText;
                    var products = customEl.querySelectorAll('.product-grid .product-tile-wrap');
                    addProductsToPDP(products);
                }
            };
            xhr.send();
        }

        waitForElement('.breadcrumb > .breadcrumb-item:nth-child(3) a', init);
    } catch (e) {
        if (debug) console.log(e, 'error in ' + variation_name);
    }
})();