D
D
DimDim77782019-08-23 23:16:10
WooCommerce
DimDim7778, 2019-08-23 23:16:10

How to make all products virtual and downloadable in Woocommerce by default?

Tell me, how to make the checkboxes by default active (so as not to tick each time) for virtual and downloadable products in Woocommerce when adding a product?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yeah, 2022-02-13
@DimDim7778

add_action( 'woocommerce_product_options_general_product_data', 'enable_virtual_option' );
function enable_virtual_option(){
?>
        <script>
            (function($){
                $('input[name=_virtual]').prop('checked', true);
    $('input[name=_downloadable]').prop('checked', true);
            })(jQuery);
        </script>
        <?php
}

P
PM, 2019-08-29
@jimmykoks

  1. Create a virtual/downloadable product
  2. Duplicate/clone created product
  3. Edit duplicate/cloned product

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question