Support » Plugin: WooCommerce » Can I set a product as "not for sale"?

Viewing 9 replies - 1 through 9 (of 9 total)
  • they have an extension that transform woocommerce into a “catalog”
    http://www.woothemes.com/products/catalog-visibility-options/

    I don’t know if that works on a product by product basis.

    leave the price field blank and then it will only be for display without an add to cart button.

    Here’s an example.

    That solution doesn’t work for me.
    I have variable products with colour swatches and all the prices left blank, but when selecting one of the colours, the add to cart div does show up.

    link to the site in question?

    The site is still under construction so can’t give you access.
    I’m using the WooCommerce Color and Image Swatches extension and I noticed that it uses it’s own single-product/variable.php template so maybe that’s way your solution isn’t working?
    Thanks!

    yeah empty price should also work, but i see in the default single-product/add-to-cart/variable.php template that there is no check for whether an item is_purchasable or not…. unlike with simple products.

    you could override the template with your theme and then wrap the

    <div class="single_variation_wrap" style="display:none;"> complete div with some conditional logic like so:

    <?php if ( $product->is_purchasable() ) { ?>
    
    	<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 } ?>

    Thanks for your suggestion!

    However the WooCommerce Color and Image Swatches extension uses it’s own template variable.php located in: plugins/woocommerce-variation-swatches-and-photos/templates/single-product/variable.php

    I tried copying this folder into my theme folder just like the woocommerce templates, but that doesn’t work. It seems I can’t override this template with my own theme and I don’t really want to modify the core files of the plugin itself…

    Any thoughts on this?
    Thanks!

    so you copied /single-product/variable.php into your /woocommerce folder? that should work if the plugin is using woocommerce_get_template to get the template in the first place…. which I can’t know without looking at their code. As an alternative you could unhook the function that is calling their template and then add your via a hook.

    look at how the plugin hijacks the template files, and hijack them back to your theme. I’m sure you can do it fairly easily just by adding and removing action hooks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can I set a product as "not for sale"?’ is closed to new replies.