Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active November 6, 2017 07:22
Show Gist options
  • Save bhavik-kiri/8193b3f48f3f1a23e49b85ced84e9edc to your computer and use it in GitHub Desktop.
Save bhavik-kiri/8193b3f48f3f1a23e49b85ced84e9edc to your computer and use it in GitHub Desktop.
<?php
add_action( 'woocommerce_product_data_panels', 'wcpt_gift_card_options_product_tab_content' );
function wcpt_gift_card_options_product_tab_content() {
// Dont forget to change the id in the div with your target of your product tab
?><div id='gift_card_options' class='panel woocommerce_options_panel'><?php
?><div class='options_group'><?php
woocommerce_wp_checkbox( array(
'id' => '_enable_gift_card',
'label' => __( 'Enable Gift Card Product', 'wcpt' ),
) );
woocommerce_wp_text_input( array(
'id' => '_gift_card_price',
'label' => __( 'Price', 'wcpt' ),
'placeholder' => '',
'desc_tip' => 'true',
'description' => __( 'Enter Gift Card Price.', 'wcpt' ),
));
?></div>
</div><?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment