woocommerce list product by id

You should use “tax query” like this: $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 5, ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_cat’, ‘terms’ => 5, ), ), ); Using taxonomy name (product_cat) as WP_Query parameter is deprecated.

Adjust Price Display for Variable Product in Woocommerce [closed]

You can hook into woocommerce_variable_price_html and reformat the price to include or. This will replace the – with or on all products with multiple differing prices. add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price_seperator’, 10, 2); function custom_variation_price_seperator( $price, $product ) { $price=””; $prices = $product->get_variation_prices( true ); $min_price = current( $prices[‘price’] ); $max_price = end( $prices[‘price’] ); if ( !$product->min_variation_price … Read more

Woocommerce Variable Product – Please choose product options… [closed]

I’m not sure why but you have form tag inside a form tag.. and chrome is making it as one… view source and look for <form class=”cart” method=”post” enctype=”multipart/form-data”> and <form class=”variations_form cart” method=”post” <form class=”variations_form cart” method=”post” was removed by the browser which is the one needed by woocommerce.

Adding Static Image to WooCommerce Content-Single-Product template

Many thanks to Nathan Powell for the fix. Changing get_stylesheet_directory() to get_stylesheet_directory_uri() will return the correct URL. get_stylesheet_directory() returns the absolute server path to child or parent theme (hence my previous issue) whereas get_stylesheet_directory_uri() returns the properly formed URI of child or parent theme. I suppose the lesson is to pay close attention to exactly … Read more

How to set up Custom Post Type archive page as Front page

I was able to solve the issue on https://wordpress.stackexchange.com/users/4771/milo suggestion. For this, I created a drop down menu in theme customizer from where I can select a dummy static page to act as Portfolio Page. I’ve used following code for drop down menu: add_action( ‘customize_register’, ‘th_customize_register’ ); function th_customize_register($wp_customize) { // Add: Drop Down Pages … Read more