<script>
$( document ).ready(function(){
$( "li.product.sale" ).each( function() {
var price_b = $( this ).find(".wc-block-components-product-price del bdi");
var price_before = price_b.text().match(/\d/g).join('');
var price_a = $( this ).find(".wc-block-components-product-price ins bdi");
var price_after = price_a.text().match(/\d/g).join('');
var sel = price_before - price_after;
var prc = Math.round( sel / price_before * 100 );
$( this ).find(".wc-block-grid__product-image > a").prepend('<span class="onsale">-'+ prc +' %</span>');
});
});
</script>
body:not(.admin-bar) img {
-moz-user-select: none !important;
-webkit-user-select: none !important;
-ms-user-select: none !important;
user-select: none !important;
pointer-events: none !important;
}
<?php
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$empty = 0;
$args = array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty
);
$all_categories = get_categories( $args );
foreach ($all_categories as $cat) {
if($cat->category_parent == 0) {
$category_id = $cat->term_id;
echo '<br /><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
$args2 = array(
'taxonomy' => $taxonomy,
'child_of' => 0,
'parent' => $category_id,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty
);
$sub_cats = get_categories( $args2 );
if($sub_cats) {
foreach($sub_cats as $sub_category) {
echo $sub_category->name ;
}
}
}
}
?>
if(is_product_category('61')) {
$map_data = array(
"center_lat" => 15.755456,
"center_lng" => 37.623104,
"zoom" => 10,
"type" => "map"
);
}else{
$map_data = array(
"center_lat" => 55.755456,
"center_lng" => 37.623104,
"zoom" => 10,
"type" => "map"
);
}
$map_data['marks'] = $marks;
a.added_to_cart.wc-forward {
position: absolute;
margin: 0 -10em;
}