How to Show taxonomies terms on front as colorized or color circle checkboxes in woocommerce woocommerce-products-filter plugin?
You can Show taxonomies terms on front as colorized or color circle checkboxes in woocommerce woocommerce-products-filter plugin?
How to show circle instead of name of color in woocommerce woocommerce-products-filter plugin.
If you want show color attributes color in circle you in woocommerce-products-filter plugin.
You do not need buy an extension.
Just do what i say:
Open this folder
wp-content/plugins/woocommerce-products-filter/views/html_types
Open this file from above folder checkbox.php
Go to line no 111 and 226.
replace this line:
echo $term['name'];
TO
if($term['taxonomy']=='pa_color'){
$ars = get_term_meta($term['term_id']);
$colorp = $ars['color_value'][0];
?>
<style type="text/css">
.pcirclecolor {
height: 30px;
width: 30px;
border-radius: 50%;
display: block;
float: left;
}
</style>
<span class="pcirclecolor" style="background-color: <?=$colorp?>"></span>
<?php
}else{
echo $term['name'];
}
$ars = get_term_meta($term['term_id']);
$colorp = $ars['color_value'][0];
?>
<style type="text/css">
.pcirclecolor {
height: 30px;
width: 30px;
border-radius: 50%;
display: block;
float: left;
}
</style>
<span class="pcirclecolor" style="background-color: <?=$colorp?>"></span>
<?php
}else{
echo $term['name'];
}
Above code is for checkbox if you want to do same for radio button do the same in radio.php file alos
Comments
Post a Comment