Created
August 25, 2025 07:44
-
-
Save webtoffee-git/87dfe90642b10de1566cd410e83b1b80 to your computer and use it in GitHub Desktop.
Compatibility issue with Gift Card templates on Product page - By WebToffee (WebToffee WooCommerce Gift Cards free version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php //do not copy this line of code | |
| add_action('woocommerce_before_single_product', function(){ | |
| if(function_exists('is_product') && is_product() && class_exists('Wbte_Gc_Gift_Card_Free_Common')) | |
| { | |
| global $product; | |
| if(!empty($product) | |
| && method_exists('Wbte_Gc_Gift_Card_Free_Common', 'is_gift_card_product') | |
| && method_exists('Wbte_Gc_Gift_Card_Free_Common', 'is_templates_enabled') | |
| && Wbte_Gc_Gift_Card_Free_Common::is_gift_card_product($product->get_id()) | |
| && Wbte_Gc_Gift_Card_Free_Common::is_templates_enabled($product->get_id()) | |
| ) { | |
| do_action( 'woocommerce_before_single_product_summary' ); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment