$(document).ready(function() {
if($('.price').children('.price-old').length > 0) {
$('.price-old').closest('.product-thumb').before('<span class="special-price--stiker"></span>');
//Вот тут должен вытягивать текст из этих двух span'ов
}
});
<div class="product-thumb">
<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
<div>
<div class="caption">
<h4 class="product-name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
<div class="description">
<?php if($product['attribute_groups']) { ?>
<?php foreach($product['attribute_groups'] as $attribute_group) { ?>
<?php foreach($attribute_group['attribute'] as $attribute) { ?>
<div class="description--attribute-name"><?php echo $attribute['name']; ?></div>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
<?php if ($product['price']) { ?>
<p class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>
<?php } ?>
<?php if ($product['tax']) { ?>
<span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
<?php } ?>
</p>
<?php } ?>
</div>
<div class="button-group">
<button class="product-thumb--btn-cart" type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');">Выбрать</button>
<button class="product-thumb--btn-favorite" type="button" onclick="compare.add('<?php echo $product['product_id']; ?>');">В избранное</button>
</div>
</div>
</div>
document.getElemenstByClassName
document.getElemenstByClassName is not a function
document.getelementsbyclassname is not a function
new WOW().init();
$(window).on('load', function () {
setTimeout(function() {
$('.header').addClass('animated fadeInDown');
}, 500);
});
const el = document.getElementById('header');
el.addEventListener('animationend', function() {
el.classList.remove('animated fadeInDown')
});
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule .* http://%{HTTP_HOST}%1 [R=301,L,QSA]
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule ^(.+)\.php$ /$1 [R=301,L]
<span class="special-price--stiker"></span>
.