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 | |
| function woo_pr_disable_signup_earn_email_notification( $is_email_enable ){ | |
| $is_email_enable = false; | |
| return $is_email_enable; | |
| } | |
| add_filter('woo_pr_enable_signup_earn_email_notification', 'woo_pr_disable_signup_earn_email_notification',10,1); |
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 | |
| // add this code inside the functions.php file of your child theme | |
| function woo_pr_disable_vender_notification_email($enable){ | |
| $enable = false; // will not send the notification email to the venodr | |
| return $enable; | |
| } | |
| add_filter( 'woo_pr_disable_vender_notification_email', 'woo_pr_disable_vender_notification_email',10,1); |
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 | |
| global $current_user, $woo_vou_vendor_role; | |
| //Current user role | |
| $user_roles = isset( $current_user->roles ) ? $current_user->roles : array(); | |
| $user_role = array_shift( $user_roles ); | |
| if( in_array( $user_role, $woo_vou_vendor_role ) ) { // Check current user is voucher vendor role | |
| // perform your action | |
| } |
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
| // add below code to the functions.php of your child theme. | |
| add_filter('woocommerce_hold_stock_for_checkout', 'woo_vou_pdf_coupon_hold_stock_on_checkout'); | |
| /** | |
| * Disable the filter | |
| */ | |
| function woo_vou_pdf_coupon_hold_stock_on_checkout(){ | |
| return false; | |
| } |
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 | |
| add_filter('woocommerce_customer_get_downloadable_products','woo_vou_pdf_change_download_text_on_list'); | |
| function woo_vou_pdf_change_download_text_on_list( $downloads ){ | |
| if( !empty( $downloads ) ){ | |
| $vou_download_text = get_option( 'vou_download_text' ); | |
| $vou_download_text = !empty($vou_download_text) ? $vou_download_text : esc_html__( 'Voucher Download', 'woovoucher' ); | |
| foreach ( $downloads as $key => $download) { |
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 | |
| add_filter( 'woo_vou_pdf_template_replace_shortcodes', 'woo_vou_pdf_change_booking_date_shortcodes', 999, 6 ); | |
| function woo_vou_pdf_change_booking_date_shortcodes( $woo_vou_details, $orderid, $item_key, $items, $voucodes, $productid ){ | |
| // code to change booking date shortcode date format on voucher pdf | |
| if( isset( $woo_vou_details['booking_date'] ) && !empty( $woo_vou_details['booking_date'] ) ){ | |
| $woo_vou_details['booking_date'] = date( 'Y-M-D', strtotime( $woo_vou_details['booking_date'] ) ); | |
| } | |
| return $woo_vou_details; | |
| } |
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 | |
| // Code to display product quantity and product total after product information | |
| add_action('woo_vou_after_productinfo', 'woo_vou_add_extra_product_info', 10, 3 ); | |
| function woo_vou_add_extra_product_info( $voucodeid, $item_id, $order_id ){ | |
| //get order | |
| $order = wc_get_order( $order_id ); | |
| //get order items |
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 | |
| /** | |
| * Handles to hide product information from check voucher code page for frontend | |
| */ | |
| add_filter('woo_vou_check_vou_productinfo_fields', 'woo_vou_hide_product_info_fields'); | |
| function woo_vou_hide_product_info_fields( $product_info_columns ){ | |
| if( woo_vou_check_is_frontend_ajax() ){ | |
| if( isset( $product_info_columns['redeemable_price'] )){ |
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 | |
| /** | |
| * Adding order meta value to the Custom shortcode in PDF voucher | |
| */ | |
| function woo_vou_pdf_order_items_meta_shortcodes( $voucher_template_html, $orderid, $item_key, $items, $voucodes, $productid) { | |
| $hidden_order_itemmeta = apply_filters( 'woocommerce_hidden_order_itemmeta', array( | |
| '_qty', | |
| '_tax_class', | |
| '_product_id', |