';?>
get_image_id();
$wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_classes', array(
'woocommerce-product-gallery',
'woocommerce-product-gallery--' . ( $product->get_image_id() ? 'with-images' : 'without-images' ),
'woocommerce-product-gallery--columns-' . absint( $columns ),
'images',
) );
if ( function_exists( 'wc_get_gallery_image_html' ) ) {
?>
get_image_id() ) {
$html = wc_get_gallery_image_html( $thumbnail_id, true );
} else {
$html = '';
$html .= sprintf( '

', esc_url( wc_placeholder_img_src( 'woocommerce_single' ) ), esc_html__( 'Awaiting product image', 'woolentor' ) );
$html .= '
';
}
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $thumbnail_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$attachment_ids = $product->get_gallery_image_ids();
if ( $attachment_ids && $product->get_image_id() ) {
foreach ( $attachment_ids as $attachment_id ) {
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', wc_get_gallery_image_html( $attachment_id ), $attachment_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
?>
get_sku() || $product->is_type( 'variable' ) ) ) : ?>
get_sku() ) ? esc_html($sku) : esc_html__( 'N/A', 'woolentor' ); ?>
get_id(), ', ', '' . _n( 'Category:', 'Categories:', count( $product->get_category_ids() ), 'woolentor' ) . ' ', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_id(), ', ', '' . _n( 'Tag:', 'Tags:', count( $product->get_tag_ids() ), 'woolentor' ) . ' ', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_sku() || $product->is_type( 'variable' ) ) ) : ?>
get_sku() ) ? esc_html($sku) : esc_html__( 'N/A', 'woolentor' ); ?>
get_id() ) ) {
?>
get_tag_ids() ), 'woolentor' ), esc_html__('Tag:','woolentor'), esc_html__('Tags:','woolentor') ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_id(), ', ', '', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_id() ) ) {
?>
get_category_ids() ), 'woolentor' ), esc_html__('Category:','woolentor'), esc_html__('Categories:','woolentor') ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_id(), ', ', '', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
get_id() );
setup_postdata( $product->get_id() );
if( get_post_type() == 'elementor_library' || get_post_type() == 'woolentor-template' ){
add_filter( 'the_content', [ $this, 'product_content' ] );
}
add_filter( 'woocommerce_product_tabs', function( $tabs ){
$tabs = woocommerce_default_product_tabs();
if( isset( $tabs['reviews'] ) ) {
$tabs['reviews']['callback'] = [ $this, 'product_review_tab' ];
}
return $tabs;
}, 9999 );
ob_start();
echo '';
wc_get_template( 'single-product/tabs/tabs.php' );
echo '
';
return ob_get_clean();
case 'wl-product-data-tabs2':
// setup_postdata( $product->get_id() );
$post = get_post( $product->get_id() );
ob_start();
if( get_post_type() == 'elementor_library' ){
add_filter( 'the_content', [ $this, 'product_content' ] );
}
wc_get_template( 'single-product/tabs/tabs.php' );
return ob_get_clean();
case 'wl-single-product-reviews':
ob_start();
if( comments_open( self::$product_id ) ){
comments_template();
}
return ob_get_clean();
case 'wl-single-product-stock':
ob_start();
$availability = $product->get_availability();
if( !empty( $availability['availability'] ) ){
echo ''.wp_kses_post( $availability['availability'] ).'
';
}else{
echo ''.esc_html__('Stock availability does not exist this product.','woolentor').'
';
}
return ob_get_clean();
case 'wl-single-product-upsell':
ob_start();
$product_per_page = '-1';
$columns = 4;
$orderby = 'rand';
$order = 'desc';
if ( ! empty( $settings['columns'] ) ) {
$columns = $settings['columns'];
}
if ( ! empty( $settings['orderby'] ) ) {
$orderby = $settings['orderby'];
}
if ( ! empty( $settings['order'] ) ) {
$order = $settings['order'];
}
if( $product->get_upsell_ids() ){
woocommerce_upsell_display( $product_per_page, $columns, $orderby, $order );
}else{
echo ''.esc_html__('No upsell products are available.','woolentor').'
';
}
return ob_get_clean();
case 'wl-product-related':
ob_start();
$args = [
'posts_per_page' => 4,
'columns' => 4,
'orderby' => $settings['orderby'],
'order' => $settings['order'],
];
if ( ! empty( $settings['posts_per_page'] ) ) {
$args['posts_per_page'] = $settings['posts_per_page'];
}
if ( ! empty( $settings['columns'] ) ) {
$args['columns'] = $settings['columns'];
}
$args['related_products'] = array_filter( array_map( 'wc_get_product', wc_get_related_products( $product->get_id(),
$args['posts_per_page'], $product->get_upsell_ids() ) ), 'wc_products_array_filter_visible' );
$args['related_products'] = wc_products_array_orderby( $args['related_products'], $args['orderby'], $args['order'] );
if( wc_get_related_products( $product->get_id(), $args['posts_per_page'], $product->get_upsell_ids() ) ){
wc_get_template( 'single-product/related.php', $args );
}else{
echo ''.esc_html__('No related products are available.','woolentor').'
';
}
return ob_get_clean();
default:
return '';
}
}
}
/**
* [product_content]
* @param [string] $content
* @return [string]
*/
public function product_content( $content ){
$product_content = get_post( self::$product_id );
$content = $product_content->post_content;
return $content;
}
/**
* Product review tab empty content for elementor editor mode
*
* @return void
*/
public function product_review_tab(){
return null;
}
}
WooLentor_Default_Data::instance();