Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active November 6, 2017 02:11
Show Gist options
  • Save bhavik-kiri/d0331f1d9bcd1187b2991abaf571639b to your computer and use it in GitHub Desktop.
Save bhavik-kiri/d0331f1d9bcd1187b2991abaf571639b to your computer and use it in GitHub Desktop.
<?php
add_action( 'woocommerce_single_product_summary', 'gift_card_template', 60 );
function gift_card_template () {
global $product;
if ( 'gift_card' == $product->get_type() ) {
$template_path = plugin_dir_path( __FILE__ ) . 'templates/';
// Load the template
wc_get_template( 'single-product/add-to-cart/gift_card.php',
'',
'',
trailingslashit( $template_path ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment