Category : product

I’m using the code below to change a product price to text (Contact for Pricing) when the price field is left empty: add_filter( ‘woocommerce_get_price_html’, ‘change_special_product_price’, 10, 2 ); function change_special_product_price( $price_html, $product ) { if ( $product->id == 6917 ) { $price_html = ‘<span class="woocommerce-Price-amount amount">Contact for Pricing</span>’; } return $price_html; } add_filter(‘woocommerce_empty_price_html’, ‘custom_call_for_empty_price_html’); function ..

Read more

I’m trying to programmatically bulk add products in WooCommerce but for some reason, it’s only adding the first product. I am making a request to an app that returns a JSON response with product names and descriptions. So far my code looks like what I have below: $curl_connection = curl_init($url); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, ..

Read more