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
| (function($){$(function(){ | |
| function jetCW_customizations(){ | |
| var loading = false; | |
| $(document).on('jet-cw-load', function(e, btn, product_id, action){ | |
| if( loading ) return; | |
| loading = true; | |
| product_id = product_id.toString(); |
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_action( 'elementor/editor/after_save', function( $post_id, $editor_data ){ | |
| if( $post_id == 53 ) { | |
| // footer - auto clear cache - fix for elementor responsive styles reverting on template update | |
| Elementor\Plugin::$instance->files_manager->clear_cache(); | |
| } | |
| }, 10, 2 ); |
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
| function ff_user_purchased_product( $user_id, $search_product_id ) { | |
| $args = [ | |
| 'customer' => $user_id, | |
| 'status' => [ 'wc-processing', 'wc-completed' ], | |
| ]; | |
| $orders = wc_get_orders( $args ); | |
| foreach( $orders as $order ) { | |
| foreach( $order->get_items() as $item_id => $item ) { | |
| $product_id = $item->get_product_id(); | |
| if( $product_id == $search_product_id ) return 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
| function ff_product_already_added( $product_id ) { | |
| $cart = WC()->cart->get_cart(); | |
| if( !count( $cart ) ) return false; | |
| foreach( $cart as $item ) { | |
| if( $product_id == $item['product_id'] ) { | |
| return true; | |
| } | |
| } | |
| 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
| (function($){$(function(){ | |
| function FF_User_Details(){ | |
| this.input_field_keys = [ | |
| 'field_first_name', | |
| 'field_last_name', | |
| 'field_email', | |
| 'field_phone', | |
| 'field_where_build', |
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
| function custom_typing_animation(){ | |
| var els = $('.custom-typing-animation'); | |
| if( !els.length ) return; | |
| els.each(function(){ | |
| wrap_letters($(this).find('.elementor-heading-title')); | |
| this.typing_observer = new MutationObserver( function(mutationList, observer) { | |
| mutationList.forEach(function(item){ | |
| if( item.attributeName !== 'class' ) return; | |
| if( !item.target.classList.contains('animated') ) return; |
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_action( 'after_setup_theme', function(){ | |
| $GLOBALS['after_setup_theme_time_start'] = microtime(true); | |
| }); | |
| add_action( 'wp_loaded', function(){ | |
| $time_end = microtime(true); | |
| pre_debug( 'time start = '. $GLOBALS['after_setup_theme_time_start'] ); | |
| pre_debug( 'time end = '. $time_end ); | |
| pre_debug( 'wp_loaded = '. ($time_end - $GLOBALS['after_setup_theme_time_start']) ); |
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 | |
| $posts_per_page = 12; | |
| $args = [ | |
| 'post_type' => 'product', | |
| 'showposts' => $posts_per_page, | |
| 'fields' => 'ids', | |
| 'no_found_rows' => true, | |
| ]; | |
| if( isset($_GET['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
| function get_term_parent_slug( $term_id, $taxonomy, $parents ) { | |
| $term = get_term_by('id', $term_id, $taxonomy ); | |
| $parents[] = $term->slug; | |
| if( $term->parent ) { | |
| // have another parent - recursion | |
| return get_term_parent_slug( $term->parent, $taxonomy, $parents ); | |
| } else { | |
| return $parents; | |
| } | |
| } |
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
| function ff_search_use_standard_query_with_priority( $data, $query_args ){ | |
| $query_args['no_found_rows'] = true; | |
| $query_args['fields'] = 'ids'; | |
| $q = get_posts( $query_args ); | |
| if( !$q ) return false; | |
| $s = $query_args['s']; | |
| $data['total_count'] = count( $q ); |