Wocommerce search in category (almost there!)
-
So i have this:
<form role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <div> <label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'woocommerce' ); ?></label> <input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" placeholder="<?php _e( 'Search for products', 'woocommerce' ); ?>" /> <input type="submit" id="searchsubmit" value="<?php echo esc_attr__( 'Search' ); ?>" /> <input type="hidden" name="post_type" value="product" /> <?php wp_dropdown_categories( array( 'name' => 'product_cat', 'show_option_all' => 'Select a category', 'taxonomy' => 'product_cat' )) ?> </div> </form>
It retruns (for example only): https://mywebsite.com/?s=5500&post_type=product&product_cat=9
I want it to return the name not the id for this to work:
I need it to retrun (for example only): https://mywebsite.com/?s=5500&post_type=product&product_cat=apple
Doing my head in but i just can not get it to display the name instead of the id!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Wocommerce search in category (almost there!)’ is closed to new replies.