Posts

Showing posts with the label woocommerce-products-filter

How to Show taxonomies terms on front as colorized or color circle checkboxes in woocommerce woocommerce-products-filter plugin?

Image
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;                  

How to get color code in woocommerce color attribute by slug in wordpress

You can get color code in wordpress woocommerce color attribute by slug in wordpress. You can use this code wordpress plugin woocommerce-products-filter also By using just simple code. First you need to get the $term['term_id']. This can be array Or object $term->term_id according to your page Use this code then for array: $color_code_array = get_term_meta($term['term_id']); $colorp = $color_code_array['color_value'][0]; // #000111 Use this code then for Object: $color_code_array = get_term_meta($term->term_id); $colorp = $color_code_array['color_value'][0]; // #000111 Now you print echo $colorp; // #000111