Skip to content

Instantly share code, notes, and snippets.

@marcelotorres
Created July 13, 2017 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelotorres/29f4f4f9551d17db7b12ff59d33ad56c to your computer and use it in GitHub Desktop.
Save marcelotorres/29f4f4f9551d17db7b12ff59d33ad56c to your computer and use it in GitHub Desktop.
WooCommerce - Customizar as opções de tipos de produtos
<?php
function custom_admin_product_option($options){
$options = array(
'virtual' => array(
'id' => '_virtual',
'wrapper_class' => 'show_if_simple',
'label' => __( 'Virtual', 'woocommerce' ),
'description' => __( 'Virtual products are intangible and aren\'t shipped.', 'woocommerce' ),
'default' => 'yes', //Alterado
),
'downloadable' => array(
'id' => '_downloadable',
'wrapper_class' => 'show_if_simple',
'label' => __( 'Downloadable', 'woocommerce' ),
'description' => __( 'Downloadable products give access to a file upon purchase.', 'woocommerce' ),
'default' => 'no',
)
);
return($options);
}
add_filter('product_type_options', 'custom_admin_product_option', 10, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment