first commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Default
|
||||
*
|
||||
*/
|
||||
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
|
||||
echo '<div class="eael-content-timeline-block">
|
||||
<div class="eael-content-timeline-line">
|
||||
<div class="eael-content-timeline-inner"></div>
|
||||
</div>
|
||||
<div class="eael-content-timeline-img eael-picture ' . ( ( 'bullet' === $settings['eael_show_image_or_icon'] ) ? 'eael-content-timeline-bullet' : '' ) . '">';
|
||||
|
||||
echo wp_kses( $content['image'], Helper::eael_allowed_icon_tags() );
|
||||
|
||||
echo '</div>';
|
||||
|
||||
$eael_ct_content = '<div class="eael-content-timeline-content">';
|
||||
if ( 'yes' == $settings['eael_show_title'] ) {
|
||||
$eael_ct_content .= '<' . \Essential_Addons_Elementor\Classes\Helper::eael_validate_html_tag( $settings['title_tag'] ) . ' class="eael-timeline-title"><a href="' . esc_url( $content['permalink'] ) . '"' . $content['nofollow'] . '' . $content['target_blank'] . '>' . $content['title'] . '</a></' . \Essential_Addons_Elementor\Classes\Helper::eael_validate_html_tag( $settings['title_tag'] ) . '>';
|
||||
}
|
||||
|
||||
if ( ! empty( $content['image_linkable'] ) && $content['image_linkable'] === 'yes' ) {
|
||||
$eael_ct_content .= '<a href="' . esc_url( $content['permalink'] ) . '"' . $content['image_link_nofollow'] . '' . $content['image_link_target'] . '>';
|
||||
}
|
||||
|
||||
$eael_ct_content .= $content['post_thumbnail'];
|
||||
|
||||
if ( ! empty( $content['image_linkable'] ) && $content['image_linkable'] === 'yes' ) {
|
||||
$eael_ct_content .= '</a>';
|
||||
}
|
||||
|
||||
if ( 'yes' == $settings['eael_show_excerpt'] ) {
|
||||
$eael_ct_content .= $content['excerpt'];
|
||||
}
|
||||
|
||||
$eael_ct_content .= $content['read_more_btn'];
|
||||
|
||||
$eael_ct_content .= '<span class="eael-date">';
|
||||
$eael_ct_content .= $content['date'];
|
||||
$eael_ct_content .= '</span>';
|
||||
$eael_ct_content .= '</div></div>';
|
||||
|
||||
echo wp_kses( $eael_ct_content, Helper::eael_allowed_tags() );
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Horizontal
|
||||
*
|
||||
*/
|
||||
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$horizontal_layout = ! empty( $settings['content_timeline_layout_horizontal'] ) ? esc_html( $settings['content_timeline_layout_horizontal'] ) : esc_html( 'center' );
|
||||
$navigation_type = ! empty( $settings['eael_content_timeline_navigation_type'] ) ? $settings['eael_content_timeline_navigation_type'] : esc_html( 'scrollbar' );
|
||||
$query = isset( $query ) ? $query : new WP_Query();
|
||||
?>
|
||||
<div class="eael-horizontal-timeline eael-horizontal-timeline--layout-<?php echo esc_attr( $horizontal_layout ) ?> eael-horizontal-timeline--align-left eael-horizontal-timeline--<?php echo esc_attr( $navigation_type ) ?>">
|
||||
<?php if( 'arrows' === $navigation_type ) : ?>
|
||||
<div class="eael-horizontal-timeline-inner">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-horizontal-timeline-track">
|
||||
<?php
|
||||
switch ( $horizontal_layout ) {
|
||||
case 'top':
|
||||
?>
|
||||
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--top <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'top' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--middle <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<div class="eael-horizontal-timeline__line"></div>
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'middle' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--bottom <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'bottom' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
break;
|
||||
case 'middle':
|
||||
?>
|
||||
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--top <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'top' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--middle <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<div class="eael-horizontal-timeline__line"></div>
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'middle' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--bottom <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'bottom' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
break;
|
||||
case 'bottom':
|
||||
?>
|
||||
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--bottom <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'bottom' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--middle <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<div class="eael-horizontal-timeline__line"></div>
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'middle' ); ?>
|
||||
</div>
|
||||
<div class="eael-horizontal-timeline-list eael-horizontal-timeline-list--top <?php echo esc_attr( $horizontal_layout ); ?>">
|
||||
<?php $this->print_horizontal_timeline_content( $settings, $query, 'top' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( 'arrows' === $navigation_type && ! empty( $settings['eael_content_timeline_arrow_type'] ) ) {
|
||||
printf( '<i class="%s eael-arrow eael-prev-arrow eael-arrow-disabled"></i>', esc_attr( $settings['eael_content_timeline_arrow_type'] ) );
|
||||
printf( '<i class="%s eael-arrow eael-next-arrow"></i>', esc_attr( $settings['eael_content_timeline_arrow_type'] ) );
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if( 'arrows' === $navigation_type ) : ?>
|
||||
</div> <!-- /.eael-horizontal-timeline-inner -->
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
/**
|
||||
* Template Name: Default
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$helperClass = new Essential_Addons_Elementor\Pro\Classes\Helper();
|
||||
$show_category_child_items = ! empty( $settings['category_show_child_items'] ) && 'yes' === $settings['category_show_child_items'] ? 1 : 0;
|
||||
$show_product_cat_child_items = ! empty( $settings['product_cat_show_child_items'] ) && 'yes' === $settings['product_cat_show_child_items'] ? 1 : 0;
|
||||
$classes = $helperClass->get_dynamic_gallery_item_classes( $show_category_child_items, $show_product_cat_child_items );
|
||||
$has_post_thumbnail = has_post_thumbnail();
|
||||
|
||||
$image_clickable = 'yes' === $settings['eael_dfg_full_image_clickable'] && $settings['eael_fg_grid_style'] == 'eael-cards';
|
||||
|
||||
if ($settings['eael_fg_grid_style'] == 'eael-hoverer') {
|
||||
echo '<div class="dynamic-gallery-item ' . esc_attr(urldecode(implode(' ', $classes))) . '">
|
||||
<div class="dynamic-gallery-item-inner" data-itemid=" ' . esc_attr( get_the_ID() ) . ' ">
|
||||
<div class="dynamic-gallery-thumbnail">';
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']) : \Elementor\Utils::get_placeholder_image_src();
|
||||
$alt_text = $has_post_thumbnail ? get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true) : '';
|
||||
echo '<img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr( $alt_text ) . '">';
|
||||
|
||||
|
||||
if ('eael-none' !== $settings['eael_fg_grid_hover_style']) {
|
||||
echo '<div class="caption ' . esc_attr($settings['eael_fg_grid_hover_style']) . ' ">';
|
||||
if ('true' == $settings['eael_fg_show_popup']) {
|
||||
if ('media' == $settings['eael_fg_show_popup_styles']) {
|
||||
$thumb_url = wp_get_attachment_image_url(get_post_thumbnail_id(), 'full');
|
||||
echo '<a href="' . esc_url( $thumb_url ) . '" class="popup-media eael-magnific-link"></a>';
|
||||
} elseif ('buttons' == $settings['eael_fg_show_popup_styles']) {
|
||||
echo '<div class="item-content">';
|
||||
$item_content = '';
|
||||
if($settings['eael_show_hover_title']) {
|
||||
$item_content .= '<h2 class="title"><a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['title_link_target_blank'] ? 'target="_blank"' : '' ) .'>' . get_the_title() . '</a></h2>';
|
||||
}
|
||||
if($settings['eael_show_hover_excerpt']) {
|
||||
$item_content .= '<p>' . wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_post_excerpt'], '<a class="eael_post_excerpt_read_more" href="' . get_the_permalink() . '"'. ( $settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) .'> ' . $settings['eael_post_excerpt_read_more'] . '</a>') . '</p>';
|
||||
}
|
||||
echo wp_kses( $item_content, Helper::eael_allowed_tags() );
|
||||
echo '</div>';
|
||||
echo '<div class="buttons">';
|
||||
if (!empty($settings['eael_section_fg_zoom_icon'])) {
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), 'full') : \Elementor\Utils::get_placeholder_image_src();
|
||||
echo '<a href="'. esc_url( $thumb_url ) .'" class="eael-magnific-link">';
|
||||
|
||||
if( isset($settings['eael_section_fg_zoom_icon']['url']) ) {
|
||||
echo '<img class="eael-dnmcg-svg-icon" src="'.esc_url($settings['eael_section_fg_zoom_icon']['url']).'" alt="'.esc_attr(get_post_meta($settings['eael_section_fg_zoom_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else if ( ! empty( $settings['eael_section_fg_zoom_icon_new'] ) ) {
|
||||
\Elementor\Icons_Manager::render_icon($settings['eael_section_fg_zoom_icon_new'], ['aria-hidden' => 'true']);
|
||||
} else {
|
||||
echo '<i class="sss ' . esc_attr($settings['eael_section_fg_zoom_icon']) . '"></i>';
|
||||
}
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
if (!empty($settings['eael_section_fg_link_icon'])) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['link_target_blank'] ? 'target="_blank"' : '' ) .'>';
|
||||
if( isset($settings['eael_section_fg_link_icon']['url'])) {
|
||||
echo '<img class="eael-dnmcg-svg-icon" src="'.esc_url($settings['eael_section_fg_link_icon']['url']).'" alt="'.esc_attr(get_post_meta($settings['eael_section_fg_link_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else if ( ! empty( $settings['eael_section_fg_link_icon_new'] ) ) {
|
||||
\Elementor\Icons_Manager::render_icon($settings['eael_section_fg_link_icon_new'], ['aria-hidden' => 'true']);
|
||||
} else {
|
||||
echo '<i class="' . esc_attr($settings['eael_section_fg_link_icon']) . '"></i>';
|
||||
}
|
||||
echo '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>
|
||||
</div>';
|
||||
} else if ($settings['eael_fg_grid_style'] == 'eael-cards') {
|
||||
echo '<div class="dynamic-gallery-item ' . esc_attr(implode(' ', $classes)) . '">
|
||||
<div class="dynamic-gallery-item-inner" data-itemid=" ' . esc_attr( get_the_ID() ) . ' ">';
|
||||
|
||||
if ( $image_clickable ){
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) .'>';
|
||||
}
|
||||
echo '<div class="dynamic-gallery-thumbnail">';
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']) : \Elementor\Utils::get_placeholder_image_src();
|
||||
$alt_text = $has_post_thumbnail ? get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true) : '';
|
||||
echo '<img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr( $alt_text ) . '">';
|
||||
|
||||
|
||||
if ('media' == $settings['eael_fg_show_popup_styles'] && 'eael-none' == $settings['eael_fg_grid_hover_style']) {
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), 'full') : \Elementor\Utils::get_placeholder_image_src();
|
||||
echo '<a href="'. esc_url( $thumb_url ) .'" class="popup-only-media eael-magnific-link"></a>';
|
||||
}
|
||||
|
||||
if ('eael-none' !== $settings['eael_fg_grid_hover_style'] && ! $image_clickable ) {
|
||||
if ('media' == $settings['eael_fg_show_popup_styles']) {
|
||||
echo '<div class="caption media-only-caption">';
|
||||
} else {
|
||||
echo '<div class="caption ' . esc_attr($settings['eael_fg_grid_hover_style']) . ' ">';
|
||||
}
|
||||
if ('true' == $settings['eael_fg_show_popup']) {
|
||||
if ('media' == $settings['eael_fg_show_popup_styles']) {
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), 'full') : \Elementor\Utils::get_placeholder_image_src();
|
||||
echo '<a href="'. esc_url( $thumb_url ) .'" class="popup-media eael-magnific-link"></a>';
|
||||
} elseif ('buttons' == $settings['eael_fg_show_popup_styles']) {
|
||||
echo '<div class="buttons">';
|
||||
if (!empty($settings['eael_section_fg_zoom_icon'])) {
|
||||
|
||||
$thumb_url = $has_post_thumbnail ? wp_get_attachment_image_url(get_post_thumbnail_id(), 'full') : \Elementor\Utils::get_placeholder_image_src();
|
||||
echo '<a href="'. esc_url( $thumb_url ) .'" class="eael-magnific-link">';
|
||||
|
||||
if( isset($settings['eael_section_fg_zoom_icon']['url']) ) {
|
||||
echo '<img class="eael-dnmcg-svg-icon" src="'.esc_url($settings['eael_section_fg_zoom_icon']['url']).'" alt="'.esc_attr(get_post_meta($settings['eael_section_fg_zoom_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else if ( ! empty( $settings['eael_section_fg_zoom_icon_new'] ) ) {
|
||||
\Elementor\Icons_Manager::render_icon($settings['eael_section_fg_zoom_icon_new'], ['aria-hidden' => 'true']);
|
||||
}else {
|
||||
echo '<i class="' . esc_attr($settings['eael_section_fg_zoom_icon']) . '"></i>';
|
||||
}
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
if (!empty($settings['eael_section_fg_link_icon'])) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['link_target_blank'] ? 'target="_blank"' : '' ) .'>';
|
||||
if( isset($settings['eael_section_fg_link_icon']['url'])) {
|
||||
echo '<img class="eael-dnmcg-svg-icon" src="'.esc_url($settings['eael_section_fg_link_icon']['url']).'" alt="'.esc_attr(get_post_meta($settings['eael_section_fg_link_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else if ( ! empty( $settings['eael_section_fg_link_icon_new'] ) ) {
|
||||
\Elementor\Icons_Manager::render_icon($settings['eael_section_fg_link_icon_new'], ['aria-hidden' => 'true']);
|
||||
}else {
|
||||
echo '<i class="' . esc_attr($settings['eael_section_fg_link_icon']) . '"></i>';
|
||||
}
|
||||
echo '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
if ( $image_clickable ){
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
echo ' <div class="item-content">';
|
||||
if($settings['eael_show_hover_title']) {
|
||||
echo '<h2 class="title"><a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['title_link_target_blank'] ? 'target="_blank"' : '' ) .'>' . wp_kses( get_the_title(), Helper::eael_allowed_tags() ) . '</a></h2>';
|
||||
} if($settings['eael_show_hover_excerpt']) {
|
||||
$content = wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_post_excerpt'], '<a class="eael_post_excerpt_read_more" href="' . get_the_permalink() . '"'. ( $settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) .'> ' . $settings['eael_post_excerpt_read_more'] . '</a>');
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
|
||||
if (('buttons' == $settings['eael_fg_show_popup_styles']) && ('eael-none' == $settings['eael_fg_grid_hover_style'])) {
|
||||
echo '<div class="buttons entry-footer-buttons">';
|
||||
if (!empty($settings['eael_section_fg_zoom_icon'])) {
|
||||
$attachment_url = wp_get_attachment_image_url(get_post_thumbnail_id(), 'full');
|
||||
echo '<a href="' . esc_url( $attachment_url ) . '" class="eael-magnific-link"><i class="' . esc_attr($settings['eael_section_fg_zoom_icon']) . '"></i></a>';
|
||||
}
|
||||
if (!empty($settings['eael_section_fg_link_icon'])) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"'. ( $settings['link_nofollow'] ? 'rel="nofollow"' : '' ) . '' . ( $settings['link_target_blank'] ? 'target="_blank"' : '' ) .'><i class="' . esc_attr($settings['eael_section_fg_link_icon']) . '"></i></a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Default
|
||||
*/
|
||||
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
if ( $settings['eael_show_fallback_img'] == 'yes' && !empty( $settings['eael_post_block_fallback_img']['url'] ) ) {
|
||||
$fallback_image_id = $settings['eael_post_block_fallback_img']['id'];
|
||||
$eael_fallback_thumb_url = Group_Control_Image_Size::get_attachment_image_src( $fallback_image_id, 'image', $settings );
|
||||
}
|
||||
|
||||
$enable_ratio = $settings['enable_post_block_image_ratio'] == 'yes' ? 'eael-image-ratio':'';
|
||||
|
||||
if ($settings['grid_style'] == 'post-block-style-overlay') {
|
||||
echo '<article class="eael-post-block-item eael-post-block-column">
|
||||
<div class="eael-post-block-item-holder">
|
||||
<div class="eael-post-block-item-holder-inner">';
|
||||
if (has_post_thumbnail() && $settings['eael_show_image'] == 'yes') {
|
||||
echo '<div class="eael-entry-media">
|
||||
<div class="eael-entry-thumbnail '. esc_attr( $enable_ratio ) .'">
|
||||
<img src="' . esc_url( wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']) ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</div>
|
||||
</div>';
|
||||
}else {
|
||||
if ( $settings['eael_show_fallback_img'] == 'yes' && !empty( $settings['eael_post_block_fallback_img']['url'] ) ) {
|
||||
echo '<div class="eael-entry-media">
|
||||
<div class="eael-entry-thumbnail ' . esc_attr( $enable_ratio ) . '">
|
||||
<img src="' . esc_url( $eael_fallback_thumb_url ) . '" alt="' . esc_attr( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) . '">
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($settings['eael_show_title'] || $settings['eael_show_meta'] || $settings['eael_show_excerpt'] || isset( $settings['eael_show_post_terms'] ) ) {
|
||||
echo '<div class="eael-entry-wrapper ' . esc_attr( $settings['post_block_hover_animation'] ) . '">
|
||||
<header class="eael-entry-header">';
|
||||
if ($settings['eael_show_title']) {
|
||||
$title_tag = Helper::eael_validate_html_tag( $settings['title_tag'] );
|
||||
$title = '<' . $title_tag . ' class="eael-entry-title">
|
||||
<a class="eael-grid-post-link"
|
||||
href="' . esc_url( get_the_permalink() ) . '"
|
||||
title="' . esc_attr( strip_tags( get_the_title() ) ) . '"
|
||||
' . ( $settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
' . get_the_title() . '
|
||||
</a>
|
||||
</' . $title_tag . '>';
|
||||
|
||||
echo wp_kses( $title, Helper::eael_allowed_tags() );
|
||||
}
|
||||
|
||||
if ($settings['eael_show_meta'] && $settings['meta_position'] == 'meta-entry-header') {
|
||||
$meta = '<div class="eael-entry-meta">';
|
||||
if($settings['eael_show_author'] === 'yes') {
|
||||
$meta .= '<span class="eael-posted-by ">' . get_the_author_posts_link() . '</span>';
|
||||
}
|
||||
if($settings['eael_show_date'] === 'yes') {
|
||||
$meta .= '<span class="eael-posted-on"><time datetime="' . get_the_date() . '">' . get_the_date() . '</time></span>';
|
||||
}
|
||||
$meta .= '</div>';
|
||||
|
||||
echo wp_kses( $meta, Helper::eael_allowed_tags() );
|
||||
}
|
||||
echo '</header>
|
||||
|
||||
<div class="eael-entry-content ss">';
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
if ($settings['eael_post_terms'] === 'category') {
|
||||
$terms = get_the_category();
|
||||
}
|
||||
if ($settings['eael_post_terms'] === 'tags') {
|
||||
$terms = get_the_tags();
|
||||
}
|
||||
if (!empty($terms)) {
|
||||
$html = '<ul class="post-meta-categories">';
|
||||
$count = 0;
|
||||
foreach ($terms as $term) {
|
||||
if ($count === intval($settings['eael_post_terms_max_length'])) {
|
||||
break;
|
||||
}
|
||||
if ($count === 0) {
|
||||
$html .= '<li class="meta-cat-icon"><i class="far fa-folder-open"></i></li>';
|
||||
}
|
||||
$link = ($settings['eael_post_terms'] === 'category') ? get_category_link($term->term_id) : get_tag_link($term->term_id);
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="' . esc_url($link) . '">';
|
||||
$html .= $term->name;
|
||||
$html .= '</a>';
|
||||
$html .= '</li>';
|
||||
$count++;
|
||||
}
|
||||
$html .= '</ul>';
|
||||
echo wp_kses( $html, Helper::eael_allowed_tags() );
|
||||
}
|
||||
}
|
||||
if ($settings['eael_show_excerpt']) {
|
||||
echo '<div class="eael-grid-post-excerpt">';
|
||||
$content = get_the_excerpt() ? get_the_excerpt() : get_the_content();
|
||||
$content = strip_shortcodes($content);
|
||||
if(empty($settings['eael_excerpt_length'])) {
|
||||
echo '<p>'. wp_kses( $content, Helper::eael_allowed_tags() ) .'</p>';
|
||||
}else {
|
||||
$content = wp_trim_words($content, $settings['eael_excerpt_length'], $settings['expanison_indicator']);
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
|
||||
if ('yes' == $settings['show_read_more_button']) {
|
||||
if (class_exists('WooCommerce') && $settings['post_type'] == 'product') {
|
||||
echo '<p class="eael-entry-content-btn">';
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
echo '</p>';
|
||||
} else {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"
|
||||
class="eael-post-elements-readmore-btn"
|
||||
' . ( $settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
' . esc_html( $settings['read_more_button_text'] ) . '</a>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
if ($settings['eael_show_meta'] && $settings['meta_position'] == 'meta-entry-footer') {
|
||||
echo '<div class="eael-entry-footer">';
|
||||
|
||||
if($settings['eael_show_avatar'] === 'yes') {
|
||||
echo '<div class="eael-author-avatar">
|
||||
<a href="' . esc_url( get_author_posts_url(get_the_author_meta('ID')) ) . '">' . get_avatar(get_the_author_meta('ID'), 96) . '</a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
||||
$entry_meta = '<div class="eael-entry-meta">';
|
||||
if($settings['eael_show_author'] === 'yes') {
|
||||
$entry_meta .= '<div class="eael-posted-by">' . get_the_author_posts_link() . '</div>';
|
||||
}
|
||||
|
||||
if($settings['eael_show_date'] === 'yes') {
|
||||
$entry_meta .= '<div class="eael-posted-on"><time datetime="' . get_the_date() . '">' . get_the_date() . '</time></div>';
|
||||
}
|
||||
$entry_meta .= '</div>';
|
||||
|
||||
echo wp_kses( $entry_meta, Helper::eael_allowed_tags() );
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
echo '<div class="eael-entry-overlay-ssss">
|
||||
<a href="' . esc_url( get_the_permalink() ) . '"
|
||||
' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
</a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>
|
||||
</article>';
|
||||
} else {
|
||||
echo '<article class="eael-post-block-item eael-post-block-column">
|
||||
<div class="eael-post-block-item-holder">
|
||||
<div class="eael-post-block-item-holder-inner">';
|
||||
if (has_post_thumbnail() && $settings['eael_show_image'] == 'yes') {
|
||||
echo '<div class="eael-entry-media">
|
||||
<div class="eael-entry-overlay ' . esc_attr( $settings['post_block_hover_animation'] ) . '">';
|
||||
if( isset($settings['eael_post_block_bg_hover_icon']['url']) ) {
|
||||
echo '<img class="eael-post-block-hover-svg-icon" src="' . esc_url( $settings['eael_post_block_bg_hover_icon']['url'] ) . '" alt="'.esc_attr(get_post_meta($settings['eael_post_block_bg_hover_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else {
|
||||
echo '<i class="' . esc_attr( $settings['eael_post_block_bg_hover_icon'] ) . '" aria-hidden="true"></i>';
|
||||
}
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"
|
||||
' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
</a>
|
||||
</div>
|
||||
<div class="eael-entry-thumbnail ' . esc_attr( $enable_ratio ) . '">
|
||||
<img src="' . esc_url( wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']) ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</div>
|
||||
</div>';
|
||||
} elseif($settings['eael_show_fallback_img'] == 'yes' && !empty( $settings['eael_post_block_fallback_img']['url'] )) {
|
||||
echo '<div class="eael-entry-media hmm">
|
||||
<div class="eael-entry-overlay ' . esc_attr( $settings['post_block_hover_animation'] ) . '">';
|
||||
if( isset($settings['eael_post_block_bg_hover_icon']['url']) ) {
|
||||
echo '<img class="eael-post-block-hover-svg-icon" src="' . esc_url( $settings['eael_post_block_bg_hover_icon']['url'] ) . '" alt="'.esc_attr(get_post_meta($settings['eael_post_block_bg_hover_icon']['id'], '_wp_attachment_image_alt', true)).'" />';
|
||||
}else {
|
||||
echo '<i class="' . esc_attr( $settings['eael_post_block_bg_hover_icon'] ) . '" aria-hidden="true"></i>';
|
||||
}
|
||||
echo '<a
|
||||
href="' . esc_url( get_the_permalink() ) . '"
|
||||
' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
</a>
|
||||
</div>
|
||||
<div class="eael-entry-thumbnail ' . esc_attr( $enable_ratio ) . '">
|
||||
<img src="' . esc_url( $eael_fallback_thumb_url ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_show_title'] || $settings['eael_show_meta'] || $settings['eael_show_excerpt'] || isset( $settings['eael_show_post_terms'] ) ) {
|
||||
echo '<div class="eael-entry-wrapper">';
|
||||
|
||||
$header = '<header class="eael-entry-header">';
|
||||
if ($settings['eael_show_title']) {
|
||||
$title_tag = Helper::eael_validate_html_tag( $settings['title_tag'] );
|
||||
$header .= '<' . $title_tag . ' class="eael-entry-title">
|
||||
<a class="eael-grid-post-link"
|
||||
href="' . esc_url( get_the_permalink() ) . '"
|
||||
title="' . esc_attr( strip_tags( get_the_title() ) ) . '"
|
||||
' . ( $settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ( $settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
' . get_the_title() . '
|
||||
</a>
|
||||
|
||||
</' . $title_tag . '>';
|
||||
}
|
||||
|
||||
if ($settings['eael_show_meta'] && $settings['meta_position'] == 'meta-entry-header') {
|
||||
$header .= '<div class="eael-entry-meta">';
|
||||
if($settings['eael_show_author'] === 'yes') {
|
||||
$header .= '<span class="eael-posted-by">' . get_the_author_posts_link() . '</span>';
|
||||
}
|
||||
|
||||
if($settings['eael_show_date'] === 'yes') {
|
||||
$header .= '<span class="eael-posted-on"><time datetime="' . get_the_date() . '">' . get_the_date() . '</time></span>';
|
||||
}
|
||||
$header .= '</div>';
|
||||
}
|
||||
$header .= '</header>';
|
||||
|
||||
echo wp_kses( $header, Helper::eael_allowed_tags() );
|
||||
|
||||
echo '<div class="eael-entry-content">';
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
if ($settings['eael_post_terms'] === 'category') {
|
||||
$terms = get_the_category();
|
||||
}
|
||||
if ($settings['eael_post_terms'] === 'tags') {
|
||||
$terms = get_the_tags();
|
||||
}
|
||||
if (!empty($terms)) {
|
||||
$html = '<ul class="post-meta-categories">';
|
||||
$count = 0;
|
||||
foreach ($terms as $term) {
|
||||
if ($count === intval($settings['eael_post_terms_max_length'])) {
|
||||
break;
|
||||
}
|
||||
if ($count === 0) {
|
||||
$html .= '<li class="meta-cat-icon"><i class="far fa-folder-open"></i></li>';
|
||||
}
|
||||
$link = ($settings['eael_post_terms'] === 'category') ? get_category_link($term->term_id) : get_tag_link($term->term_id);
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="' . esc_url($link) . '">';
|
||||
$html .= $term->name;
|
||||
$html .= '</a>';
|
||||
$html .= '</li>';
|
||||
$count++;
|
||||
}
|
||||
$html .= '</ul>';
|
||||
echo wp_kses( $html, Helper::eael_allowed_tags() );
|
||||
}
|
||||
}
|
||||
if ($settings['eael_show_excerpt']) {
|
||||
echo '<div class="eael-grid-post-excerpt">';
|
||||
$content = strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content());
|
||||
if(empty($settings['eael_excerpt_length'])) {
|
||||
echo '<p>'. wp_kses( $content, Helper::eael_allowed_tags() ) .'</p>';
|
||||
}else {
|
||||
$content = wp_trim_words( $content, $settings['eael_excerpt_length'], $settings['expanison_indicator']);
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
|
||||
if ('yes' == $settings['show_read_more_button']) {
|
||||
echo '<a
|
||||
href="' . esc_url( get_the_permalink() ) . '"
|
||||
class="eael-post-elements-readmore-btn"
|
||||
' . ( $settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . '
|
||||
' . ($settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>
|
||||
' . esc_html( $settings['read_more_button_text'] ) . '</a>';
|
||||
}
|
||||
|
||||
if (class_exists('WooCommerce') && $settings['post_type'] == 'product') {
|
||||
echo '<p class="eael-entry-content-btn">';
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
echo '</p>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_show_meta'] && $settings['meta_position'] == 'meta-entry-footer') {
|
||||
echo '<div class="eael-entry-footer">';
|
||||
|
||||
if($settings['eael_show_avatar'] === 'yes') {
|
||||
echo '<div class="eael-author-avatar">
|
||||
<a href="' . esc_url( get_author_posts_url(get_the_author_meta('ID')) ) . '">' . get_avatar(get_the_author_meta('ID'), 96) . '</a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$entry_meta = '<div class="eael-entry-meta">';
|
||||
if($settings['eael_show_author'] === 'yes') {
|
||||
$entry_meta .= '<div class="eael-posted-by">' . get_the_author_posts_link() . '</div>';
|
||||
}
|
||||
|
||||
if($settings['eael_show_date'] === 'yes') {
|
||||
$entry_meta .= '<div class="eael-posted-on"><time datetime="' . get_the_date() . '">' . get_the_date() . '</time></div>';
|
||||
}
|
||||
$entry_meta .= '</div>';
|
||||
|
||||
echo wp_kses( $entry_meta, Helper::eael_allowed_tags() );
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</div>
|
||||
</div>
|
||||
</article>';
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Default
|
||||
*
|
||||
*/
|
||||
use Elementor\Icons_Manager;
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
use \Elementor\Group_Control_Image_Size;
|
||||
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
if(isset($settings['title_tag'])){
|
||||
$settings['title_tag'] = Helper::eael_pro_validate_html_tag($settings['title_tag']);
|
||||
}
|
||||
|
||||
if ( $settings['eael_show_fallback_img'] == 'yes' && ! empty( $settings['eael_post_carousel_fallback_img']['url'] ) ) {
|
||||
$fallback_image_id = $settings['eael_post_carousel_fallback_img']['id'];
|
||||
$eael_fallback_thumb_url = Group_Control_Image_Size::get_attachment_image_src( $fallback_image_id, 'image', $settings );
|
||||
}
|
||||
|
||||
$image_url = ! empty( $eael_fallback_thumb_url ) ? $eael_fallback_thumb_url : '';
|
||||
$image_url = has_post_thumbnail() ? wp_get_attachment_image_url( get_post_thumbnail_id(), $settings['image_size'] ) : $image_url;
|
||||
|
||||
$enable_ratio = $settings['enable_post_carousel_image_ratio'] == 'yes' ? 'eael-image-ratio':'';
|
||||
|
||||
echo '<div class="swiper-slide">';
|
||||
if ( $settings['eael_post_carousel_preset_style'] === 'two' ) {
|
||||
echo '<article class="eael-grid-post eael-post-grid-column">
|
||||
<div class="eael-grid-post-holder">
|
||||
<div class="eael-grid-post-holder-inner">';
|
||||
|
||||
if ( ( $settings['eael_show_image'] == '0' || $settings['eael_show_image'] == 'yes' ) && ( has_post_thumbnail() || ! empty( $eael_fallback_thumb_url ) ) ) {
|
||||
echo '<div class="eael-entry-media eael-entry-medianone">';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
echo wp_kses( Helper::get_terms_as_list($settings['eael_post_terms'], $settings['eael_post_terms_max_length']), Helper::eael_allowed_tags() );
|
||||
}
|
||||
|
||||
if ( isset( $settings['post_block_hover_animation'] ) && 'none' !== $settings['post_block_hover_animation'] ) {
|
||||
echo '<div class="eael-entry-overlay ' . esc_attr( $settings['post_block_hover_animation'] ) . '">';
|
||||
|
||||
if( $settings['eael_post_carousel_item_style'] === 'eael-overlay' ) {
|
||||
// Show content
|
||||
echo "<div class='eael-entry-wrapper-fade-in'>";
|
||||
$this->print_entry_content_style_2( $settings );
|
||||
echo "</div>";
|
||||
} else {
|
||||
// Show icon
|
||||
if ( isset( $settings['__fa4_migrated']['eael_post_grid_bg_hover_icon_new'] ) || empty( $settings['eael_post_grid_bg_hover_icon'] ) ) {
|
||||
Icons_Manager::render_icon( $settings['eael_post_grid_bg_hover_icon_new'] );
|
||||
} else {
|
||||
echo '<i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '></a></div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-entry-thumbnail '. esc_attr( $enable_ratio ) .'">
|
||||
<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) . '">
|
||||
<a href="' . esc_url( get_the_permalink() ) . '"' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '></a>
|
||||
</div>';
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
|
||||
if( $settings['eael_post_carousel_item_style'] !== 'eael-overlay' ) {
|
||||
$this->print_entry_content_style_2( $settings );
|
||||
}
|
||||
echo '</div></div></article>';
|
||||
} else if ( $settings['eael_post_carousel_preset_style'] === 'three' ) {
|
||||
|
||||
echo '<article class="eael-grid-post eael-post-grid-column">
|
||||
<div class="eael-grid-post-holder">
|
||||
<div class="eael-grid-post-holder-inner">';
|
||||
|
||||
if ( ( $settings['eael_show_image'] == '0' || $settings['eael_show_image'] == 'yes' ) && ( has_post_thumbnail() || ! empty( $eael_fallback_thumb_url ) ) ) {
|
||||
echo '<div class="eael-entry-media eael-entry-medianone">';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
echo wp_kses( Helper::get_terms_as_list( $settings['eael_post_terms'], intval( $settings['eael_post_terms_max_length'] ) ), Helper::eael_allowed_tags() );
|
||||
}
|
||||
|
||||
if ( isset( $settings['post_block_hover_animation'] ) && 'none' !== $settings['post_block_hover_animation'] ) {
|
||||
echo '<div class="eael-entry-overlay ' . esc_attr( $settings['post_block_hover_animation'] ) . '">';
|
||||
|
||||
if ( $settings['eael_post_carousel_item_style'] === 'eael-overlay' ) {
|
||||
// Show content
|
||||
echo "<div class='eael-entry-wrapper-fade-in'>";
|
||||
$this->print_entry_content_style_3( $settings );
|
||||
echo "</div>";
|
||||
} else {
|
||||
// Show icon
|
||||
if ( isset( $settings['__fa4_migrated']['eael_post_grid_bg_hover_icon_new'] ) || empty( $settings['eael_post_grid_bg_hover_icon'] ) ) {
|
||||
Icons_Manager::render_icon( $settings['eael_post_grid_bg_hover_icon_new'] );
|
||||
} else {
|
||||
echo '<i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '></a></div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-entry-thumbnail '. esc_attr( $enable_ratio ) .'">
|
||||
<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) . '">
|
||||
<a href="' . esc_url( get_the_permalink() ) . '"></a>
|
||||
</div>';
|
||||
echo '</div>';
|
||||
|
||||
if ( $settings['eael_show_date'] === 'yes' && $settings['eael_post_carousel_item_style'] !== 'eael-overlay' ) {
|
||||
echo '<span class="eael-meta-posted-on"><time datetime="' . get_the_date() . '"><span>' . get_the_date( 'd' ) . '</span>' . get_the_date( 'F' ) . '</time></span>';
|
||||
}
|
||||
}
|
||||
|
||||
if( $settings['eael_post_carousel_item_style'] !== 'eael-overlay' ) {
|
||||
$this->print_entry_content_style_3( $settings );
|
||||
}
|
||||
|
||||
echo '</div></div></article>';
|
||||
} else {
|
||||
echo '<article class="eael-grid-post eael-post-grid-column">
|
||||
<div class="eael-grid-post-holder">
|
||||
<div class="eael-grid-post-holder-inner">';
|
||||
|
||||
|
||||
if ( ( $settings['eael_show_image'] == '0' || $settings['eael_show_image'] == 'yes' ) && ( has_post_thumbnail() || ! empty( $eael_fallback_thumb_url ) ) ) {
|
||||
echo '<div class="eael-entry-media eael-entry-medianone">';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
echo wp_kses( Helper::get_terms_as_list($settings['eael_post_terms'], intval( $settings['eael_post_terms_max_length'] )), Helper::eael_allowed_tags() );
|
||||
}
|
||||
|
||||
if ( isset( $settings['post_block_hover_animation'] ) && 'none' !== $settings['post_block_hover_animation'] ) {
|
||||
echo '<div class="eael-entry-overlay ' . esc_attr( $settings['post_block_hover_animation'] ) . '">';
|
||||
|
||||
if( $settings['eael_post_carousel_item_style'] === 'eael-overlay' ) {
|
||||
// Show content
|
||||
echo "<div class='eael-entry-wrapper-fade-in'>";
|
||||
$this->print_entry_content_style_1( $settings );
|
||||
echo "</div>";
|
||||
} else {
|
||||
// Show icon
|
||||
if ( isset( $settings['__fa4_migrated']['eael_post_grid_bg_hover_icon_new'] ) || empty( $settings['eael_post_grid_bg_hover_icon'] ) ) {
|
||||
Icons_Manager::render_icon( $settings['eael_post_grid_bg_hover_icon_new'] );
|
||||
} else {
|
||||
echo '<i class="fas fa-long-arrow-alt-right" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $settings['image_link_nofollow'] ? 'rel="nofollow"' : '' ) . ( $settings['image_link_target_blank'] ? 'target="_blank"' : '' ) . '></a></div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-entry-thumbnail '. esc_attr( $enable_ratio ) .'">
|
||||
<img src="' . esc_url( $image_url ) . '" alt="' . esc_attr( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) . '">
|
||||
<a href="' . esc_url( get_the_permalink() ) . '"></a>
|
||||
</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if( $settings['eael_post_carousel_item_style'] !== 'eael-overlay' ) {
|
||||
$this->print_entry_content_style_1( $settings );
|
||||
}
|
||||
|
||||
echo '</div></div></article>';
|
||||
}
|
||||
echo '</div>';
|
||||
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Advanced
|
||||
*/
|
||||
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
|
||||
$category = get_the_category();
|
||||
$taxonomies = get_taxonomies( [ 'object_type' => [ $settings['post_type'] ] ] );
|
||||
if ( $settings['post_type'] === $settings['post_type'] ) {
|
||||
$category = get_the_terms( get_the_ID(), array_key_first( $taxonomies ) );
|
||||
}
|
||||
|
||||
$cat_name = $cat_id = null;
|
||||
$cat_name_2 = $cat_id_2 = null;
|
||||
$cat_name_3 = $cat_id_3 = null;
|
||||
|
||||
$show_cat = ($settings['eael_post_list_post_cat'] != '');
|
||||
$max_cat_length = ! empty ( $settings['eael_post_list_post_cat_max_length'] ) ? intval( $settings['eael_post_list_post_cat_max_length'] ) : 1;
|
||||
$cat_separator = ! empty ( $settings['eael_post_list_post_cat_separator'] ) ? esc_html( $settings['eael_post_list_post_cat_separator'] ) : '';
|
||||
|
||||
if ( !is_wp_error($category) ) {
|
||||
if( ! empty( $category[0] ) ){
|
||||
$cat_id = isset($category[0]->term_id) ? $category[0]->term_id : null;
|
||||
$cat_name = isset($category[0]->name) ? $category[0]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[1] ) ){
|
||||
$cat_id_2 = isset($category[1]->term_id) ? $category[1]->term_id : null;
|
||||
$cat_name_2 = isset($category[1]->name) ? $category[1]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[2] ) ){
|
||||
$cat_id_3 = isset($category[2]->term_id) ? $category[2]->term_id : null;
|
||||
$cat_name_3 = isset($category[2]->name) ? $category[2]->name : null;
|
||||
}
|
||||
}
|
||||
$cat_is_ready = ($show_cat && $cat_name && $cat_id);
|
||||
$separator_1 = ! empty( $cat_id_2 ) ? $cat_separator : '';
|
||||
$separator_2 = ! empty( $cat_id_3 ) ? $cat_separator : '';
|
||||
|
||||
echo '<div class="eael-post-list-post ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '<div class="eael-post-list-post-inner">' : '');
|
||||
if ($settings['eael_post_list_post_feature_image'] === 'yes') {
|
||||
echo '<div class="eael-post-list-thumbnail ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
if (has_post_thumbnail()) {
|
||||
$thumb_url = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['eael_post_featured_image_size']);
|
||||
echo '<a href="' . get_the_permalink() . '"' . $link_settings['image_link_nofollow'] . '' . $link_settings['image_link_target_blank'] . '>
|
||||
<img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-post-list-content">';
|
||||
if ($settings['eael_post_list_layout_type'] == 'default' && $cat_is_ready) {
|
||||
echo '<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_title'] == 'yes' && !empty($settings['eael_post_list_title_tag'])) {
|
||||
$validate_tag = Helper::eael_pro_validate_html_tag($settings['eael_post_list_title_tag']);
|
||||
echo "<" . esc_attr( $validate_tag ) . " class=\"eael-post-list-title\">";
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $link_settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . wp_kses( get_the_title(), Helper::eael_allowed_tags() ) . '</a>';
|
||||
echo "</". esc_attr( $validate_tag ) .">";
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_meta'] === 'yes') {
|
||||
echo '<div class="meta">
|
||||
<span><i class="far fa-calendar-alt"></i> ' . get_the_date(get_option('date_format')) . '</span>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_excerpt'] === 'yes') {
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced') {
|
||||
$content = wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_post_list_post_excerpt_length'], $settings['eael_post_list_excerpt_expanison_indicator']);
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($settings['eael_show_read_more_button']) && $settings['eael_show_read_more_button'] ) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="eael-post-elements-readmore-btn"' . ( $link_settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . esc_attr($settings['eael_post_list_read_more_text']) . '</a>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced') {
|
||||
echo '<div class="boxed-meta">';
|
||||
if ($settings['eael_post_list_author_meta'] != '') {
|
||||
$author_link = get_author_posts_url(get_the_author_meta('ID'));
|
||||
$day_link = get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'));
|
||||
echo '<div class="author-meta">
|
||||
<a href="' . esc_url( $author_link ) . '" class="author-photo">
|
||||
' . get_avatar(get_the_author_meta('ID'), 100, false, strip_tags( get_the_title() ) . '-author') . '
|
||||
</a>
|
||||
|
||||
<div class="author-info">
|
||||
<h5>' . esc_url( get_the_author_posts_link() ) . '</h5>
|
||||
<a href="' . esc_url( $day_link ) . '"><p>' . get_the_date(get_option('date_format')) . '</p></a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $cat_is_ready ) {
|
||||
$user_meta_hidden_class = empty( $settings['eael_post_list_author_meta'] ) ? 'user-meta-hidden' : '';
|
||||
echo '<div class="meta-categories ' . esc_attr( $user_meta_hidden_class ) . ' ">
|
||||
<div class="meta-cats-wrap">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '</div>' : '');
|
||||
echo '</div>';
|
||||
|
||||
$iterator++;
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Default
|
||||
*/
|
||||
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
|
||||
$category = get_the_category();
|
||||
$taxonomies = get_taxonomies( [ 'object_type' => [ $settings['post_type'] ] ] );
|
||||
if ( $settings['post_type'] === $settings['post_type'] ) {
|
||||
$category = get_the_terms( get_the_ID(), array_key_first( $taxonomies ) );
|
||||
}
|
||||
|
||||
$cat_name = $cat_id = null;
|
||||
$cat_name_2 = $cat_id_2 = null;
|
||||
$cat_name_3 = $cat_id_3 = null;
|
||||
|
||||
$show_cat = ($settings['eael_post_list_post_cat'] != '');
|
||||
$max_cat_length = ! empty ( $settings['eael_post_list_post_cat_max_length'] ) ? intval( $settings['eael_post_list_post_cat_max_length'] ) : 1;
|
||||
$cat_separator = ! empty ( $settings['eael_post_list_post_cat_separator'] ) ? esc_html( $settings['eael_post_list_post_cat_separator'] ) : '';
|
||||
|
||||
if ( !is_wp_error($category) ) {
|
||||
if( ! empty( $category[0] ) ){
|
||||
$cat_id = isset($category[0]->term_id) ? $category[0]->term_id : null;
|
||||
$cat_name = isset($category[0]->name) ? $category[0]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[1] ) ){
|
||||
$cat_id_2 = isset($category[1]->term_id) ? $category[1]->term_id : null;
|
||||
$cat_name_2 = isset($category[1]->name) ? $category[1]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[2] ) ){
|
||||
$cat_id_3 = isset($category[2]->term_id) ? $category[2]->term_id : null;
|
||||
$cat_name_3 = isset($category[2]->name) ? $category[2]->name : null;
|
||||
}
|
||||
}
|
||||
$cat_is_ready = ($show_cat && $cat_name && $cat_id);
|
||||
$separator_1 = ! empty( $cat_id_2 ) ? $cat_separator : '';
|
||||
$separator_2 = ! empty( $cat_id_3 ) ? $cat_separator : '';
|
||||
|
||||
echo '<div class="eael-post-list-post ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '<div class="eael-post-list-post-inner">' : '');
|
||||
if ($settings['eael_post_list_post_feature_image'] === 'yes') {
|
||||
echo '<div class="eael-post-list-thumbnail ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
if (has_post_thumbnail()) {
|
||||
$thumb_url = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['eael_post_featured_image_size']);
|
||||
echo '<a href="' . get_the_permalink() . '"' . $link_settings['image_link_nofollow'] . '' . $link_settings['image_link_target_blank'] . '>
|
||||
<img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-post-list-content">';
|
||||
if ($settings['eael_post_list_layout_type'] == 'default' && $cat_is_ready) {
|
||||
echo '<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced' && ($iterator == 8) && $cat_is_ready) {
|
||||
echo '<div class="boxed-meta">
|
||||
<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_title'] == 'yes' && !empty($settings['eael_post_list_title_tag'])) {
|
||||
$validate_tag = Helper::eael_pro_validate_html_tag($settings['eael_post_list_title_tag']);
|
||||
echo "<". esc_attr( $validate_tag ) ." class=\"eael-post-list-title\">";
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $link_settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . wp_kses( get_the_title(), Helper::eael_allowed_tags() ) . '</a>';
|
||||
echo "</". esc_attr( $validate_tag ) .">";
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_meta'] === 'yes') {
|
||||
echo '<div class="meta">
|
||||
<span><i class="far fa-calendar-alt"></i> ' . get_the_date(get_option('date_format')) . '</span>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_excerpt'] === 'yes') {
|
||||
if ($settings['eael_post_list_layout_type'] == 'default' || ($settings['eael_post_list_layout_type'] == 'advanced' && $iterator !== 8)) {
|
||||
$content = wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_post_list_post_excerpt_length'], $settings['eael_post_list_excerpt_expanison_indicator']);
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($settings['eael_show_read_more_button']) && $settings['eael_show_read_more_button'] ) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="eael-post-elements-readmore-btn"' . ( $link_settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . esc_attr($settings['eael_post_list_read_more_text']) . '</a>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced') {
|
||||
$author_link = get_author_posts_url(get_the_author_meta('ID'));
|
||||
$day_link = get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'));
|
||||
echo '<div class="boxed-meta">';
|
||||
if ($settings['eael_post_list_author_meta'] != '') {
|
||||
echo '<div class="author-meta">
|
||||
<a href="' . esc_url( $author_link ) . '" class="author-photo">
|
||||
' . get_avatar(get_the_author_meta('ID'), 100, false, strip_tags( get_the_title() ) . '-author') . '
|
||||
</a>
|
||||
|
||||
<div class="author-info">
|
||||
<h5>' . esc_url( get_the_author_posts_link() ) . '</h5>
|
||||
<a href="' . esc_url( $day_link ) . '"><p>' . get_the_date(get_option('date_format')) . '</p></a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($iterator != 8) {
|
||||
if ($cat_is_ready) {
|
||||
echo '<div class="meta-categories">
|
||||
<div class="meta-cats-wrap">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '</div>' : '');
|
||||
echo '</div>';
|
||||
|
||||
$iterator++;
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Preset 2
|
||||
*/
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
|
||||
$category = get_the_category();
|
||||
$taxonomies = get_taxonomies( [ 'object_type' => [ $settings['post_type'] ] ] );
|
||||
if ( $settings['post_type'] === $settings['post_type'] ) {
|
||||
$category = get_the_terms( get_the_ID(), array_key_first( $taxonomies ) );
|
||||
}
|
||||
|
||||
$cat_name = $cat_id = null;
|
||||
$cat_name_2 = $cat_id_2 = null;
|
||||
$cat_name_3 = $cat_id_3 = null;
|
||||
|
||||
$show_cat = ($settings['eael_post_list_post_cat'] != '');
|
||||
$max_cat_length = ! empty ( $settings['eael_post_list_post_cat_max_length'] ) ? intval( $settings['eael_post_list_post_cat_max_length'] ) : 1;
|
||||
$cat_separator = ! empty ( $settings['eael_post_list_post_cat_separator'] ) ? esc_html( $settings['eael_post_list_post_cat_separator'] ) : '';
|
||||
|
||||
if ( !is_wp_error($category) ) {
|
||||
if( ! empty( $category[0] ) ){
|
||||
$cat_id = isset($category[0]->term_id) ? $category[0]->term_id : null;
|
||||
$cat_name = isset($category[0]->name) ? $category[0]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[1] ) ){
|
||||
$cat_id_2 = isset($category[1]->term_id) ? $category[1]->term_id : null;
|
||||
$cat_name_2 = isset($category[1]->name) ? $category[1]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[2] ) ){
|
||||
$cat_id_3 = isset($category[2]->term_id) ? $category[2]->term_id : null;
|
||||
$cat_name_3 = isset($category[2]->name) ? $category[2]->name : null;
|
||||
}
|
||||
}
|
||||
$cat_is_ready = ($show_cat && $cat_name && $cat_id);
|
||||
$separator_1 = ! empty( $cat_id_2 ) ? $cat_separator : '';
|
||||
$separator_2 = ! empty( $cat_id_3 ) ? $cat_separator : '';
|
||||
|
||||
echo '<div class="eael-post-list-post ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '<div class="eael-post-list-post-inner">' : '');
|
||||
if ($settings['eael_post_list_post_feature_image'] === 'yes') {
|
||||
echo '<div class="eael-post-list-thumbnail ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
if (has_post_thumbnail()) {
|
||||
$thumb_url = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['eael_post_featured_image_size']);
|
||||
echo '<a href="' . get_the_permalink() . '"' . $link_settings['image_link_nofollow'] . '' . $link_settings['image_link_target_blank'] . '>
|
||||
<img src="' . esc_url( $thumb_url ) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '">
|
||||
</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div class="eael-post-list-content">';
|
||||
if ($cat_is_ready) {
|
||||
echo '<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced' && ($iterator == 8) && $cat_is_ready) {
|
||||
echo '<div class="boxed-meta">';
|
||||
echo '<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_title'] == 'yes' && !empty($settings['eael_post_list_title_tag'])) {
|
||||
$validate_tag = Helper::eael_pro_validate_html_tag($settings['eael_post_list_title_tag']);
|
||||
echo "<". esc_attr( $validate_tag ) ." class=\"eael-post-list-title\">";
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $link_settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . wp_kses( get_the_title(), Helper::eael_allowed_tags() ) . '</a>';
|
||||
echo "</". esc_attr( $validate_tag ) .">";
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_meta'] === 'yes') {
|
||||
echo '<div class="meta">
|
||||
<span><i class="far fa-calendar-alt"></i> ' . get_the_date(get_option('date_format')) . '</span>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $settings['eael_post_list_post_excerpt'] === 'yes' ) {
|
||||
$content = wp_trim_words( strip_shortcodes( get_the_excerpt() ? get_the_excerpt() : get_the_content() ), $settings['eael_post_list_post_excerpt_length'], $settings['eael_post_list_excerpt_expanison_indicator'] );
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>';
|
||||
}
|
||||
|
||||
if ( isset($settings['eael_show_read_more_button']) && $settings['eael_show_read_more_button'] ) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="eael-post-elements-readmore-btn"' . ( $link_settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . esc_attr($settings['eael_post_list_read_more_text']) . '</a>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_layout_type'] == 'advanced') {
|
||||
echo '<div class="boxed-meta">';
|
||||
if ($settings['eael_post_list_author_meta'] != '') {
|
||||
$author_link = get_author_posts_url(get_the_author_meta('ID'));
|
||||
$day_link = get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'));
|
||||
echo '<div class="author-meta">
|
||||
<a href="' . esc_url( $author_link ) . '" class="author-photo">
|
||||
' . get_avatar(get_the_author_meta('ID'), 100, false, strip_tags( get_the_title() ) . '-author') . '
|
||||
</a>
|
||||
|
||||
<div class="author-info">
|
||||
<h5>' . esc_url( get_the_author_posts_link() ) . '</h5>
|
||||
<a href="' . esc_url( $day_link ) . '"><p>' . get_the_date(get_option('date_format')) . '</p></a>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($iterator != 8) {
|
||||
if ($cat_is_ready) {
|
||||
echo '<div class="meta-categories">
|
||||
<div class="meta-cats-wrap">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo ($settings['eael_post_list_layout_type'] == 'advanced' ? '</div>' : '');
|
||||
echo '</div>';
|
||||
|
||||
$iterator++;
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Template Name: Preset 3
|
||||
*/
|
||||
|
||||
use Elementor\Group_Control_Image_Size;
|
||||
use Essential_Addons_Elementor\Pro\Classes\Helper;
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
|
||||
$category = get_the_category();
|
||||
$taxonomies = get_taxonomies( [ 'object_type' => [ $settings['post_type'] ] ] );
|
||||
if ( $settings['post_type'] === $settings['post_type'] ) {
|
||||
$category = get_the_terms( get_the_ID(), array_key_first( $taxonomies ) );
|
||||
}
|
||||
|
||||
$cat_name = $cat_id = null;
|
||||
$cat_name_2 = $cat_id_2 = null;
|
||||
$cat_name_3 = $cat_id_3 = null;
|
||||
|
||||
$show_cat = ($settings['eael_post_list_post_cat'] != '');
|
||||
$max_cat_length = ! empty ( $settings['eael_post_list_post_cat_max_length'] ) ? intval( $settings['eael_post_list_post_cat_max_length'] ) : 1;
|
||||
$cat_separator = ! empty ( $settings['eael_post_list_post_cat_separator'] ) ? esc_html( $settings['eael_post_list_post_cat_separator'] ) : '';
|
||||
|
||||
if ( !is_wp_error($category) ) {
|
||||
if( ! empty( $category[0] ) ){
|
||||
$cat_id = isset($category[0]->term_id) ? $category[0]->term_id : null;
|
||||
$cat_name = isset($category[0]->name) ? $category[0]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[1] ) ){
|
||||
$cat_id_2 = isset($category[1]->term_id) ? $category[1]->term_id : null;
|
||||
$cat_name_2 = isset($category[1]->name) ? $category[1]->name : null;
|
||||
}
|
||||
|
||||
if( ! empty( $category[2] ) ){
|
||||
$cat_id_3 = isset($category[2]->term_id) ? $category[2]->term_id : null;
|
||||
$cat_name_3 = isset($category[2]->name) ? $category[2]->name : null;
|
||||
}
|
||||
}
|
||||
$cat_is_ready = ($show_cat && $cat_name && $cat_id);
|
||||
$separator_1 = ! empty( $cat_id_2 ) ? $cat_separator : '';
|
||||
$separator_2 = ! empty( $cat_id_3 ) ? $cat_separator : '';
|
||||
|
||||
$post_featured_image_url = Group_Control_Image_Size::get_attachment_image_src( get_post_thumbnail_id(),
|
||||
'eael_post_featured_image', $settings );
|
||||
|
||||
$featured_img = $settings['eael_post_list_post_feature_image'] === 'yes';
|
||||
|
||||
echo '<div class="eael-post-list-post ' . (has_post_thumbnail() ? '' : 'eael-empty-thumbnail') . '">';
|
||||
|
||||
echo '<div class="eael-post-list-featured-inner" '. ( $featured_img ? 'style="background-image: url(' . esc_url( $post_featured_image_url ) . ')"' : '' ) .'>';
|
||||
|
||||
echo '<div class="eael-post-list-content">';
|
||||
if ($cat_is_ready) {
|
||||
echo '<div class="meta-categories">';
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id)) . '">' . esc_html($cat_name . $separator_1) . '</a>';
|
||||
|
||||
if( $cat_id_2 && ( 2 === $max_cat_length || 3 === $max_cat_length ) ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_2)) . '">' . esc_html($cat_name_2 . $separator_2) . '</a>';
|
||||
}
|
||||
|
||||
if( $cat_id_3 && 3 === $max_cat_length ){
|
||||
echo '<a href="' . esc_url(get_category_link($cat_id_3)) . '">' . esc_html($cat_name_3) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_title'] == 'yes' && !empty($settings['eael_post_list_title_tag'])) {
|
||||
$validate_tag = Helper::eael_pro_validate_html_tag($settings['eael_post_list_title_tag']);
|
||||
echo "<". esc_attr( $validate_tag ) ." class=\"eael-post-list-title\">";
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '"' . ( $link_settings['title_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['title_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . wp_kses( get_the_title(), Helper::eael_allowed_tags() ) . '</a>';
|
||||
echo "</". esc_attr( $validate_tag ) .">";
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_meta'] === 'yes') {
|
||||
echo '<div class="meta">
|
||||
<span><i class="far fa-calendar-alt"></i> ' . get_the_date(get_option('date_format')) . '</span>
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ($settings['eael_post_list_post_excerpt'] === 'yes') {
|
||||
$content = wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_post_list_post_excerpt_length'], $settings['eael_post_list_excerpt_expanison_indicator']);
|
||||
echo '<p>' . wp_kses( $content, Helper::eael_allowed_tags() ) . '</p>'; }
|
||||
|
||||
if ( isset($settings['eael_show_read_more_button']) && $settings['eael_show_read_more_button'] ) {
|
||||
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="eael-post-elements-readmore-btn"' . ( $link_settings['read_more_link_nofollow'] ? 'rel="nofollow"' : '' ) . ' ' . ( $link_settings['read_more_link_target_blank'] ? 'target="_blank"' : '' ) . '>' . esc_attr($settings['eael_post_list_read_more_text']) . '</a>';
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Preset 1
|
||||
*/
|
||||
?>
|
||||
<div class="eael-account-dashboard-wrapper preset-1">
|
||||
<div class="eael-account-dashboard-body">
|
||||
<div class="eael-account-dashboard-container">
|
||||
<?php $this->get_account_dashboard_navbar($current_user); ?>
|
||||
<?php $this->get_account_dashboard_content($current_user, $is_editor); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Preset 2
|
||||
*/
|
||||
?>
|
||||
<div class="eael-account-dashboard-wrapper preset-2">
|
||||
<div class="eael-account-dashboard-body">
|
||||
<div class="eael-account-dashboard-container">
|
||||
<?php $this->get_account_dashboard_navbar($current_user); ?>
|
||||
<?php $this->get_account_dashboard_content($current_user, $is_editor); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: Preset 3
|
||||
*/
|
||||
?>
|
||||
<div class="eael-account-dashboard-wrapper preset-3">
|
||||
<div class="eael-account-dashboard-body">
|
||||
<div class="eael-account-dashboard-container">
|
||||
<?php $this->get_account_dashboard_navbar($current_user); ?>
|
||||
<?php $this->get_account_dashboard_content($current_user, $is_editor); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
/**
|
||||
* Template Name: Style 1
|
||||
*
|
||||
* @var $cs_product
|
||||
* @var $image_size
|
||||
* @var $is_purchasable
|
||||
* @var $settings
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="eael-cs-single-product">
|
||||
<div class="eael-cs-product-image">
|
||||
<?php echo wp_kses( $cs_product->get_image( $image_size ), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<div class="eael-cs-product-info">
|
||||
<?php if ( $settings['eael_cross_sales_visibility_title'] === 'yes' || $settings['eael_cross_sales_visibility_price'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-title-price">
|
||||
<?php if ( $settings['eael_cross_sales_visibility_title'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-title">
|
||||
<?php echo esc_html( $cs_product->get_title() ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_price'] ) { ?>
|
||||
<div class="eael-cs-product-price">
|
||||
<?php echo wp_kses( $cs_product->get_price_html(), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_buttons'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-buttons <?php echo $is_purchasable ? 'eael-cs-purchasable' : ''; ?>">
|
||||
<a href="<?php echo esc_url( $cs_product->get_permalink() ); ?>"><i
|
||||
class="fas fa-eye"></i><?php echo esc_html( $settings['eael_woo_cross_sales_view_product_label'] ); ?>
|
||||
</a>
|
||||
<?php if ( $is_purchasable ) { ?>
|
||||
<a href="<?php echo esc_url( $cs_product->add_to_cart_url() ); ?>" class="add_to_cart_button ajax_add_to_cart"
|
||||
data-product_id="<?php echo esc_html( $cs_product->get_ID() ); ?>" data-quantity="1"><i
|
||||
class="fas fa-shopping-cart"></i><?php echo esc_html( $settings['eael_woo_cross_sales_add_to_cart_label'] ); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
/**
|
||||
* Template Name: Style 2
|
||||
*
|
||||
* @var $cs_product
|
||||
* @var $image_size
|
||||
* @var $is_purchasable
|
||||
* @var $settings
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="eael-cs-single-product">
|
||||
<div class="eael-cs-product-image">
|
||||
<?php
|
||||
echo wp_kses( $cs_product->get_image( $image_size ), Helper::eael_allowed_tags() );
|
||||
if ( $settings['eael_cross_sales_visibility_buttons'] === 'yes' ) {
|
||||
?>
|
||||
<div class="eael-cs-product-buttons <?php echo $is_purchasable ? 'eael-cs-purchasable' : ''; ?>">
|
||||
<a href="<?php echo esc_url( $cs_product->get_permalink() ); ?>"><i class="fas fa-eye"></i></a>
|
||||
<?php if ( $is_purchasable ) { ?>
|
||||
<a href="<?php echo esc_url( $cs_product->add_to_cart_url() ); ?>" class="add_to_cart_button ajax_add_to_cart"
|
||||
data-product_id="<?php echo esc_html( $cs_product->get_ID() ); ?>" data-quantity="1"></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ( $settings['eael_cross_sales_visibility_title'] === 'yes' || $settings['eael_cross_sales_visibility_price'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-info">
|
||||
<?php if ( $settings['eael_cross_sales_visibility_title'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-title">
|
||||
<?php echo esc_html( $cs_product->get_title() ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_price'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-price">
|
||||
<?php echo wp_kses( $cs_product->get_price_html(), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
use Essential_Addons_Elementor\Classes\Helper;
|
||||
/**
|
||||
* Template Name: Style 3
|
||||
*
|
||||
* @var $cs_product
|
||||
* @var $image_size
|
||||
* @var $is_purchasable
|
||||
* @var $parent_id
|
||||
* @var $settings
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<div class="eael-cs-single-product">
|
||||
<div class="eael-cs-product-image">
|
||||
<?php echo wp_kses( $cs_product->get_image( $image_size ), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<div class="eael-cs-product-info">
|
||||
<?php if ( $settings['eael_cross_sales_visibility_title'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-title">
|
||||
<a href="<?php echo esc_url( $cs_product->get_permalink() ); ?>"><?php echo esc_html( $cs_product->get_title() ); ?></a>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_price'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-price">
|
||||
<?php echo wp_kses( $cs_product->get_price_html(), Helper::eael_allowed_tags() ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_description'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-excerpt">
|
||||
<?php
|
||||
if ( $parent_id > 0 ) {
|
||||
$product_instance = wc_get_product( $parent_id );
|
||||
$product_short_description = $product_instance->get_short_description();
|
||||
} else {
|
||||
$product_short_description = $cs_product->get_short_description();
|
||||
}
|
||||
|
||||
$description = wp_trim_words( strip_shortcodes( $product_short_description ), $settings['eael_cross_sales_excerpt_length'],
|
||||
$settings['eael_cross_sales_excerpt_expanison_indicator'] );
|
||||
echo wp_kses( $description, Helper::eael_allowed_tags() );
|
||||
?>
|
||||
</div>
|
||||
<?php }
|
||||
if ( $settings['eael_cross_sales_visibility_buttons'] === 'yes' ) { ?>
|
||||
<div class="eael-cs-product-buttons <?php echo $is_purchasable ? 'eael-cs-purchasable' : ''; ?>">
|
||||
<?php if ( $is_purchasable ) { ?>
|
||||
<a href="<?php echo esc_url( $cs_product->add_to_cart_url() ); ?>" class="add_to_cart_button ajax_add_to_cart"
|
||||
data-product_id="<?php echo esc_html( $cs_product->get_ID() ); ?>" data-quantity="1"><i
|
||||
class="fas fa-shopping-cart"></i><?php echo esc_html( $settings['eael_woo_cross_sales_add_to_cart_label'] ); ?></a>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo esc_url( $cs_product->get_permalink() ); ?>"><i
|
||||
class="fas fa-eye"></i><?php echo esc_html( $settings['eael_woo_cross_sales_view_product_label'] ); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 1
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$product = wc_get_product( get_the_ID() );
|
||||
|
||||
if ( ! $product ) {
|
||||
error_log( '$product not found in ' . __FILE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
// Improvement
|
||||
$sale_badge_align = isset( $settings['eael_product_sale_badge_alignment'] ) ? $settings['eael_product_sale_badge_alignment'] : '';
|
||||
$sale_badge_preset = !empty($settings['eael_product_sale_badge_preset']) ?
|
||||
$settings['eael_product_sale_badge_preset'] : 'sale-preset-3';
|
||||
$sale_text = !empty($settings['eael_product_carousel_sale_text']) ? $settings['eael_product_carousel_sale_text'] : 'Sale!';
|
||||
$stockout_text = !empty($settings['eael_product_carousel_stockout_text']) ? $settings['eael_product_carousel_stockout_text'] : 'Stock Out';
|
||||
|
||||
// should print vars
|
||||
$should_print_rating = isset( $settings['eael_product_slider_rating'] ) && 'yes' === $settings['eael_product_slider_rating'];
|
||||
$should_print_quick_view = isset( $settings['eael_product_slider_quick_view'] ) && 'yes' === $settings['eael_product_slider_quick_view'];
|
||||
$should_print_image_clickable = isset( $settings['eael_product_slider_image_clickable'] ) && 'yes' === $settings['eael_product_slider_image_clickable'];
|
||||
$should_print_price = isset( $settings['eael_product_slider_price'] ) && 'yes' === $settings['eael_product_slider_price'];
|
||||
$should_print_excerpt = isset( $settings['eael_product_slider_excerpt'] ) && ('yes' === $settings['eael_product_slider_excerpt'] && has_excerpt());
|
||||
$widget_id = isset($settings['eael_widget_id']) ? $settings['eael_widget_id'] : null;
|
||||
$quick_view_setting = [
|
||||
'widget_id' => $widget_id,
|
||||
'product_id' => $product->get_id(),
|
||||
'page_id' => $settings['eael_page_id'],
|
||||
];
|
||||
|
||||
$reverse = ($settings['eael_product_slider_column_reverse'] == 'yes') ? 'eael-reverse-column' : '';
|
||||
|
||||
if ( true === wc_get_loop_product_visibility( $product->get_id() ) || $product->is_visible() ) {
|
||||
?>
|
||||
<li <?php post_class( ['product', 'swiper-slide'] ); ?>>
|
||||
<div class="eael-product-slider <?php echo esc_attr( $reverse );?>">
|
||||
<div class="product-details-wrap">
|
||||
<div class="product-details">
|
||||
<?php
|
||||
$product_details_html = '';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
$product_details_html .= Helper::get_product_categories_list($settings['eael_post_terms']);
|
||||
}
|
||||
|
||||
if ( $settings['eael_product_slider_show_title'] ) {
|
||||
$product_details_html .= '<div class="eael-product-title">';
|
||||
$product_details_html .= '<' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
if ( empty( $settings['eael_product_slider_title_length'] ) ) {
|
||||
$product_details_html .= $product->get_title();
|
||||
} else {
|
||||
$product_details_html .= implode( " ", array_slice( explode( " ", $product->get_title() ), 0, $settings['eael_product_slider_title_length'] ) );
|
||||
}
|
||||
$product_details_html .= '</' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if ($should_print_rating) {
|
||||
$product_details_html .= wc_get_rating_html($product->get_average_rating(), $product->get_rating_count());
|
||||
}
|
||||
if ( $should_print_excerpt ) {
|
||||
$product_details_html .= '<div class="eael-product-excerpt">';
|
||||
$product_details_html .= '<p>' . wp_trim_words(strip_shortcodes(get_the_excerpt()), $settings['eael_product_slider_excerpt_length'],
|
||||
$settings['eael_product_slider_excerpt_expanison_indicator']) . '</p>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if($should_print_price ){
|
||||
$product_details_html .= '<div class="eael-product-price">'. $product->get_price_html() .'</div>';
|
||||
}
|
||||
|
||||
if( $product_details_html ){
|
||||
echo wp_kses( $product_details_html, Helper::eael_allowed_tags() );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="icons-wrap box-style">
|
||||
<li class="add-to-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
|
||||
<?php if( $should_print_quick_view ){?>
|
||||
<li class="eael-product-quick-view">
|
||||
<a id="eael_quick_view_<?php echo esc_attr( uniqid() ); ?>" data-quickview-setting="<?php echo esc_attr( htmlspecialchars(wp_json_encode($quick_view_setting),ENT_QUOTES) ); ?>"
|
||||
class="open-popup-link">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="view-details" title="Details"><?php echo '<a href="' . esc_url( $product->get_permalink() ) . '"><i class="fas fa-link"></i></a>'; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="product-image-wrap">
|
||||
<div class="image-wrap">
|
||||
<?php
|
||||
echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="eael-onsale outofstock ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="eael-onsale ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">' . esc_html( $sale_text ) . '</span>' : '') );
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '<a href="' . esc_url( $product->get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
|
||||
}
|
||||
echo wp_kses( $product->get_image( $settings['eael_product_slider_image_size_size'], ['loading' => 'eager']), Helper::eael_allowed_tags() );
|
||||
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$product = wc_get_product( get_the_ID() );
|
||||
|
||||
if ( ! $product ) {
|
||||
error_log( '$product not found in ' . __FILE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
// Improvement
|
||||
$sale_badge_align = !empty( $settings['eael_product_sale_badge_alignment'] ) ? $settings['eael_product_sale_badge_alignment'] : 'right';
|
||||
$sale_badge_preset = !empty($settings['eael_product_sale_badge_preset']) ? $settings['eael_product_sale_badge_preset'] : 'sale-preset-1';
|
||||
$sale_text = !empty($settings['eael_product_carousel_sale_text']) ? $settings['eael_product_carousel_sale_text'] : 'Sale!';
|
||||
$stockout_text = !empty($settings['eael_product_carousel_stockout_text']) ? $settings['eael_product_carousel_stockout_text'] : 'Stock Out';
|
||||
|
||||
// should print vars
|
||||
$should_print_rating = isset( $settings['eael_product_slider_rating'] ) && 'yes' === $settings['eael_product_slider_rating'];
|
||||
$should_print_quick_view = isset( $settings['eael_product_slider_quick_view'] ) && 'yes' === $settings['eael_product_slider_quick_view'];
|
||||
$should_print_image_clickable = isset( $settings['eael_product_slider_image_clickable'] ) && 'yes' === $settings['eael_product_slider_image_clickable'];
|
||||
$should_print_price = isset( $settings['eael_product_slider_price'] ) && 'yes' === $settings['eael_product_slider_price'];
|
||||
$should_print_excerpt = isset( $settings['eael_product_slider_excerpt'] ) && ('yes' === $settings['eael_product_slider_excerpt'] && has_excerpt());
|
||||
$widget_id = isset($settings['eael_widget_id']) ? $settings['eael_widget_id'] : null;
|
||||
$quick_view_setting = [
|
||||
'widget_id' => $widget_id,
|
||||
'product_id' => $product->get_id(),
|
||||
'page_id' => $settings['eael_page_id'],
|
||||
];
|
||||
|
||||
$reverse = ($settings['eael_product_slider_column_reverse'] == 'yes') ? 'eael-reverse-column' : '';
|
||||
|
||||
if ( true === wc_get_loop_product_visibility( $product->get_id() ) || $product->is_visible() ) {
|
||||
?>
|
||||
<li <?php post_class( ['product', 'swiper-slide'] ); ?>>
|
||||
<div class="eael-product-slider <?php echo esc_attr( $reverse );?>">
|
||||
<div class="product-details-wrap">
|
||||
<?php
|
||||
$product_details_html = '';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
$product_details_html .= Helper::get_product_categories_list($settings['eael_post_terms']);
|
||||
}
|
||||
|
||||
if ( $settings['eael_product_slider_show_title'] ) {
|
||||
$product_details_html .= '<div class="eael-product-title">';
|
||||
$product_details_html .= '<' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
if ( empty( $settings['eael_product_slider_title_length'] ) ) {
|
||||
$product_details_html .= $product->get_title();
|
||||
} else {
|
||||
$product_details_html .= implode( " ", array_slice( explode( " ", $product->get_title() ), 0, $settings['eael_product_slider_title_length'] ) );
|
||||
}
|
||||
$product_details_html .= '</' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if ($should_print_rating) {
|
||||
$product_details_html .= wc_get_rating_html($product->get_average_rating(), $product->get_rating_count());
|
||||
}
|
||||
if ( $should_print_excerpt ) {
|
||||
$product_details_html .= '<div class="eael-product-excerpt">';
|
||||
$product_details_html .= '<p>' . wp_trim_words(strip_shortcodes(get_the_excerpt()), $settings['eael_product_slider_excerpt_length'],
|
||||
$settings['eael_product_slider_excerpt_expanison_indicator']) . '</p>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if($should_print_price ){
|
||||
$product_details_html .= '<div class="eael-product-price">'. $product->get_price_html() .'</div>';
|
||||
}
|
||||
|
||||
if( $product_details_html ){
|
||||
echo wp_kses( $product_details_html, Helper::eael_allowed_tags() );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="product-image-wrap">
|
||||
<div class="image-wrap">
|
||||
<?php
|
||||
echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="eael-onsale outofstock ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">' . esc_html( $stockout_text ) . '</span>' : ($product->is_on_sale() ? '<span class="eael-onsale ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">' . esc_html( $sale_text ) . '</span>' : '') );
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '<a href="' . esc_url( $product->get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
|
||||
}
|
||||
echo wp_kses( $product->get_image($settings['eael_product_slider_image_size_size'], ['loading' => 'eager']), Helper::eael_allowed_tags() );
|
||||
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="icons-wrap box-style-list">
|
||||
<li class="add-to-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
|
||||
<?php if( $should_print_quick_view ){?>
|
||||
<li class="eael-product-quick-view">
|
||||
<a id="eael_quick_view_<?php echo esc_attr( uniqid() ); ?>" data-quickview-setting="<?php echo esc_attr( htmlspecialchars(wp_json_encode($quick_view_setting),ENT_QUOTES) ); ?>"
|
||||
class="open-popup-link">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="view-details" title="Details"><?php echo '<a href="' . esc_url( $product->get_permalink() ) . '"><i class="fas fa-link"></i></a>'; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$product = wc_get_product( get_the_ID() );
|
||||
|
||||
if ( ! $product ) {
|
||||
error_log( '$product not found in ' . __FILE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
// Improvement
|
||||
$sale_badge_align = isset( $settings['eael_product_sale_badge_alignment'] ) ? $settings['eael_product_sale_badge_alignment'] : '';
|
||||
$sale_badge_preset = !empty($settings['eael_product_sale_badge_preset']) ? $settings['eael_product_sale_badge_preset'] :
|
||||
'sale-preset-4';
|
||||
$sale_text = !empty($settings['eael_product_carousel_sale_text']) ? $settings['eael_product_carousel_sale_text'] : 'Sale!';
|
||||
$stockout_text = !empty($settings['eael_product_carousel_stockout_text']) ? $settings['eael_product_carousel_stockout_text'] : 'Stock Out';
|
||||
|
||||
// should print vars
|
||||
$should_print_rating = isset( $settings['eael_product_slider_rating'] ) && 'yes' === $settings['eael_product_slider_rating'];
|
||||
$should_print_quick_view = isset( $settings['eael_product_slider_quick_view'] ) && 'yes' === $settings['eael_product_slider_quick_view'];
|
||||
$should_print_image_clickable = isset( $settings['eael_product_slider_image_clickable'] ) && 'yes' === $settings['eael_product_slider_image_clickable'];
|
||||
$should_print_price = isset( $settings['eael_product_slider_price'] ) && 'yes' === $settings['eael_product_slider_price'];
|
||||
$should_print_excerpt = isset( $settings['eael_product_slider_excerpt'] ) && ('yes' === $settings['eael_product_slider_excerpt'] && has_excerpt());
|
||||
$widget_id = isset($settings['eael_widget_id']) ? $settings['eael_widget_id'] : null;
|
||||
$quick_view_setting = [
|
||||
'widget_id' => $widget_id,
|
||||
'product_id' => $product->get_id(),
|
||||
'page_id' => $settings['eael_page_id'],
|
||||
];
|
||||
|
||||
$reverse = ($settings['eael_product_slider_column_reverse'] == 'yes') ? 'eael-reverse-column' : '';
|
||||
|
||||
if ( true === wc_get_loop_product_visibility( $product->get_id() ) || $product->is_visible() ) {
|
||||
?>
|
||||
<li <?php post_class( ['product', 'swiper-slide'] ); ?>>
|
||||
<div class="eael-product-slider <?php echo esc_attr( $reverse );?>">
|
||||
<div class="product-image-wrap">
|
||||
<div class="image-wrap">
|
||||
<?php
|
||||
echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="eael-onsale outofstock ' . esc_attr( $sale_badge_preset ) .' ' . esc_attr( $sale_badge_align ) . '">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="eael-onsale ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">' . esc_html( $sale_text ) . '</span>' : '') );
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '<a href="' . esc_url( $product->get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
|
||||
}
|
||||
echo wp_kses( $product->get_image($settings['eael_product_slider_image_size_size'], ['loading' => 'eager']), Helper::eael_allowed_tags() );
|
||||
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-details-wrap">
|
||||
<div class="product-details">
|
||||
<?php
|
||||
$product_details_html = '';
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
$product_details_html .= Helper::get_product_categories_list($settings['eael_post_terms']);
|
||||
}
|
||||
|
||||
if ( $should_print_price ) {
|
||||
$product_details_html .= '<div class="eael-product-price">' . $product->get_price_html() . '</div>';
|
||||
}
|
||||
|
||||
if ( $settings['eael_product_slider_show_title'] ) {
|
||||
$title = '<div class="eael-product-title">';
|
||||
$title .= '<' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
if ( empty( $settings['eael_product_slider_title_length'] ) ) {
|
||||
$title .= $product->get_title();
|
||||
} else {
|
||||
$title .= implode( " ", array_slice( explode( " ", $product->get_title() ), 0, $settings['eael_product_slider_title_length'] ) );
|
||||
}
|
||||
$title .= '</' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
$title .= '</div>';
|
||||
|
||||
$product_details_html .= $title;
|
||||
}
|
||||
|
||||
if ( $should_print_excerpt ) {
|
||||
$product_details_html .= '<div class="eael-product-excerpt">';
|
||||
$product_details_html .= '<p>' . wp_trim_words(strip_shortcodes(get_the_excerpt()), $settings['eael_product_slider_excerpt_length'],
|
||||
$settings['eael_product_slider_excerpt_expanison_indicator']) . '</p>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if ($should_print_rating) {
|
||||
$product_details_html .= wc_get_rating_html($product->get_average_rating(), $product->get_rating_count());
|
||||
}
|
||||
|
||||
echo wp_kses( $product_details_html, Helper::eael_allowed_tags() )
|
||||
?>
|
||||
</div>
|
||||
|
||||
<ul class="icons-wrap box-style">
|
||||
<?php if( $should_print_quick_view ){?>
|
||||
<li class="eael-product-quick-view">
|
||||
<a id="eael_quick_view_<?php echo esc_attr( uniqid() ); ?>" data-quickview-setting="<?php echo esc_attr( htmlspecialchars(wp_json_encode($quick_view_setting),ENT_QUOTES) ); ?>"
|
||||
class="open-popup-link">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="view-details" title="Details"><?php echo '<a href="' . esc_url( $product->get_permalink() ) . '"><i class="fas fa-link"></i></a>'; ?></li>
|
||||
</ul>
|
||||
|
||||
<div class="eael-add-to-cart-button"><?php woocommerce_template_loop_add_to_cart(); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
|
||||
$product = wc_get_product( get_the_ID() );
|
||||
|
||||
if ( ! $product ) {
|
||||
error_log( '$product not found in ' . __FILE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
// Improvement
|
||||
$sale_badge_align = isset( $settings['eael_product_sale_badge_alignment'] ) ? $settings['eael_product_sale_badge_alignment'] : '';
|
||||
$sale_badge_preset = !empty($settings['eael_product_sale_badge_preset']) ? $settings['eael_product_sale_badge_preset'] : 'sale-preset-2';
|
||||
$sale_text = !empty($settings['eael_product_carousel_sale_text']) ? $settings['eael_product_carousel_sale_text'] : 'Sale!';
|
||||
$stockout_text = !empty($settings['eael_product_carousel_stockout_text']) ? $settings['eael_product_carousel_stockout_text'] : 'Stock Out';
|
||||
|
||||
// should print vars
|
||||
$should_print_rating = isset( $settings['eael_product_slider_rating'] ) && 'yes' === $settings['eael_product_slider_rating'];
|
||||
$should_print_quick_view = isset( $settings['eael_product_slider_quick_view'] ) && 'yes' === $settings['eael_product_slider_quick_view'];
|
||||
$should_print_image_clickable = isset( $settings['eael_product_slider_image_clickable'] ) && 'yes' === $settings['eael_product_slider_image_clickable'];
|
||||
$should_print_price = isset( $settings['eael_product_slider_price'] ) && 'yes' === $settings['eael_product_slider_price'];
|
||||
$should_print_excerpt = isset( $settings['eael_product_slider_excerpt'] ) && ('yes' === $settings['eael_product_slider_excerpt'] && has_excerpt());
|
||||
$widget_id = isset($settings['eael_widget_id']) ? $settings['eael_widget_id'] : null;
|
||||
$quick_view_setting = [
|
||||
'widget_id' => $widget_id,
|
||||
'product_id' => $product->get_id(),
|
||||
'page_id' => $settings['eael_page_id'],
|
||||
];
|
||||
|
||||
$reverse = ($settings['eael_product_slider_column_reverse'] == 'yes') ? 'eael-reverse-column' : '';
|
||||
|
||||
if ( true === wc_get_loop_product_visibility( $product->get_id() ) || $product->is_visible() ) {
|
||||
?>
|
||||
<li <?php post_class( ['product', 'swiper-slide'] ); ?>>
|
||||
<div class="eael-product-slider <?php echo esc_attr( $reverse );?>">
|
||||
<div class="product-details-wrap">
|
||||
<div class="product-details">
|
||||
<?php
|
||||
$product_details_html = '';
|
||||
|
||||
if ($settings['eael_show_post_terms'] === 'yes') {
|
||||
$product_details_html .= Helper::get_product_categories_list($settings['eael_post_terms']);
|
||||
}
|
||||
|
||||
if ( $settings['eael_product_slider_show_title'] ) {
|
||||
$product_details_html .= '<div class="eael-product-title">';
|
||||
$product_details_html .= '<' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
if ( empty( $settings['eael_product_slider_title_length'] ) ) {
|
||||
$product_details_html .= $product->get_title();
|
||||
} else {
|
||||
$product_details_html .= implode( " ", array_slice( explode( " ", $product->get_title() ), 0, $settings['eael_product_slider_title_length'] ) );
|
||||
}
|
||||
$product_details_html .= '</' . $settings['eael_product_slider_title_tag'] . '>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if ($should_print_rating) {
|
||||
$product_details_html .= wc_get_rating_html( $product->get_average_rating(), $product->get_rating_count() );
|
||||
}
|
||||
|
||||
if($should_print_price ){
|
||||
$product_details_html .= '<div class="eael-product-price">'. $product->get_price_html() .'</div>';
|
||||
}
|
||||
|
||||
if ( $should_print_excerpt ) {
|
||||
$product_details_html .= '<div class="eael-product-excerpt">';
|
||||
$product_details_html .= '<p>' . wp_trim_words(strip_shortcodes(get_the_excerpt()), $settings['eael_product_slider_excerpt_length'],
|
||||
$settings['eael_product_slider_excerpt_expanison_indicator']) . '</p>';
|
||||
$product_details_html .= '</div>';
|
||||
}
|
||||
|
||||
if( $product_details_html ){
|
||||
echo wp_kses( $product_details_html, Helper::eael_allowed_tags() );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="eael-add-to-cart-button"><?php woocommerce_template_loop_add_to_cart(); ?></div>
|
||||
</div>
|
||||
<div class="product-image-wrap">
|
||||
<div class="image-wrap">
|
||||
<?php
|
||||
echo ( ! $product->managing_stock() && ! $product->is_in_stock() ? '<span class="eael-onsale outofstock ' . esc_attr( $sale_badge_preset ) .' ' . esc_attr( $sale_badge_align ) . '">'. esc_html( $stockout_text ) .'</span>' : ($product->is_on_sale() ? '<span class="eael-onsale ' . esc_attr( $sale_badge_preset ) . ' ' . esc_attr( $sale_badge_align ) . '">' . esc_html( $sale_text ) . '</span>' : '') );
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '<a href="' . esc_url( $product->get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
|
||||
}
|
||||
echo wp_kses( $product->get_image($settings['eael_product_slider_image_size_size'], ['loading' => 'eager']), Helper::eael_allowed_tags() );
|
||||
|
||||
if( $should_print_image_clickable ) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="image-hover-wrap">
|
||||
<ul class="icons-wrap box-style">
|
||||
<?php if( $should_print_quick_view ){?>
|
||||
<li class="eael-product-quick-view">
|
||||
<a id="eael_quick_view_<?php echo esc_attr( uniqid() ); ?>" data-quickview-setting="<?php echo esc_attr( htmlspecialchars(wp_json_encode($quick_view_setting),ENT_QUOTES) ); ?>"
|
||||
class="open-popup-link">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="view-details" title="Details"><?php echo '<a href="' . esc_url( $product->get_permalink() ) . '"><i class="fas fa-link"></i></a>'; ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 1
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array(
|
||||
'completed',
|
||||
'processing'
|
||||
) ) );
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
$downloads = $order->get_downloadable_items();
|
||||
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
|
||||
?>
|
||||
<?php if ( $order->has_status( 'failed' ) ) :
|
||||
echo 'faild';
|
||||
else:
|
||||
?>
|
||||
|
||||
<div class="eael-thankyou-container">
|
||||
|
||||
<?php if ( $settings['eael_show_thankyou_message'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-message">
|
||||
<?php if ( $settings['eael_show_thankyou_message_icon']['value'] !== '' ): ?>
|
||||
<div class="eael-thankyou-message-icon"><?php \Elementor\Icons_Manager::render_icon( $settings['eael_show_thankyou_message_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-icon'
|
||||
] ); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="eael-thankyou-message-text"><?php echo wp_kses( $settings['eael_thankyou_message'], Helper::eael_allowed_tags() ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-overview">
|
||||
<ul class="woocommerce-order-overview order_details">
|
||||
<?php if ( $settings['eael_show_order_overview_number'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__order order">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_number_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_date'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__date date">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_date_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wc_format_datetime( $order->get_date_created(), $settings['eael_order_overview_date_format'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_email'] === 'yes' && is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
|
||||
<li class="woocommerce-order-overview__email email">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_email_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_total'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__total total">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_total_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_payment_method'] === 'yes' && $order->get_payment_method_title() ) : ?>
|
||||
<li class="woocommerce-order-overview__payment-method method">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_payment_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eael-thankyou-payment-extra-info">
|
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $show_downloads && isset( $settings['eael_show_order_downloads'] ) && $settings['eael_show_order_downloads'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-downloads">
|
||||
<?php if ( isset( $settings['eael_thankyou_show_downloads_title'] ) && $settings['eael_thankyou_show_downloads_title'] === 'yes' ): ?>
|
||||
<h2 class="woocommerce-order-downloads__title"><?php echo esc_html( $settings['eael_thankyou_downloads_title'] ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
add_filter( 'woocommerce_account_downloads_columns', function ( $columns ) use ( $settings ) {
|
||||
if ( isset( $settings['eael_thankyou_show_product_column'] ) && $settings['eael_thankyou_show_product_column'] === 'yes' ) {
|
||||
$columns['download-product'] = $settings['eael_thankyou_product_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-product'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_download_remaining_column'] ) && $settings['eael_thankyou_show_download_remaining_column'] === 'yes' ) {
|
||||
$columns['download-remaining'] = $settings['eael_thankyou_download_remaining_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-remaining'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_expires_column'] ) && $settings['eael_thankyou_show_expires_column'] === 'yes' ) {
|
||||
$columns['download-expires'] = $settings['eael_thankyou_expires_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-expires'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_download_column'] ) && $settings['eael_thankyou_download_column'] === 'yes' ) {
|
||||
$columns['download-file'] = $settings['eael_thankyou_download_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-file'] );
|
||||
}
|
||||
|
||||
return $columns;
|
||||
} );
|
||||
wc_get_template( 'order/order-downloads.php', [ 'downloads' => $downloads ] );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_details'] === 'yes' ): ?>
|
||||
|
||||
<div class="eael-thankyou-order-details">
|
||||
|
||||
<?php if ( $settings['eael_show_order_details_title'] === 'yes' ): ?>
|
||||
|
||||
<h2 class="woocommerce-order-details__title"><?php echo esc_html( $settings['eael_order_details_title'] ); ?></h2>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-order-items">
|
||||
<table class="eael-thankyou-order-items-table">
|
||||
|
||||
<?php if ( $settings['eael_show_order_table_heading'] === 'yes' ): ?>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="eael-thankyou-order-products"><?php echo esc_html( $settings['eael_order_table_product_label'] ); ?></th>
|
||||
<th class="eael-thankyou-order-totals"><?php echo esc_html( $settings['eael_order_table_total_label'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $order_items as $item_id => $item ) {
|
||||
$product = $item->get_product();
|
||||
?>
|
||||
<tr class="eael-thankyou-order-item">
|
||||
|
||||
<td class="eael-thankyou-order-item-details">
|
||||
<?php
|
||||
if ( $settings['eael_show_order_items_image'] === 'yes' ) {
|
||||
$image_url = wp_get_attachment_image_url( $product->get_image_id(), 'full' );
|
||||
echo '<img class="eael-thankyou-product-image" src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $item->get_name() ) . '">';
|
||||
}
|
||||
echo "<div class='eael-thankyou-product-info'>";
|
||||
if ( $settings['eael_show_order_items_name'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-name'>";
|
||||
$is_visible = $product && $product->is_visible();
|
||||
$product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
|
||||
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
|
||||
echo "</div>";
|
||||
}
|
||||
echo "<div class='eael-thankyou-product-summary'>";
|
||||
|
||||
if ( $settings['eael_show_order_items_meta'] === 'yes' && $item->get_all_formatted_meta_data() ) {
|
||||
$hide_meta_label = empty( $settings['eael_show_order_items_meta_label'] ) || $settings['eael_show_order_items_meta_label'] != 'yes' ? 'hide-meta-label' : '';
|
||||
echo "<div class='eael-thankyou-product-meta " . esc_attr( $hide_meta_label ) . "'>";
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
|
||||
|
||||
$meta_args = [
|
||||
'separator' => ',</li><li>',
|
||||
'label_before' => '<span class="wc-item-meta-label">',
|
||||
'label_after' => ':</span> '
|
||||
];
|
||||
|
||||
wc_display_item_meta( $item, $meta_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if ( $settings['eael_show_order_items_qty'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-qty'>";
|
||||
$qty = $item->get_quantity();
|
||||
$refunded_qty = $order->get_qty_refunded_for_item( $item_id );
|
||||
|
||||
if ( $refunded_qty ) {
|
||||
$qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * - 1 ) ) . '</ins>';
|
||||
} else {
|
||||
$qty_display = esc_html( $qty );
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_order_item_quantity_html', ' <span class="product-quantity">' . sprintf( 'Qty: %s', $qty_display ) . '</span>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo "</div>";
|
||||
}
|
||||
echo "</div></div>";
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="eael-thankyou-order-item-total">
|
||||
<?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-billing-shipping-summary">
|
||||
<div class="eael-thankyou-billing-shipping">
|
||||
<?php if ( $settings['eael_show_order_billing'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-billing">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-billing-title'>" . esc_html( $settings['eael_order_billing_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-billing-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_cell_no'] === 'yes' && $order->get_billing_phone() ): ?>
|
||||
<div class="eael-thankyou-phone">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_cell_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_cell_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-cell-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_cell_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_phone() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_email'] === 'yes' && $order->get_billing_email() ): ?>
|
||||
<div class="eael-thankyou-email">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_email_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_email_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-email-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_email_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_email() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_shipping'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-shipping">
|
||||
<?php
|
||||
if ( $settings['eael_show_shipping_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-shipping-title'>" . esc_html( $settings['eael_order_shipping_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-shipping-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="eael-thankyou-order-summary">
|
||||
<?php if ( $settings['eael_show_order_summary'] === 'yes' ): ?>
|
||||
<table class="eael-thankyou-order-summary-table">
|
||||
<?php
|
||||
foreach ( $order->get_order_item_totals() as $key => $total ) {
|
||||
$class = strtolower( str_replace( [ ' ', ':' ], [ '-', '' ], $total['label'] ) );
|
||||
?>
|
||||
<tr class="eael-thankyou-order-summary-<?php echo esc_attr( $class ) ?>">
|
||||
<th scope="row"><?php echo esc_html( $total['label'] ); ?></th>
|
||||
<td><?php echo wp_kses_post( $total['value'] ); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ( $order->get_customer_note() ) : ?>
|
||||
<tr class="eael-thankyou-order-summary-note">
|
||||
<th><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
|
||||
<td><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
@@ -0,0 +1,336 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 2
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array(
|
||||
'completed',
|
||||
'processing'
|
||||
) ) );
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
$downloads = $order->get_downloadable_items();
|
||||
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
|
||||
?>
|
||||
<?php if ( $order->has_status( 'failed' ) ) :
|
||||
echo 'faild';
|
||||
else:
|
||||
?>
|
||||
|
||||
<div class="eael-thankyou-container">
|
||||
|
||||
<?php if ( $settings['eael_show_thankyou_message'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-message">
|
||||
<?php
|
||||
$customer_name = $order->get_billing_first_name();
|
||||
if ( $settings['eael_thankyou_customer_name_type'] === 'last' ) {
|
||||
$customer_name = $order->get_billing_last_name();
|
||||
} else if ( $settings['eael_thankyou_customer_name_type'] === 'full' ) {
|
||||
$customer_name .= ' ' . $order->get_billing_last_name();
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-hello"><?php printf( '%s %s,', esc_html( $settings['eael_thankyou_hello_text'] ), esc_html( $customer_name ) ); ?></div>
|
||||
|
||||
<div class="eael-thankyou-message-text"><?php echo wp_kses( $settings['eael_thankyou_message'], Helper::eael_allowed_tags() ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_details'] === 'yes' && $settings['eael_show_order_details_title'] === 'yes' ): ?>
|
||||
|
||||
<h2 class="woocommerce-order-details__title"><?php echo esc_html( $settings['eael_order_details_title'] ); ?></h2>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-overview">
|
||||
<ul class="woocommerce-order-overview order_details">
|
||||
<?php if ( $settings['eael_show_order_overview_number'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__order order">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_number_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_date'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__date date">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_date_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wc_format_datetime( $order->get_date_created(), $settings['eael_order_overview_date_format'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_email'] === 'yes' && is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
|
||||
<li class="woocommerce-order-overview__email email">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_email_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_total'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__total total">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_total_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_payment_method'] === 'yes' && $order->get_payment_method_title() ) : ?>
|
||||
<li class="woocommerce-order-overview__payment-method method">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_payment_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eael-thankyou-payment-extra-info">
|
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
|
||||
</div>
|
||||
<?php if ( $settings['eael_show_order_details'] === 'yes' ): ?>
|
||||
|
||||
<div class="eael-thankyou-order-details">
|
||||
|
||||
<div class="eael-thankyou-order-items">
|
||||
<table class="eael-thankyou-order-items-table">
|
||||
|
||||
<?php if ( $settings['eael_show_order_table_heading'] === 'yes' ): ?>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="eael-thankyou-order-products"><?php echo esc_html( $settings['eael_order_table_product_label'] ); ?></th>
|
||||
<?php if ( $settings['eael_show_order_items_meta'] === 'yes' ): ?>
|
||||
<th class="eael-thankyou-order-item-variations"><?php echo esc_html( $settings['eael_order_table_meta_label'] ); ?></th>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_items_price'] === 'yes' ): ?>
|
||||
<th class="eael-thankyou-order-item-price"><?php echo esc_html( $settings['eael_order_table_item_price_label'] ); ?></th>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_items_qty'] === 'yes' ): ?>
|
||||
<th class="eael-thankyou-order-item-qty"><?php echo esc_html( $settings['eael_order_table_qty_label'] ); ?></th>
|
||||
<?php endif; ?>
|
||||
<th class="eael-thankyou-order-totals"><?php echo esc_html( $settings['eael_order_table_total_label'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $order_items as $item_id => $item ) {
|
||||
$product = $item->get_product();
|
||||
?>
|
||||
<tr class="eael-thankyou-order-item">
|
||||
|
||||
<td class="eael-thankyou-order-item-details">
|
||||
<?php
|
||||
if ( $settings['eael_show_order_items_image'] === 'yes' ) {
|
||||
$image_url = wp_get_attachment_image_url( $product->get_image_id(), 'full' );
|
||||
echo '<img class="eael-thankyou-product-image" src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $item->get_name() ) . '">';
|
||||
}
|
||||
echo "<div class='eael-thankyou-product-info'>";
|
||||
if ( $settings['eael_show_order_items_name'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-name'>";
|
||||
$is_visible = $product && $product->is_visible();
|
||||
$product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
|
||||
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
|
||||
echo "</div>";
|
||||
}
|
||||
echo "</div>";
|
||||
?>
|
||||
</td>
|
||||
<?php if ( $settings['eael_show_order_items_meta'] === 'yes' ): ?>
|
||||
<td>
|
||||
<?php
|
||||
if ( $item->get_all_formatted_meta_data() ) {
|
||||
$hide_meta_label = empty( $settings['eael_show_order_items_meta_label'] ) || $settings['eael_show_order_items_meta_label'] != 'yes' ? 'hide-meta-label' : '';
|
||||
echo "<div class='eael-thankyou-product-meta " . esc_attr( $hide_meta_label ) . "'>";
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
|
||||
|
||||
$meta_args = [
|
||||
'separator' => '</li><li>',
|
||||
'label_before' => '<span class="wc-item-meta-label">',
|
||||
'label_after' => ':</span> '
|
||||
];
|
||||
|
||||
wc_display_item_meta( $item, $meta_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</td> <?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_items_price'] === 'yes' ): ?>
|
||||
<td>
|
||||
<?php
|
||||
echo "<div class='eael-thankyou-product-price'>";
|
||||
echo wp_kses( $product->get_price_html(), Helper::eael_allowed_tags() );
|
||||
echo "</div>";
|
||||
?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_items_qty'] === 'yes' ): ?>
|
||||
<td>
|
||||
<?php
|
||||
if ( $settings['eael_show_order_items_qty'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-qty'>";
|
||||
$qty = $item->get_quantity();
|
||||
$refunded_qty = $order->get_qty_refunded_for_item( $item_id );
|
||||
|
||||
if ( $refunded_qty ) {
|
||||
$qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * - 1 ) ) . '</ins>';
|
||||
} else {
|
||||
$qty_display = esc_html( $qty );
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_order_item_quantity_html', ' <span class="product-quantity">' . $qty_display . '</span>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
|
||||
<td class="eael-thankyou-order-item-total">
|
||||
<?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-order-summary">
|
||||
<?php if ( $settings['eael_show_order_summary'] === 'yes' ): ?>
|
||||
<table class="eael-thankyou-order-summary-table">
|
||||
<?php
|
||||
foreach ( $order->get_order_item_totals() as $key => $total ) {
|
||||
$class = strtolower( str_replace( [ ' ', ':' ], [ '-', '' ], $total['label'] ) );
|
||||
?>
|
||||
<tr class="eael-thankyou-order-summary-<?php echo esc_attr( $class ); ?>">
|
||||
<th scope="row"><?php echo esc_html( $total['label'] ); ?></th>
|
||||
<td><?php echo wp_kses_post( $total['value'] ); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ( $order->get_customer_note() ) : ?>
|
||||
<tr class="eael-thankyou-order-summary-note">
|
||||
<th><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
|
||||
<td><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $show_downloads && isset( $settings['eael_show_order_downloads'] ) && $settings['eael_show_order_downloads'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-downloads">
|
||||
<?php if ( isset( $settings['eael_thankyou_show_downloads_title'] ) && $settings['eael_thankyou_show_downloads_title'] === 'yes' ): ?>
|
||||
<h2 class="woocommerce-order-downloads__title"><?php echo esc_html( $settings['eael_thankyou_downloads_title'] ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
add_filter( 'woocommerce_account_downloads_columns', function ( $columns ) use ( $settings ) {
|
||||
if ( isset( $settings['eael_thankyou_show_product_column'] ) && $settings['eael_thankyou_show_product_column'] === 'yes' ) {
|
||||
$columns['download-product'] = $settings['eael_thankyou_product_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-product'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_download_remaining_column'] ) && $settings['eael_thankyou_show_download_remaining_column'] === 'yes' ) {
|
||||
$columns['download-remaining'] = $settings['eael_thankyou_download_remaining_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-remaining'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_expires_column'] ) && $settings['eael_thankyou_show_expires_column'] === 'yes' ) {
|
||||
$columns['download-expires'] = $settings['eael_thankyou_expires_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-expires'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_download_column'] ) && $settings['eael_thankyou_download_column'] === 'yes' ) {
|
||||
$columns['download-file'] = $settings['eael_thankyou_download_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-file'] );
|
||||
}
|
||||
|
||||
return $columns;
|
||||
} );
|
||||
wc_get_template( 'order/order-downloads.php', [ 'downloads' => $downloads ] );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-billing-shipping">
|
||||
<?php if ( $settings['eael_show_order_billing'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-billing">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-billing-title'>" . esc_html( $settings['eael_order_billing_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-billing-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_cell_no'] === 'yes' && $order->get_billing_phone() ): ?>
|
||||
<div class="eael-thankyou-phone">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_cell_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_cell_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-cell-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_cell_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_phone() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_email'] === 'yes' && $order->get_billing_email() ): ?>
|
||||
<div class="eael-thankyou-email">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_email_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_email_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-email-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_email_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_email() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_shipping'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-shipping">
|
||||
<?php
|
||||
if ( $settings['eael_show_shipping_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-shipping-title'>" . esc_html( $settings['eael_order_shipping_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-shipping-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
@@ -0,0 +1,405 @@
|
||||
<?php
|
||||
|
||||
use \Essential_Addons_Elementor\Classes\Helper;
|
||||
|
||||
/**
|
||||
* Template Name: Preset 3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
} // Exit if accessed directly
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array(
|
||||
'completed',
|
||||
'processing'
|
||||
) ) );
|
||||
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
$downloads = $order->get_downloadable_items();
|
||||
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
|
||||
?>
|
||||
<?php if ( $order->has_status( 'failed' ) ) :
|
||||
echo 'faild';
|
||||
else:
|
||||
?>
|
||||
<div class="eael-thankyou-container">
|
||||
<div class="eael-thankyou-left">
|
||||
<?php if ( $settings['eael_show_thankyou_message'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-message">
|
||||
<?php if ( $settings['eael_show_thankyou_message_icon']['value'] !== '' ): ?>
|
||||
<div class="eael-thankyou-message-icon"><?php \Elementor\Icons_Manager::render_icon( $settings['eael_show_thankyou_message_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-icon'
|
||||
] ); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="eael-thankyou-message-text-area">
|
||||
<div class="eael-thankyou-text"><?php echo esc_html( $settings['eael_thankyou_text'] ); ?></div>
|
||||
<div class="eael-thankyou-message-text"><?php echo wp_kses( $settings['eael_thankyou_message'], Helper::eael_allowed_tags() ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-overview">
|
||||
<?php if ( $settings['eael_show_order_overview_section_title'] === 'yes' ): ?>
|
||||
<h2 class="eael-order-overview-title"><?php echo esc_html( $settings['eael_order_overview_section_title'] ) ?></h2>
|
||||
<?php endif; ?>
|
||||
<ul class="woocommerce-order-overview order_details">
|
||||
<?php if ( $settings['eael_show_order_overview_number'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__order order">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_number_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_date'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__date date">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_date_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wc_format_datetime( $order->get_date_created(), $settings['eael_order_overview_date_format'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_email'] === 'yes' && is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
|
||||
<li class="woocommerce-order-overview__email email">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_email_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_total'] === 'yes' ): ?>
|
||||
<li class="woocommerce-order-overview__total total">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_total_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_order_overview_payment_method'] === 'yes' && $order->get_payment_method_title() ) : ?>
|
||||
<li class="woocommerce-order-overview__payment-method method">
|
||||
<span class="woocommerce-order-overview-label"><?php echo esc_html( $settings['eael_order_overview_payment_label'] ); ?></span>
|
||||
<span class="woocommerce-order-overview-value"><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="eael-thankyou-payment-extra-info">
|
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
|
||||
</div>
|
||||
<div class="eael-thankyou-billing-shipping eael-thankyou-billing-shipping-for-desktop">
|
||||
<?php if ( $settings['eael_show_order_billing'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-billing">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-billing-title'>" . esc_html( $settings['eael_order_billing_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-billing-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_cell_no'] === 'yes' && $order->get_billing_phone() ): ?>
|
||||
<div class="eael-thankyou-phone">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_cell_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_cell_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-cell-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_cell_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_phone() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_email'] === 'yes' && $order->get_billing_email() ): ?>
|
||||
<div class="eael-thankyou-email">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_email_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_email_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-email-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_email_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_email() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_shipping'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-shipping">
|
||||
<?php
|
||||
if ( $settings['eael_show_shipping_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-shipping-title'>" . esc_html( $settings['eael_order_shipping_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-shipping-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eael-thankyou-right">
|
||||
|
||||
<div class="eael-thankyou-order-details">
|
||||
|
||||
<?php if ( $settings['eael_show_order_details'] === 'yes' ): ?>
|
||||
|
||||
<div class="eael-thankyou-order-items">
|
||||
<table class="eael-thankyou-order-items-table">
|
||||
|
||||
<?php if ( $settings['eael_show_order_table_heading'] === 'yes' ): ?>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="eael-thankyou-order-products"><?php echo esc_html( $settings['eael_order_table_product_label'] ); ?></th>
|
||||
<th class="eael-thankyou-order-totals"><?php echo esc_html( $settings['eael_order_table_total_label'] ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $order_items as $item_id => $item ) {
|
||||
$product = $item->get_product();
|
||||
?>
|
||||
<tr class="eael-thankyou-order-item">
|
||||
|
||||
<td class="eael-thankyou-order-item-details">
|
||||
<?php
|
||||
if ( $settings['eael_show_order_items_image'] === 'yes' ) {
|
||||
$image_url = wp_get_attachment_image_url( $product->get_image_id(), 'full' );
|
||||
echo '<img class="eael-thankyou-product-image" src="' . esc_url( $image_url ) . '" alt="' . esc_attr( $item->get_name() ) . '">';
|
||||
}
|
||||
echo "<div class='eael-thankyou-product-info'>";
|
||||
if ( $settings['eael_show_order_items_name'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-name'>";
|
||||
$is_visible = $product && $product->is_visible();
|
||||
$product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
|
||||
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
|
||||
echo "</div>";
|
||||
}
|
||||
echo "<div class='eael-thankyou-product-summary'>";
|
||||
|
||||
if ( $settings['eael_show_order_items_meta'] === 'yes' && $item->get_all_formatted_meta_data() ) {
|
||||
$hide_meta_label = empty( $settings['eael_show_order_items_meta_label'] ) || $settings['eael_show_order_items_meta_label'] != 'yes' ? 'hide-meta-label' : '';
|
||||
echo "<div class='eael-thankyou-product-meta " . esc_attr( $hide_meta_label ) . "'>";
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
|
||||
|
||||
$meta_args = [
|
||||
'separator' => ',</li><li>',
|
||||
'label_before' => '<span class="wc-item-meta-label">',
|
||||
'label_after' => ':</span> '
|
||||
];
|
||||
|
||||
wc_display_item_meta( $item, $meta_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
if ( $settings['eael_show_order_items_qty'] === 'yes' ) {
|
||||
echo "<div class='eael-thankyou-product-qty'>";
|
||||
$qty = $item->get_quantity();
|
||||
$refunded_qty = $order->get_qty_refunded_for_item( $item_id );
|
||||
|
||||
if ( $refunded_qty ) {
|
||||
$qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * - 1 ) ) . '</ins>';
|
||||
} else {
|
||||
$qty_display = esc_html( $qty );
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_order_item_quantity_html', ' <span class="product-quantity">' . sprintf( 'Qty: %s', $qty_display ) . '</span>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo "</div>";
|
||||
}
|
||||
echo "</div></div>";
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="eael-thankyou-order-item-total">
|
||||
<?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-order-summary">
|
||||
<?php if ( $settings['eael_show_order_summary'] === 'yes' ): ?>
|
||||
<table class="eael-thankyou-order-summary-table">
|
||||
<?php
|
||||
foreach ( $order->get_order_item_totals() as $key => $total ) {
|
||||
$class = strtolower( str_replace( [ ' ', ':' ], [ '-', '' ], $total['label'] ) );
|
||||
?>
|
||||
<tr class="eael-thankyou-order-summary-<?php echo esc_attr( $class ); ?>">
|
||||
<th scope="row"><?php echo esc_html( $total['label'] ); ?></th>
|
||||
<td><?php echo wp_kses_post( $total['value'] ); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ( $order->get_customer_note() ) : ?>
|
||||
<tr class="eael-thankyou-order-summary-note">
|
||||
<th><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
|
||||
<td><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php if ( $show_downloads && isset( $settings['eael_show_order_downloads'] ) && $settings['eael_show_order_downloads'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-downloads eael-thankyou-for-mobile">
|
||||
<?php if ( isset( $settings['eael_thankyou_show_downloads_title'] ) && $settings['eael_thankyou_show_downloads_title'] === 'yes' ): ?>
|
||||
<h2 class="woocommerce-order-downloads__title"><?php echo esc_html( $settings['eael_thankyou_downloads_title'] ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
add_filter( 'woocommerce_account_downloads_columns', function ( $columns ) use ( $settings ) {
|
||||
if ( isset( $settings['eael_thankyou_show_product_column'] ) && $settings['eael_thankyou_show_product_column'] === 'yes' ) {
|
||||
$columns['download-product'] = $settings['eael_thankyou_product_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-product'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_download_remaining_column'] ) && $settings['eael_thankyou_show_download_remaining_column'] === 'yes' ) {
|
||||
$columns['download-remaining'] = $settings['eael_thankyou_download_remaining_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-remaining'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_expires_column'] ) && $settings['eael_thankyou_show_expires_column'] === 'yes' ) {
|
||||
$columns['download-expires'] = $settings['eael_thankyou_expires_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-expires'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_download_column'] ) && $settings['eael_thankyou_download_column'] === 'yes' ) {
|
||||
$columns['download-file'] = $settings['eael_thankyou_download_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-file'] );
|
||||
}
|
||||
|
||||
return $columns;
|
||||
} );
|
||||
wc_get_template( 'order/order-downloads.php', [ 'downloads' => $downloads ] );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="eael-thankyou-billing-shipping eael-thankyou-for-mobile">
|
||||
<?php if ( $settings['eael_show_order_billing'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-billing">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-billing-title'>" . esc_html( $settings['eael_order_billing_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-billing-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_cell_no'] === 'yes' && $order->get_billing_phone() ): ?>
|
||||
<div class="eael-thankyou-phone">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_cell_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_cell_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-cell-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_cell_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_phone() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $settings['eael_show_billing_email'] === 'yes' && $order->get_billing_email() ): ?>
|
||||
<div class="eael-thankyou-email">
|
||||
<?php
|
||||
if ( $settings['eael_show_billing_email_label_type'] === 'icon' ) {
|
||||
\Elementor\Icons_Manager::render_icon( $settings['eael_show_billing_email_label_icon'], [
|
||||
'aria-hidden' => 'true',
|
||||
'class' => 'eael-thankyou-billing-email-icon eael-thankyou-icon'
|
||||
] );
|
||||
} else {
|
||||
echo esc_html( $settings['eael_show_billing_email_label'] );
|
||||
}
|
||||
echo esc_html( $order->get_billing_email() );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $settings['eael_show_order_shipping'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-shipping">
|
||||
<?php
|
||||
if ( $settings['eael_show_shipping_title'] === 'yes' ) {
|
||||
echo "<h2 class='eael-thankyou-shipping-title'>" . esc_html( $settings['eael_order_shipping_title'] ) . "</h2>";
|
||||
}
|
||||
?>
|
||||
<div class="eael-thankyou-shipping-address">
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( $show_downloads && isset( $settings['eael_show_order_downloads'] ) && $settings['eael_show_order_downloads'] === 'yes' ): ?>
|
||||
<div class="eael-thankyou-order-downloads eael-thankyou-for-desktop">
|
||||
<?php if ( isset( $settings['eael_thankyou_show_downloads_title'] ) && $settings['eael_thankyou_show_downloads_title'] === 'yes' ): ?>
|
||||
<h2 class="woocommerce-order-downloads__title"><?php echo esc_html( $settings['eael_thankyou_downloads_title'] ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
add_filter( 'woocommerce_account_downloads_columns', function ( $columns ) use ( $settings ) {
|
||||
if ( isset( $settings['eael_thankyou_show_product_column'] ) && $settings['eael_thankyou_show_product_column'] === 'yes' ) {
|
||||
$columns['download-product'] = $settings['eael_thankyou_product_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-product'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_download_remaining_column'] ) && $settings['eael_thankyou_show_download_remaining_column'] === 'yes' ) {
|
||||
$columns['download-remaining'] = $settings['eael_thankyou_download_remaining_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-remaining'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_show_expires_column'] ) && $settings['eael_thankyou_show_expires_column'] === 'yes' ) {
|
||||
$columns['download-expires'] = $settings['eael_thankyou_expires_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-expires'] );
|
||||
}
|
||||
|
||||
if ( isset( $settings['eael_thankyou_download_column'] ) && $settings['eael_thankyou_download_column'] === 'yes' ) {
|
||||
$columns['download-file'] = $settings['eael_thankyou_download_column_label'];
|
||||
} else {
|
||||
unset( $columns['download-file'] );
|
||||
}
|
||||
|
||||
return $columns;
|
||||
} );
|
||||
wc_get_template( 'order/order-downloads.php', [ 'downloads' => $downloads ] );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
endif;
|
||||
Reference in New Issue
Block a user