Home Forums WoodMart support forum Categories dropdown in WOO search form shows html block

Categories dropdown in WOO search form shows html block

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #43343

    condatec
    Participant

    The Title Tag for the Kategorie Dropdown shows HTML Block id and not the right text !!!

    #43354

    Artem Temos
    Keymaster

    Hi,

    Please, provide us a screenshot of this problem for better understanding.

    #44319

    condatec
    Participant

    here is the screenshot

    Attachments:
    You must be logged in to view attached files.
    #44420

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    function woodmart_show_categories_dropdown() {
    		$args = array( 
    			'hide_empty' => 1,
    			'parent' => 0
    		);
    		$terms = get_terms('product_cat', $args);
    		if( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
    			?>
    			<div class="search-by-category input-dropdown">
    				<div class="input-dropdown-inner woodmart-scroll-content">
    					<input type="hidden" name="product_cat" value="0">
    					<a href="#" data-val="0"><?php esc_html_e('Select category', 'woodmart'); ?></a>
    					<div class="list-wrapper woodmart-scroll">
    						<ul class="woodmart-scroll-content">
    							<li style="display:none;"><a href="#" data-val="0"><?php esc_html_e('Select category', 'woodmart'); ?></a></li>
    							<?php
    								if( ! apply_filters( 'woodmart_show_only_parent_categories_dropdown', false ) ) {
    							        $args = array(
    							            'orderby' => 'id',
    							            'title_li' => false,
    							            'taxonomy' => 'product_cat',
    										'use_desc_for_title' => false,
    							            'walker' => new WOODMART_Custom_Walker_Category(),
    							        );
    							        wp_list_categories($args);
    								} else {
    								    foreach ( $terms as $term ) {
    								    	?>
    											<li><a href="#" data-val="<?php echo esc_attr( $term->slug ); ?>"><?php echo esc_attr( $term->name ); ?></a></li>
    								    	<?php
    								    }
    								}
    							?>
    						</ul>
    					</div>
    				</div>
    			</div>
    			<?php
    		}
    	}
Viewing 4 posts - 1 through 4 (of 4 total)