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 | |
| //test email renew_reminder | |
| add_action( 'init', 'ywsbs_sendemail'); | |
| function ywsbs_sendemail(){ | |
| if( class_exists( 'YWSBS_Subscription') ) { | |
| $subscription = new YWSBS_Subscription( 361 ); | |
| do_action( 'ywsbs_customer_subscription_renew_reminder_mail', $subscription ); | |
| } | |
| } |
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('ywpar_get_product_point_round','ywpar_get_product_point_round', 10 ); | |
| function ywpar_get_product_point_round( $points ){ | |
| return floor( $points ); | |
| } |
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 | |
| /** | |
| * Leave only Paypal, if there is a product with subscription on cart | |
| */ | |
| function ywsbs_only_paypal_for_subscriptions( $gateways ) { | |
| if ( yith_added_product_as_subscription_on_cart() ) { | |
| foreach ( $gateways as $k => $gateway ) { | |
| if ( false === strpos( $gateway, 'WC_Gateway_Paypal' ) ) { |
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('ywpar_show_tab_to_shop_manager', 'ywpar_show_tab_to_shop_manager', 10, 2); | |
| function ywpar_show_tab_to_shop_manager( $shop_manager_tabs, $admin_tabs ) { | |
| if ( isset( $admin_tabs['roles'] ) ) { | |
| unset( $admin_tabs['roles'] ); | |
| } | |
| return $admin_tabs; | |
| } |
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('ywraq_exclusion_limit', 'ywraq_exclusion_limit'); | |
| function ywraq_exclusion_limit(){ | |
| return 500; | |
| } | |
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 | |
| if( class_exists('YITH_YWRAQ_Frontend') ){ | |
| add_action('template_redirect','ywraq_show_button_single_product_page'); | |
| function ywraq_show_button_single_product_page(){ | |
| remove_action( 'woocommerce_before_single_product', array( YITH_YWRAQ_Frontend(), 'show_button_single_page' ) ); | |
| add_action( 'woocommerce_single_product_summary', array( YITH_YWRAQ_Frontend(), 'show_button_single_page' ) ); | |
| } | |
| } |
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 | |
| if( defined('YITH_YWRAQ_PREMIUM') ){ | |
| add_filter( 'ywraq_pdf_logo', 'ywraq_change_pdf_logo' ); | |
| function ywraq_change_pdf_logo( $logo ) { | |
| $logo_id = get_option( 'ywraq_pdf_logo-yith-attachment-id' ); | |
| $logo = get_attached_file( $logo_id ); |
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 | |
| if ( defined( 'YITH_YWSBS_PREMIUM' ) ) { | |
| add_action( 'woocommerce_init', 'ywsbs_add_notice' ); | |
| function ywsbs_add_notice(){ | |
| if( is_user_logged_in()){ | |
| $current_user = wp_get_current_user(); | |
| $sbs = YITH_WC_Subscription()->get_user_subscriptions( $current_user->get('ID'), $status = 'active' ); | |
| foreach ( $sbs as $sub_id ){ | |
| $subscription = ywsbs_get_subscription( $sub_id ); |
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 ywpop_hide_popup(){ | |
| if ( ! class_exists( 'YITH_Popup_Frontend' ) ) { | |
| return; | |
| } | |
| $current_popup = YITH_Popup_Frontend()->get_current_popup(); |
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_action( 'template_redirect', 'ywpop_hide_popup', 9); | |
| function ywpop_hide_popup(){ | |
| if( is_product_category() ){ | |
| add_filter( 'enable_yit_popup', '__return_false'); | |
| } | |
| } | |
| add_action( 'template_redirect', 'ywpop_change_popup', 9); |