get_value(get_the_ID(), '_product_video')){ ?> trim( $wc_cpdf->get_value( get_the_ID(), '_product_video' ) ), ) ); } // Custom Product Tabs function flatsome_custom_product_tabs( $tabs ) { global $wc_cpdf; // Product video Tab if($wc_cpdf->get_value(get_the_ID(), '_product_video_placement') == 'tab'){ $tabs['ux_video_tab'] = array( 'title' => __('Video','flatsome'), 'priority' => 10, 'callback' => 'flatsome_product_video_tab' ); } // Adds the new tab if($wc_cpdf->get_value(get_the_ID(), '_custom_tab_title')){ $tabs['ux_custom_tab'] = array( 'title' => $wc_cpdf->get_value(get_the_ID(), '_custom_tab_title'), 'priority' => 40, 'callback' => 'flatsome_custom_tab_content' ); } // Custom Global Section if(get_theme_mod('tab_title')){ $tabs['ux_global_tab'] = array( 'title' => get_theme_mod('tab_title'), 'priority' => 50, 'callback' => 'flatsome_global_tab_content' ); } // Move review tab to the last position //$tabs['reviews']['priority'] = 100; return $tabs; } add_filter( 'woocommerce_product_tabs', 'flatsome_custom_product_tabs' ); function flatsome_custom_tab_content() { // The new tab content global $wc_cpdf; echo do_shortcode($wc_cpdf->get_value(get_the_ID(), '_custom_tab')); } function flatsome_global_tab_content() { // The new tab content echo do_shortcode(get_theme_mod('tab_content')); } function flatsome_product_tabs_classes(){ $classes = array('nav','nav-uppercase'); $tab_style = get_theme_mod('product_display','tabs'); if($tab_style == 'tabs' || !$tab_style){ $classes[] = 'nav-line'; } else{ $tab_style = str_replace("tabs_","",$tab_style); if($tab_style == 'vertical') $classes[] = 'nav-line'; if($tab_style == 'normal') $classes[] = 'nav-tabs'; $classes[] = 'nav-'.$tab_style; } $align = get_theme_mod('product_tabs_align','left'); if($align){ $classes[] = 'nav-'.$align; } echo implode(' ', $classes); } // Add Custom HTML Blocks function flatsome_before_add_to_cart_html(){ echo do_shortcode(get_theme_mod('html_before_add_to_cart')); } add_action( 'woocommerce_single_product_summary', 'flatsome_before_add_to_cart_html', 20); // Add HTML after Add to Cart button function flatsome_after_add_to_cart_html(){ echo do_shortcode(get_theme_mod('html_after_add_to_cart')); } add_action( 'woocommerce_single_product_summary', 'flatsome_after_add_to_cart_html', 30); // Add Custom HTML to top of product page function flatsome_product_top_content(){ global $wc_cpdf; if($wc_cpdf->get_value(get_the_ID(), '_top_content')){ echo do_shortcode($wc_cpdf->get_value(get_the_ID(), '_top_content')); } } add_action('flatsome_before_product_page','flatsome_product_top_content', 10); // Add Custom HTML to bottom of product page function flatsome_product_bottom_content(){ global $wc_cpdf; if($wc_cpdf->get_value(get_the_ID(), '_bottom_content')){ echo do_shortcode($wc_cpdf->get_value(get_the_ID(), '_bottom_content')); } } add_action('flatsome_after_product_page','flatsome_product_bottom_content', 10); function flatsome_related_products_args( $args ) { $args['posts_per_page'] = get_theme_mod('max_related_products', 8); return $args; } add_filter( 'woocommerce_output_related_products_args', 'flatsome_related_products_args' ); function flatsome_sticky_add_to_cart_before() { global $product; if ( ! is_product() || ! get_theme_mod( 'product_sticky_cart', 0 ) || ! apply_filters( 'flatsome_sticky_add_to_cart_enabled', true, $product ) ) { return; } echo '
'; echo '
'; echo '
'; $image_id = $product->get_image_id(); $image = wp_get_attachment_image_src( $image_id, 'woocommerce_gallery_thumbnail' ); if ( $image ) { $image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true ); $image = '' . $image_alt . ''; echo $image; } echo '
' . get_the_title() . '
'; if ( ! $product->is_type( 'variable' ) ) { woocommerce_template_single_price(); } echo '
'; } add_action( 'woocommerce_before_add_to_cart_button', 'flatsome_sticky_add_to_cart_before', -100 ); function flatsome_sticky_add_to_cart_after() { global $product; if ( ! is_product() || ! get_theme_mod( 'product_sticky_cart', 0 ) || ! apply_filters( 'flatsome_sticky_add_to_cart_enabled', true, $product ) ) { return; } echo '
'; echo '
'; } add_action( 'woocommerce_after_add_to_cart_button', 'flatsome_sticky_add_to_cart_after', 100 );