Create a Search Form that only Searches with WooCommerce Sale Products

Yes, you can add search value in getting post query like this : $args = array( ‘post_type’ => ‘product’, ‘s’ => ‘search value’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( // Simple products type ‘key’ => ‘_sale_price’, ‘value’ => 0, ‘compare’ => ‘>’, ‘type’ => ‘numeric’ ), array( // Variable products type ‘key’ => ‘_min_variation_sale_price’, … Read more

How can I show “sold out” instead of “out of stock” for some products with particular tags and categories [closed]

Try this add_filter( ‘woocommerce_get_availability’, ‘change_out_of_stock_text_woocommerce’, 1, 2); function change_out_of_stock_text_woocommerce( $availability, $product_to_check ) { if ( ! $product_to_check->is_in_stock() || has_term( ‘my-ex-cat-slug’, ‘product_cat’ ) || has_term( ‘my-ex-tag-slug’, ‘product_tag’ )) { $availability[‘availability’] = __(‘Sold Out’, ‘woocommerce’); } return $availability; } Change my-ex-cat-slug with your Category’s slug and my-ex-tag-slug with tag’s slug

data-value for custom woocommerce field showing in code but not visable on page load

the data-value doesnt show, is to use. if you want to show it, it should be inside the a tag, once it is php code with variables must be inside the php “tags” so should be something like this <li data-value=”<?php echo $_location1; ?>”><a href=”#”><?php echo $_date1.’ ‘.$_location1; ?></a></li> this will show this “Friday, 29 … Read more