I have a bit trouble with woocomerce checkbox, i add custom checkbox to product page wit this code:
woocommerce_wp_textarea_input(
array(
'id' => '_textarea',
'label' => __( 'My Textarea', 'woocommerce' ),
'placeholder' => '',
'description' => __( 'Enter the custom value here.', 'woocommerce' )
));
then save value with this:
$woocommerce_checkbox = isset( $_POST['_checkbox'] ) ? 'yes' : 'no';
update_post_meta( $post_id, '_checkbox', $woocommerce_checkbox );
Now i tried to write function which make my stock status hiden when this checkbox is checked but i fail , can i ask you guys for some support ?
Aucun commentaire:
Enregistrer un commentaire