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( ! function_exists('YITH_WC_Points_Rewards') ){ | |
| add_filter('ywpar_hide_messages', 'ywpar_hide_messages' ); | |
| function ywpar_hide_messages( $result ){ | |
| if ( ! YITH_WC_Points_Rewards()->is_user_enabled( ) ) { | |
| $result = true; | |
| } |
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 | |
| /** | |
| * Moves the message in the single product page | |
| * is necessary add <div class="col"><?php do_action( 'ywcm_show_message' ); ?></div> inside the | |
| * file /wp-content/themes/flatsome/woocommerce/single-product/layouts/product.php of flatsome | |
| * */ | |
| if ( defined( 'YITH_YWCM_PREMIUM' ) ) { | |
| add_action( 'template_redirect', 'ywcart_message_single_product' ); | |
| function ywcart_message_single_product() { | |
| global $YWCM_Instance; |
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('yith_ywraq_email_after_raq_table','yith_ywraq_email_after_raq_table'); | |
| function yith_ywraq_email_after_raq_table( $order ){ | |
| $af4 = yit_get_prop( $order, 'ywraq_other_email_fields', true ); | |
| if( ! empty( $af4 ) ){ | |
| foreach ( $af4 as $key => $value ) { ?> | |
| <div> | |
| <span><strong><?php echo $key; ?>: </strong></span> | |
| <span><?php echo $value ?></span> |
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( wp_is_mobile() ){ | |
| add_action( 'wp_enqueue_scripts', 'dequeue_script', 11 ); | |
| function dequeue_script(){ | |
| wp_dequeue_script( 'yith_wcas_jquery-autocomplete' ); | |
| wp_dequeue_script( 'yith_autocomplete' ); | |
| } | |
| } |
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
| $( document ).on( 'click', '.yith-wcbk-copy-to-clipboard', function ( event ) { | |
| var target = $( this ), | |
| selector_to_copy = target.data( 'selector-to-copy' ), | |
| obj_to_copy = $( selector_to_copy ); | |
| if ( obj_to_copy.length > 0 ) { | |
| var temp = $( "<input>" ); | |
| $( 'body' ).append( temp ); | |
| temp.val( obj_to_copy.html() ).select(); |
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_WC_Subscription' ) ) { | |
| add_filter( 'woocommerce_can_reduce_order_stock', 'ywsbs_woocommerce_can_reduce_order_stock', 10, 2 ); | |
| function ywsbs_woocommerce_can_reduce_order_stock( $result, $order ) { | |
| $is_a_renew = yit_get_prop( $order, 'is_a_renew' ); | |
| return ( $is_a_renew == 'yes' ) ? false : $result; | |
| } |
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_order_metabox', 'ywraq_override_shipping_off' ); | |
| function ywraq_override_shipping_off( $fields ) { | |
| if ( isset( $fields['ywraq_disable_shipping_method'] ) ) { | |
| $fields['ywraq_disable_shipping_method']['std'] = 'no'; |
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 | |
| //Hide add to cart in the loop | |
| add_action('init', 'ywraq_woocommerce_after_shop_loop_item', 0 ); | |
| function ywraq_woocommerce_after_shop_loop_item(){ | |
| global $avada_woocommerce; | |
| remove_action( 'woocommerce_after_shop_loop_item', array( $avada_woocommerce, 'avada_woocommerce_template_loop_add_to_cart' ), 10 ); | |
| } |
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('yith_wcas_search_with_like', '__return_true'); | |
| add_filter( 'yith_wcas_search_string_manipulation', 'my_yith_wcas_search_string_manipulation' ); | |
| function my_yith_wcas_search_string_manipulation( $string ) { | |
| $string = str_replace( '$', '%', trim( $string ) ); | |
| $string = str_replace( '.', '%', trim( $string ) ); |
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('ywrac_coupon_args','ywrac_coupon_args'); | |
| function ywrac_coupon_args( $args ){ | |
| $product_on_sale = wc_get_product_ids_on_sale(); | |
| if( is_array( $product_on_sale) && !empty( $product_on_sale ) ){ | |
| $args['exclude_product_ids'] = implode( ',', $product_on_sale ); | |
| } |