• Hi
    I am using the Booster Plus version and I want to hide the prices from showing on a product with variables. I am using the radio button option instead of the default dropdown selector. I have five variables of a product, each variable with a different price. I don’t want any prices to show as they are listed in the product description. I also don’t want the base price showing underneath the variables and. Also, the lowest priced variable is selected by default and I would like to remove this as well. This is what it looks like:
    o 1 ($5.50)
    o 2 ($7.50)
    o 3 ($9.50)

    Hopefully someone has an answer to this.

    Thanks

Viewing 1 replies (of 1 total)
  • Hello @jgreene626,

    Regarding selected default value, there is an native WooCommerce option where you can set it leaving it empty. This option is located here:
    admin > product page > product data > variations > Default form values

    Now, about hiding the prices, put this in your functions.php and please tell me if this solves your problem.

    add_action( 'wp_footer', function () {
    	if ( ! is_product() ) {
    		return;
    	}
    	global $product;
    	if ( ! $product->is_type( 'variable' ) ) {
    		return;
    	}
    	?>
    	<script>
    		jQuery(document).ready(function ($) {
    			var labels = $('.variations_form.cart label');
    			if (labels.length) {
    				labels.each(function () {
    					var old_html = jQuery(this).html();
    					var new_html = old_html.replace(/\s\(.*\)$/, '');
    					jQuery(this).html(new_html);
    				});
    			}
    		});
    	</script>
    	<style>
    		.woocommerce-variation-price {display: none}
    	</style>
    	<?php
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Variable pricing issue’ is closed to new replies.