Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: [WooCommerce] Hide Prices
    aimeevee

    (@aimeevee)

    I was not looking for a plug & play plugin but just because I did not want to pay. I found a quick fix using the

    <?php if (is_user_logged_in() ) { //only logged in user can view this ?>

    Here is the FULL code which also hides the add to cart button 😉

    <?php do_action('woocommerce_before_add_to_cart_button'); ?>
    <?php if (is_user_logged_in() ) {  //only logged in user can view this ?>
    	<div class="single_variation_wrap" style="display:none;">
    		<div class="single_variation"></div>
    		<div class="variations_button">
    			<input type="hidden" name="variation_id" value="" />
    			<?php woocommerce_quantity_input(); ?>
    			<button type="submit" class="single_add_to_cart_button button alt"><?php echo apply_filters('single_add_to_cart_text', __('Add to cart', 'woocommerce'), $product->product_type); ?></button>
    		</div>
    	</div>
    	<div><input type="hidden" name="product_id" value="<?php echo esc_attr( $post->ID ); ?>" /></div>
    
    	<?php do_action('woocommerce_after_add_to_cart_button'); ?>
    
    </form>
    <?php } ?>

    Place the code in the woocommerce/templates/single-product/add-to-cart/variable.php file on both in the woocommerce plugin as well as any variable.php which may be included in your theme’s files

    Forum: Plugins
    In reply to: [WooCommerce] Hide Prices
    aimeevee

    (@aimeevee)

    the solution suggested in the first reply worked wonderfully…however the variable price still displays is there a way to block that as well?

Viewing 2 replies - 1 through 2 (of 2 total)