first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
/**
* Gallery Anchor Nav Controller template
*/
?>
<ul class="jet-woo-product-gallery-anchor-nav-controller">
<?php
foreach ( $anchor_nav_controller_ids as $anchor_nav_controller_id ) {
printf(
'<li class="controller-item"><a href="#%s" data-index="%s"><span class="controller-item__bullet"></span></a></li>',
$anchor_nav_controller_id,
$anchor_nav_controller_id
);
}
?>
<?php
if ( 'popup' === $settings['video_display_in'] && $this->product_has_video() ) {
echo '<li class="controller-item">';
include $this->__get_global_template( 'popup-video' );
echo '</li>';
}
?>
</ul>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Product gallery main image template
*/
$props = wc_get_product_attachment_props( get_post_thumbnail_id( $product_id ), $post );
$image = get_the_post_thumbnail( $product_id, $images_size, array(
'title' => $props['title'],
'alt' => $props['alt'],
'data-caption' => $props['caption'],
'data-src' => $props['src'],
'data-large_image' => $props['full_src'],
'data-large_image_width' => $props['full_src_w'],
'data-large_image_height' => $props['full_src_h'],
'class' => 'wp-post-image',
) );
$this->add_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->add_render_attribute( 'image_link', 'href', esc_url( $props['url'] ) );
$this->add_render_attribute( 'image_link', 'itemprop', 'image' );
$this->add_render_attribute( 'image_link', 'title', esc_attr( $props['caption'] ) );
$this->add_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item featured" id="<?php echo $anchor_nav_controller_ids[0] ?>">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<?php
/**
* Gallery template
*/
$product_id = $_product->get_id();
$attachment_ids = $_product->get_gallery_image_ids();
$images_size = $settings['image_size'];
$enable_gallery = filter_var( $settings['enable_gallery'], FILTER_VALIDATE_BOOLEAN );
$zoom = 'yes' === $settings['enable_zoom'] ? 'jet-woo-product-gallery__image--with-zoom' : '';
$gallery = '[jet-woo-product-gallery]';
$anchor_nav_controller_ids = array( $this->get_unique_controller_id() );
$video_thumbnail_url = $this->__get_video_thumbnail_url();
$video_type = jet_woo_gallery_video_integration()->get_video_type();
$video = $this->__get_video_html();
?>
<div class="jet-woo-product-gallery-anchor-nav">
<div class="jet-woo-product-gallery-anchor-nav-items">
<?php
if ( has_post_thumbnail( $product_id ) ) {
include $this->__get_global_template( 'image' );
} else {
printf(
'<div class="jet-woo-product-gallery__image-item featured no-image" id="%s"><div class="jet-woo-product-gallery__image image-with-placeholder"><img src="%s" alt="%s" /></div></div>',
$anchor_nav_controller_ids[0],
wc_placeholder_img_src(),
__( 'Placeholder', 'jet-woo-product-gallery' )
);
}
if ( $attachment_ids ) {
foreach ( $attachment_ids as $attachment_id ) {
include $this->__get_global_template( 'thumbnails' );
}
}
if ( 'content' === $settings['video_display_in'] && $this->product_has_video() ) {
include $this->__get_global_template( 'video' );
array_push( $anchor_nav_controller_ids, $anchor_nav_controller_id );
}
?>
</div>
<?php include $this->__get_global_template( 'controller' ); ?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
/**
* Product Gallery popup video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_popup_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_popup_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_popup_overlay', 'class', 'jet-woo-product-video__popup-overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_popup_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
$this->add_render_attribute( 'popup_button', 'class', 'jet-woo-product-video__popup-button' );
$this->add_render_attribute( 'popup_button', 'role', 'button' );
$popup_button_html = '<div ' . $this->get_render_attribute_string( 'popup_button' ) . '>';
$popup_button_html .= sprintf(
'<i class="jet-woo-product-video__popup-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['popup-button-icon'] )
);
$popup_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Open popup with video', 'jet-woo-product-gallery' )
);
$popup_button_html .= '</div>';
?>
<div class="jet-woo-product-video__popup-wrapper">
<?php echo $popup_button_html ?>
<div class="jet-woo-product-video__popup-content">
<div class="jet-woo-product-video__popup-overlay"></div>
<div class="jet-woo-product-video__popup">
<div <?php $this->print_render_attribute_string( 'video_popup_wrapper' ); ?>><?php echo $video ?></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<?php
/**
* Product Gallery thumbnails template
*/
$anchor_nav_controller_id = $this->get_unique_controller_id();
$image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$image = wp_get_attachment_image( $attachment_id, $images_size, false, array(
'title' => get_post_field( 'post_title', $attachment_id ),
'data-caption' => get_post_field( 'post_excerpt', $attachment_id ),
'data-src' => $image_src[0],
'data-large_image' => $image_src[0],
'data-large_image_width' => $image_src[1],
'data-large_image_height' => $image_src[2],
) );
array_push( $anchor_nav_controller_ids, $anchor_nav_controller_id );
$this->set_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->set_render_attribute( 'image_link', 'href', esc_url( $image_src[0] ) );
$this->set_render_attribute( 'image_link', 'itemprop', 'image' );
$this->set_render_attribute( 'image_link', 'title', get_post_field( 'post_title', $attachment_id ) );
$this->set_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item" id="<?php echo $anchor_nav_controller_id ?>">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,70 @@
<?php
/**
* Product Gallery video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$anchor_nav_controller_id = $this->get_unique_controller_id();
$this->add_render_attribute( 'video_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_overlay', 'class', 'jet-woo-product-video__overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
if ( filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
$this->add_render_attribute( 'play_button', 'class', 'jet-woo-product-video__play-button' );
$this->add_render_attribute( 'play_button', 'role', 'button' );
$play_button_html = '<div ' . $this->get_render_attribute_string( 'play_button' ) . '>';
switch ( $settings['play_button_type'] ) {
case 'icon' :
$play_button_html .= sprintf(
'<i class="jet-woo-product-video__play-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['play_button_icon'] )
);
break;
case 'image':
$play_button_html .= jet_woo_product_gallery_tools()->get_image_by_url(
$settings['play_button_image']['url'],
array(
'class' => 'jet-woo-product-video__play-button-image',
'alt' => esc_html__( 'Play Video', 'jet-woo-product-gallery' ),
)
);
}
$play_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Play Video', 'jet-woo-product-gallery' )
);
$play_button_html .= '</div>';
}
?>
<div class="jet-woo-product-gallery__image-item" id="<?php echo $anchor_nav_controller_id ?>">
<div class="jet-woo-product-gallery__image jet-woo-product-gallery--with-video">
<div <?php $this->print_render_attribute_string( 'video_wrapper' ); ?>><?php echo $video ?></div>
<div <?php $this->print_render_attribute_string( 'video_overlay' ); ?>><?php echo $play_button_html ?></div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Product gallery main image template
*/
$props = wc_get_product_attachment_props( get_post_thumbnail_id( $product_id ), $post );
$image = get_the_post_thumbnail( $product_id, $images_size, array(
'title' => $props['title'],
'alt' => $props['alt'],
'data-caption' => $props['caption'],
'data-src' => $props['src'],
'data-large_image' => $props['full_src'],
'data-large_image_width' => $props['full_src_w'],
'data-large_image_height' => $props['full_src_h'],
'class' => 'wp-post-image',
) );
$this->add_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->add_render_attribute( 'image_link', 'href', esc_url( $props['url'] ) );
$this->add_render_attribute( 'image_link', 'itemprop', 'image' );
$this->add_render_attribute( 'image_link', 'title', esc_attr( $props['caption'] ) );
$this->add_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item featured <?php echo implode( ' ', $column_classes ); ?>">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,56 @@
<?php
/**
* Gallery template
*/
$product_id = $_product->get_id();
$attachment_ids = $_product->get_gallery_image_ids();
$images_size = $settings['image_size'];
$enable_gallery = filter_var( $settings['enable_gallery'], FILTER_VALIDATE_BOOLEAN );
$zoom = 'yes' === $settings['enable_zoom'] ? 'jet-woo-product-gallery__image--with-zoom' : '';
$gallery = '[jet-woo-product-gallery]';
$video_thumbnail_url = $this->__get_video_thumbnail_url();
$video_type = jet_woo_gallery_video_integration()->get_video_type();
$video = $this->__get_video_html();
$column_classes = array(
jet_woo_product_gallery_tools()->col_classes( array(
'desk' => $settings['columns'],
'tab' => $settings['columns_tablet'],
'mob' => $settings['columns_mobile'],
) )
);
?>
<div class="jet-woo-product-gallery__content">
<div class="jet-woo-product-gallery-grid col-row">
<?php
if ( has_post_thumbnail( $product_id ) ) {
include $this->__get_global_template( 'image' );
} else {
printf(
'<div class="jet-woo-product-gallery__image-item featured no-image %s"><div class="jet-woo-product-gallery__image image-with-placeholder"><img src="%s" alt="%s" /></div></div>',
implode( ' ', $column_classes ),
wc_placeholder_img_src(),
__( 'Placeholder', 'jet-woo-product-gallery' )
);
}
if ( $attachment_ids ) {
foreach ( $attachment_ids as $attachment_id ) {
include $this->__get_global_template( 'thumbnails' );
}
}
if ( 'content' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'video' );
}
?>
</div>
<?php
if ( 'popup' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'popup-video' );
}
?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
/**
* Product Gallery popup video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_popup_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_popup_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_popup_overlay', 'class', 'jet-woo-product-video__popup-overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_popup_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
$this->add_render_attribute( 'popup_button', 'class', 'jet-woo-product-video__popup-button' );
$this->add_render_attribute( 'popup_button', 'role', 'button' );
$popup_button_html = '<div ' . $this->get_render_attribute_string( 'popup_button' ) . '>';
$popup_button_html .= sprintf(
'<i class="jet-woo-product-video__popup-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['popup-button-icon'] )
);
$popup_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Open popup with video', 'jet-woo-product-gallery' )
);
$popup_button_html .= '</div>';
?>
<div class="jet-woo-product-video__popup-wrapper">
<?php echo $popup_button_html ?>
<div class="jet-woo-product-video__popup-content">
<div class="jet-woo-product-video__popup-overlay"></div>
<div class="jet-woo-product-video__popup">
<div <?php $this->print_render_attribute_string( 'video_popup_wrapper' ); ?>><?php echo $video ?></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Product Gallery thumbnails template
*/
$image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$image = wp_get_attachment_image( $attachment_id, $images_size, false, array(
'title' => get_post_field( 'post_title', $attachment_id ),
'data-caption' => get_post_field( 'post_excerpt', $attachment_id ),
'data-src' => $image_src[0],
'data-large_image' => $image_src[0],
'data-large_image_width' => $image_src[1],
'data-large_image_height' => $image_src[2],
) );
$this->set_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->set_render_attribute( 'image_link', 'href', esc_url( $image_src[0] ) );
$this->set_render_attribute( 'image_link', 'itemprop', 'image' );
$this->set_render_attribute( 'image_link', 'title', get_post_field( 'post_title', $attachment_id ) );
$this->set_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item <?php echo implode( ' ', $column_classes ); ?>">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,68 @@
<?php
/**
* Product Gallery video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_overlay', 'class', 'jet-woo-product-video__overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
if ( filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
$this->add_render_attribute( 'play_button', 'class', 'jet-woo-product-video__play-button' );
$this->add_render_attribute( 'play_button', 'role', 'button' );
$play_button_html = '<div ' . $this->get_render_attribute_string( 'play_button' ) . '>';
switch ( $settings['play_button_type'] ) {
case 'icon' :
$play_button_html .= sprintf(
'<i class="jet-woo-product-video__play-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['play_button_icon'] )
);
break;
case 'image':
$play_button_html .= jet_woo_product_gallery_tools()->get_image_by_url(
$settings['play_button_image']['url'],
array(
'class' => 'jet-woo-product-video__play-button-image',
'alt' => esc_html__( 'Play Video', 'jet-woo-product-gallery' ),
)
);
}
$play_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Play Video', 'jet-woo-product-gallery' )
);
$play_button_html .= '</div>';
}
?>
<div class="jet-woo-product-gallery__image-item <?php echo implode( ' ', $column_classes ); ?>">
<div class="jet-woo-product-gallery__image jet-woo-product-gallery--with-video">
<div <?php $this->print_render_attribute_string( 'video_wrapper' ); ?>><?php echo $video ?></div>
<div <?php $this->print_render_attribute_string( 'video_overlay' ); ?>><?php echo $play_button_html ?></div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Product gallery main image template
*/
$props = wc_get_product_attachment_props( get_post_thumbnail_id( $product_id ), $post );
$image = get_the_post_thumbnail( $product_id, $images_size, array(
'title' => $props['title'],
'alt' => $props['alt'],
'data-caption' => $props['caption'],
'data-src' => $props['src'],
'data-large_image' => $props['full_src'],
'data-large_image_width' => $props['full_src_w'],
'data-large_image_height' => $props['full_src_h'],
'class' => 'wp-post-image',
) );
$this->add_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->add_render_attribute( 'image_link', 'href', esc_url( $props['url'] ) );
$this->add_render_attribute( 'image_link', 'itemprop', 'image' );
$this->add_render_attribute( 'image_link', 'title', esc_attr( $props['caption'] ) );
$this->add_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item featured">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,48 @@
<?php
/**
* Gallery template
*/
$product_id = $_product->get_id();
$attachment_ids = $_product->get_gallery_image_ids();
$images_size = $settings['image_size'];
$enable_gallery = filter_var( $settings['enable_gallery'], FILTER_VALIDATE_BOOLEAN );
$zoom = 'yes' === $settings['enable_zoom'] ? 'jet-woo-product-gallery__image--with-zoom' : '';
$gallery = '[jet-woo-product-gallery]';
$video_thumbnail_url = $this->__get_video_thumbnail_url();
$video_type = jet_woo_gallery_video_integration()->get_video_type();
$video = $this->__get_video_html();
?>
<div class="jet-woo-product-gallery__content">
<div class="jet-woo-product-gallery-modern">
<?php
if ( has_post_thumbnail( $product_id ) ) {
include $this->__get_global_template( 'image' );
} else {
printf(
'<div class="jet-woo-product-gallery__image-item featured no-image %s"><div class="jet-woo-product-gallery__image image-with-placeholder"><img src="%s" alt="%s" /></div></div>',
implode( ' ', $column_classes ),
wc_placeholder_img_src(),
__( 'Placeholder', 'jet-woo-product-gallery' )
);
}
if ( $attachment_ids ) {
foreach ( $attachment_ids as $attachment_id ) {
include $this->__get_global_template( 'thumbnails' );
}
}
if ( 'content' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'video' );
}
?>
</div>
<?php
if ( 'popup' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'popup-video' );
}
?>
</div>

View File

@@ -0,0 +1,56 @@
<?php
/**
* Product Gallery popup video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_popup_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_popup_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_popup_overlay', 'class', 'jet-woo-product-video__popup-overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_popup_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
$this->add_render_attribute( 'popup_button', 'class', 'jet-woo-product-video__popup-button' );
$this->add_render_attribute( 'popup_button', 'role', 'button' );
$popup_button_html = '<div ' . $this->get_render_attribute_string( 'popup_button' ) . '>';
$popup_button_html .= sprintf(
'<i class="jet-woo-product-video__popup-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['popup-button-icon'] )
);
$popup_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Open popup with video', 'jet-woo-product-gallery' )
);
$popup_button_html .= '</div>';
?>
<div class="jet-woo-product-video__popup-wrapper">
<?php echo $popup_button_html ?>
<div class="jet-woo-product-video__popup-content">
<div class="jet-woo-product-video__popup-overlay"></div>
<div class="jet-woo-product-video__popup">
<div <?php $this->print_render_attribute_string( 'video_popup_wrapper' ); ?>><?php echo $video ?></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Product Gallery thumbnails template
*/
$image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$image = wp_get_attachment_image( $attachment_id, $images_size, false, array(
'title' => get_post_field( 'post_title', $attachment_id ),
'data-caption' => get_post_field( 'post_excerpt', $attachment_id ),
'data-src' => $image_src[0],
'data-large_image' => $image_src[0],
'data-large_image_width' => $image_src[1],
'data-large_image_height' => $image_src[2],
) );
$this->set_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->set_render_attribute( 'image_link', 'href', esc_url( $image_src[0] ) );
$this->set_render_attribute( 'image_link', 'itemprop', 'image' );
$this->set_render_attribute( 'image_link', 'title', get_post_field( 'post_title', $attachment_id ) );
$this->set_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,68 @@
<?php
/**
* Product Gallery video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_overlay', 'class', 'jet-woo-product-video__overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
if ( filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
$this->add_render_attribute( 'play_button', 'class', 'jet-woo-product-video__play-button' );
$this->add_render_attribute( 'play_button', 'role', 'button' );
$play_button_html = '<div ' . $this->get_render_attribute_string( 'play_button' ) . '>';
switch ( $settings['play_button_type'] ) {
case 'icon' :
$play_button_html .= sprintf(
'<i class="jet-woo-product-video__play-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['play_button_icon'] )
);
break;
case 'image':
$play_button_html .= jet_woo_product_gallery_tools()->get_image_by_url(
$settings['play_button_image']['url'],
array(
'class' => 'jet-woo-product-video__play-button-image',
'alt' => esc_html__( 'Play Video', 'jet-woo-product-gallery' ),
)
);
}
$play_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Play Video', 'jet-woo-product-gallery' )
);
$play_button_html .= '</div>';
}
?>
<div class="jet-woo-product-gallery__image-item">
<div class="jet-woo-product-gallery__image jet-woo-product-gallery--with-video">
<div <?php $this->print_render_attribute_string( 'video_wrapper' ); ?>><?php echo $video ?></div>
<div <?php $this->print_render_attribute_string( 'video_overlay' ); ?>><?php echo $play_button_html ?></div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<?php
/**
* Product gallery main image template
*/
$props = wc_get_product_attachment_props( get_post_thumbnail_id( $product_id ), $post );
$image = get_the_post_thumbnail( $product_id, $images_size, array(
'title' => $props['title'],
'alt' => $props['alt'],
'data-caption' => $props['caption'],
'data-src' => $props['src'],
'data-large_image' => $props['full_src'],
'data-large_image_width' => $props['full_src_w'],
'data-large_image_height' => $props['full_src_h'],
'class' => 'wp-post-image',
) );
$this->add_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->add_render_attribute( 'image_link', 'href', esc_url( $props['url'] ) );
$this->add_render_attribute( 'image_link', 'itemprop', 'image' );
$this->add_render_attribute( 'image_link', 'title', esc_attr( $props['caption'] ) );
$this->add_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item featured">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,81 @@
<?php
/**
* Gallery template
*/
$product_id = $_product->get_id();
$attachment_ids = $_product->get_gallery_image_ids();
$images_size = $settings['image_size'];
$enable_gallery = filter_var( $settings['enable_gallery'], FILTER_VALIDATE_BOOLEAN );
$zoom = filter_var( $settings['enable_zoom'], FILTER_VALIDATE_BOOLEAN ) ? 'jet-woo-product-gallery__image--with-zoom' : '';
$gallery = '[jet-woo-product-gallery]';
$video_type = jet_woo_gallery_video_integration()->get_video_type();
$video_thumbnail_url = $this->__get_video_thumbnail_url();
$video = $this->__get_video_html();
$thumbnail_column_classes = array(
jet_woo_product_gallery_tools()->col_classes( array(
'desk' => $settings['pagination_thumbnails_columns'],
'tab' => $settings['pagination_thumbnails_columns_tablet'],
'mob' => $settings['pagination_thumbnails_columns_mobile'],
) )
);
$this->set_render_attribute(
'slick_slider_wrapper',
'class',
array(
'jet-woo-slick__wrapper',
'jet-woo-slick-type-' . $settings['slider_pagination_type'],
'jet-woo-slick-direction-' . $settings['slider_pagination_direction'],
'jet-woo-slick-v-pos-' . $settings['slider_pagination_v_position'],
'jet-woo-slick-h-pos-' . $settings['slider_pagination_h_position']
)
);
$this->set_render_attribute(
'slick_slider',
'class',
array(
'jet-woo-product-gallery-slider',
'jet-woo-slick',
)
);
?>
<div <?php $this->print_render_attribute_string( 'slick_slider_wrapper' ); ?>>
<div <?php $this->print_render_attribute_string( 'slick_slider' ); ?> <?php echo $this->get_slider_data_settings(); ?>>
<?php
if ( has_post_thumbnail( $product_id ) ) {
include $this->__get_global_template( 'image' );
} else {
printf(
'<div class="jet-woo-product-gallery__image-item featured no-image"><div class="jet-woo-product-gallery__image image-with-placeholder"><img src="%s" alt="%s" /></div></div>',
wc_placeholder_img_src(),
__( 'Placeholder', 'jet-woo-product-gallery' )
);
}
if ( $attachment_ids ) {
foreach ( $attachment_ids as $attachment_id ) {
include $this->__get_global_template( 'thumbnails' );
}
}
if ( 'content' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'video' );
}
?>
</div>
<?php
if ( 'thumbnails' === $settings['slider_pagination_type'] && 'yes' === $settings['slider_show_pagination'] ) {
include $this->__get_global_template( 'thumbnails-pagination' );
}
?>
</div>
<?php
if ( 'popup' === $settings['video_display_in'] ) {
include $this->__get_global_template( 'popup-video' );
}
?>

View File

@@ -0,0 +1,57 @@
<?php
/**
* Product Gallery popup video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_popup_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_popup_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_popup_overlay', 'class', 'jet-woo-product-video__popup-overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_popup_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
$this->add_render_attribute( 'popup_button', 'class', 'jet-woo-product-video__popup-button' );
$this->add_render_attribute( 'popup_button', 'role', 'button' );
$popup_button_html = '<div ' . $this->get_render_attribute_string( 'popup_button' ) . '>';
$popup_button_html .= sprintf(
'<i class="jet-woo-product-video__popup-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['popup-button-icon'] )
);
$popup_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Open popup with video', 'jet-woo-product-gallery' )
);
$popup_button_html .= '</div>';
?>
<div class="jet-woo-product-video__popup-wrapper">
<?php echo $popup_button_html ?>
<div class="jet-woo-product-video__popup-content">
<div class="jet-woo-product-video__popup-overlay"></div>
<div class="jet-woo-product-video__popup">
<div <?php $this->print_render_attribute_string( 'video_popup_wrapper' ); ?>><?php echo $video ?></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,47 @@
<?php
/**
* Product Gallery thumbnails template
*/
$this->set_render_attribute( 'thumbs', 'class', array(
'jet-woo-slick-control-nav',
'jet-woo-slick-control-thumbs',
) );
$this->set_render_attribute( 'thumbs_item', 'class', array( 'jet-woo-slick-control-thumbs__item' ) );
if ( has_post_thumbnail( $product_id ) ) {
array_unshift( $attachment_ids, intval( get_post_thumbnail_id( $product_id ) ) );
}
$thumbs_video_placeholder_html = '';
$thumbs_html = '';
if ( $this->product_has_video() && 'content' === $settings['video_display_in'] ) {
if ( $this->__video_has_custom_placeholder() ) {
$video_thumbnail_id = jet_woo_gallery_video_integration()->get_video_custom_placeholder();
array_push( $attachment_ids, $video_thumbnail_id );
} else {
$video_placeholder_url = jet_woo_product_gallery()->plugin_url( 'assets/images/video-thumbnails-placeholder.png' );
$thumbs_video_placeholder_html = '<li data-thumb="' . esc_url( $video_placeholder_url ) . '" ' . $this->get_render_attribute_string( 'thumbs_item' ) . '><div class="jet-woo-slick-control-thumbs__item-image"><img width="300" height="300" src="' . esc_url( $video_placeholder_url ) . '" ></div></li>';
}
}
if ( $attachment_ids ) {
foreach ( $attachment_ids as $attachment_id ) {
$image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$image = wp_get_attachment_image( $attachment_id, $settings['thumbs_image_size'], false );
$thumbs_html .= '<li data-thumb="' . esc_url( $image_src[0] ) . '" ' . $this->get_render_attribute_string( 'thumbs_item' ) . '><div class="jet-woo-slick-control-thumbs__item-image">' . $image . '</div></li>';
}
}
if ( 'content' === $settings['video_display_in'] ) {
$thumbs_html .= $thumbs_video_placeholder_html;
}
?>
<ol <?php $this->print_render_attribute_string( 'thumbs' ); ?>>
<?php echo $thumbs_html; ?>
</ol>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Product Gallery thumbnails template
*/
$image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$image = wp_get_attachment_image( $attachment_id, $images_size, false, array(
'title' => get_post_field( 'post_title', $attachment_id ),
'data-caption' => get_post_field( 'post_excerpt', $attachment_id ),
'data-src' => $image_src[0],
'data-large_image' => $image_src[0],
'data-large_image_width' => $image_src[1],
'data-large_image_height' => $image_src[2],
) );
$this->set_render_attribute( 'image_link', 'class', 'jet-woo-product-gallery__image-link' );
$this->set_render_attribute( 'image_link', 'href', esc_url( $image_src[0] ) );
$this->set_render_attribute( 'image_link', 'itemprop', 'image' );
$this->set_render_attribute( 'image_link', 'title', get_post_field( 'post_title', $attachment_id ) );
$this->set_render_attribute( 'image_link', 'rel', 'prettyPhoto' . $gallery );
?>
<div class="jet-woo-product-gallery__image-item">
<div class="jet-woo-product-gallery__image <?php echo $zoom ?>">
<?php
if ( $enable_gallery ) {
jet_woo_product_gallery_functions()->get_gallery_trigger_button( $settings['gallery_button_icon'] );
}
?>
<a <?php $this->print_render_attribute_string( 'image_link' ); ?>>
<?php echo $image; ?>
</a>
</div>
</div>

View File

@@ -0,0 +1,68 @@
<?php
/**
* Product Gallery video template
*/
if ( ! $this->product_has_video() ) {
return '';
}
$this->add_render_attribute( 'video_wrapper', 'class', 'jet-woo-product-video' );
if ( 'self_hosted' !== $video_type ) {
$this->add_render_attribute(
'video_wrapper',
'class',
array(
'jet-woo-product-video-aspect-ratio',
'jet-woo-product-video-aspect-ratio--' . $settings['aspect_ratio']
)
);
}
$this->add_render_attribute( 'video_overlay', 'class', 'jet-woo-product-video__overlay' );
if ( '' !== $video_thumbnail_url ) {
$this->add_render_attribute( 'video_overlay', 'style', 'background-image: url(' . $video_thumbnail_url . ');' );
}
if ( filter_var( $settings['show_play_button'], FILTER_VALIDATE_BOOLEAN ) ) {
$this->add_render_attribute( 'play_button', 'class', 'jet-woo-product-video__play-button' );
$this->add_render_attribute( 'play_button', 'role', 'button' );
$play_button_html = '<div ' . $this->get_render_attribute_string( 'play_button' ) . '>';
switch ( $settings['play_button_type'] ) {
case 'icon' :
$play_button_html .= sprintf(
'<i class="jet-woo-product-video__play-button-icon %s" aria-hidden="true"></i>',
esc_attr( $settings['play_button_icon'] )
);
break;
case 'image':
$play_button_html .= jet_woo_product_gallery_tools()->get_image_by_url(
$settings['play_button_image']['url'],
array(
'class' => 'jet-woo-product-video__play-button-image',
'alt' => esc_html__( 'Play Video', 'jet-woo-product-gallery' ),
)
);
}
$play_button_html .= sprintf(
'<span class="elementor-screen-only">%s</span>',
esc_html__( 'Play Video', 'jet-woo-product-gallery' )
);
$play_button_html .= '</div>';
}
?>
<div class="jet-woo-product-gallery__image-item">
<div class="jet-woo-product-gallery__image jet-woo-product-gallery--with-video">
<div <?php $this->print_render_attribute_string( 'video_wrapper' ); ?>><?php echo $video ?></div>
<div <?php $this->print_render_attribute_string( 'video_overlay' ); ?>><?php echo $play_button_html ?></div>
</div>
</div>

View File

@@ -0,0 +1,39 @@
<?php
/**
* Photoswipe template
*/
?>
<div class="pswp jet-woo-product-gallery-pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" aria-label="<?php esc_attr_e( 'Close (Esc)', 'jet-woo-product-gallery' ); ?>"></button>
<button class="pswp__button pswp__button--share" aria-label="<?php esc_attr_e( 'Share', 'jet-woo-product-gallery' ); ?>"></button>
<button class="pswp__button pswp__button--fs" aria-label="<?php esc_attr_e( 'Toggle fullscreen', 'jet-woo-product-gallery' ); ?>"></button>
<button class="pswp__button pswp__button--zoom" aria-label="<?php esc_attr_e( 'Zoom in/out', 'jet-woo-product-gallery' ); ?>"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" aria-label="<?php esc_attr_e( 'Previous (arrow left)', 'jet-woo-product-gallery' ); ?>"></button>
<button class="pswp__button pswp__button--arrow--right" aria-label="<?php esc_attr_e( 'Next (arrow right)', 'jet-woo-product-gallery' ); ?>"></button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>