woo product , wp_insert_post() never displays on the front end. What gives? [closed]

Glad you got it to work! Per my comment, WooCommerce takes Post Meta into consideration whenever deciding whether or not to add a Product to the Shop Catalog. It seems you were able to make it show up by updating the product visibility: update_post_meta( $new_product_post_id, ‘_visibility’, ‘visible’ ); I’m not 100% familiar with WooCommerce so … Read more

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.

How to set a default value in a meta box

Here’s a tweaked version of the referenced wpse103469_add_price_per_unit_meta_to_price() function. If no units have been specified, the default units are appended to the price, otherwise the user-specified units are used. add_filter(‘woocommerce_get_price_html’, ‘wpse103469_add_price_per_unit_meta_to_price’); function wpse103469_add_price_per_unit_meta_to_price( $price ) { $default_units = __( ‘sq. ft.’, ‘myplugin_textdomain’ ); $units = get_post_meta( get_the_ID(), ‘wc_price_per_unit_key’, true ); return ( $units ) ? … Read more