'; } } } if ( ! function_exists( 'alpha_single_product_after_rating_end' ) ) { function alpha_single_product_after_rating_end() { global $alpha_layout; if ( empty( $alpha_layout['single_product_block'] ) ) { echo ''; } } } /** * Display sale countdown for simple & variable product in single product page. * * @since 1.0 * @param string $ends_label * @return void */ if ( ! function_exists( 'alpha_single_product_sale_countdown' ) ) { function alpha_single_product_sale_countdown( $ends_label = '' ) { global $product; if ( $product->is_on_sale() ) { $extra_class = ''; if ( $product->is_type( 'variable' ) ) { $variations = $product->get_available_variations( 'object' ); $date_diff = ''; $sale_date = ''; foreach ( $variations as $variation ) { if ( $variation->is_on_sale() ) { $new_date = get_post_meta( $variation->get_id(), '_sale_price_dates_to', true ); if ( ! $new_date || ( $date_diff && $date_diff != $new_date ) ) { $date_diff = false; } elseif ( $new_date ) { if ( false !== $date_diff ) { $date_diff = $new_date; } $sale_date = $new_date; } if ( false === $date_diff && $sale_date ) { break; } } } if ( $date_diff ) { $date_diff = date( 'Y/m/d H:i:s', (int) $date_diff ); } elseif ( $sale_date ) { $extra_class .= ' countdown-variations'; $date_diff = date( 'Y/m/d H:i:s', (int) $sale_date ); } } else { $date_diff = $product->get_date_on_sale_to(); if ( $date_diff ) { $date_diff = $date_diff->date( 'Y/m/d H:i:s' ); } } if ( $date_diff && defined( 'ALPHA_CORE_VERSION' ) ) { wp_enqueue_script( 'jquery-countdown' ); wp_enqueue_style( 'alpha-countdown', ALPHA_ASSETS . '/vendor/countdown/countdown' . ( is_rtl() ? '-rtl' : '' ) . '.min.css', array(), '6.7.0' ); wp_enqueue_script( 'alpha-countdown', ALPHA_ASSETS . '/vendor/countdown/countdown' . ALPHA_JS_SUFFIX, '6.7.0', true ); ?>
0, 00 : 00 : 00
(' . $GLOBALS['product']->get_review_count() . ')'; } // Global tab $title = alpha_get_option( 'product_tab_title' ); if ( $title ) { $tabs['alpha_product_tab'] = array( 'title' => sanitize_text_field( $title ), 'priority' => 24, 'callback' => 'alpha_wc_product_custom_tab', ); } if ( ! defined( 'ALPHA_PRO_VERSION' ) ) { return $tabs; } // Custom tab for current product $title = get_post_meta( get_the_ID(), 'alpha_custom_tab_title_1st', true ); if ( $title ) { $tabs['alpha_custom_tab_1st'] = array( 'title' => sanitize_text_field( $title ), 'priority' => 26, 'callback' => 'alpha_wc_product_custom_tab', ); } $title = get_post_meta( get_the_ID(), 'alpha_custom_tab_title_2nd', true ); if ( $title ) { $tabs['alpha_custom_tab_2nd'] = array( 'title' => sanitize_text_field( $title ), 'priority' => 26, 'callback' => 'alpha_wc_product_custom_tab', ); } return $tabs; } } /** * wc_product_custom_tab * * Render Woocommerce Custom Tab. * * @param string $key * @param string product_tab * * @since 1.0 */ if ( ! function_exists( 'alpha_wc_product_custom_tab' ) ) { function alpha_wc_product_custom_tab( $key, $product_tab ) { if ( ! defined( 'ALPHA_PRO_VERSION' ) ) { return; } wc_get_template( 'single-product/tabs/custom_tab.php', array( 'tab_name' => $key, 'tab_data' => $product_tab, ) ); } }