Initial Commit N° : 001 - V.4.3.3
This commit is contained in:
@@ -0,0 +1,552 @@
|
||||
<?php
|
||||
/**
|
||||
* Archive Products Page
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.6.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
define('NASA_ARCHIVE_PRODUCT', true);
|
||||
|
||||
/**
|
||||
* Before setup shop
|
||||
*/
|
||||
do_action('nasa_before_render_shop');
|
||||
|
||||
global $nasa_opt;
|
||||
|
||||
$nasa_ajax_product = isset($nasa_opt['disable_ajax_product']) && $nasa_opt['disable_ajax_product'] ? false : true;
|
||||
defined('NASA_AJAX_SHOP') or define('NASA_AJAX_SHOP', $nasa_ajax_product);
|
||||
|
||||
$nasa_opt['products_per_row'] = isset($nasa_opt['products_per_row']) && (int) $nasa_opt['products_per_row'] ?
|
||||
(int) $nasa_opt['products_per_row'] : 4;
|
||||
$nasa_opt['products_per_row'] = $nasa_opt['products_per_row'] > 6 || $nasa_opt['products_per_row'] < 2 ? 4 : $nasa_opt['products_per_row'];
|
||||
|
||||
$nasa_change_view = !isset($nasa_opt['enable_change_view']) || $nasa_opt['enable_change_view'] ? true : false;
|
||||
|
||||
$nasa_sidebar = isset($nasa_opt['category_sidebar']) ? $nasa_opt['category_sidebar'] : 'left-classic';
|
||||
|
||||
$option_mobile = isset($nasa_opt['nasa_in_mobile']) && $nasa_opt['nasa_in_mobile'] ? true : false;
|
||||
|
||||
$is_app = $option_mobile && isset($nasa_opt['mobile_layout']) && $nasa_opt['mobile_layout'] == 'app' ? true : false;
|
||||
|
||||
$enable_change_view_mobile = $is_app && isset($nasa_opt['enable_change_view_mobile']) && $nasa_opt['enable_change_view_mobile'] ? true : false;
|
||||
|
||||
$option_change_shop_layout = !$option_mobile && isset($nasa_opt['option_change_shop_layout']) ? $nasa_opt['option_change_shop_layout'] : 'shop-default';
|
||||
|
||||
$hasSidebar = true;
|
||||
$topSidebar = false;
|
||||
$topSidebar2 = false;
|
||||
$topSidebar3 = false;
|
||||
$topbarWrap_class = 'row filters-container nasa-filter-wrap';
|
||||
$attr = 'nasa-products-page-wrap';
|
||||
$class_wrap_archive = 'row fullwidth category-page nasa-store-page';
|
||||
$sort_by_extra_class = '';
|
||||
$before_archive_products_extra_class = 'ns-before-archive-products';
|
||||
$content_extra_class = '';
|
||||
$content_class = '';
|
||||
|
||||
if (isset($_GET['view-layout']) && in_array($_GET['view-layout'], array('grid-2', 'list'))) :
|
||||
$type_show = $_GET['view-layout'];
|
||||
$class_wrap_archive = ($type_show == 'list') ? $class_wrap_archive . ' nasa-mobile-store-in-list' : $class_wrap_archive;
|
||||
else :
|
||||
$type_show = 'grid-default';
|
||||
endif;
|
||||
|
||||
switch ($nasa_sidebar):
|
||||
case 'right':
|
||||
case 'left':
|
||||
$attr .= ' large-12 columns has-sidebar';
|
||||
break;
|
||||
|
||||
case 'right-classic':
|
||||
$attr .= ' large-9 medium-12 columns left has-sidebar';
|
||||
$class_wrap_archive .= ' nasa-with-sidebar-classic right-classic';
|
||||
break;
|
||||
|
||||
case 'no':
|
||||
$hasSidebar = false;
|
||||
$attr .= ' large-12 columns no-sidebar';
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
$hasSidebar = false;
|
||||
$topSidebar = true;
|
||||
$topbarWrap_class .= ' top-bar-wrap-type-1';
|
||||
$attr .= ' large-12 columns no-sidebar top-sidebar';
|
||||
$class_wrap_archive .= ' nasa-top-sidebar-style';
|
||||
break;
|
||||
|
||||
case 'top-2':
|
||||
$hasSidebar = false;
|
||||
$topSidebar2 = true;
|
||||
$topbarWrap_class .= ' top-bar-wrap-type-2';
|
||||
$attr .= ' large-12 columns no-sidebar top-sidebar-2';
|
||||
break;
|
||||
|
||||
case 'top-3':
|
||||
$hasSidebar = false;
|
||||
$topSidebar3 = true;
|
||||
$topbarWrap_class .= ' top-bar-wrap-type-3';
|
||||
$attr .= ' large-12 columns no-sidebar top-sidebar-3';
|
||||
break;
|
||||
|
||||
case 'left-classic':
|
||||
default :
|
||||
$attr .= ' large-9 medium-12 columns right has-sidebar';
|
||||
$class_wrap_archive .= ' nasa-with-sidebar-classic';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
$nasa_recom_pos = isset($nasa_opt['recommend_product_position']) ? $nasa_opt['recommend_product_position'] : 'bot';
|
||||
|
||||
$layout_style = '';
|
||||
if (isset($nasa_opt['products_layout_style']) && $nasa_opt['products_layout_style'] == 'masonry-isotope') :
|
||||
$layout_style = ' nasa-products-masonry-isotope';
|
||||
$layout_style .= isset($nasa_opt['products_masonry_mode']) ? ' nasa-mode-' . $nasa_opt['products_masonry_mode'] : '';
|
||||
endif;
|
||||
|
||||
switch ($option_change_shop_layout):
|
||||
case 'shop-background-color':
|
||||
// $attr .= ' nasa-flex jc flex-column';
|
||||
$class_wrap_archive = str_replace('row','nasa-flex jc flex-column ns-shop-width-background',$class_wrap_archive);
|
||||
$before_archive_products_extra_class .= ' row';
|
||||
break;
|
||||
|
||||
// case 'shop-default':
|
||||
default :
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
/**
|
||||
* Header Shop
|
||||
*/
|
||||
get_header('shop');
|
||||
|
||||
/**
|
||||
* Hook Before Main content
|
||||
*/
|
||||
do_action('woocommerce_before_main_content');
|
||||
?>
|
||||
|
||||
<div class="nasa_shop_description-wrap">
|
||||
<?php
|
||||
/**
|
||||
* Hook: woocommerce_shop_loop_header.
|
||||
*
|
||||
* @since 8.6.0
|
||||
*
|
||||
* @hooked woocommerce_product_taxonomy_archive_header - 10
|
||||
*/
|
||||
do_action('woocommerce_shop_loop_header');
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr($class_wrap_archive); ?>">
|
||||
<?php
|
||||
/**
|
||||
* Hook: nasa_before_archive_products.
|
||||
*/
|
||||
do_action('nasa_before_archive_products');
|
||||
?>
|
||||
|
||||
<div class="large-12 columns <?php echo esc_attr($before_archive_products_extra_class); ?>">
|
||||
<div class="<?php echo esc_attr($topbarWrap_class); ?>">
|
||||
<?php
|
||||
/**
|
||||
* Top Side bar Type 1
|
||||
*/
|
||||
if ($topSidebar) :
|
||||
$topSidebar_wrap = $nasa_change_view ? 'large-10 medium-12 ' : 'large-12 ';
|
||||
|
||||
if (!isset($nasa_opt['showing_info_top']) || $nasa_opt['showing_info_top']) :
|
||||
echo '<div class="showing_info_top hidden-tag">';
|
||||
do_action('nasa_shop_category_count');
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
$is_empty = !woocommerce_product_loop() && $option_mobile ? 'ns-no-matching-product' : '';
|
||||
?>
|
||||
|
||||
<div class="large-12 columns nasa-topbar-filter-wrap">
|
||||
<div class="nasa-flex jbw nasa-topbar-all <?php echo $is_empty?>">
|
||||
<div class="nasa-filter-action nasa-min-height">
|
||||
<div class="nasa-labels-filter-top">
|
||||
<input name="nasa-labels-filter-text" type="hidden" value="<?php echo esc_attr__('Filter by:', 'elessi-theme'); ?>" />
|
||||
<input name="nasa-widget-show-more-text" type="hidden" value="<?php echo esc_attr__('More +', 'elessi-theme'); ?>" />
|
||||
<input name="nasa-widget-show-less-text" type="hidden" value="<?php echo esc_attr__('Less -', 'elessi-theme'); ?>" />
|
||||
<input name="nasa-limit-widgets-show-more" type="hidden" value="<?php echo (!isset($nasa_opt['limit_widgets_show_more']) || (int) $nasa_opt['limit_widgets_show_more'] < 0) ? '2' : (int) $nasa_opt['limit_widgets_show_more']; ?>" />
|
||||
<a class="toggle-topbar-shop-mobile hidden-tag" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M18 5H6C5.5286 5 5.29289 5 5.14645 5.14645C5 5.29289 5 5.5286 5 6V7.96482C5 8.2268 5 8.35779 5.05916 8.46834C5.11833 8.57888 5.22732 8.65154 5.4453 8.79687L8.4688 10.8125C9.34073 11.3938 9.7767 11.6845 10.0133 12.1267C10.25 12.5688 10.25 13.0928 10.25 14.1407V19L13.75 17.25V14.1407C13.75 13.0928 13.75 12.5688 13.9867 12.1267C14.2233 11.6845 14.6593 11.3938 15.5312 10.8125L18.5547 8.79687C18.7727 8.65154 18.8817 8.57888 18.9408 8.46834C19 8.35779 19 8.2268 19 7.96482V6C19 5.5286 19 5.29289 18.8536 5.14645C18.7071 5 18.4714 5 18 5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<?php echo esc_attr__(' Filters', 'elessi-theme'); ?>
|
||||
</a>
|
||||
<span class="nasa-labels-filter-accordion nasa-flex"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Nasa Change view in Mobile
|
||||
*/
|
||||
if ($enable_change_view_mobile) : ?>
|
||||
<div class="nasa-change-view-mobile-wrap">
|
||||
<div class="nasa-change-view-mobile">
|
||||
<a class="nasa-change-layout productList <?php echo ($type_show == 'list') ? 'active' : ''; ?>" data-columns="1" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 1H7.66666C8.77123 1 9.66667 1.89543 9.66667 3V7.66666C9.66667 8.77123 8.77123 9.66667 7.66667 9.66667H3C1.89543 9.66667 1 8.77123 1 7.66667V3C1 1.89543 1.89543 1 3 1ZM0 3C0 1.34315 1.34315 0 3 0H7.66666C9.32352 0 10.6667 1.34315 10.6667 3V7.66666C10.6667 9.32352 9.32352 10.6667 7.66667 10.6667H3C1.34315 10.6667 0 9.32352 0 7.66667V3ZM3 14.037H7.66666C8.77123 14.037 9.66667 14.9325 9.66667 16.037V20.7037C9.66667 21.8083 8.77123 22.7037 7.66667 22.7037H3C1.89543 22.7037 1 21.8083 1 20.7037V16.0371C1 14.9325 1.89543 14.037 3 14.037ZM0 16.0371C0 14.3802 1.34315 13.037 3 13.037H7.66666C9.32352 13.037 10.6667 14.3802 10.6667 16.037V20.7037C10.6667 22.3606 9.32352 23.7037 7.66667 23.7037H3C1.34315 23.7037 0 22.3606 0 20.7037V16.0371ZM13.037 16C13.037 15.6727 13.3024 15.4074 13.6296 15.4074H23.1111C23.4384 15.4074 23.7037 15.6727 23.7037 16C23.7037 16.3273 23.4384 16.5926 23.1111 16.5926H13.6296C13.3024 16.5926 13.037 16.3273 13.037 16ZM13.6296 2.37036C13.3024 2.37036 13.037 2.63567 13.037 2.96295C13.037 3.29023 13.3024 3.55555 13.6296 3.55555H23.1111C23.4384 3.55555 23.7037 3.29023 23.7037 2.96295C23.7037 2.63567 23.4384 2.37036 23.1111 2.37036H13.6296ZM13.037 20.7407C13.037 20.4134 13.3024 20.1481 13.6296 20.1481H23.1111C23.4384 20.1481 23.7037 20.4134 23.7037 20.7407C23.7037 21.068 23.4384 21.3333 23.1111 21.3333H13.6296C13.3024 21.3333 13.037 21.068 13.037 20.7407ZM13.9259 7.40741C13.5987 7.40741 13.3333 7.67272 13.3333 8C13.3333 8.32728 13.5987 8.5926 13.9259 8.5926H23.4074C23.7347 8.5926 24 8.32728 24 8C24 7.67272 23.7347 7.40741 23.4074 7.40741H13.9259Z" fill="currentColor" />
|
||||
</svg>
|
||||
</a>
|
||||
<a class="nasa-change-layout grid df <?php echo ($type_show != 'list') ? 'active' : ''; ?>" data-columns="2" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.8 1H3C1.89543 1 1 1.89543 1 3V7.8C1 8.90457 1.89543 9.8 3 9.8H7.8C8.90457 9.8 9.8 8.90457 9.8 7.8V3C9.8 1.89543 8.90457 1 7.8 1ZM3 0C1.34315 0 0 1.34315 0 3V7.8C0 9.45685 1.34315 10.8 3 10.8H7.8C9.45685 10.8 10.8 9.45685 10.8 7.8V3C10.8 1.34315 9.45685 0 7.8 0H3ZM7.8 14.2H3C1.89543 14.2 1 15.0954 1 16.2V21C1 22.1046 1.89543 23 3 23H7.8C8.90457 23 9.8 22.1046 9.8 21V16.2C9.8 15.0954 8.90457 14.2 7.8 14.2ZM3 13.2C1.34315 13.2 0 14.5432 0 16.2V21C0 22.6569 1.34315 24 3 24H7.8C9.45685 24 10.8 22.6569 10.8 21V16.2C10.8 14.5432 9.45685 13.2 7.8 13.2H3ZM21 1H16.2C15.0954 1 14.2 1.89543 14.2 3V7.8C14.2 8.90457 15.0954 9.8 16.2 9.8H21C22.1046 9.8 23 8.90457 23 7.8V3C23 1.89543 22.1045 1 21 1ZM16.2 0C14.5431 0 13.2 1.34315 13.2 3V7.8C13.2 9.45685 14.5431 10.8 16.2 10.8H21C22.6568 10.8 24 9.45685 24 7.8V3C24 1.34315 22.6568 0 21 0H16.2ZM21 14.2H16.2C15.0954 14.2 14.2 15.0954 14.2 16.2V21C14.2 22.1046 15.0954 23 16.2 23H21C22.1046 23 23 22.1046 23 21V16.2C23 15.0954 22.1045 14.2 21 14.2ZM16.2 13.2C14.5431 13.2 13.2 14.5432 13.2 16.2V21C13.2 22.6569 14.5431 24 16.2 24H21C22.6568 24 24 22.6569 24 21V16.2C24 14.5432 22.6568 13.2 21 13.2H16.2Z" fill="currentColor" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nasa-sort-by-action">
|
||||
<ul class="sort-bar nasa-flex margin-top-0">
|
||||
<li class="nasa-filter-order filter-order">
|
||||
<?php woocommerce_catalog_ordering(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ($nasa_change_view) : ?>
|
||||
<div class="nasa-topbar-change-view-wrap nasa-flex hide-for-medium hide-for-small">
|
||||
<?php
|
||||
/**
|
||||
* Change view ICONS
|
||||
*/
|
||||
$type_sidebar = (!isset($nasa_opt['top_bar_cat_pos']) || $nasa_opt['top_bar_cat_pos'] == 'left-bar') ? 'top-push-cat' : 'no';
|
||||
/**
|
||||
* Nasa Change view in Desktop
|
||||
*/
|
||||
do_action('nasa_change_view', $type_sidebar); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Sidebar TOP
|
||||
*/
|
||||
do_action('nasa_top_sidebar_shop');
|
||||
|
||||
/**
|
||||
* Top Side bar type 2
|
||||
*/
|
||||
elseif ($topSidebar2 || $topSidebar3) :
|
||||
$class_type_fillter = $topSidebar3 ? 'nasa-top-bar-3-content' : 'nasa-top-bar-2-content';
|
||||
?>
|
||||
|
||||
<div class="large-4 medium-6 small-6 columns nasa-toggle-top-bar rtl-right">
|
||||
<a class="nasa-toggle-top-bar-click nasa-flex" href="javascript:void(0);" rel="nofollow">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M18 5H6C5.5286 5 5.29289 5 5.14645 5.14645C5 5.29289 5 5.5286 5 6V7.96482C5 8.2268 5 8.35779 5.05916 8.46834C5.11833 8.57888 5.22732 8.65154 5.4453 8.79687L8.4688 10.8125C9.34073 11.3938 9.7767 11.6845 10.0133 12.1267C10.25 12.5688 10.25 13.0928 10.25 14.1407V19L13.75 17.25V14.1407C13.75 13.0928 13.75 12.5688 13.9867 12.1267C14.2233 11.6845 14.6593 11.3938 15.5312 10.8125L18.5547 8.79687C18.7727 8.65154 18.8817 8.57888 18.9408 8.46834C19 8.35779 19 8.2268 19 7.96482V6C19 5.5286 19 5.29289 18.8536 5.14645C18.7071 5 18.4714 5 18 5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<?php esc_html_e('Filters', 'elessi-theme'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="large-4 columns hide-for-medium hide-for-small nasa-change-view-wrap nasa-min-height text-center rtl-right">
|
||||
<?php if ($nasa_change_view) : ?>
|
||||
<?php
|
||||
/**
|
||||
* Change view ICONS
|
||||
*/
|
||||
do_action('nasa_change_view'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="large-4 medium-6 small-6 columns nasa-sort-by-action nasa-clear-none nasa-min-height text-right rtl-right rtl-text-left">
|
||||
<ul class="sort-bar nasa-float-none margin-top-0">
|
||||
<li class="nasa-filter-order filter-order">
|
||||
<?php woocommerce_catalog_ordering(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="large-12 columns mobile-padding-top-5 mobile-margin-bottom-20 hidden-tag nasa-top-bar-content <?php echo($class_type_fillter)?>">
|
||||
<?php
|
||||
if($topSidebar2):
|
||||
do_action('nasa_top_sidebar_shop', '2');
|
||||
elseif($topSidebar3):
|
||||
do_action('nasa_top_sidebar_shop', '3');
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* TOGGLE Side bar in side (Off-Canvas)
|
||||
*/
|
||||
elseif ($hasSidebar && in_array($nasa_sidebar, array('left', 'right'))) : ?>
|
||||
<div class="large-4 medium-6 small-6 columns nasa-toggle-layout-side-sidebar">
|
||||
<div class="li-toggle-sidebar">
|
||||
<a class="toggle-sidebar-shop nasa-flex" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M18 5H6C5.5286 5 5.29289 5 5.14645 5.14645C5 5.29289 5 5.5286 5 6V7.96482C5 8.2268 5 8.35779 5.05916 8.46834C5.11833 8.57888 5.22732 8.65154 5.4453 8.79687L8.4688 10.8125C9.34073 11.3938 9.7767 11.6845 10.0133 12.1267C10.25 12.5688 10.25 13.0928 10.25 14.1407V19L13.75 17.25V14.1407C13.75 13.0928 13.75 12.5688 13.9867 12.1267C14.2233 11.6845 14.6593 11.3938 15.5312 10.8125L18.5547 8.79687C18.7727 8.65154 18.8817 8.57888 18.9408 8.46834C19 8.35779 19 8.2268 19 7.96482V6C19 5.5286 19 5.29289 18.8536 5.14645C18.7071 5 18.4714 5 18 5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<?php esc_html_e(' Filters', 'elessi-theme'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="large-4 columns hide-for-medium hide-for-small nasa-change-view-layout-side-sidebar nasa-min-height">
|
||||
<?php
|
||||
if ($nasa_change_view) :
|
||||
/**
|
||||
* Change view ICONS
|
||||
*/
|
||||
do_action('nasa_change_view');
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="large-4 medium-6 small-6 columns nasa-sort-bar-layout-side-sidebar nasa-clear-none nasa-min-height">
|
||||
<ul class="sort-bar nasa-flex je rtl-jst">
|
||||
<li class="nasa-filter-order filter-order">
|
||||
<?php woocommerce_catalog_ordering(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* No | left-classic | right-classic side bar
|
||||
*/
|
||||
else :
|
||||
$toggle_sidebar = $hasSidebar && (!isset($nasa_opt['toggle_sidebar_classic']) || $nasa_opt['toggle_sidebar_classic']) ? true : false;
|
||||
$first_col = '';
|
||||
if (!$toggle_sidebar) :
|
||||
if (!isset($nasa_opt['showing_info_top']) || $nasa_opt['showing_info_top']) :
|
||||
$first_col .= '<div class="showing_info_top">';
|
||||
|
||||
ob_start();
|
||||
do_action('nasa_shop_category_count');
|
||||
$first_col .= ob_get_clean();
|
||||
|
||||
$first_col .= '</div>';
|
||||
endif;
|
||||
else :
|
||||
$sort_by_extra_class .= ' nasa-sort-by-sidebar-classic';
|
||||
$first_col .= '<a href="javascript:void(0);" class="nasa-toogle-sidebar-classic nasa-hide-in-mobile rtl-text-right" rel="nofollow">' . esc_html__('Filters', 'elessi-theme') . '</a>';
|
||||
endif;
|
||||
|
||||
$second_cl = 'hide-for-medium hide-for-small nasa-change-view-layout-side-sidebar nasa-min-height columns';
|
||||
$third_cl = 'nasa-clear-none nasa-sort-bar-layout-side-sidebar columns medium-12 small-12' . $sort_by_extra_class;
|
||||
|
||||
$second_cl .= $first_col ? ' large-4' : ' large-6 text-left';
|
||||
$third_cl .= $first_col ? ' large-4' : ' large-6';
|
||||
|
||||
$sortbarclass = 'sort-bar nasa-flex je rtl-jst';
|
||||
$col_class = '';
|
||||
|
||||
if ($nasa_sidebar == 'right-classic') :
|
||||
$sortbarclass = 'sort-bar nasa-flex rtl-je jst';
|
||||
$col_class = ' right';
|
||||
$second_cl .= ' right';
|
||||
$third_cl .= ' right';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php if ($first_col) : ?>
|
||||
<div class="large-4 columns hide-for-medium hide-for-small text-left<?php echo esc_attr($col_class); ?>">
|
||||
<?php echo $first_col; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php echo esc_attr($second_cl); ?>">
|
||||
<?php
|
||||
if ($nasa_change_view) :
|
||||
/**
|
||||
* Change view ICONS
|
||||
*/
|
||||
do_action('nasa_change_view', $nasa_sidebar);
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr($third_cl); ?>">
|
||||
<ul class="<?php echo esc_attr($sortbarclass); ?>">
|
||||
<?php if ($hasSidebar) : ?>
|
||||
<li class="li-toggle-sidebar">
|
||||
<a class="toggle-sidebar" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="25px" height="25px" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M18 5H6C5.5286 5 5.29289 5 5.14645 5.14645C5 5.29289 5 5.5286 5 6V7.96482C5 8.2268 5 8.35779 5.05916 8.46834C5.11833 8.57888 5.22732 8.65154 5.4453 8.79687L8.4688 10.8125C9.34073 11.3938 9.7767 11.6845 10.0133 12.1267C10.25 12.5688 10.25 13.0928 10.25 14.1407V19L13.75 17.25V14.1407C13.75 13.0928 13.75 12.5688 13.9867 12.1267C14.2233 11.6845 14.6593 11.3938 15.5312 10.8125L18.5547 8.79687C18.7727 8.65154 18.8817 8.57888 18.9408 8.46834C19 8.35779 19 8.2268 19 7.96482V6C19 5.5286 19 5.29289 18.8536 5.14645C18.7071 5 18.4714 5 18 5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
|
||||
<?php esc_html_e('Filters', 'elessi-theme'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="nasa-filter-order filter-order">
|
||||
<?php woocommerce_catalog_ordering(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Toggle Widgets - Always Close
|
||||
*/
|
||||
if (!isset($nasa_opt['toggle_widgets']) || $nasa_opt['toggle_widgets']) :
|
||||
$get_sidebar = isset($nasa_opt['category_sidebar']) ? $nasa_opt['category_sidebar'] : 'top';
|
||||
$get_sidebar = isset($_GET['sidebar']) ? $_GET['sidebar'] : $get_sidebar;
|
||||
|
||||
$content_class = isset($nasa_opt['toggle_widgets_Alc']) && $nasa_opt['toggle_widgets_Alc'] ? ' nasa-toggle-widgets-alc' : '';
|
||||
|
||||
$content_class = isset($nasa_opt['archive_sticky_sidebar_classic']) && $nasa_opt['archive_sticky_sidebar_classic'] && in_array($get_sidebar, array('left-classic', 'right-classic')) ? ' nasa-toggle-widgets-alc' : $content_class;
|
||||
endif;
|
||||
|
||||
$content_class .= $topSidebar3 ? ' nasa-push-cat-filter-type-3' : '';
|
||||
$content_class .= ' margin-bottom-40';
|
||||
$content_class = $option_change_shop_layout == 'shop-background-color' ? str_replace('margin-bottom-40', 'row', $content_class) : $content_class;
|
||||
|
||||
if ($option_change_shop_layout == 'shop-background-color') : ?>
|
||||
<div class="nasa-archive-product-content-bg margin-bottom-40">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nasa-archive-product-content nasa-after-clear<?php echo esc_attr($content_class); ?>">
|
||||
<?php
|
||||
if ($topSidebar && (!isset($nasa_opt['top_bar_cat_pos']) || $nasa_opt['top_bar_cat_pos'] == 'left-bar')) :
|
||||
$attr .= ' nasa-has-push-cat';
|
||||
$class_cat_top = 'nasa-push-cat-filter';
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_cat_top); ?>"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ($topSidebar3 && isset($nasa_opt['top_bar_cat_pos_type_3']) ) :
|
||||
$attr .= ' nasa-has-push-cat';
|
||||
$class_cat_top = 'nasa-push-cat-filter ';
|
||||
|
||||
if ($nasa_opt['top_bar_cat_pos_type_3'] == 'side-canvas') :
|
||||
$class_cat_top .= 'ns-top-bar-side-canvas';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_cat_top); ?>"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php echo esc_attr($attr); ?>">
|
||||
|
||||
<?php if ($nasa_recom_pos !== 'bot' && defined('NASA_CORE_ACTIVED') && NASA_CORE_ACTIVED) : ?>
|
||||
<?php do_action('nasa_recommend_product'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nasa-archive-product-warp<?php echo esc_attr($layout_style); ?>">
|
||||
<?php
|
||||
if (woocommerce_product_loop()) :
|
||||
/**
|
||||
* Before Shop Loop
|
||||
*/
|
||||
do_action('woocommerce_before_shop_loop');
|
||||
|
||||
woocommerce_product_loop_start();
|
||||
do_action('nasa_get_content_products', $nasa_sidebar);
|
||||
woocommerce_product_loop_end();
|
||||
|
||||
/**
|
||||
* Hook: woocommerce_after_shop_loop.
|
||||
*
|
||||
* @hooked woocommerce_pagination - 10
|
||||
*/
|
||||
do_action('woocommerce_after_shop_loop');
|
||||
else :
|
||||
echo '<div class="row"><div class="large-12 columns nasa-archive-no-result">';
|
||||
do_action('woocommerce_no_products_found');
|
||||
echo '</div></div>';
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Sidebar LEFT | RIGHT
|
||||
*/
|
||||
if ($hasSidebar && !$topSidebar && !$topSidebar2 && !$topSidebar3) :
|
||||
do_action('nasa_sidebar_shop', $nasa_sidebar);
|
||||
endif;
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php if ($option_change_shop_layout == 'shop-background-color') : ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($nasa_recom_pos == 'bot' && defined('NASA_CORE_ACTIVED') && NASA_CORE_ACTIVED) : ?>
|
||||
<?php do_action('nasa_recommend_product'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Ajax enable
|
||||
*/
|
||||
if ($nasa_ajax_product) :
|
||||
?>
|
||||
<div class="nasa-has-filter-ajax hidden-tag">
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Base URL
|
||||
*/
|
||||
echo '<input type="hidden" name="nasa_base-url" id="nasa_base-url" value="' . esc_url(home_url('/')) . '" />';
|
||||
|
||||
/**
|
||||
* Current URL
|
||||
*/
|
||||
echo '<input type="hidden" name="nasa_current-slug" id="nasa_current-slug" value="' . esc_url(elessi_get_origin_url(array('page', 'paged', 'post_type', 'orderby', 'product_cat', 'product_tag'))) . '" />';
|
||||
|
||||
/**
|
||||
* Default Sorting
|
||||
*/
|
||||
$default_sort = wc_get_loop_prop('is_search') ? 'relevance' : apply_filters('woocommerce_default_catalog_orderby', get_option('woocommerce_default_catalog_orderby', 'menu_order'));
|
||||
echo '<input type="hidden" name="nasa_default_sort" id="nasa_default_sort" value="' . esc_attr($default_sort) . '" />';
|
||||
|
||||
/**
|
||||
* Render GET to inputs
|
||||
*/
|
||||
if (!empty($_GET)) :
|
||||
echo '<div class="hidden-tag nasa-value-gets">';
|
||||
foreach ($_GET as $key => $value) :
|
||||
if (!in_array($key, array('add-to-cart'))) :
|
||||
echo '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '" />';
|
||||
endif;
|
||||
endforeach;
|
||||
echo '</div>';
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Hook After Main content
|
||||
*/
|
||||
do_action('woocommerce_after_main_content');
|
||||
|
||||
/**
|
||||
* Footer Shop
|
||||
*/
|
||||
get_footer('shop');
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Empty cart page
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-empty.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://woo.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 7.0.1
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/*
|
||||
* @hooked wc_empty_cart_message - 10
|
||||
*/
|
||||
do_action('woocommerce_cart_is_empty');
|
||||
|
||||
if (wc_get_page_id('shop') > 0) : ?>
|
||||
<p class="return-to-shop margin-bottom-80">
|
||||
<a class="button wc-backward<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>" href="<?php echo esc_url(apply_filters('woocommerce_return_to_shop_redirect', wc_get_page_permalink('shop'))); ?>">
|
||||
<?php
|
||||
/**
|
||||
* Filter "Return To Shop" text.
|
||||
*
|
||||
* @since 4.6.0
|
||||
* @param string $default_text Default text.
|
||||
*/
|
||||
echo esc_html(apply_filters('woocommerce_return_to_shop_text', __('Return to shop', 'elessi-theme')));
|
||||
?>
|
||||
</a>
|
||||
</p>
|
||||
<div class="row nasa-empty-cart-recommend-product">
|
||||
<?php do_action('nasa_recommend_product'); ?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
do_action('nasa_carts_empty_after');
|
||||
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* Shipping Methods Display
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
*
|
||||
* @version 8.8.0
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$is_cart = is_cart();
|
||||
$class_shipping = 'woocommerce-shipping-methods';
|
||||
|
||||
if ($is_cart) :
|
||||
global $nasa_opt;
|
||||
|
||||
$hide_in_cart = defined('NASA_CHECKOUT_LAYOUT') && NASA_CHECKOUT_LAYOUT == 'modern' && (!isset($nasa_opt['cart_1_shiping']) || $nasa_opt['cart_1_shiping']) ? true : false;
|
||||
$no_check_shipping_in_cart = apply_filters('nasa_no_check_shipping_in_cart', $hide_in_cart);
|
||||
|
||||
$class_shipping .= $no_check_shipping_in_cart ? ' hide-check-shipping' : '';
|
||||
endif;
|
||||
|
||||
$formatted_destination = isset($formatted_destination) ? $formatted_destination : WC()->countries->get_formatted_address($package['destination'], ', ');
|
||||
$has_calculated_shipping = !empty($has_calculated_shipping);
|
||||
$show_shipping_calculator = !empty($show_shipping_calculator);
|
||||
$calculator_text = '';
|
||||
?>
|
||||
|
||||
<?php if ($is_cart || !defined('NASA_CHECKOUT_LAYOUT') || NASA_CHECKOUT_LAYOUT != 'modern') : ?>
|
||||
<tr class="woocommerce-shipping-totals shipping">
|
||||
<th><?php echo wp_kses_post($package_name); ?></th>
|
||||
<td data-title="<?php echo esc_attr($package_name); ?>">
|
||||
<?php else: ?>
|
||||
<div class="shipping-wrap-modern">
|
||||
<h5 class="shipping-package-name hidden-tag"><?php echo wp_kses_post($package_name); ?></h5>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($available_methods) && is_array($available_methods)) : ?>
|
||||
<ul id="shipping_method" class="<?php echo $class_shipping; ?>">
|
||||
<?php foreach ($available_methods as $method) : ?>
|
||||
<li>
|
||||
<?php
|
||||
if (1 < count($available_methods)) :
|
||||
printf('<input type="radio" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" %4$s />', $index, esc_attr(sanitize_title($method->id)), esc_attr($method->id), checked($method->id, $chosen_method, false)); // WPCS: XSS ok.
|
||||
else :
|
||||
printf('<input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" />', $index, esc_attr(sanitize_title($method->id)), esc_attr($method->id)); // WPCS: XSS ok.
|
||||
endif;
|
||||
|
||||
printf('<label for="shipping_method_%1$s_%2$s">%3$s</label>', $index, esc_attr(sanitize_title($method->id)), wc_cart_totals_shipping_method_label($method)); // WPCS: XSS ok.
|
||||
do_action('woocommerce_after_shipping_rate', $method, $index);
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php if ($is_cart) : ?>
|
||||
<p class="woocommerce-shipping-destination">
|
||||
<?php
|
||||
if ($formatted_destination) :
|
||||
// Translators: $s shipping destination.
|
||||
printf(esc_html__('Shipping to %s.', 'elessi-theme') . ' ', '<strong>' . esc_html($formatted_destination) . '</strong>');
|
||||
$calculator_text = esc_html__('Change address', 'elessi-theme');
|
||||
else :
|
||||
echo wp_kses_post(apply_filters('woocommerce_shipping_estimate_html', __('Shipping options will be updated during checkout.', 'elessi-theme')));
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php elseif (!$has_calculated_shipping || !$formatted_destination) :
|
||||
|
||||
if ($is_cart && 'no' === get_option('woocommerce_enable_shipping_calc')) :
|
||||
echo wp_kses_post(apply_filters('woocommerce_shipping_not_enabled_on_cart_html', __('Shipping costs are calculated during checkout.', 'elessi-theme')));
|
||||
else :
|
||||
echo wp_kses_post(apply_filters('woocommerce_shipping_may_be_available_html', __('Enter your address to view shipping options.', 'elessi-theme')));
|
||||
endif;
|
||||
|
||||
elseif (!$is_cart) :
|
||||
echo wp_kses_post(apply_filters('woocommerce_no_shipping_available_html', __('There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'elessi-theme')));
|
||||
else :
|
||||
echo wp_kses_post(
|
||||
/**
|
||||
* Provides a means of overriding the default 'no shipping available' HTML string.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $html HTML message.
|
||||
* @param string $formatted_destination The formatted shipping destination.
|
||||
*/
|
||||
apply_filters(
|
||||
'woocommerce_cart_no_shipping_available_html',
|
||||
// Translators: $s shipping destination.
|
||||
sprintf(esc_html__('No shipping options were found for %s.', 'elessi-theme') . ' ', '<strong>' . esc_html($formatted_destination) . '</strong>'),
|
||||
$formatted_destination
|
||||
)
|
||||
);
|
||||
|
||||
$calculator_text = esc_html__('Enter a different address', 'elessi-theme');
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php if ($show_package_details) : ?>
|
||||
<?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html($package_details) . '</small></p>'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($show_shipping_calculator) : ?>
|
||||
<?php woocommerce_shipping_calculator($calculator_text); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($is_cart || !defined('NASA_CHECKOUT_LAYOUT') || NASA_CHECKOUT_LAYOUT != 'modern') : ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else : ?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/**
|
||||
* Cart Page
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.9.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
global $nasa_opt;
|
||||
|
||||
do_action('woocommerce_before_cart');
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="large-8 columns rtl-right desktop-padding-right-30 rtl-desktop-padding-right-10 rtl-desktop-padding-left-30 mobile-margin-bottom-30">
|
||||
|
||||
<form class="woocommerce-cart-form nasa-shopping-cart-form<?php echo isset($nasa_opt['auto_update_cart']) && $nasa_opt['auto_update_cart'] ? ' qty-auto-update': ''; ?>" action="<?php echo esc_url(wc_get_cart_url()); ?>" method="post">
|
||||
|
||||
<?php do_action('woocommerce_before_cart_table'); ?>
|
||||
|
||||
<table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents responsive" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product-name" colspan="3"><?php esc_html_e('Product', 'elessi-theme'); ?></th>
|
||||
<th class="product-price hide-for-small"><?php esc_html_e('Price', 'elessi-theme'); ?></th>
|
||||
<th class="product-quantity"><?php esc_html_e('Quantity', 'elessi-theme'); ?></th>
|
||||
<th class="product-subtotal hide-for-small"><?php esc_html_e('Subtotal', 'elessi-theme'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
do_action('woocommerce_before_cart_contents');
|
||||
|
||||
$cart_items = WC()->cart->get_cart();
|
||||
|
||||
foreach ($cart_items as $cart_item_key => $cart_item) :
|
||||
$_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key);
|
||||
$product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key);
|
||||
|
||||
/**
|
||||
* Filter the product name.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @param string $product_name Name of the product in the cart.
|
||||
* @param array $cart_item The product in the cart.
|
||||
* @param string $cart_item_key Key for the product in the cart.
|
||||
*/
|
||||
$product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key);
|
||||
|
||||
if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_cart_item_visible', true, $cart_item, $cart_item_key)) :
|
||||
|
||||
$product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key);
|
||||
|
||||
$price_product = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $cart_item, $cart_item_key);
|
||||
?>
|
||||
|
||||
<tr class="woocommerce-cart-form__cart-item <?php echo esc_attr(apply_filters('woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key)); ?>">
|
||||
<td class="product-remove remove-product">
|
||||
<?php echo apply_filters(
|
||||
'woocommerce_cart_item_remove_link',
|
||||
sprintf('<a href="%s" class="remove nasa-stclose" aria-label="%s" data-product_id="%s" data-product_sku="%s">×</a>',
|
||||
esc_url(wc_get_cart_remove_url($cart_item_key)),
|
||||
/* translators: %s is the product name */
|
||||
esc_attr(sprintf(__('Remove %s from cart', 'elessi-theme'), $product_name)),
|
||||
esc_attr($product_id),
|
||||
esc_attr($_product->get_sku())
|
||||
), $cart_item_key
|
||||
); ?>
|
||||
</td>
|
||||
|
||||
<td class="product-thumbnail">
|
||||
<?php
|
||||
$thumbnail = apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key);
|
||||
if (!$product_permalink) :
|
||||
echo $thumbnail;
|
||||
else :
|
||||
printf('<a href="%s">%s</a>', esc_url($product_permalink), $thumbnail);
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="product-name" data-title="<?php esc_attr_e('Product', 'elessi-theme'); ?>">
|
||||
<?php
|
||||
if (!$product_permalink):
|
||||
echo wp_kses_post($product_name . ' ');
|
||||
else:
|
||||
/**
|
||||
* This filter is documented above.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
echo wp_kses_post(apply_filters('woocommerce_cart_item_name', sprintf('<a href="%s">%s</a>', esc_url($product_permalink), $_product->get_name()), $cart_item, $cart_item_key));
|
||||
endif;
|
||||
|
||||
do_action('woocommerce_after_cart_item_name', $cart_item, $cart_item_key);
|
||||
|
||||
// Meta data.
|
||||
echo wc_get_formatted_cart_item_data($cart_item); // PHPCS: XSS ok.
|
||||
|
||||
// Backorder notification
|
||||
if ($_product->backorders_require_notification() && $_product->is_on_backorder($cart_item['quantity'])) :
|
||||
echo wp_kses_post(apply_filters('woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__('Available on backorder', 'elessi-theme') . '</p>', $product_id));
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="product-price mobile-price hide-for-large hide-for-medium" data-title="<?php esc_attr_e('Price', 'elessi-theme'); ?>">
|
||||
<?php echo $price_product; ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="product-price hide-for-small" data-title="<?php esc_attr_e('Price', 'elessi-theme'); ?>">
|
||||
<?php echo $price_product; ?>
|
||||
</td>
|
||||
|
||||
<td class="product-quantity" data-title="<?php esc_attr_e('Quantity', 'elessi-theme'); ?>">
|
||||
<?php
|
||||
if ($_product->is_sold_individually()) :
|
||||
$min_quantity = 1;
|
||||
$max_quantity = 1;
|
||||
else :
|
||||
$min_quantity = 0;
|
||||
$max_quantity = $_product->get_max_purchase_quantity();
|
||||
endif;
|
||||
|
||||
$product_quantity = woocommerce_quantity_input(
|
||||
array(
|
||||
'input_name' => 'cart[' . $cart_item_key . '][qty]',
|
||||
'input_value' => $cart_item['quantity'],
|
||||
'max_value' => $max_quantity,
|
||||
'min_value' => $min_quantity,
|
||||
'product_name' => $product_name,
|
||||
),
|
||||
$_product,
|
||||
false
|
||||
);
|
||||
|
||||
echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item); // PHPCS: XSS ok.
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="product-subtotal hide-for-small" data-title="<?php esc_attr_e('Total', 'elessi-theme'); ?>">
|
||||
<?php
|
||||
echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); // PHPCS: XSS ok.
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
do_action('woocommerce_cart_contents'); ?>
|
||||
|
||||
<tr class="nasa-no-border">
|
||||
<td colspan="6" class="actions nasa-actions">
|
||||
<div class="row desktop-margin-top-30">
|
||||
<div class="large-7 columns mobile-margin-top-20 left rtl-right nasa-min-height">
|
||||
|
||||
<?php if (wc_coupons_enabled()) : ?>
|
||||
<div class="coupon">
|
||||
<label class="hidden-tag" for="coupon_code">
|
||||
<?php esc_html_e('Coupon:', 'elessi-theme'); ?>
|
||||
</label>
|
||||
<input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php esc_attr_e('Coupon code', 'elessi-theme'); ?>" />
|
||||
|
||||
<button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e('Apply coupon', 'elessi-theme'); ?>">
|
||||
<?php esc_attr_e('Apply coupon', 'elessi-theme'); ?>
|
||||
</button>
|
||||
|
||||
<?php do_action('woocommerce_cart_coupon'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="large-5 columns mobile-margin-top-20 text-right rtl-text-left rtl-left">
|
||||
<button type="submit" class="button" name="update_cart" value="<?php esc_attr_e('Update Cart', 'elessi-theme'); ?>">
|
||||
<?php esc_html_e('Update Cart', 'elessi-theme'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action('woocommerce_cart_actions'); ?>
|
||||
|
||||
<?php wp_nonce_field('woocommerce-cart', 'woocommerce-cart-nonce'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php do_action('woocommerce_after_cart_contents'); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php do_action('woocommerce_after_cart_table'); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php do_action('woocommerce_before_cart_collaterals'); ?>
|
||||
|
||||
<div class="large-4 columns cart-collaterals rtl-left">
|
||||
<?php
|
||||
/**
|
||||
* Cart collaterals hook.
|
||||
*
|
||||
* @removed woocommerce_cross_sell_display
|
||||
* @hooked woocommerce_cart_totals - 10
|
||||
*/
|
||||
do_action('woocommerce_cart_collaterals');
|
||||
?>
|
||||
</div><!-- .large-4 -->
|
||||
|
||||
</div><!-- .row -->
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Cart after_cart hook.
|
||||
*
|
||||
* @hooked woocommerce_cross_sell_display
|
||||
*/
|
||||
do_action('woocommerce_after_cart');
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* Cross-sells
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
if ($cross_sells) :
|
||||
global $nasa_opt;
|
||||
|
||||
// echo $nasa_opt['loop_layout_buttons'];
|
||||
|
||||
$_delay = 0;
|
||||
$_delay_item = (isset($nasa_opt['delay_overlay']) && (int) $nasa_opt['delay_overlay']) ? (int) $nasa_opt['delay_overlay'] : 100;
|
||||
|
||||
$layout_buttons_class = '';
|
||||
if (isset($nasa_opt['loop_layout_buttons']) && $nasa_opt['loop_layout_buttons'] != '') :
|
||||
$layout_buttons_class = ' nasa-' . $nasa_opt['loop_layout_buttons'];
|
||||
endif;
|
||||
|
||||
$columns_desk = !isset($nasa_opt['crs_columns_desk']) || !(int) $nasa_opt['crs_columns_desk'] ? 5 : (int) $nasa_opt['crs_columns_desk'];
|
||||
$columns_tablet = !isset($nasa_opt['crs_columns_tablet']) || !(int) $nasa_opt['crs_columns_tablet'] ? 3 : (int) $nasa_opt['crs_columns_tablet'];
|
||||
$columns_small = isset($nasa_opt['crs_columns_small']) ? $nasa_opt['crs_columns_small'] : 2;
|
||||
$columns_small_slide = $columns_small == '1.5-cols' ? 1 : (int) $columns_small;
|
||||
|
||||
$columns_desk = apply_filters('ns_crs_columns_desk', $columns_desk);
|
||||
|
||||
if (!$columns_small) :
|
||||
$columns_small_slide = 2;
|
||||
endif;
|
||||
|
||||
$start_row = '<div class="row">';
|
||||
$end_row = '</div>';
|
||||
$class_wrap = 'large-12 columns related related-product cross-sells products grid nasa-slider-wrap margin-top-50';
|
||||
|
||||
$data_attrs = array(
|
||||
'data-columns="' . esc_attr($columns_desk) . '"',
|
||||
'data-columns-small="' . esc_attr($columns_small_slide) . '"',
|
||||
'data-columns-tablet="' . esc_attr($columns_tablet) . '"',
|
||||
'data-switch-tablet="' . elessi_switch_tablet() . '"',
|
||||
'data-switch-desktop="' . elessi_switch_desktop() . '"',
|
||||
);
|
||||
|
||||
if ($columns_small == '1.5-cols') :
|
||||
$data_attrs[] = 'data-padding-small="20%"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['crs_slide_auto']) && $nasa_opt['crs_slide_auto']) :
|
||||
$data_attrs[] = 'data-autoplay="true"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['crs_slide_loop']) && $nasa_opt['crs_slide_loop']) :
|
||||
$data_attrs[] = 'data-loop="true"';
|
||||
endif;
|
||||
|
||||
$arr_attrs = apply_filters('nasa_attrs_cross_sell_wrap', $data_attrs);
|
||||
|
||||
$attrs_str = !empty($arr_attrs) ? ' ' . implode(' ', $arr_attrs) : '';
|
||||
|
||||
$heading = apply_filters('woocommerce_product_cross_sells_products_heading', __('You may be interested in…', 'elessi-theme'));
|
||||
|
||||
$class_slider = 'ns-items-gap nasa-slick-slider nasa-slick-nav nasa-nav-radius products grid' . $layout_buttons_class;
|
||||
|
||||
echo $start_row;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_wrap); ?>">
|
||||
<?php if ($heading) : ?>
|
||||
<div class="nasa-slide-style-product-carousel nasa-relative margin-bottom-20">
|
||||
<h3 class="nasa-shortcode-title-slider fs-25 mobile-fs-20 text-center">
|
||||
<?php echo esc_html($heading); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_slider); ?>"<?php echo $attrs_str; ?>>
|
||||
<?php
|
||||
foreach ($cross_sells as $cross_sell) :
|
||||
$post_object = get_post($cross_sell->get_id());
|
||||
setup_postdata($GLOBALS['post'] = $post_object);
|
||||
|
||||
// Product Item -->
|
||||
wc_get_template('content-product.php', array(
|
||||
'_delay' => $_delay,
|
||||
'wrapper' => 'div'
|
||||
));
|
||||
// End Product Item -->
|
||||
|
||||
$_delay += $_delay_item;
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
echo $end_row;
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
@@ -0,0 +1,227 @@
|
||||
<?php
|
||||
/**
|
||||
* Mini-cart
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $nasa_opt;
|
||||
|
||||
do_action('woocommerce_before_mini_cart');
|
||||
|
||||
if (WC()->cart && !WC()->cart->is_empty()) :
|
||||
$enable_button_ajax = 'yes' === get_option('woocommerce_enable_ajax_add_to_cart') ? true : false;
|
||||
|
||||
$is_change_variation_mini_cart = (isset($nasa_opt['mini_cart_change_variation_product']) && $nasa_opt['mini_cart_change_variation_product'] && $enable_button_ajax) ? true : false;
|
||||
|
||||
$extra_mini_cart_class = 'nasa-minicart-items';
|
||||
|
||||
if ($is_change_variation_mini_cart) :
|
||||
$extra_mini_cart_class .= ' nasa-change_variation_mini_cart';
|
||||
endif;
|
||||
|
||||
$in_mobile = isset($nasa_opt['nasa_in_mobile']) && $nasa_opt['nasa_in_mobile'] ? true : false;
|
||||
$mini_cart_mobile_view_hide = '';
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($extra_mini_cart_class); ?>" data-text="<?php echo esc_attr__('Update Cart', 'elessi-theme'); ?>">
|
||||
<div class="woocommerce-mini-cart cart_list product_list_widget <?php echo esc_attr($args['list_class']); ?>">
|
||||
<?php
|
||||
do_action('woocommerce_before_mini_cart_contents');
|
||||
|
||||
$cart_items = WC()->cart->get_cart();
|
||||
|
||||
if ($in_mobile && isset($nasa_opt['mobile_layout']) && $nasa_opt['mobile_layout'] == 'app') :
|
||||
$mini_cart_mobile_view_hide = isset($nasa_opt['mini_cart_mobile_view_hide']) && $nasa_opt['mini_cart_mobile_view_hide'] ? ' mini_cart_mobile_view_hidden' : '';
|
||||
endif;
|
||||
|
||||
foreach ($cart_items as $cart_item_key => $cart_item) :
|
||||
$_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key);
|
||||
$product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key);
|
||||
|
||||
if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key)) :
|
||||
|
||||
$variations = isset($cart_item['variation']) && $cart_item['variation'] ? $cart_item['variation'] : null;
|
||||
$_data_attr = '';
|
||||
if (!empty($variations)) :
|
||||
$result = array();
|
||||
|
||||
foreach ($variations as $key => $variation) :
|
||||
$result[] = "$variation";
|
||||
endforeach;
|
||||
|
||||
$_data_attr = implode(".", $result);
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Filter the product name.
|
||||
*
|
||||
* @param string $product_name Name of the product in the cart.
|
||||
*/
|
||||
$product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key);
|
||||
$product_var_id = apply_filters('ns_cart_item_variation_id', $_product->get_id(), $cart_item, $cart_item_key);
|
||||
$thumbnail = apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key);
|
||||
$product_price = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $cart_item, $cart_item_key);
|
||||
$product_permalink = apply_filters('woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink($cart_item) : '', $cart_item, $cart_item_key);
|
||||
?>
|
||||
|
||||
<div class="nasa-flex align-start mini-cart-item woocommerce-mini-cart-item <?php echo esc_attr(apply_filters('woocommerce_mini_cart_item_class', 'mini_cart_item', $cart_item, $cart_item_key)); ?>" data-variation-product="<?php echo esc_attr($product_var_id . '.' . $_data_attr); ?>" data-id-var-product="<?php echo esc_attr($product_var_id); ?>" data-id-product="<?php echo esc_attr($product_id); ?>">
|
||||
<div class="nasa-image-cart-item">
|
||||
<?php echo $thumbnail; ?>
|
||||
</div>
|
||||
|
||||
<div class="nasa-info-cart-item padding-left-15 rtl-padding-left-0 rtl-padding-right-15" data-variations-selected="<?php echo $is_change_variation_mini_cart && $variations != null ? htmlspecialchars(wp_json_encode($variations)): '' ?>">
|
||||
<div class="mini-cart-info">
|
||||
<div class="nasa-flex jbw align-start">
|
||||
<?php if (empty($product_permalink)) : ?>
|
||||
<span class="product-name nasa-bold"><?php echo wp_kses_post($product_name); ?></span>
|
||||
<?php else : ?>
|
||||
<a class="product-name nasa-bold" href="<?php echo esc_url($product_permalink); ?>" title="<?php echo esc_attr($product_name); ?>">
|
||||
<?php echo wp_kses_post($product_name); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="product-remove">
|
||||
<?php
|
||||
echo apply_filters(
|
||||
'woocommerce_cart_item_remove_link',
|
||||
sprintf(
|
||||
'<a href="%s" class="remove remove_from_cart_button item-in-cart nasa-stclose small ajax-sp_%s" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s"></a>',
|
||||
esc_url(wc_get_cart_remove_url($cart_item_key)),
|
||||
$enable_button_ajax ? 'yes' : 'no',
|
||||
/* translators: %s is the product name */
|
||||
esc_attr(sprintf(__('Remove %s from cart', 'elessi-theme'), $product_name)),
|
||||
esc_attr($product_id),
|
||||
esc_attr($cart_item_key),
|
||||
esc_attr($_product->get_sku())
|
||||
),
|
||||
$cart_item_key
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php echo wc_get_formatted_cart_item_data($cart_item); ?>
|
||||
|
||||
<?php
|
||||
if ($product_price) :
|
||||
echo '<div class="nasa-flex jbw align-start mini-cart-item-price margin-top-5">';
|
||||
|
||||
$wrap = false;
|
||||
$quantily_show = true;
|
||||
|
||||
/**
|
||||
* Qty input
|
||||
* Elessi Theme Support
|
||||
*/
|
||||
if ((!isset($nasa_opt['mini_cart_qty']) || $nasa_opt['mini_cart_qty'])) :
|
||||
$quantily_show = false;
|
||||
$wrap = true;
|
||||
|
||||
if ($_product->is_sold_individually()) :
|
||||
$min_quantity = 1;
|
||||
$max_quantity = 1;
|
||||
else :
|
||||
$min_quantity = 0;
|
||||
$max_quantity = $_product->get_max_purchase_quantity();
|
||||
endif;
|
||||
|
||||
$qty_args = array(
|
||||
'input_name' => 'cart[' . $cart_item_key . '][qty]',
|
||||
'input_value' => $cart_item['quantity'],
|
||||
'max_value' => $max_quantity,
|
||||
'min_value' => $min_quantity,
|
||||
'product_name' => $_product->get_name(),
|
||||
'mini_cart' => true
|
||||
);
|
||||
|
||||
$product_quantity = woocommerce_quantity_input($qty_args, $_product, false);
|
||||
|
||||
echo '<div class="quantity-wrap nasa-flex flex-wrap">';
|
||||
|
||||
echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item); // PHPCS: XSS ok.
|
||||
endif;
|
||||
|
||||
echo apply_filters('woocommerce_widget_cart_item_quantity', '<div class="cart_list_product_quantity">' . ($quantily_show ? sprintf('%s × %s', $cart_item['quantity'], $product_price) : sprintf('× %s', $product_price)) . '</div>', $cart_item, $cart_item_key);
|
||||
|
||||
echo $wrap ? '</div>' : '';
|
||||
|
||||
/**
|
||||
* SubTotal
|
||||
* Elessi Theme Support
|
||||
*/
|
||||
if ((!isset($nasa_opt['mini_cart_subtotal']) || $nasa_opt['mini_cart_subtotal'])) :
|
||||
echo '<div class="mini-cart-item-subtotal nasa-bold margin-left-10 rtl-margin-left-0 rtl-margin-right-10">';
|
||||
echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key);
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
echo '</div>';
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
do_action('woocommerce_mini_cart_contents');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nasa-minicart-footer<?php echo $mini_cart_mobile_view_hide; ?>">
|
||||
<?php do_action('nasa_mini_cart_before_total'); ?>
|
||||
|
||||
<div class="minicart_total_checkout woocommerce-mini-cart__total total">
|
||||
<?php
|
||||
/**
|
||||
* Woocommerce_widget_shopping_cart_total hook.
|
||||
*
|
||||
* @removed woocommerce_widget_shopping_cart_subtotal - 10
|
||||
* @hooked elessi_widget_shopping_cart_subtotal - 10
|
||||
* @hooked elessi_subtotal_free_shipping - 20
|
||||
*/
|
||||
do_action('woocommerce_widget_shopping_cart_total');
|
||||
?>
|
||||
</div>
|
||||
<div class="btn-mini-cart inline-lists text-center">
|
||||
<?php do_action('woocommerce_widget_shopping_cart_before_buttons'); ?>
|
||||
|
||||
<p class="woocommerce-mini-cart__buttons buttons">
|
||||
<?php do_action('woocommerce_widget_shopping_cart_buttons'); ?>
|
||||
</p>
|
||||
|
||||
<?php do_action('woocommerce_widget_shopping_cart_after_buttons'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
/**
|
||||
* Empty cart
|
||||
*/
|
||||
else :
|
||||
$icon_empty = elessi_mini_cart_icon();
|
||||
$target_shop = apply_filters('nasa_target_return_shop', 'javascript:void(0);');
|
||||
// $str1 = array('nasa-icon cart-icon', 'width="28" height="28"');
|
||||
// $str2 = array('nasa-icon cart-icon nasa-empty-icon', ' width="100%" height="122"');
|
||||
// $icon_class = str_replace($str1, $str2, $icon_empty);
|
||||
|
||||
?>
|
||||
<p class="empty woocommerce-mini-cart__empty-message">
|
||||
<?php echo $icon_empty ?>
|
||||
<?php echo esc_html__('No products in the cart.', 'elessi-theme')?>
|
||||
<a href="<?php echo esc_attr($target_shop); ?>" class="button nasa-sidebar-return-shop" rel="nofollow">
|
||||
<?php echo esc_html__('RETURN TO SHOP', 'elessi-theme') ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
do_action('woocommerce_after_mini_cart');
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Checkout Form
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
do_action('nasa_checkout_form_layout', $checkout);
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Checkout coupon form
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!wc_coupons_enabled()) : // @codingStandardsIgnoreLine.
|
||||
return;
|
||||
endif;
|
||||
|
||||
defined('NASA_CHECKOUT_LAYOUT') or define('NASA_CHECKOUT_LAYOUT', 'default');
|
||||
?>
|
||||
|
||||
<div class="woocommerce-form-coupon-toggle nasa-toggle-coupon-checkout">
|
||||
<?php wc_print_notice(apply_filters('woocommerce_checkout_coupon_message', __('Have a coupon?', 'elessi-theme') . ' <a href="#" class="showcoupon">' . __('Click here to enter your code', 'elessi-theme') . '<svg width="30" height="30" viewBox="0 0 32 32"><path d="M15.233 19.175l0.754 0.754 6.035-6.035-0.754-0.754-5.281 5.281-5.256-5.256-0.754 0.754 3.013 3.013z" fill="currentColor" /></svg></a>'), 'notice'); ?>
|
||||
</div>
|
||||
|
||||
<form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
|
||||
<div class="row">
|
||||
<div class="large-7 columns">
|
||||
<p><?php esc_html_e('If you have a coupon code, please apply it below.', 'elessi-theme'); ?></p>
|
||||
|
||||
<div class="form-row form-row-first coupon">
|
||||
<input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e('Coupon code', 'elessi-theme'); ?>" id="coupon_code" value="" />
|
||||
<button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e('Apply coupon', 'elessi-theme'); ?>"><?php esc_html_e('Apply coupon', 'elessi-theme'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-5 columns title-align-left">
|
||||
<?php
|
||||
if (NASA_CHECKOUT_LAYOUT !== 'modern') {
|
||||
elessi_checkout_get_coupon_slide();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout login form
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.8.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if (is_user_logged_in() || 'no' === get_option('woocommerce_enable_checkout_login_reminder')) :
|
||||
return;
|
||||
endif;
|
||||
|
||||
?>
|
||||
<div class="woocommerce-form-login-toggle">
|
||||
<svg class="ns-svg-user hidden-tag" width="25" height="25" viewBox="0 0 32 32"><path d="M16 3.205c-7.067 0-12.795 5.728-12.795 12.795s5.728 12.795 12.795 12.795 12.795-5.728 12.795-12.795c0-7.067-5.728-12.795-12.795-12.795zM16 4.271c6.467 0 11.729 5.261 11.729 11.729 0 2.845-1.019 5.457-2.711 7.49-1.169-0.488-3.93-1.446-5.638-1.951-0.146-0.046-0.169-0.053-0.169-0.66 0-0.501 0.206-1.005 0.407-1.432 0.218-0.464 0.476-1.244 0.569-1.944 0.259-0.301 0.612-0.895 0.839-2.026 0.199-0.997 0.106-1.36-0.026-1.7-0.014-0.036-0.028-0.071-0.039-0.107-0.050-0.234 0.019-1.448 0.189-2.391 0.118-0.647-0.030-2.022-0.921-3.159-0.562-0.719-1.638-1.601-3.603-1.724l-1.078 0.001c-1.932 0.122-3.008 1.004-3.57 1.723-0.89 1.137-1.038 2.513-0.92 3.159 0.172 0.943 0.239 2.157 0.191 2.387-0.010 0.040-0.025 0.075-0.040 0.111-0.131 0.341-0.225 0.703-0.025 1.7 0.226 1.131 0.579 1.725 0.839 2.026 0.092 0.7 0.35 1.48 0.569 1.944 0.159 0.339 0.234 0.801 0.234 1.454 0 0.607-0.023 0.614-0.159 0.657-1.767 0.522-4.579 1.538-5.628 1.997-1.725-2.042-2.768-4.679-2.768-7.555 0-6.467 5.261-11.729 11.729-11.729zM7.811 24.386c1.201-0.49 3.594-1.344 5.167-1.808 0.914-0.288 0.914-1.058 0.914-1.677 0-0.513-0.035-1.269-0.335-1.908-0.206-0.438-0.442-1.189-0.494-1.776-0.011-0.137-0.076-0.265-0.18-0.355-0.151-0.132-0.458-0.616-0.654-1.593-0.155-0.773-0.089-0.942-0.026-1.106 0.027-0.070 0.053-0.139 0.074-0.216 0.128-0.468-0.015-2.005-0.17-2.858-0.068-0.371 0.018-1.424 0.711-2.311 0.622-0.795 1.563-1.238 2.764-1.315l1.011-0.001c1.233 0.078 2.174 0.521 2.797 1.316 0.694 0.887 0.778 1.94 0.71 2.312-0.154 0.852-0.298 2.39-0.17 2.857 0.022 0.078 0.047 0.147 0.074 0.217 0.064 0.163 0.129 0.333-0.025 1.106-0.196 0.977-0.504 1.461-0.655 1.593-0.103 0.091-0.168 0.218-0.18 0.355-0.051 0.588-0.286 1.338-0.492 1.776-0.236 0.502-0.508 1.171-0.508 1.886 0 0.619 0 1.389 0.924 1.68 1.505 0.445 3.91 1.271 5.18 1.77-2.121 2.1-5.035 3.4-8.248 3.4-3.183 0-6.073-1.277-8.188-3.342z" fill="currentColor"/></svg>
|
||||
<?php wc_print_notice(apply_filters('woocommerce_checkout_login_message',esc_html__('Returning customer?', 'elessi-theme')) . ' <a href="#" class="showlogin">' . esc_html__('Click here to login', 'elessi-theme') . '<svg width="30" height="30" viewBox="0 0 32 32"><path d="M15.233 19.175l0.754 0.754 6.035-6.035-0.754-0.754-5.281 5.281-5.256-5.256-0.754 0.754 3.013 3.013z" fill="currentColor"/></svg></a>', 'notice'); ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
woocommerce_login_form(
|
||||
array(
|
||||
'message' => esc_html__('If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'elessi-theme'),
|
||||
'redirect' => wc_get_checkout_url(),
|
||||
'hidden' => true,
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout Payment Section
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.1.0
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!wp_doing_ajax()) :
|
||||
do_action('woocommerce_review_order_before_payment');
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div id="payment" class="woocommerce-checkout-payment">
|
||||
<?php if (WC()->cart->needs_payment()) : ?>
|
||||
<ul class="wc_payment_methods payment_methods methods">
|
||||
<?php
|
||||
if (!empty($available_gateways)) :
|
||||
foreach ($available_gateways as $gateway) :
|
||||
wc_get_template('checkout/payment-method.php', array('gateway' => $gateway));
|
||||
endforeach;
|
||||
else :
|
||||
echo '<li>';
|
||||
wc_print_notice(apply_filters('woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__('Sorry, it seems that there are no available payment methods. Please contact us if you require assistance or wish to make alternate arrangements.', 'elessi-theme') : esc_html__('Please fill in your details above to see available payment methods.', 'elessi-theme') ), 'notice'); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
|
||||
echo '</li>';
|
||||
endif;
|
||||
?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Custom Hook for - Add our Recommend Products to your Order
|
||||
*/
|
||||
do_action('ns_before_place_order_payment'); ?>
|
||||
|
||||
<div class="form-row place-order">
|
||||
<noscript>
|
||||
<?php
|
||||
/* translators: $1 and $2 opening and closing emphasis tags respectively */
|
||||
printf(esc_html__('Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'elessi-theme'), '<em>', '</em>');
|
||||
?>
|
||||
<br /><button type="submit" class="button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e('Update totals', 'elessi-theme'); ?>"><?php esc_html_e('Update totals', 'elessi-theme'); ?></button>
|
||||
</noscript>
|
||||
|
||||
<?php wc_get_template('checkout/terms.php'); ?>
|
||||
|
||||
<?php do_action('woocommerce_review_order_before_submit'); ?>
|
||||
|
||||
<?php echo apply_filters('woocommerce_order_button_html', '<button type="submit" class="button alt' . esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : '') . '" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr($order_button_text) . '" data-value="' . esc_attr($order_button_text) . '">' . esc_html($order_button_text) . '</button>'); // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<?php do_action('woocommerce_review_order_after_submit'); ?>
|
||||
|
||||
<?php wp_nonce_field('woocommerce-process_checkout', 'woocommerce-process-checkout-nonce'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (!wp_doing_ajax()) :
|
||||
do_action('woocommerce_review_order_after_payment');
|
||||
endif;
|
||||
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Review order table
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 5.2.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
global $nasa_opt;
|
||||
?>
|
||||
|
||||
<table class="shop_table woocommerce-checkout-review-order-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product-name" ><?php esc_html_e('Product', 'elessi-theme'); ?></th>
|
||||
<th class="product-total"><?php esc_html_e('Subtotal', 'elessi-theme'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
do_action('woocommerce_review_order_before_cart_contents');
|
||||
|
||||
$cart = WC()->cart->get_cart();
|
||||
|
||||
foreach ($cart as $cart_item_key => $cart_item) :
|
||||
$_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key);
|
||||
|
||||
if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key)) :
|
||||
|
||||
$product_name = apply_filters('woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key);
|
||||
$product_price = apply_filters('woocommerce_cart_item_price', WC()->cart->get_product_price($_product), $cart_item, $cart_item_key);
|
||||
?>
|
||||
<tr class="<?php echo esc_attr(apply_filters('woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key)); ?>">
|
||||
<td class="product-name" colspan="2">
|
||||
<div class="co-wrap-item">
|
||||
<?php if (!isset($nasa_opt['mini_checkout_img']) || $nasa_opt['mini_checkout_img']) : ?>
|
||||
<div class="co-wrap-img margin-right-15 rtl-margin-right-0 rtl-margin-left-15 nasa-relative">
|
||||
<?php echo apply_filters('woocommerce_cart_item_thumbnail', $_product->get_image('thumbnail'), $cart_item, $cart_item_key); ?>
|
||||
|
||||
<?php echo apply_filters('woocommerce_checkout_cart_item_quantity', '<span class="product-quantity quantity-review-item">' . sprintf('%s', $cart_item['quantity']) . '</span>', $cart_item, $cart_item_key); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="co-wrap-info nasa-flex flex-wrap jbw align-start">
|
||||
<span class="co-product-name">
|
||||
<?php
|
||||
echo $product_name;
|
||||
|
||||
if (isset($nasa_opt['mini_checkout_img']) && !$nasa_opt['mini_checkout_img'] && (!isset($nasa_opt['mini_checkout_qty']) || !$nasa_opt['mini_checkout_qty'])) :
|
||||
echo apply_filters('woocommerce_checkout_cart_item_quantity', '<strong class="product-quantity">' . sprintf(' × %s', $cart_item['quantity']) . '</strong>', $cart_item, $cart_item_key );
|
||||
endif;
|
||||
?>
|
||||
</span>
|
||||
|
||||
<?php echo wc_get_formatted_cart_item_data($cart_item); ?>
|
||||
|
||||
<?php
|
||||
if (isset($nasa_opt['mini_checkout_qty']) && $nasa_opt['mini_checkout_qty']) :
|
||||
if ($_product->is_sold_individually()) :
|
||||
$min_quantity = 1;
|
||||
$max_quantity = 1;
|
||||
else :
|
||||
$min_quantity = 0;
|
||||
$max_quantity = $_product->get_max_purchase_quantity();
|
||||
endif;
|
||||
|
||||
$product_quantity = woocommerce_quantity_input(
|
||||
array(
|
||||
'input_name' => 'cart[' . $cart_item_key . '][qty]',
|
||||
'input_value' => $cart_item['quantity'],
|
||||
'max_value' => $max_quantity,
|
||||
'min_value' => $min_quantity,
|
||||
'product_name' => $product_name
|
||||
),
|
||||
$_product,
|
||||
false
|
||||
);
|
||||
|
||||
echo apply_filters('woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item); // PHPCS: XSS ok.
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="product-total">
|
||||
<?php echo apply_filters('woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal($_product, $cart_item['quantity']), $cart_item, $cart_item_key); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
do_action('woocommerce_review_order_after_cart_contents');
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<?php do_action('nasa_review_order_before_cart_subtotal');?>
|
||||
|
||||
<tr class="cart-subtotal">
|
||||
<th><?php esc_html_e('Subtotal', 'elessi-theme'); ?></th>
|
||||
<td ><?php wc_cart_totals_subtotal_html(); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php $coupons = WC()->cart->get_coupons(); ?>
|
||||
<?php if ($coupons): ?>
|
||||
<?php foreach ($coupons as $code => $coupon) : ?>
|
||||
<tr class="cart-discount coupon-<?php echo esc_attr(sanitize_title($code)); ?>">
|
||||
<th><?php wc_cart_totals_coupon_label($coupon); ?></th>
|
||||
<td ><?php wc_cart_totals_coupon_html($coupon); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (WC()->cart->needs_shipping() && WC()->cart->show_shipping()) : ?>
|
||||
<?php do_action('woocommerce_review_order_before_shipping'); ?>
|
||||
|
||||
<?php if (!defined('NASA_CHECKOUT_LAYOUT') || NASA_CHECKOUT_LAYOUT != 'modern') : ?>
|
||||
<?php wc_cart_totals_shipping_html(); ?>
|
||||
<?php else : ?>
|
||||
<tr class="order-shipping-modern hidden-tag"><th></th><td ></td></tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action('woocommerce_review_order_after_shipping'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $fees = WC()->cart->get_fees(); ?>
|
||||
<?php if ($fees) : ?>
|
||||
<?php foreach ($fees as $fee) : ?>
|
||||
<tr class="fee">
|
||||
<th><?php echo esc_html($fee->name); ?></th>
|
||||
<td ><?php wc_cart_totals_fee_html($fee); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (wc_tax_enabled() && !WC()->cart->display_prices_including_tax()) : ?>
|
||||
<?php if ('itemized' === get_option('woocommerce_tax_total_display')) : ?>
|
||||
<?php
|
||||
$taxs = WC()->cart->get_tax_totals();
|
||||
foreach ($taxs as $code => $tax) : ?>
|
||||
<tr class="tax-rate tax-rate-<?php echo esc_attr(sanitize_title($code)); ?>">
|
||||
<th><?php echo esc_html($tax->label); ?></th>
|
||||
<td ><?php echo wp_kses_post($tax->formatted_amount); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<tr class="tax-total">
|
||||
<th><?php echo esc_html(WC()->countries->tax_or_vat()); ?></th>
|
||||
<td ><?php wc_cart_totals_taxes_total_html(); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action('woocommerce_review_order_before_order_total'); ?>
|
||||
|
||||
<tr class="order-total">
|
||||
<th><?php esc_html_e('Total', 'elessi-theme'); ?></th>
|
||||
<td ><?php wc_cart_totals_order_total_html(); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php do_action('woocommerce_review_order_after_order_total'); ?>
|
||||
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Thankyou page
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.1.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') or exit;
|
||||
|
||||
echo '<div class="woocommerce-order">';
|
||||
|
||||
if ($order) :
|
||||
do_action('woocommerce_before_thankyou', $order->get_id());
|
||||
?>
|
||||
|
||||
<div class="row nasa-order-received">
|
||||
<div class="large-12 columns nasa-order-received-left">
|
||||
<div class="nasa-warper-order margin-bottom-20">
|
||||
|
||||
<?php if ($order->has_status('failed')) : ?>
|
||||
|
||||
<p class="woocommerce-thankyou-order-failed">
|
||||
<?php esc_html_e('Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'elessi-theme'); ?>
|
||||
</p>
|
||||
|
||||
<p class="woocommerce-thankyou-order-failed-actions">
|
||||
<a href="<?php echo esc_url($order->get_checkout_payment_url()); ?>" class="button pay">
|
||||
<?php esc_html_e('Pay', 'elessi-theme') ?>
|
||||
</a>
|
||||
|
||||
<?php if (NASA_CORE_USER_LOGGED) : ?>
|
||||
<a href="<?php echo esc_url(wc_get_page_permalink('myaccount')); ?>" class="button pay">
|
||||
<?php esc_html_e('My Account', 'elessi-theme'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<?php wc_get_template('checkout/order-received.php', array('order' => $order)); ?>
|
||||
|
||||
<ul class="woocommerce-thankyou-order-details order_details">
|
||||
<li class="order">
|
||||
<?php esc_html_e('Order Number', 'elessi-theme'); ?>
|
||||
<strong><?php echo $order->get_order_number(); ?></strong>
|
||||
</li>
|
||||
<li class="date">
|
||||
<?php esc_html_e('Date', 'elessi-theme'); ?>
|
||||
<strong><?php echo wc_format_datetime($order->get_date_created()); ?></strong>
|
||||
</li>
|
||||
<li class="total">
|
||||
<?php esc_html_e('Total', 'elessi-theme'); ?>
|
||||
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
|
||||
</li>
|
||||
<?php if ($order->get_payment_method_title()) : ?>
|
||||
<li class="method">
|
||||
<?php esc_html_e('Payment Method', 'elessi-theme'); ?>
|
||||
<strong><?php echo wp_kses_post($order->get_payment_method_title()); ?></strong>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="large-12 columns nasa-order-received-right">
|
||||
<div class="nasa-warper-order">
|
||||
<?php do_action('woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?>
|
||||
<?php do_action('woocommerce_thankyou', $order->get_id()); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<?php wc_get_template('checkout/order-received.php', array('order' => false)); ?>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
echo '</div>';
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* The template for displaying product content within loops
|
||||
*
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $product, $nasa_opt;
|
||||
|
||||
if (!is_a($product, WC_Product::class) || !$product->is_visible()) :
|
||||
return;
|
||||
endif;
|
||||
|
||||
$show_in_list = isset($show_in_list) ? $show_in_list : true;
|
||||
if (!isset($_delay)) :
|
||||
$_delay = 0;
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Show Short Description info
|
||||
*/
|
||||
$description_info = isset($description_info) ? $description_info : true;
|
||||
|
||||
/**
|
||||
* Set Before - After product
|
||||
*/
|
||||
$before_product = '';
|
||||
$after_product = '';
|
||||
|
||||
if ((!isset($wrapper) || $wrapper == 'li')) :
|
||||
$wrap_item_class = 'product-warp-item';
|
||||
$wrap_item_class .= isset($wrapper_class) && $wrapper_class ? ' ' . $wrapper_class : '';
|
||||
|
||||
$before_product = '<li class="' . esc_attr($wrap_item_class) . '">';
|
||||
$after_product = '</li>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Attributes content product
|
||||
*/
|
||||
$attrs_content = (isset($nasa_opt['transition_load']) && $nasa_opt['transition_load'] == 'wow') ? ' data-wow="fadeInUp" data-wow-duration="1s" data-wow-delay="' . esc_attr($_delay) . 'ms"' : '';
|
||||
|
||||
echo $before_product;
|
||||
?>
|
||||
|
||||
<div <?php wc_product_class('', $product); ?><?php echo $attrs_content; ?>>
|
||||
|
||||
<?php do_action('woocommerce_before_shop_loop_item'); ?>
|
||||
|
||||
<div class="product-img-wrap">
|
||||
<?php do_action('woocommerce_before_shop_loop_item_title'); ?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr(apply_filters('ns_product_info_wrap_classes', 'product-info-wrap info')); ?>">
|
||||
<?php do_action('woocommerce_shop_loop_item_title'); ?>
|
||||
<?php do_action('woocommerce_after_shop_loop_item_title', $description_info); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action('woocommerce_after_shop_loop_item', $show_in_list); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo $after_product;
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.6.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
do_action('woocommerce_before_single_product');
|
||||
|
||||
if (post_password_required()) {
|
||||
echo get_the_password_form(); // WPCS: XSS ok.
|
||||
return;
|
||||
}
|
||||
|
||||
do_action('nasa_single_product_layout');
|
||||
|
||||
do_action('woocommerce_after_single_product');
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying product price filter widget.
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$nasa_min = isset($_GET['min_price']) ? $_GET['min_price'] : '';
|
||||
$nasa_max = isset($_GET['max_price']) ? $_GET['max_price'] : '';
|
||||
$has_price = ($nasa_min !== '' && $nasa_max !== '' && ($nasa_min >= 0 || $nasa_max >= $nasa_min)) ? '1' : '0';
|
||||
$class_reset = $has_price == '1' ? 'reset_price nasa-stclose' : 'reset_price nasa-stclose hidden-tag';
|
||||
$hide_btn = isset($hide_btn) && $hide_btn ? true : false;
|
||||
$nasa_widget = isset($nasa_widget) && $nasa_widget ? true : false;
|
||||
|
||||
do_action('woocommerce_widget_price_filter_start', $args);
|
||||
?>
|
||||
|
||||
<form method="get" action="<?php echo esc_url($form_action); ?>">
|
||||
<div class="price_slider_wrapper">
|
||||
<div class="price_slider" style="display:none;"></div>
|
||||
|
||||
<div class="price_slider_amount" data-step="<?php echo esc_attr($step); ?>">
|
||||
<input type="text" id="min_price" name="min_price" value="<?php echo esc_attr($current_min_price); ?>" data-min="<?php echo esc_attr($min_price); ?>" placeholder="<?php echo esc_attr__('Min price', 'elessi-theme'); ?>" />
|
||||
|
||||
<input type="text" id="max_price" name="max_price" value="<?php echo esc_attr($current_max_price); ?>" data-max="<?php echo esc_attr($max_price); ?>" placeholder="<?php echo esc_attr__('Max price', 'elessi-theme'); ?>" />
|
||||
|
||||
<?php if (!$hide_btn) :
|
||||
$class_btn = 'button small';
|
||||
$class_btn .= $nasa_widget ? ' nasa-filter-price-btn' : '';
|
||||
?>
|
||||
<button type="submit" class="<?php echo esc_attr($class_btn); ?>">
|
||||
<?php echo esc_html__('Filter', 'elessi-theme'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="price_label" style="display: none;">
|
||||
<?php echo esc_html__('Price:', 'elessi-theme'); ?> <span class="from"></span> — <span class="to"></span>
|
||||
<a href="javascript:void(0);" class="<?php echo esc_attr($class_reset); ?>" data-filtered="<?php echo $has_price ? '1' : '0'; ?>" rel="nofollow"><?php echo esc_html__('Reset', 'elessi-theme'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php echo wc_query_string_form_fields(null, array('min_price', 'max_price', 'paged'), '', true); ?>
|
||||
|
||||
<?php /* input type="hidden" class="nasa_hasPrice" name="nasa_hasPrice" value="<?php echo esc_attr($has_price); ?>" / */?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
do_action('woocommerce_widget_price_filter_end', $args);
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.5.5
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $product, $nasa_opt;
|
||||
|
||||
if (!is_a($product, 'WC_Product')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$productId = $product->get_id();
|
||||
$product_type = $product->get_type();
|
||||
$link = $product->get_permalink();
|
||||
$title = $product->get_name();
|
||||
$show_rating = isset($show_rating) ? $show_rating : true;
|
||||
$animation = !isset($animation) ? true : $animation;
|
||||
|
||||
$class = 'item-product-widget';
|
||||
$class .= $animation ? ' wow fadeInUp' : '';
|
||||
$class_img = 'nasa-item-img';
|
||||
$class_info = 'nasa-item-meta margin-left-20 rtl-margin-left-0 rtl-margin-right-20';
|
||||
|
||||
$list_type = isset($list_type) ? $list_type : '1';
|
||||
$image_size = 'thumbnail';
|
||||
|
||||
switch ($list_type) :
|
||||
case 'list_main':
|
||||
$class .= ' nasa-list-type-main';
|
||||
$image_size = apply_filters('single_product_archive_thumbnail_size', 'woocommerce_thumbnail');
|
||||
break;
|
||||
|
||||
case 'list_extra' :
|
||||
$class .= ' nasa-list-type-extra';
|
||||
break;
|
||||
|
||||
default:
|
||||
$list_type = '1';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
if (!isset($delay)){
|
||||
global $delay;
|
||||
$_delay_item = (isset($nasa_opt['delay_overlay']) && (int) $nasa_opt['delay_overlay']) ? (int) $nasa_opt['delay_overlay'] : 100;
|
||||
$delay = !$delay ? 0 : $delay;
|
||||
$delay += $_delay_item;
|
||||
}
|
||||
|
||||
$attributes = array(
|
||||
'data-wow-duration="1s"',
|
||||
'data-wow-delay="' . ((int) $delay) . 'ms"'
|
||||
);
|
||||
|
||||
$class_warp = isset($class_column) ? ' ' . $class_column : '';
|
||||
$wapper = (isset($wapper) && $wapper == 'div') ? 'div' : 'li';
|
||||
|
||||
$start_wapper = ($wapper == 'div') ? '<div class="' . esc_attr($class) . '" ' . implode(' ', $attributes) . '>' : '<li class="' . esc_attr($class) . '" ' . implode(' ', $attributes) . '>';
|
||||
|
||||
$end_warp = '</' . $wapper . '>';
|
||||
|
||||
echo $start_wapper;
|
||||
do_action('woocommerce_widget_product_item_start', $args);
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_img); ?>">
|
||||
<a class="nasa-widget-img" href="<?php echo esc_url($link); ?>" title="<?php echo esc_attr($title); ?>">
|
||||
<?php echo $product->get_image($image_size); ?>
|
||||
</a>
|
||||
|
||||
<?php if (!isset($nasa_opt['disable-quickview']) || !$nasa_opt['disable-quickview']) : ?>
|
||||
<a href="javascript:void(0);" class="quick-view btn-link quick-view-icon" data-prod="<?php echo esc_attr($productId); ?>" data-product_type="<?php echo esc_attr($product_type); ?>" title="<?php echo $product_type !== 'woosb' ? esc_attr__('Quick View', 'elessi-theme') : esc_attr__('View', 'elessi-theme'); ?>" data-href="<?php echo esc_url($link); ?>" rel="nofollow">
|
||||
<svg fill="currentColor" width="18" height="18" viewBox="0 0 32 32">
|
||||
<path d="M11.202 4.271v-1.066h-7.997v7.997h1.066v-6.177l7.588 7.588 0.754-0.754-7.588-7.588z"/>
|
||||
<path d="M20.798 3.205v1.066h6.177l-7.588 7.588 0.754 0.754 7.588-7.588v6.177h1.066v-7.997z"/>
|
||||
<path d="M11.859 19.387l-7.588 7.588v-6.177h-1.066v7.997h7.997v-1.066h-6.177l7.588-7.588z"/>
|
||||
<path d="M27.729 26.975l-7.588-7.588-0.754 0.754 7.588 7.588h-6.177v1.066h7.997v-7.997h-1.066z"/>
|
||||
</svg>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr($class_info); ?>">
|
||||
<a class="product-title nasa-widget-title nasa-bold" href="<?php echo esc_url($link); ?>" title="<?php echo esc_attr($title); ?>">
|
||||
<?php echo $title; ?>
|
||||
</a>
|
||||
|
||||
<?php echo $show_rating ? wp_kses_post(wc_get_rating_html($product->get_average_rating())) : ''; ?>
|
||||
|
||||
<span class="price">
|
||||
<?php echo $product->get_price_html(); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
do_action('woocommerce_widget_product_item_end', $args);
|
||||
|
||||
echo $end_warp;
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Breadcrumb
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 2.3.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
if (!empty($breadcrumb)) {
|
||||
global $post, $nasa_opt, $wp_query;
|
||||
|
||||
/**
|
||||
* Breadcrumb single row
|
||||
*/
|
||||
if (isset($row) && $row == 'single') {
|
||||
/**
|
||||
* Remove title in archive Products page
|
||||
*/
|
||||
add_filter('woocommerce_show_page_title', '__return_false');
|
||||
|
||||
/**
|
||||
* Single Portfolio
|
||||
*/
|
||||
if (is_singular('portfolio')) {
|
||||
$breadcrumb = elessi_rebuilt_breadcrumb_portfolio($breadcrumb, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Portfolio
|
||||
*/
|
||||
else {
|
||||
$queried_object = $wp_query->get_queried_object();
|
||||
|
||||
if (isset($queried_object->taxonomy) && $queried_object->taxonomy == 'portfolio_category') {
|
||||
$breadcrumb = elessi_rebuilt_breadcrumb_portfolio($breadcrumb, false);
|
||||
}
|
||||
}
|
||||
|
||||
echo $wrap_before;
|
||||
|
||||
$key = 0;
|
||||
$sizeof = sizeof($breadcrumb);
|
||||
foreach ($breadcrumb as $crumb) {
|
||||
echo $before;
|
||||
|
||||
echo (!empty($crumb[1]) && $sizeof !== $key + 1) ?
|
||||
'<a href="' . esc_url($crumb[1]) . '" title="' . esc_attr($crumb[0]) . '">' .
|
||||
esc_html($crumb[0]) .
|
||||
'</a>' : esc_html($crumb[0]);
|
||||
|
||||
echo $after;
|
||||
|
||||
if ($sizeof !== $key + 1) {
|
||||
echo $delimiter;
|
||||
}
|
||||
|
||||
$key++;
|
||||
}
|
||||
|
||||
echo $wrap_after;
|
||||
}
|
||||
|
||||
/**
|
||||
* Breadcrumb double row
|
||||
*/
|
||||
else {
|
||||
$queried_object = $wp_query->get_queried_object();
|
||||
|
||||
$title = '';
|
||||
$count = count($breadcrumb);
|
||||
|
||||
/**
|
||||
* Single product - Single post
|
||||
*/
|
||||
if (is_product() || is_singular('post')) {
|
||||
if (isset($breadcrumb[$count-1][1])) {
|
||||
unset($breadcrumb[$count-1][1]);
|
||||
}
|
||||
|
||||
$h2 = $breadcrumb[$count-1];
|
||||
unset($breadcrumb[$count-1]);
|
||||
|
||||
$title = isset($h2[0]) ? esc_html($h2[0]) : '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Single Portfolio
|
||||
*/
|
||||
elseif (is_singular('portfolio')) {
|
||||
$title = get_the_title();
|
||||
$breadcrumb = elessi_rebuilt_breadcrumb_portfolio($breadcrumb, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Archive Portfolio
|
||||
*/
|
||||
elseif (isset($queried_object->taxonomy) && $queried_object->taxonomy == 'portfolio_category') {
|
||||
$title = $queried_object->name;
|
||||
$breadcrumb = elessi_rebuilt_breadcrumb_portfolio($breadcrumb, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* page Other
|
||||
*/
|
||||
else {
|
||||
if ($count > 1) {
|
||||
$endBreadcrumb = $breadcrumb[$count - 1];
|
||||
unset($breadcrumb[$count - 1]);
|
||||
$title = esc_html($endBreadcrumb[0]);
|
||||
|
||||
/**
|
||||
* Page search
|
||||
*/
|
||||
if (is_search() && $count > 2 && isset($breadcrumb[$count-2][1])) {
|
||||
unset($breadcrumb[$count-2][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($title) {
|
||||
$tag_html = 'span';
|
||||
|
||||
if (NASA_WOO_ACTIVED && (is_shop() || is_product_taxonomy())) {
|
||||
$tag_html = 'h1';
|
||||
|
||||
/**
|
||||
* Remove title in archive Products page
|
||||
*/
|
||||
add_filter('woocommerce_show_page_title', '__return_false');
|
||||
}
|
||||
|
||||
$tag_html = apply_filters('nasa_tag_first_breadcrumb', $tag_html);
|
||||
echo '<' . $tag_html . ' class="nasa-first-breadcrumb">' . $before . $title . $after . '</' . $tag_html . '>';
|
||||
}
|
||||
|
||||
echo $wrap_before;
|
||||
|
||||
$key = 0;
|
||||
$sizeof = sizeof($breadcrumb);
|
||||
|
||||
foreach ($breadcrumb as $crumb) {
|
||||
echo $before;
|
||||
echo (!empty($crumb[1])) ? '<a href="' . esc_url($crumb[1]) . '" title="' . esc_attr($crumb[0]) . '">' . esc_html($crumb[0]) . '</a>' : esc_html($crumb[0]);
|
||||
echo $after;
|
||||
echo ($sizeof !== $key + 1) ? $delimiter : '';
|
||||
|
||||
$key++;
|
||||
}
|
||||
|
||||
echo $wrap_after;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Login form
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.2.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
if (NASA_CORE_USER_LOGGED) :
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<form class="woocommerce-form woocommerce-form-login login" method="post"<?php echo $hidden ? ' style="display:none;"' : ''; ?>>
|
||||
<div class="wrap-all">
|
||||
<?php do_action('woocommerce_login_form_start'); ?>
|
||||
|
||||
<?php echo $message ? wpautop(wptexturize($message)) : ''; // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<p class="form-row form-row-first">
|
||||
<label for="username"><?php esc_html_e('Username or email', 'elessi-theme'); ?> <span class="required" aria-hidden="true">*</span></label>
|
||||
<input type="text" class="input-text" name="username" id="username" autocomplete="username" required aria-required="true" />
|
||||
</p>
|
||||
|
||||
<p class="form-row form-row-last">
|
||||
<label for="password"><?php esc_html_e('Password', 'elessi-theme'); ?> <span class="required" aria-hidden="true">*</span></label>
|
||||
<input class="input-text woocommerce-Input" type="password" name="password" id="password" autocomplete="current-password" required aria-required="true" />
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action('woocommerce_login_form'); ?>
|
||||
|
||||
<p class="form-row submit_wrap">
|
||||
<span class="nasa-flex jbw">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme none-weight">
|
||||
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e('Remember me', 'elessi-theme'); ?></span>
|
||||
</label>
|
||||
|
||||
<span class="lost_password">
|
||||
<a href="<?php echo esc_url(wp_lostpassword_url()); ?>" class="none-weight"><?php esc_html_e('Lost your password?', 'elessi-theme'); ?></a>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<?php wp_nonce_field('woocommerce-login', 'woocommerce-login-nonce'); ?>
|
||||
<input type="hidden" name="redirect" value="<?php echo esc_url($redirect) ?>" />
|
||||
|
||||
<button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php esc_attr_e('Login', 'elessi-theme'); ?>"><?php esc_html_e('Login', 'elessi-theme'); ?></button>
|
||||
</p>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php do_action('woocommerce_login_form_end'); ?>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Quantity Input
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.4.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$label = !empty($args['product_name']) ? sprintf(esc_html__('%s quantity', 'elessi-theme'), wp_strip_all_tags($args['product_name'])) : esc_html__('Quantity', 'elessi-theme');
|
||||
|
||||
// In some cases we wish to display the quantity but not allow for it to be changed.
|
||||
$type = isset($type) ? $type : 'text';
|
||||
$readonly = isset($readonly) ? $readonly : false;
|
||||
|
||||
$quantily_class = 'quantity';
|
||||
$quantily_class .= $readonly ? ' qnot' : '';
|
||||
$quantily_class .= $type == 'hidden' ? ' hidden-tag' : '';
|
||||
|
||||
$classes = isset($classes) ? $classes : array('input-text', 'qty', 'text');
|
||||
|
||||
$mini_cart = isset($mini_cart) && $mini_cart ? true : false;
|
||||
|
||||
$input_value = $mini_cart && isset($cart_item_qty) ? $cart_item_qty : $input_value;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($quantily_class); ?>">
|
||||
<?php
|
||||
/**
|
||||
* Hook to output something before the quantity input field.
|
||||
*
|
||||
* @since 7.2.0
|
||||
*/
|
||||
do_action('woocommerce_before_quantity_input_field');
|
||||
?>
|
||||
|
||||
<label class="screen-reader-text hidden-tag" for="<?php echo esc_attr($input_id); ?>">
|
||||
<?php echo $label; ?>
|
||||
</label>
|
||||
|
||||
<?php if (!$readonly && $type != 'hidden') : ?>
|
||||
<a href="javascript:void(0);" class="plus" rel="nofollow">
|
||||
<svg width="13" height="20" stroke-width="2" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 6V18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path d="M6 12H18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ((!$mini_cart) || (!$readonly && $mini_cart)) : ?>
|
||||
<input
|
||||
type="<?php echo esc_attr($type); ?>"
|
||||
<?php echo $readonly ? 'readonly="readonly"' : ''; ?>
|
||||
id="<?php echo esc_attr($input_id); ?>"
|
||||
class="<?php echo esc_attr(join(' ', (array) $classes)); ?>"
|
||||
name="<?php echo esc_attr($input_name); ?>"
|
||||
aria-label="<?php echo esc_attr__('Product quantity', 'elessi-theme'); ?>"
|
||||
value="<?php echo esc_attr($input_value); ?>"
|
||||
data-old="<?php echo esc_attr($input_value); ?>"
|
||||
<?php if (in_array($type, array('text', 'search', 'tel', 'url', 'email', 'password'), true)) : ?>
|
||||
size="4"
|
||||
<?php endif; ?>
|
||||
min="<?php echo esc_attr($min_value); ?>"
|
||||
max="<?php echo esc_attr(0 < $max_value ? $max_value : ''); ?>"
|
||||
<?php if (!$readonly) : ?>
|
||||
step="<?php echo esc_attr($step); ?>"
|
||||
placeholder="<?php echo esc_attr($placeholder); ?>"
|
||||
inputmode="<?php echo esc_attr($inputmode); ?>"
|
||||
autocomplete="<?php echo esc_attr(isset($autocomplete) ? $autocomplete : 'on'); ?>"
|
||||
<?php endif; ?>
|
||||
/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* For Mini Cart
|
||||
*/
|
||||
echo ($mini_cart && ($readonly || $type == 'hidden')) ? $input_value : '';
|
||||
?>
|
||||
|
||||
<?php if (!$readonly && $type != 'hidden') : ?>
|
||||
<a href="javascript:void(0);" class="minus" rel="nofollow">
|
||||
<svg width="13" height="20" stroke-width="2" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M6 12H18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Hook to output something after quantity input field
|
||||
*
|
||||
* @since 3.6.0
|
||||
*/
|
||||
do_action('woocommerce_after_quantity_input_field');
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Loop Add to Cart
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.2.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $product;
|
||||
|
||||
$aria_describedby = isset($args['aria-describedby_text']) ? sprintf('aria-describedby="woocommerce_loop_add_to_cart_link_describedby_%s"', esc_attr($product->get_id())) : '';
|
||||
|
||||
$class = isset($args['class']) ? $args['class'] : 'add-to-cart-grid btn-link nasa-tip';
|
||||
$class = isset($args['modern-8-add']) && $args['modern-8-add'] == 1 ? str_replace("nasa-quick-add", "nasa-modern-8-add", $class) : $class;
|
||||
echo apply_filters(
|
||||
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
|
||||
sprintf(
|
||||
'<a href="%s" %s data-quantity="%s" class="%s" %s>' .
|
||||
'<span class="add_to_cart_text">%s</span>' .
|
||||
'%s' .
|
||||
'</a>',
|
||||
esc_url($product->add_to_cart_url()),
|
||||
$aria_describedby,
|
||||
esc_attr(isset($args['quantity']) ? $args['quantity'] : 1),
|
||||
esc_attr($class),
|
||||
isset($args['attributes']) ? wc_implode_html_attributes($args['attributes']) : '',
|
||||
esc_html($product->add_to_cart_text()),
|
||||
isset($args['icon_cart']) && $args['icon_cart'] ? '<span class="nasa-icon cart-icon nasa-flex jc">' . $args['icon_cart'] . '</span>' : '<span class="nasa-icon cart-icon nasa-flex jc"><svg width="17" height="17" viewBox="0 0 24 24" stroke-width="2" fill="currentColor"><path d="M12 6V18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 12H18" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg></span>'
|
||||
),
|
||||
$product,
|
||||
$args
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Product Loop End
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 2.0.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Product Loop Start
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $nasa_opt, $woocommerce_loop;
|
||||
|
||||
$data_columns_small = 1;
|
||||
$data_columns_tablet = 2;
|
||||
|
||||
$class_wrap = '';
|
||||
|
||||
/**
|
||||
* Loop in Shop page
|
||||
*/
|
||||
if (!isset($woocommerce_loop['is_shortcode']) || !$woocommerce_loop['is_shortcode']) {
|
||||
$typeView = isset($nasa_opt['products_type_view']) && in_array($nasa_opt['products_type_view'],array('grid', 'list', 'list-2')) ? $nasa_opt['products_type_view'] : 'grid';
|
||||
|
||||
switch ($typeView) :
|
||||
case 'list' :
|
||||
$class_wrap = 'list';
|
||||
break;
|
||||
|
||||
case 'list-2' :
|
||||
$class_wrap = 'list-2 list';
|
||||
break;
|
||||
|
||||
case 'grid' :
|
||||
default:
|
||||
$class_wrap = 'grid';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
$nasa_change_view = !isset($nasa_opt['enable_change_view']) || $nasa_opt['enable_change_view'] ? true : false;
|
||||
|
||||
$products_per_row = (isset($nasa_opt['products_type_view']) && $nasa_opt['products_type_view'] == 'list') ? 4 :
|
||||
(isset($nasa_opt['products_per_row']) && (int) $nasa_opt['products_per_row'] ? (int) $nasa_opt['products_per_row'] : 4);
|
||||
|
||||
if (isset($_GET['view-layout']) && in_array($_GET['view-layout'], array('grid-2', 'grid-3', 'grid-4', 'grid-5', 'grid-6', 'list', 'list-2'))) :
|
||||
switch ($_GET['view-layout']) :
|
||||
case 'grid-2' :
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 2;
|
||||
break;
|
||||
|
||||
case 'grid-3' :
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 3;
|
||||
break;
|
||||
|
||||
case 'grid-5' :
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 5;
|
||||
break;
|
||||
|
||||
case 'grid-6' :
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 6;
|
||||
break;
|
||||
|
||||
case 'grid-4' :
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 4;
|
||||
break;
|
||||
case 'list' :
|
||||
$products_per_row = 4;
|
||||
$class_wrap = 'list';
|
||||
break;
|
||||
case 'list-2' :
|
||||
$products_per_row = 4;
|
||||
$class_wrap = 'list-2 list';
|
||||
break;
|
||||
default:
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = 4;
|
||||
break;
|
||||
endswitch;
|
||||
endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop in Short code
|
||||
*/
|
||||
else {
|
||||
$class_wrap = 'grid';
|
||||
$products_per_row = isset($woocommerce_loop['columns']) ? $woocommerce_loop['columns'] :
|
||||
(isset($nasa_opt['products_per_row']) && (int) $nasa_opt['products_per_row'] ? (int) $nasa_opt['products_per_row'] : 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Columns for desktop
|
||||
*/
|
||||
switch ($products_per_row):
|
||||
case 2:
|
||||
$class_wrap .= ' large-block-grid-2';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$class_wrap .= ' large-block-grid-3';
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$class_wrap .= ' large-block-grid-5';
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$class_wrap .= ' large-block-grid-6';
|
||||
break;
|
||||
|
||||
case 4:
|
||||
default:
|
||||
$class_wrap .= ' large-block-grid-4';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
/**
|
||||
* Columns for mobile
|
||||
*/
|
||||
$products_per_row_small = isset($nasa_opt['products_per_row_small']) && (int) $nasa_opt['products_per_row_small'] ? (int) $nasa_opt['products_per_row_small'] : 1;
|
||||
switch ($products_per_row_small):
|
||||
case 2:
|
||||
$class_wrap .= ' small-block-grid-2';
|
||||
$data_columns_small = 2;
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
$class_wrap .= ' small-block-grid-1';
|
||||
$data_columns_small = 1;
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
/**
|
||||
* Columns for tablet
|
||||
*/
|
||||
$products_per_row_tablet = isset($nasa_opt['products_per_row_tablet']) && (int) $nasa_opt['products_per_row_tablet'] ? (int) $nasa_opt['products_per_row_tablet'] : 2;
|
||||
switch ($products_per_row_tablet):
|
||||
case 3:
|
||||
$class_wrap .= ' medium-block-grid-3';
|
||||
$data_columns_tablet = 3;
|
||||
break;
|
||||
case 4:
|
||||
$class_wrap .= ' medium-block-grid-4';
|
||||
$data_columns_tablet = 4;
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
$class_wrap .= ' medium-block-grid-2';
|
||||
$data_columns_tablet = 2;
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
$loop_start_class = apply_filters('nasa_loop_start_class', $class_wrap);
|
||||
|
||||
$class_warp_all = 'nasa-content-page-products';
|
||||
if (isset($nasa_opt['loop_layout_buttons']) && $nasa_opt['loop_layout_buttons'] != '') :
|
||||
$class_warp_all .= ' nasa-' . $nasa_opt['loop_layout_buttons'];
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_warp_all); ?>">
|
||||
<ul class="products <?php echo esc_attr($loop_start_class); ?>" data-columns_small="<?php echo esc_attr($data_columns_small); ?>" data-columns_medium="<?php echo esc_attr($data_columns_tablet); ?>">
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Displayed when no products are found matching the current query
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.8.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
?>
|
||||
<div class="woocommerce-info woocommerce-no-products-found">
|
||||
<img src="<?php echo apply_filters('nasa_no_products_found_src', ELESSI_THEME_URI.'/assets/images/not-found-dark-icon.png'); ?>" alt="<?php esc_attr_e('Not Found Products', 'elessi-theme'); ?>" class="not-found-img" width="100" height="115" />
|
||||
|
||||
<?php esc_html_e('No products were found matching your selection.', 'elessi-theme'); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Show options for ordering
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
global $nasa_opt;
|
||||
?>
|
||||
<form class="woocommerce-ordering" method="get">
|
||||
<span class="sort-text margin-right-5 rtl-margin-right-0 rtl-margin-left-5">
|
||||
<?php esc_html_e('Sort by', 'elessi-theme'); ?>
|
||||
</span>
|
||||
|
||||
<select name="orderby" class="orderby" aria-label="<?php esc_attr_e('Shop order', 'elessi-theme'); ?>">
|
||||
<?php foreach ($catalog_orderby_options as $id => $name) : ?>
|
||||
<option value="<?php echo esc_attr($id); ?>" <?php selected($orderby, $id); ?>><?php echo esc_html($name); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<?php if (!isset($nasa_opt['nasa_in_mobile']) || !$nasa_opt['nasa_in_mobile']) : ?>
|
||||
<div class="nasa-ordering"><?php esc_html_e('...', 'elessi-theme'); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="paged" value="1" />
|
||||
<?php wc_query_string_form_fields(null, array('orderby', 'submit', 'paged', 'product-page')); ?>
|
||||
</form>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Pagination - Show numbered pagination for catalog pages.
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.3.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $nasa_opt, $nasa_loadmore_style;
|
||||
|
||||
if (!isset($nasa_loadmore_style) || !is_array($nasa_loadmore_style) || empty($nasa_loadmore_style)) {
|
||||
$nasa_loadmore_style = array('infinite', 'load-more');
|
||||
}
|
||||
|
||||
$nasa_ajax_product = (defined('NASA_AJAX_SHOP') && NASA_AJAX_SHOP) ? NASA_AJAX_SHOP : false;
|
||||
|
||||
$total = isset($total) ? $total : wc_get_loop_prop('total_pages');
|
||||
$current = isset($current) ? $current : wc_get_loop_prop('current_page');
|
||||
$base = isset($base) ? $base : esc_url_raw(str_replace(999999999, '%#%', remove_query_arg('add-to-cart', get_pagenum_link(999999999, false))));
|
||||
|
||||
$format = isset($format) ? $format : '';
|
||||
|
||||
$pagination_style = isset($nasa_opt['pagination_style']) ? $nasa_opt['pagination_style'] : 'style-2';
|
||||
|
||||
if (isset($_GET['paging-style']) && in_array($_GET['paging-style'], $nasa_loadmore_style)) :
|
||||
$pagination_style = $_GET['paging-style'];
|
||||
endif;
|
||||
|
||||
if (!$nasa_ajax_product) :
|
||||
$pagination_style = $pagination_style == 'style-2' ? 'style-2' : 'style-1';
|
||||
endif;
|
||||
|
||||
$loadmore = in_array($pagination_style, $nasa_loadmore_style);
|
||||
$loadmoreClass = 'text-center';
|
||||
$loadmoreClass .= $pagination_style == 'infinite' ? ' nasa-infinite-shop' : '';
|
||||
|
||||
$class_wrap = 'row nasa-paginations-warp filters-container-down';
|
||||
$class_wrap .= $loadmore ? ' paging-style-loadmore' : '';
|
||||
|
||||
if ($total <= 1) :
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div id="nasa-paging" class="<?php echo esc_attr($class_wrap); ?>">
|
||||
<div class="large-12 columns">
|
||||
<?php
|
||||
if ($loadmore) :
|
||||
echo '<div id="nasa-wrap-archive-loadmore" class="' . $loadmoreClass . '">';
|
||||
|
||||
if ($current >= $total) :
|
||||
echo '<p>' . esc_html__('ALL PRODUCTS LOADED !', 'elessi-theme') . '</p>';
|
||||
else :
|
||||
echo '<a class="nasa-archive-loadmore" href="javascript:void(0);" rel="nofollow">';
|
||||
echo esc_html__('LOAD MORE ...', 'elessi-theme');
|
||||
echo '</a>';
|
||||
endif;
|
||||
|
||||
echo '</div>';
|
||||
endif;
|
||||
|
||||
if ($pagination_style == 'style-1') : ?>
|
||||
<div class="nasa-pagination nasa-pagination-store clearfix style-1">
|
||||
<div class="page-sumary">
|
||||
<?php do_action('nasa_shop_category_count'); ?>
|
||||
</div>
|
||||
<nav class="woocommerce-pagination page-numbers-wrap" aria-label="<?php esc_attr_e('Product Pagination', 'elessi-theme'); ?>">
|
||||
<?php
|
||||
echo paginate_links(apply_filters('woocommerce_pagination_args', array(
|
||||
'base' => $base,
|
||||
'format' => $format,
|
||||
'current' => max(1, $current),
|
||||
'total' => $total
|
||||
)));
|
||||
?>
|
||||
</nav>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="nasa-pagination nasa-pagination-store style-2">
|
||||
<nav class="woocommerce-pagination page-numbers-wrap" aria-label="<?php esc_attr_e('Product Pagination', 'elessi-theme'); ?>">
|
||||
<?php
|
||||
echo paginate_links(apply_filters('woocommerce_pagination_args', array(
|
||||
'base' => $base,
|
||||
'format' => $format,
|
||||
'current' => max(1, $current),
|
||||
'total' => $total
|
||||
)));
|
||||
?>
|
||||
</nav>
|
||||
<!-- hr /-->
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
/*!-- end PAGINATION -- */
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Result Count.
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.4.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
?>
|
||||
|
||||
<p class="woocommerce-result-count"<?php echo (empty($orderedby) || 1 === intval($total)) ? '' : ' role="alert" aria-relevant="all" data-is-sorted-by="true"'; ?>>
|
||||
<?php
|
||||
if ($total <= $per_page || -1 === $per_page) :
|
||||
echo $total == 1 ? sprintf(esc_html__('%s result', 'elessi-theme'), $total) : sprintf(esc_html__('%s results', 'elessi-theme'), $total);
|
||||
else :
|
||||
$first = ($per_page * $current) - $per_page + 1;
|
||||
$last = min($total, $per_page * $current);
|
||||
$total = $last - $first + 1;
|
||||
|
||||
echo $total == 1 ? sprintf(esc_html__('%s result', 'elessi-theme'), $total) : sprintf(esc_html__('%s results', 'elessi-theme'), $total);
|
||||
|
||||
// $first = ($per_page * $current) - $per_page + 1;
|
||||
// $last = min($total, $per_page * $current);
|
||||
|
||||
// printf(_nx('%1$d–%2$d of %3$d result', '%1$d–%2$d of %3$d results', $total, 'with first and last result', 'elessi-theme'), $first, $last, $total);
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Product loop sale flash
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 1.6.4
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $nasa_opt, $post, $product;
|
||||
|
||||
if (!$product) :
|
||||
return;
|
||||
endif;
|
||||
|
||||
$badges = '';
|
||||
|
||||
/**
|
||||
* Featured
|
||||
*/
|
||||
if (isset($nasa_opt['featured_badge']) && $nasa_opt['featured_badge'] && $product->is_featured()) :
|
||||
$badges .= '<span class="badge featured-label">' . esc_html__('Featured', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* New
|
||||
*/
|
||||
if (isset($nasa_opt['at_badge_new']) && $nasa_opt['at_badge_new']) :
|
||||
$product_id = $product->get_type() == 'variation' ? $product->get_parent_id() : $product->get_id();
|
||||
|
||||
$published_on = get_the_date('Y-m-d', $product_id);
|
||||
$current_date = strtotime(date('Y-m-d'));
|
||||
$target_date = strtotime($published_on);
|
||||
$diff_days = abs(floor(($target_date - $current_date) / (60 * 60 * 24)));
|
||||
|
||||
$max_time = isset($nasa_opt['max_ns_time_at_badge_new']) && (int) $nasa_opt['max_ns_time_at_badge_new'] ? (int) $nasa_opt['max_ns_time_at_badge_new'] : 10;
|
||||
|
||||
$badges .= $diff_days <= $max_time ? '<span class="badge new-label">' . esc_html__('New', 'elessi-theme') . '</span>' : '';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* On Sale Badge
|
||||
*/
|
||||
if ($product->is_on_sale()) :
|
||||
$badges_sale = '';
|
||||
|
||||
if ($product->get_type() == 'variable') :
|
||||
$badges_sale = '<span class="badge sale-label sale-variable">' . esc_html__('Sale', 'elessi-theme') . '</span>';
|
||||
else :
|
||||
$maximumper = 0;
|
||||
$regular_price = $product->get_regular_price();
|
||||
$sale_price = $product->get_sale_price();
|
||||
|
||||
if (is_numeric($sale_price)) :
|
||||
$percentage = $regular_price ? round(((($regular_price - $sale_price) / $regular_price) * 100), 0) : 0;
|
||||
|
||||
if ($percentage > $maximumper) :
|
||||
$maximumper = $percentage;
|
||||
endif;
|
||||
|
||||
$badges_sale = '<span class="badge sale-label">' . sprintf(esc_html__('-%s%', 'elessi-theme'), $maximumper) . '</span>';
|
||||
endif;
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Hook onsale WooCommerce
|
||||
*/
|
||||
$badges .= apply_filters('woocommerce_sale_flash', $badges_sale, $post, $product);
|
||||
|
||||
/**
|
||||
* Style show with Deal product
|
||||
*/
|
||||
$badges .= '<span class="badge deal-label">' . esc_html__('Limited', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Out of stock
|
||||
*/
|
||||
if ("outofstock" === $product->get_stock_status()):
|
||||
$badges .= elessi_badge_outofstock();
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Backorders - Allowed
|
||||
*/
|
||||
if (isset($nasa_opt['backorder_badge']) && $nasa_opt['backorder_badge'] && $product->backorders_allowed()) :
|
||||
$badges .= '<span class="badge backorders-label">' . esc_html__('Backorders', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Hook to Badges
|
||||
*/
|
||||
$badges_content = apply_filters('nasa_badges', $badges);
|
||||
|
||||
if ('' !== $badges_content) :
|
||||
echo '<div class="nasa-badges-wrap">' . $badges_content . '</div>';
|
||||
endif;
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Login Form
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.2.0
|
||||
*/
|
||||
|
||||
defined('ABSPATH') or exit; // Exit if accessed directly
|
||||
|
||||
do_action('nasa_login_register_form');
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* My Account navigation
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.3.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
do_action('woocommerce_before_account_navigation');
|
||||
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-acc-nav.php';
|
||||
include is_file($file) ? $file : ELESSI_THEME_PATH . '/includes/nasa-acc-nav.php';
|
||||
|
||||
do_action('woocommerce_after_account_navigation');
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Show error messages
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.6.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
if (empty($notices) || !is_array($notices)) :
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<ul class="woocommerce-error is-error" role="alert">
|
||||
<?php foreach ($notices as $notice) : ?>
|
||||
<li<?php echo wc_get_notice_data_attr($notice); ?>>
|
||||
<svg viewBox="0 0 512 512" height="17" width="17" ><path fill="currentColor" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>
|
||||
<?php echo wc_kses_notice($notice['notice']); ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Show messages
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.6.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
if (empty($notices) || !is_array($notices)) :
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php foreach ($notices as $notice) : ?>
|
||||
<div class="woocommerce-info"<?php echo wc_get_notice_data_attr($notice); ?> role="alert">
|
||||
<?php echo wc_kses_notice($notice['notice']); ?>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Show messages
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 8.6.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
if (empty($notices) || !is_array($notices)) :
|
||||
return;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<?php foreach ($notices as $notice) : ?>
|
||||
<div class="woocommerce-message"<?php echo wc_get_notice_data_attr($notice); ?> role="alert">
|
||||
<?php echo wc_kses_notice($notice['notice']); ?>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* Display single product reviews (comments)
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly.
|
||||
endif;
|
||||
|
||||
if (!comments_open()) :
|
||||
return;
|
||||
endif;
|
||||
|
||||
global $product, $nasa_opt;
|
||||
|
||||
$ratings = $product->get_rating_count();
|
||||
$rating_item = array(
|
||||
5 => $product->get_rating_count(5),
|
||||
4 => $product->get_rating_count(4),
|
||||
3 => $product->get_rating_count(3),
|
||||
2 => $product->get_rating_count(2),
|
||||
1 => $product->get_rating_count(1)
|
||||
);
|
||||
|
||||
$count = $product->get_review_count();
|
||||
$sort_type = isset($_GET['review_sort']) && $_GET['review_sort'] != '' ? $_GET['review_sort'] : 'date_DESC';
|
||||
|
||||
if ($sort_type == 'media_DESC') :
|
||||
$args_media = array(
|
||||
'post_id' => $product->get_id(),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'nasa_review_images',
|
||||
'compare' => 'EXISTS',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$reviews_with_media = get_comments($args_media);
|
||||
$count_media = count($reviews_with_media);
|
||||
endif;
|
||||
|
||||
$change_layout_review = in_array(apply_filters('nasa_single_product_tabs_style', '2d-no-border'), array('small-accordion'));
|
||||
|
||||
$options_sort = array(
|
||||
'date_DESC' => esc_html__('Latest', 'elessi-theme'),
|
||||
'date_ASC' => esc_html__('Oldest', 'elessi-theme'),
|
||||
'media_DESC' => esc_html__('Media', 'elessi-theme'),
|
||||
'rating_ASC' => esc_html__('Lowest Rating', 'elessi-theme'),
|
||||
'rating_DESC' => esc_html__('Highest Rating', 'elessi-theme')
|
||||
);
|
||||
|
||||
$reviews_layout = isset($nasa_opt['single_review_layout']) && $nasa_opt['single_review_layout'] != '' ? $nasa_opt['single_review_layout'] : 'list';
|
||||
$reviews_layout = isset($_GET['reviews_layout']) && $_GET['reviews_layout'] != '' ? $_GET['reviews_layout'] : $reviews_layout;
|
||||
|
||||
$reviewForm = (get_option('woocommerce_review_rating_verification_required') === 'no' || wc_customer_bought_product('', get_current_user_id(), $product->get_id())) ? true : false;
|
||||
|
||||
$svg_alert = '<svg width="12" height="12" viewBox="0 0 12 13" fill="none">
|
||||
<path d="M6 0C2.67188 0 0 2.69531 0 6C0 9.32812 2.67188 12 6 12C9.30469 12 12 9.32812 12 6C12 2.69531 9.30469 0 6 0ZM6 10.875C3.30469 10.875 1.125 8.69531 1.125 6C1.125 3.32812 3.30469 1.125 6 1.125C8.67188 1.125 10.875 3.32812 10.875 6C10.875 8.69531 8.67188 10.875 6 10.875ZM6 7.125C6.30469 7.125 6.5625 6.89062 6.5625 6.5625V3.5625C6.5625 3.25781 6.30469 3 6 3C5.67188 3 5.4375 3.25781 5.4375 3.5625V6.5625C5.4375 6.89062 5.67188 7.125 6 7.125ZM6 7.92188C5.57812 7.92188 5.25 8.25 5.25 8.64844C5.25 9.04688 5.57812 9.375 6 9.375C6.39844 9.375 6.72656 9.04688 6.72656 8.64844C6.72656 8.25 6.39844 7.92188 6 7.92188Z" fill="currentColor" />
|
||||
</svg>';
|
||||
|
||||
$required_alert = '<span class="nasa-error">' . $svg_alert . esc_html__('This field is required.', 'elessi-theme') . '</span>';
|
||||
$invalid_alert = '<span class="nasa-invalid-field nasa-error">' . $svg_alert . esc_html__('Email incorrect format.', 'elessi-theme') . '</span>';
|
||||
|
||||
$classStatistic = 'nasa-statistic-ratings';
|
||||
$classStatistic .= !$reviewForm ? ' fullwidth' : '';
|
||||
?>
|
||||
|
||||
<div id="reviews" class="woocommerce-Reviews">
|
||||
<!-- Show statistic Ratings -->
|
||||
<div class="<?php echo esc_attr($classStatistic); ?>">
|
||||
<?php /* h2>
|
||||
<?php echo esc_html__('Customer reviews', 'elessi-theme'); ?>
|
||||
</h2 */?>
|
||||
<div class="nasa-avg-rating">
|
||||
<span class="avg-rating-number">
|
||||
<?php echo 0 < $count ? $product->get_average_rating() : '0.00'; ?>
|
||||
</span>
|
||||
<div class="star-rating">
|
||||
<span style="width: <?php echo 0 < $count ? esc_attr($product->get_average_rating()/5 * 100) : 0; ?>%"></span>
|
||||
</div>
|
||||
|
||||
<?php echo sprintf(esc_html__('%s reviews', 'elessi-theme'), $count); ?>
|
||||
</div>
|
||||
|
||||
<table class="nasa-rating-bars">
|
||||
<tbody>
|
||||
<?php for ($i = 5; $i >= 1; $i--): ?>
|
||||
<?php
|
||||
echo '<!-- ' . $i . ' stars -->';
|
||||
$per = ($ratings > 0 && isset($rating_item[$i])) ? round($rating_item[$i] / $ratings * 100, 2) : 0;
|
||||
?>
|
||||
|
||||
<tr class="nasa-rating-bar">
|
||||
<td class="star-rating-wrap">
|
||||
<span>
|
||||
<?php echo $i; ?>
|
||||
<svg height="17" width="17" viewBox="0 0 24 24" ><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" /></svg>
|
||||
</span>
|
||||
</td>
|
||||
<td class="nasa-rating-per-wrap">
|
||||
<div class="nasa-rating-per">
|
||||
<span style="width: <?php echo esc_attr($per); ?>%" class="nasa-per-content"></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nasa-ratings-number text-center rtl-text-left">
|
||||
<?php echo $rating_item[$i]; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ($reviewForm) : ?>
|
||||
<div id="review_form_wrapper">
|
||||
<div class="nasa_review-submitted_sucess">
|
||||
<span class="ns-thank" ><?php echo esc_html__('Thank you!', 'elessi-theme'); ?></span>
|
||||
<span><?php echo esc_html__('Your review has been submitted', 'elessi-theme'); ?></span>
|
||||
</div>
|
||||
<a class="ns-form-close nasa-stclose close-review-form" href="javascript:void(0);" rel="nofollow"></a>
|
||||
<div id="review_form">
|
||||
<?php
|
||||
$commenter = wp_get_current_commenter();
|
||||
$req = (bool) get_option('require_name_email', 1);
|
||||
$comment_form = array(
|
||||
/* translators: %s is product title */
|
||||
'title_reply' => have_comments() ? sprintf(__('Add a review “%s”', 'elessi-theme'), get_the_title()) : sprintf(__('Be the first to review “%s”', 'elessi-theme'), get_the_title()),
|
||||
/* translators: %s is product title */
|
||||
'title_reply_to' => __('Leave a Reply to %s', 'elessi-theme'),
|
||||
'title_reply_before' => '<span class="nasa-error nasa-message"></span><span class="nasa-success nasa-message"></span><span id="reply-title" class="comment-reply-title">',
|
||||
'title_reply_after' => '</span>',
|
||||
'comment_notes_after' => '',
|
||||
'fields' => array(
|
||||
'author' => '<p class="comment-form-author"><label for="author">' . esc_html__('Name', 'elessi-theme') . ' <span class="required">' . ($req ? '*' : '') . '</span></label> ' .
|
||||
'<input id="author" name="author" type="text" placeholder="' . ($req ? esc_attr__('Name *', 'elessi-theme') : esc_attr__('Name', 'elessi-theme')) . '" value="' . esc_attr($commenter['comment_author']) . '" size="30" class="' . ($req ? 'nasa-field-required' : '') . '" />' . ($req ? $required_alert : '') . '</p>',
|
||||
|
||||
'email' => '<p class="comment-form-email"><label for="email">' . esc_html__('Email', 'elessi-theme') . ' <span class="required">' . ($req ? '*' : '') . '</span></label> ' .
|
||||
'<input id="email" name="email" type="email" placeholder="' . ($req ? esc_attr__('Email *', 'elessi-theme') : esc_attr__('Email', 'elessi-theme')) . '" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" class="' . ($req ? 'nasa-field-required' : '') . '"/>' . ($req ? $required_alert : '') . $invalid_alert . '</p>',
|
||||
),
|
||||
'label_submit' => __('Submit', 'elessi-theme'),
|
||||
'id_submit' => 'nasa-submit',
|
||||
'logged_in_as' => '',
|
||||
'comment_field' => '',
|
||||
);
|
||||
|
||||
$account_page_url = wc_get_page_permalink('myaccount');
|
||||
if ($account_page_url) :
|
||||
/* Redirect back product after logged in */
|
||||
$account_page_url = add_query_arg('redirect_to', $product->get_permalink(), $account_page_url);
|
||||
|
||||
/* translators: %s opening and closing link tags respectively */
|
||||
$comment_form['must_log_in'] = '<p class="must-log-in">' . sprintf(esc_html__('You must be %1$slogged in%2$s to post a review.', 'elessi-theme'), '<a href="' . esc_url($account_page_url) . '">', '</a>') . '</p>';
|
||||
|
||||
$login_ajax = !NASA_CORE_USER_LOGGED && (!isset($nasa_opt['login_ajax']) || $nasa_opt['login_ajax'] == 1) ? true : false;
|
||||
|
||||
if ($login_ajax) :
|
||||
echo '<a class="hidden-tag nasa-login-register-ajax" data-enable="1" href="' . esc_url($account_page_url) . '" rel="nofollow"></a>';
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
if (wc_review_ratings_enabled()) :
|
||||
$comment_form['comment_field'] = '<p class="comment-form-rating"><label class="nasa-rating" for="rating">' . esc_html__('Your rating', 'elessi-theme') . ' <span class="required">*</span></label>'.
|
||||
'<select name="rating" id="rating" class="' . (wc_review_ratings_required() ? 'nasa-field-required' : '') . '">' .
|
||||
'<option value="">' . esc_html__('Rate…', 'elessi-theme') . '</option>' .
|
||||
'<option value="5">' . esc_html__('Perfect', 'elessi-theme') . '</option>' .
|
||||
'<option value="4">' . esc_html__('Good', 'elessi-theme') . '</option>' .
|
||||
'<option value="3">' . esc_html__('Average', 'elessi-theme') . '</option>' .
|
||||
'<option value="2">' . esc_html__('Not that bad', 'elessi-theme') . '</option>' .
|
||||
'<option value="1">' . esc_html__('Very poor', 'elessi-theme') . '</option>' .
|
||||
'</select>' . $required_alert . '</p>';
|
||||
endif;
|
||||
|
||||
$comment_form['comment_field'] .= '<p class="comment-form-comment"><label for="comment">' . esc_html__('Your review', 'elessi-theme') . ' <span class="required">*</span></label><textarea id="comment" name="comment" placeholder="' . esc_html__('Your review *', 'elessi-theme') . '" cols="45" rows="8" class="nasa-field-required"></textarea>' . $required_alert . '</p>';
|
||||
|
||||
comment_form(apply_filters('woocommerce_product_review_comment_form_args', $comment_form));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nasa_reviewed_images_wrap">
|
||||
|
||||
<?php /*h2><?php esc_html_e('Customer photos', 'elessi-theme'); ?></h2*/?>
|
||||
<div class="nasa_reviewed_images"></div>
|
||||
<a class="button btn-add-new-review" href="javascript:void(0);" rel="nofollow"><?php echo(have_comments() ? __('Write a review', 'elessi-theme') : sprintf(__('Be the first to review “%s”', 'elessi-theme'), get_the_title())); ?></a>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<div class="nasa_reviewed_images_wrap">
|
||||
<div class="nasa_reviewed_images"></div>
|
||||
</div>
|
||||
<p class="woocommerce-verification-required"><?php esc_html_e('Only logged in customers who have purchased this product may leave a review.', 'elessi-theme'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nasa-clear-both"></div>
|
||||
|
||||
<div id="comments">
|
||||
<h2 class="woocommerce-Reviews-title">
|
||||
<?php
|
||||
if ($count && wc_review_ratings_enabled()) :
|
||||
/* translators: 1: reviews count 2: product name */
|
||||
// $reviews_title = $sort_type == 'media_DESC' ? sprintf(esc_html(_n('%1$s/%2$s review %3$s has media', '%1$s/%2$s reviews %3$s has media', $count_media, 'elessi-theme')), esc_html($count_media),esc_html($count),'<span>' . get_the_title() . '</span>') : sprintf(esc_html(_n('Showing 1 - %2$s of %1$s review', 'Showing 1 - %2$s of %1$s reviews', $count, 'elessi-theme')), esc_html($count),'<span class="review-showing">' . get_option( 'comments_per_page' ) .'</span>');
|
||||
|
||||
$path = $_SERVER['REQUEST_URI'];
|
||||
$page_number = preg_match("/comment-page-(\d+)/", $path, $matches) ? $page_number = $matches[1] : 1;
|
||||
$comments_per_page = get_option('comments_per_page', 10);
|
||||
|
||||
$review_end = $page_number * $comments_per_page > $count ? $count : $page_number * $comments_per_page;
|
||||
$review_start = (isset($nasa_opt['single_review_ajax']) && $nasa_opt['single_review_ajax']) ? 1 : ($page_number > 1 ? ($page_number -1) * $comments_per_page + 1 : 1);
|
||||
|
||||
$reviews_title = sprintf(esc_html(_n('Showing %3$s - %2$s of %1$s review', 'Showing %3$s - %2$s of %1$s reviews', $count, 'elessi-theme')), esc_html($count), esc_html($review_end), esc_html($review_start));
|
||||
|
||||
if ($sort_type == 'media_DESC') :
|
||||
$review_end = $page_number * $comments_per_page > $count_media ? $count_media : $page_number * $comments_per_page;
|
||||
$reviews_title = sprintf(esc_html(_n('Showing %3$s - %2$s of %1$s media review', 'Showing %3$s - %2$s of %1$s media reviews', $count_media, 'elessi-theme')), esc_html($count_media), esc_html($review_end), esc_html($review_start));
|
||||
endif;
|
||||
|
||||
$reviews_title = ($sort_type == 'media_DESC' && $count <= 0) ? esc_html__('Reviews', 'elessi-theme') : $reviews_title;
|
||||
|
||||
echo apply_filters('woocommerce_reviews_title', $reviews_title, $count, $product); // WPCS: XSS ok.
|
||||
else :
|
||||
echo esc_html__('Reviews', 'elessi-theme');
|
||||
endif;
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<?php if ($count > 0) : ?>
|
||||
<?php if (!$change_layout_review) : ?>
|
||||
<div class="woocommerce-Reviews-layout">
|
||||
<a href="javascript:void(0);" class="nasa-change-layout-reviews masonry nasa-tip <?php echo $reviews_layout == 'masonry' ? 'nasa-active' :''; ?>" rel="nofollow" data-tip="<?php echo esc_attr__('Grid', 'elessi-theme'); ?>" data-class="commentlist masonry large-block-grid-4 small-block-grid-2 medium-block-grid-3" data-type="masonry">
|
||||
<svg width="26" height="17" viewBox="0 0 26 18" fill="none">
|
||||
<rect width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
<rect y="9" width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
<rect x="9" width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
<rect x="18" width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
<rect x="9" y="9" width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
<rect x="18" y="9" width="8" height="8" rx="2" fill="currentColor"></rect>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="nasa-change-layout-reviews list nasa-tip <?php echo $reviews_layout == 'list' ? 'nasa-active' :''; ?>" rel="nofollow" data-tip="<?php echo esc_attr__('List', 'elessi-theme'); ?>" data-class="commentlist list" data-type="list">
|
||||
<svg width="21" height="17" viewBox="0 0 21 18" fill="none">
|
||||
<rect x="9" y="2" width="12" height="1" rx="0.5" fill="currentColor"></rect>
|
||||
<rect x="9" y="4" width="12" height="1" rx="0.5" fill="currentColor"></rect>
|
||||
<rect width="8" height="8" rx="1.5" fill="currentColor"></rect>
|
||||
<rect x="9" y="11" width="12" height="1" rx="0.5" fill="currentColor"></rect>
|
||||
<rect x="9" y="13" width="12" height="1" rx="0.5" fill="currentColor"></rect>
|
||||
<rect y="9" width="8" height="8" rx="1.5" fill="currentColor"></rect>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<div class="woocommerce-Reviews-ordering">
|
||||
<span class="sort-text margin-right-5 rtl-margin-right-0 rtl-margin-left-5"><?php echo esc_html__('Sort by','elessi-theme')?></span>
|
||||
<div class="nasa-ordering">
|
||||
<a href="javascript:void(0);" class="nasa-current-orderby nasa-bold-700">
|
||||
<?php foreach ($options_sort as $key => $option) :
|
||||
if ($key == $sort_type) :
|
||||
echo $option;
|
||||
break;
|
||||
endif;
|
||||
endforeach; ?>
|
||||
</a>
|
||||
<div class="sub-ordering">
|
||||
<?php foreach ($options_sort as $key => $option) :
|
||||
$active_class = $key == $sort_type ? ' active' : ''; ?>
|
||||
<a href="javascript:void(0);" data-value="<?php echo esc_attr($key); ?>" class="nasa-orderby<?php echo esc_attr($active_class); ?>"><?php echo $option; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<svg class="svg_desktop" width="20" height="20" viewBox="0 0 32 32" fill="currentColor"><path d="M15.233 19.175l0.754 0.754 6.035-6.035-0.754-0.754-5.281 5.281-5.256-5.256-0.754 0.754 3.013 3.013z" /></svg>
|
||||
<svg class="svg_mobile" width="22" height="22" viewBox="0 0 32 32">
|
||||
<path d="M28.262 5.87c0-1.472-1.194-2.665-2.666-2.665s-2.666 1.193-2.666 2.665c0 1.289 0.916 2.365 2.133 2.612v18.18h1.066v-18.18c1.217-0.247 2.133-1.323 2.133-2.612zM25.596 7.47c-0.882 0-1.599-0.717-1.599-1.599s0.717-1.599 1.599-1.599c0.882 0 1.599 0.717 1.599 1.599s-0.717 1.599-1.599 1.599z" fill="currentColor" />
|
||||
<path d="M6.937 23.517v-18.18h-1.066v18.18c-1.217 0.247-2.132 1.322-2.132 2.612 0 1.472 1.194 2.666 2.666 2.666s2.666-1.194 2.666-2.666c0-1.29-0.916-2.365-2.133-2.612zM6.404 27.729c-0.882 0-1.599-0.717-1.599-1.599s0.717-1.599 1.599-1.599 1.599 0.717 1.599 1.599-0.717 1.599-1.599 1.599z" fill="currentColor" />
|
||||
<path d="M16.533 13.388v-8.050h-1.066v8.050c-1.217 0.247-2.133 1.323-2.133 2.612s0.916 2.365 2.133 2.612v8.050h1.066v-8.050c1.217-0.247 2.133-1.323 2.133-2.612s-0.916-2.365-2.133-2.612zM16 17.599c-0.882 0-1.599-0.717-1.599-1.599s0.717-1.599 1.599-1.599 1.599 0.717 1.599 1.599-0.717 1.599-1.599 1.599z" fill="currentColor" />
|
||||
</svg>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (have_comments()) : ?>
|
||||
<ol class="commentlist <?php echo $reviews_layout == 'list' || $change_layout_review ? 'list': 'masonry large-block-grid-4 small-block-grid-2 medium-block-grid-3';?>">
|
||||
<?php wp_list_comments(apply_filters('woocommerce_product_review_list_args', array('callback' => 'woocommerce_comments'))); ?>
|
||||
</ol>
|
||||
|
||||
<?php
|
||||
if (get_comment_pages_count() > 1 && get_option('page_comments')) :
|
||||
echo '<nav class="woocommerce-pagination">';
|
||||
|
||||
paginate_comments_links(
|
||||
apply_filters('woocommerce_comment_pagination_args', array(
|
||||
'prev_text' => '<svg width="35" height="35" viewBox="0 0 32 32" fill="currentColor"><path d="M12.792 15.233l-0.754 0.754 6.035 6.035 0.754-0.754-5.281-5.281 5.256-5.256-0.754-0.754-3.013 3.013z"/></svg>',
|
||||
'next_text' => '<svg width="35" height="35" viewBox="0 0 32 32" fill="currentColor"><path d="M19.159 16.767l0.754-0.754-6.035-6.035-0.754 0.754 5.281 5.281-5.256 5.256 0.754 0.754 3.013-3.013z"/></svg>',
|
||||
'type' => 'list'
|
||||
))
|
||||
);
|
||||
|
||||
echo '</nav>';
|
||||
endif;
|
||||
?>
|
||||
<?php else : ?>
|
||||
<p class="woocommerce-noreviews"><?php echo $sort_type == 'media_DESC' ? esc_html__('There are no media reviews yet.', 'elessi-theme') : esc_html__('There are no reviews yet.', 'elessi-theme'); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 1.6.4
|
||||
*/
|
||||
defined('ABSPATH') or exit;
|
||||
|
||||
/**
|
||||
* Before setup shop
|
||||
*/
|
||||
do_action('nasa_before_render_single_product');
|
||||
|
||||
global $nasa_opt;
|
||||
|
||||
$nasa_ajax = isset($nasa_opt['single_product_ajax']) && $nasa_opt['single_product_ajax'] ? true : false;
|
||||
defined('NASA_AJAX_PRODUCT') or define('NASA_AJAX_PRODUCT', $nasa_ajax);
|
||||
|
||||
get_header('shop');
|
||||
?>
|
||||
<div class="product-page">
|
||||
<?php
|
||||
|
||||
/**
|
||||
* woocommerce_before_main_content hook.
|
||||
*
|
||||
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
|
||||
* @hooked woocommerce_breadcrumb - 20
|
||||
*/
|
||||
do_action('woocommerce_before_main_content');
|
||||
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
wc_get_template_part('content', 'single-product');
|
||||
endwhile;
|
||||
|
||||
/**
|
||||
* woocommerce_after_main_content hook.
|
||||
*
|
||||
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
|
||||
*/
|
||||
do_action('woocommerce_after_main_content');
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
get_footer('shop');
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* External product add to cart
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
do_action('woocommerce_before_add_to_cart_form');
|
||||
?>
|
||||
|
||||
<form class="cart" action="<?php echo esc_url($product_url); ?>" method="get">
|
||||
<?php do_action('woocommerce_before_add_to_cart_button'); ?>
|
||||
|
||||
<button type="submit" class="ns-single-add-btn single_add_to_cart_button button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : '' ); ?>"><?php echo esc_html($button_text); ?></button>
|
||||
|
||||
<?php wc_query_string_form_fields($product_url); ?>
|
||||
|
||||
<?php do_action('woocommerce_after_add_to_cart_button'); ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
do_action('woocommerce_after_add_to_cart_form');
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* Grouped product add to cart
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
global $product, $post;
|
||||
|
||||
do_action('woocommerce_before_add_to_cart_form');
|
||||
?>
|
||||
|
||||
<form class="cart grouped_form" action="<?php echo esc_url(apply_filters('woocommerce_add_to_cart_form_action', $product->get_permalink())); ?>" method="post" enctype="multipart/form-data">
|
||||
<table cellspacing="0" class="woocommerce-grouped-product-list group_table">
|
||||
<tbody>
|
||||
<?php
|
||||
$quantites_required = false;
|
||||
$previous_post = $post;
|
||||
|
||||
$grouped_product_columns = apply_filters(
|
||||
'woocommerce_grouped_product_columns',
|
||||
array(
|
||||
'quantity',
|
||||
'label',
|
||||
'price',
|
||||
),
|
||||
$product
|
||||
);
|
||||
|
||||
$show_add_to_cart_button = false;
|
||||
|
||||
do_action('woocommerce_grouped_product_list_before', $grouped_product_columns, $quantites_required, $product);
|
||||
|
||||
foreach ($grouped_products as $grouped_product_child) :
|
||||
$post_object = get_post($grouped_product_child->get_id());
|
||||
$quantites_required = $quantites_required || ( $grouped_product_child->is_purchasable() && !$grouped_product_child->has_options() );
|
||||
$post = $post_object; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
setup_postdata($post);
|
||||
|
||||
if ($grouped_product_child->is_in_stock()) :
|
||||
$show_add_to_cart_button = true;
|
||||
endif;
|
||||
|
||||
echo '<tr id="product-' . esc_attr($grouped_product_child->get_id()) . '" class="woocommerce-grouped-product-list-item ' . esc_attr(implode(' ', wc_get_product_class('', $grouped_product_child))) . '">';
|
||||
|
||||
// Output columns for each product.
|
||||
foreach ($grouped_product_columns as $column_id) :
|
||||
do_action('woocommerce_grouped_product_list_before_' . $column_id, $grouped_product_child);
|
||||
|
||||
switch ($column_id) :
|
||||
case 'quantity':
|
||||
ob_start();
|
||||
|
||||
if (!$grouped_product_child->is_purchasable() || $grouped_product_child->has_options() || !$grouped_product_child->is_in_stock()) :
|
||||
woocommerce_template_loop_add_to_cart();
|
||||
elseif ($grouped_product_child->is_sold_individually()) :
|
||||
echo '<input type="checkbox" name="' . esc_attr('quantity[' . $grouped_product_child->get_id() . ']') . '" value="1" class="wc-grouped-product-add-to-cart-checkbox" id="' . esc_attr('quantity-' . $grouped_product_child->get_id()) . '" />';
|
||||
echo '<label for="' . esc_attr('quantity-' . $grouped_product_child->get_id()) . '" class="screen-reader-text">' . esc_html__('Buy one of this item', 'elessi-theme') . '</label>';
|
||||
else :
|
||||
do_action('woocommerce_before_add_to_cart_quantity');
|
||||
|
||||
woocommerce_quantity_input(
|
||||
array(
|
||||
'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']',
|
||||
'input_value' => isset($_POST['quantity'][$grouped_product_child->get_id()]) ? wc_stock_amount(wc_clean(wp_unslash($_POST['quantity'][$grouped_product_child->get_id()]))) : '', // phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
'min_value' => apply_filters('woocommerce_quantity_input_min', 0, $grouped_product_child),
|
||||
'max_value' => apply_filters('woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child),
|
||||
'placeholder' => '0',
|
||||
)
|
||||
);
|
||||
|
||||
do_action('woocommerce_after_add_to_cart_quantity');
|
||||
endif;
|
||||
|
||||
$value = ob_get_clean();
|
||||
|
||||
break;
|
||||
|
||||
case 'label':
|
||||
$value = '<label for="product-' . esc_attr($grouped_product_child->get_id()) . '">';
|
||||
$value .= $grouped_product_child->is_visible() ? '<a href="' . esc_url(apply_filters('woocommerce_grouped_product_list_link', $grouped_product_child->get_permalink(), $grouped_product_child->get_id())) . '">' . $grouped_product_child->get_name() . '</a>' : $grouped_product_child->get_name();
|
||||
$value .= '</label>';
|
||||
break;
|
||||
|
||||
case 'price':
|
||||
$value = $grouped_product_child->get_price_html() . wc_get_stock_html($grouped_product_child);
|
||||
break;
|
||||
|
||||
default:
|
||||
$value = '';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr($column_id) . '">' . apply_filters('woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product_child) . '</td>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action('woocommerce_grouped_product_list_after_' . $column_id, $grouped_product_child);
|
||||
endforeach;
|
||||
|
||||
echo '</tr>';
|
||||
endforeach;
|
||||
|
||||
$post = $previous_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
setup_postdata($post);
|
||||
|
||||
do_action('woocommerce_grouped_product_list_after', $grouped_product_columns, $quantites_required, $product);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="add-to-cart" value="<?php echo esc_attr($product->get_id()); ?>" />
|
||||
|
||||
<?php if ($quantites_required && $show_add_to_cart_button) : ?>
|
||||
|
||||
<?php do_action('woocommerce_before_add_to_cart_button'); ?>
|
||||
|
||||
<button type="submit" class="ns-single-add-btn single_add_to_cart_button button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>"><?php echo esc_html($product->single_add_to_cart_text()); ?></button>
|
||||
|
||||
<?php do_action('woocommerce_after_add_to_cart_button'); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
do_action('woocommerce_after_add_to_cart_form');
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Simple product add to cart
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
global $product, $nasa_opt;
|
||||
|
||||
if (!$product->is_purchasable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo wc_get_stock_html($product); // WPCS: XSS ok.
|
||||
|
||||
$disable_add_to_cart = isset($nasa_opt['disable-cart']) && $nasa_opt['disable-cart'] ? true : false;
|
||||
|
||||
if (!$disable_add_to_cart && $product->is_in_stock()) :
|
||||
?>
|
||||
|
||||
<?php do_action('woocommerce_before_add_to_cart_form'); ?>
|
||||
|
||||
<form class="cart" action="<?php echo esc_url(apply_filters('woocommerce_add_to_cart_form_action', $product->get_permalink())); ?>" method="post" enctype='multipart/form-data'>
|
||||
<?php do_action('woocommerce_before_add_to_cart_button'); ?>
|
||||
|
||||
<?php
|
||||
do_action('woocommerce_before_add_to_cart_quantity');
|
||||
|
||||
woocommerce_quantity_input(
|
||||
array(
|
||||
'min_value' => apply_filters('woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product),
|
||||
'max_value' => apply_filters('woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product),
|
||||
'input_value' => isset($_POST['quantity']) ? wc_stock_amount(wp_unslash($_POST['quantity'])) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.
|
||||
)
|
||||
);
|
||||
|
||||
do_action('woocommerce_after_add_to_cart_quantity');
|
||||
?>
|
||||
|
||||
<button type="submit" name="add-to-cart" value="<?php echo esc_attr($product->get_id()); ?>" class="ns-single-add-btn single_add_to_cart_button button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>">
|
||||
<?php echo esc_html($product->single_add_to_cart_text()); ?>
|
||||
</button>
|
||||
|
||||
<?php do_action('woocommerce_after_add_to_cart_button'); ?>
|
||||
</form>
|
||||
|
||||
<?php do_action('woocommerce_after_add_to_cart_form'); ?>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Single variation cart button
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 7.0.1
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
global $nasa_opt, $product;
|
||||
?>
|
||||
|
||||
<div class="woocommerce-variation-add-to-cart variations_button">
|
||||
<?php
|
||||
do_action('woocommerce_before_add_to_cart_button');
|
||||
|
||||
do_action('woocommerce_before_add_to_cart_quantity');
|
||||
|
||||
if (!isset($nasa_opt['disable-cart']) || !$nasa_opt['disable-cart']) :
|
||||
woocommerce_quantity_input(array(
|
||||
'min_value' => apply_filters('woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product),
|
||||
'max_value' => apply_filters('woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product),
|
||||
'input_value' => isset($_POST['quantity']) ? wc_stock_amount(wp_unslash($_POST['quantity'])) : $product->get_min_purchase_quantity(),
|
||||
));
|
||||
endif;
|
||||
|
||||
do_action('woocommerce_after_add_to_cart_quantity');
|
||||
|
||||
if (!isset($nasa_opt['disable-cart']) || !$nasa_opt['disable-cart']) :
|
||||
?>
|
||||
<button type="submit" class="ns-single-add-btn single_add_to_cart_button button alt<?php echo esc_attr(wc_wp_theme_get_element_class_name('button') ? ' ' . wc_wp_theme_get_element_class_name('button') : ''); ?>">
|
||||
<?php echo esc_html($product->single_add_to_cart_text()); ?>
|
||||
</button>
|
||||
|
||||
<input type="hidden" name="add-to-cart" value="<?php echo absint($product->get_id()); ?>" />
|
||||
<input type="hidden" name="product_id" value="<?php echo absint($product->get_id()); ?>" />
|
||||
<input type="hidden" name="variation_id" class="variation_id" value="0" />
|
||||
<?php
|
||||
endif;
|
||||
|
||||
do_action('woocommerce_after_add_to_cart_button');
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Meta
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.0.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $product;
|
||||
|
||||
?>
|
||||
<div class="product_meta">
|
||||
|
||||
<?php do_action('woocommerce_product_meta_start'); ?>
|
||||
|
||||
<?php if (wc_product_sku_enabled()) :
|
||||
$sku = $product->get_sku();
|
||||
|
||||
if ($sku || $product->is_type('variable')) : ?>
|
||||
<span class="sku_wrapper">
|
||||
<strong><?php esc_html_e('SKU:', 'elessi-theme'); ?></strong> <span class="sku"><?php echo $sku ? $sku : esc_html__('N/A', 'elessi-theme'); ?></span>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo wc_get_product_category_list($product->get_id(), ', ', '<span class="posted_in">' . _n('<strong>Category:</strong>', '<strong>Categories:</strong>', count($product->get_category_ids()), 'elessi-theme') . ' ', '</span>'); ?>
|
||||
|
||||
<?php echo wc_get_product_tag_list($product->get_id(), ', ', '<span class="tagged_as">' . _n('<strong>Tag:</strong>', '<strong>Tags:</strong>', count($product->get_tag_ids()), 'elessi-theme') . ' ', '</span>'); ?>
|
||||
|
||||
<?php do_action('woocommerce_product_meta_end'); ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,265 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom Product image
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.0.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $product, $nasa_opt;
|
||||
|
||||
$product_id = $product->get_id();
|
||||
$post_thumbnail_id = $product->get_image_id();
|
||||
$product_post = get_post($product_id);
|
||||
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
|
||||
$attach_video_id = elessi_get_product_meta_value($product_id, '_product_video_upload');
|
||||
$video_url = $attach_video_id ? wp_get_attachment_url($attach_video_id) : false;
|
||||
|
||||
$attach_video_poster_id = elessi_get_product_meta_value($product_id, '_product_video_poster_upload');
|
||||
|
||||
$video_title = $attach_video_id ? get_the_title($attach_video_id) : '';
|
||||
// $data_rel = '';
|
||||
|
||||
$image_size = apply_filters('woocommerce_gallery_image_size', 'woocommerce_single');
|
||||
$full_size = apply_filters('woocommerce_gallery_full_size', apply_filters('woocommerce_product_thumbnails_large_size', 'full'));
|
||||
|
||||
if ($post_thumbnail_id) :
|
||||
$image_title = esc_attr(get_the_title($post_thumbnail_id));
|
||||
$alt_text = trim(wp_strip_all_tags(get_post_meta($post_thumbnail_id, '_wp_attachment_image_alt', true)));
|
||||
|
||||
$image_full = wp_get_attachment_image_src($post_thumbnail_id, $full_size);
|
||||
$image_link = isset($image_full[0]) ? $image_full[0] : wp_get_attachment_url($post_thumbnail_id);
|
||||
$image_large = wp_get_attachment_image_src($post_thumbnail_id, $image_size);
|
||||
$src_large = isset($image_large[0]) ? $image_large[0] : $image_link;
|
||||
|
||||
$video_poster_url = $attach_video_poster_id ? wp_get_attachment_url($attach_video_poster_id) : $image_link;
|
||||
|
||||
$image = wp_get_attachment_image(
|
||||
$post_thumbnail_id,
|
||||
$image_size,
|
||||
false,
|
||||
apply_filters(
|
||||
'woocommerce_gallery_image_html_attachment_image_params',
|
||||
array(
|
||||
'title' => _wp_specialchars(get_post_field('post_title', $post_thumbnail_id), ENT_QUOTES, 'UTF-8', true),
|
||||
'alt' => $alt_text,
|
||||
'data-caption' => _wp_specialchars(get_post_field('post_excerpt', $post_thumbnail_id), ENT_QUOTES, 'UTF-8', true),
|
||||
'data-src' => esc_url($image_full[0]),
|
||||
'data-large_image' => esc_url($image_full[0]),
|
||||
'data-large_image_width' => esc_attr($image_full[1]),
|
||||
'data-large_image_height' => esc_attr($image_full[2]),
|
||||
'class' => 'wp-post-image skip-lazy attachment-shop_single size-shop_single',
|
||||
),
|
||||
$post_thumbnail_id,
|
||||
$image_size,
|
||||
true
|
||||
)
|
||||
);
|
||||
endif;
|
||||
|
||||
$attachment_count = count($attachment_ids);
|
||||
|
||||
$slideHoz = false;
|
||||
if (isset($nasa_opt['product_detail_layout']) && in_array($nasa_opt['product_detail_layout'], array('classic', 'modern-2', 'modern-3')) && isset($nasa_opt['product_thumbs_style']) && $nasa_opt['product_thumbs_style'] === 'hoz') :
|
||||
$slideHoz = true;
|
||||
endif;
|
||||
|
||||
|
||||
if (isset($nasa_opt['product_detail_layout']) && in_array($nasa_opt['product_detail_layout'], array('new')) && isset($nasa_opt['product_thumbs_style']) && $nasa_opt['product_thumbs_style'] === 'hoz' && isset($nasa_opt['product_image_style']) && $nasa_opt['product_image_style'] === 'slide') :
|
||||
$slideHoz = true;
|
||||
endif;
|
||||
|
||||
if (in_array($nasa_opt['product_detail_layout'], array('modern-1', 'new-3'))) :
|
||||
$slideHoz = true;
|
||||
endif;
|
||||
|
||||
$imageMobilePadding = 'mobile-padding-left-5 mobile-padding-right-5';
|
||||
if (isset($nasa_opt['product_detail_layout']) && $nasa_opt['product_detail_layout'] == 'new' && isset($nasa_opt['product_image_style']) && $nasa_opt['product_image_style'] == 'scroll') :
|
||||
$imageMobilePadding = 'mobile-padding-left-0 mobile-padding-right-0 nasa-flex align-start';
|
||||
endif;
|
||||
|
||||
$class_main_imgs = 'main-images nasa-single-product-main-image nasa-main-image-default';
|
||||
|
||||
$class_wrapimg = 'row nasa-mobile-row woocommerce-product-gallery__wrapper';
|
||||
|
||||
$show_thumbnail = true;
|
||||
if (isset($nasa_opt['product_detail_layout']) && in_array($nasa_opt['product_detail_layout'], array('full'))) :
|
||||
$show_thumbnail = false;
|
||||
$class_wrapimg = 'nasa-row nasa-mobile-row woocommerce-product-gallery__wrapper nasa-columns-padding-0';
|
||||
$imageMobilePadding = 'mobile-padding-left-0 mobile-padding-right-0';
|
||||
|
||||
if (isset($nasa_opt['half_full_slide']) && $nasa_opt['half_full_slide']) :
|
||||
$class_main_imgs .= ' no-easyzoom';
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['product_detail_layout']) && $nasa_opt['product_detail_layout'] === 'modern-4'):
|
||||
$show_thumbnail = false;
|
||||
endif;
|
||||
|
||||
$sliders_arrow = isset($nasa_opt['product_slide_arrows']) && $nasa_opt['product_slide_arrows'] && $nasa_opt['product_image_style'] === 'slide' ? true : false;
|
||||
|
||||
$in_mobile = isset($nasa_opt['nasa_in_mobile']) && $nasa_opt['nasa_in_mobile'] ? true : false;
|
||||
$mobile_app = $in_mobile && isset($nasa_opt['mobile_layout']) && $nasa_opt['mobile_layout'] == 'app' ? true : false;
|
||||
|
||||
$wrapper_classes = apply_filters(
|
||||
'woocommerce_single_product_image_gallery_classes',
|
||||
array(
|
||||
'woocommerce-product-gallery',
|
||||
'woocommerce-product-gallery--' . ($post_thumbnail_id ? 'with-images' : 'without-images'),
|
||||
'images',
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr(implode(' ', array_map('sanitize_html_class', $wrapper_classes))); ?>">
|
||||
<div class="<?php echo esc_attr($class_wrapimg); ?>">
|
||||
<div class="large-12 columns <?php echo $imageMobilePadding; ?>">
|
||||
|
||||
<?php if ($show_thumbnail && !$slideHoz && !$in_mobile) : ?>
|
||||
<div class="nasa-thumb-wrap rtl-right">
|
||||
<?php do_action('woocommerce_product_thumbnails'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="nasa-main-wrap rtl-left<?php echo $slideHoz ? ' nasa-thumbnail-hoz' : ''; ?>">
|
||||
<div class="product-images-slider images-popups-gallery">
|
||||
<div class="nasa-main-image-default-wrap">
|
||||
<?php if ($mobile_app && $attachment_count) : ?>
|
||||
<div class="ns-img-count nasa-flex jc fs-13">
|
||||
<span class="ns-img-now">1</span>/<span class="ns-img-total"><?php echo $video_url ? $attachment_count + 2 : $attachment_count + 1; ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($sliders_arrow) : ?>
|
||||
<div class="nasa-single-slider-arrows">
|
||||
<a class="nasa-single-arrow nasa-disabled" data-action="prev" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="42" height="42" viewBox="0 0 32 32" fill="currentColor"><path d="M12.792 15.233l-0.754 0.754 6.035 6.035 0.754-0.754-5.281-5.281 5.256-5.256-0.754-0.754-3.013 3.013z"/></svg>
|
||||
</a>
|
||||
<a class="nasa-single-arrow nasa-disabled" data-action="next" href="javascript:void(0);" rel="nofollow">
|
||||
<svg width="42" height="42" viewBox="0 0 32 32" fill="currentColor"><path d="M19.159 16.767l0.754-0.754-6.035-6.035-0.754 0.754 5.281 5.281-5.256 5.256 0.754 0.754 3.013-3.013z"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_main_imgs); ?>">
|
||||
<div class="item-wrap first">
|
||||
<div class="nasa-item-main-image-wrap" data-key="0">
|
||||
<?php if ($post_thumbnail_id) : ?>
|
||||
<div class="easyzoom first">
|
||||
<?php
|
||||
echo apply_filters(
|
||||
'woocommerce_single_product_image_thumbnail_html',
|
||||
sprintf(
|
||||
'<a href="%s" class="woocommerce-main-image product-image woocommerce-product-gallery__image" data-o_href="%s" data-full_href="%s" title="%s">%s</a>',
|
||||
$image_link,
|
||||
$src_large,
|
||||
$image_link,
|
||||
$image_title,
|
||||
$image
|
||||
),
|
||||
$post_thumbnail_id
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<?php echo apply_filters(
|
||||
'woocommerce_single_product_image_thumbnail_html',
|
||||
sprintf(
|
||||
'<div class="woocommerce-product-gallery__image--placeholder"><img src="%s" alt="%s" class="wp-post-image" /></div>',
|
||||
esc_url(wc_placeholder_img_src('woocommerce_single')),
|
||||
esc_html__('Awaiting product image', 'elessi-theme')
|
||||
),
|
||||
$post_thumbnail_id
|
||||
); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$_i = 0;
|
||||
if ($attachment_count > 0) :
|
||||
foreach ($attachment_ids as $attachment_id) :
|
||||
$image_full = wp_get_attachment_image_src($attachment_id, $full_size);
|
||||
if (!$image_full) :
|
||||
continue;
|
||||
endif;
|
||||
|
||||
$image_link = wp_get_attachment_url($attachment_id);
|
||||
$image_title = esc_attr(get_the_title($attachment_id));
|
||||
$alt_text = trim(wp_strip_all_tags(get_post_meta($attachment_id, '_wp_attachment_image_alt', true)));
|
||||
|
||||
$image = wp_get_attachment_image(
|
||||
$attachment_id,
|
||||
$image_size,
|
||||
false,
|
||||
apply_filters(
|
||||
'woocommerce_gallery_image_html_attachment_image_params',
|
||||
array(
|
||||
'title' => _wp_specialchars(get_post_field('post_title', $attachment_id), ENT_QUOTES, 'UTF-8', true),
|
||||
'alt' => $alt_text,
|
||||
'data-caption' => _wp_specialchars(get_post_field('post_excerpt', $attachment_id), ENT_QUOTES, 'UTF-8', true),
|
||||
'data-src' => esc_url($image_full[0]),
|
||||
'data-large_image' => esc_url($image_full[0]),
|
||||
'data-large_image_width' => esc_attr($image_full[1]),
|
||||
'data-large_image_height' => esc_attr($image_full[2]),
|
||||
'class' => 'skip-lazy attachment-shop_single size-shop_single',
|
||||
),
|
||||
$post_thumbnail_id,
|
||||
$image_size,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$_i++;
|
||||
?>
|
||||
<div class="item-wrap">
|
||||
<div class="nasa-item-main-image-wrap" data-key="<?php echo (int) $_i; ?>">
|
||||
<div class="easyzoom">
|
||||
<?php
|
||||
echo sprintf(
|
||||
'<a href="%s" class="woocommerce-additional-image product-image" title="%s">%s</a>',
|
||||
$image_link,
|
||||
$image_title,
|
||||
$image
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
<?php if ($video_url) : ?>
|
||||
<div class="item-wrap">
|
||||
<div class="nasa-item-main-video-wrap nasa-item-main-image-wrap" data-key="<?php echo (int) $_i+1; ?>">
|
||||
<?php $video_poster_url = $video_poster_url ? $video_poster_url : wc_placeholder_img_src();?>
|
||||
<?php echo do_shortcode('[video src="' . esc_url($video_url) . '" preload="auto" poster="'.$video_poster_url.'"]'); ?>
|
||||
<img class="ns-video-size" src="<?php echo esc_url($video_poster_url); ?>" alt="<?php echo esc_attr($video_title); ?>" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="product-image-btn">
|
||||
<?php do_action('nasa_single_buttons'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($show_thumbnail && $slideHoz) : ?>
|
||||
<div class="nasa-thumb-wrap nasa-thumbnail-hoz">
|
||||
<?php do_action('woocommerce_product_thumbnails'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Thumbnails
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.5.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $product;
|
||||
|
||||
$product_id = $product->get_id();
|
||||
$attachment_ids = $product->get_gallery_image_ids();
|
||||
|
||||
$attach_video_id = elessi_get_product_meta_value($product_id, '_product_video_upload');
|
||||
$video_url = $attach_video_id ? wp_get_attachment_url($attach_video_id) : false;
|
||||
$attach_video_poster_id = elessi_get_product_meta_value($product_id, '_product_video_poster_upload');
|
||||
$video_load = '';
|
||||
|
||||
?>
|
||||
<div class="nasa-thumbnail-default-wrap">
|
||||
<div class="product-thumbnails images-popups-gallery nasa-single-product-thumbnails nasa-thumbnail-default">
|
||||
<?php
|
||||
if ($product->get_image_id()) :
|
||||
$thumbId = get_post_thumbnail_id();
|
||||
$image_title = esc_attr(get_the_title($thumbId));
|
||||
$image_thumb = wp_get_attachment_image_src($thumbId, 'thumbnail');
|
||||
$thumb_src = isset($image_thumb['0']) ? $image_thumb['0'] : wc_placeholder_img_src();
|
||||
$image = get_the_post_thumbnail($product_id, apply_filters('single_product_small_thumbnail_size', 'thumbnail'), array('alt' => $image_title, 'class' => 'skip-lazy attachment-thumbnail size-thumbnail'));
|
||||
$video_load = $thumb_src;
|
||||
|
||||
echo sprintf('<div class="nasa-wrap-item-thumb nasa-active" data-key="0" data-thumb_org="%s"><a href="javascript:void(0);" title="%s" class="active-thumbnail" rel="nofollow">%s</a></div>', $thumb_src, $image_title, $image);
|
||||
else :
|
||||
$noimage = wc_placeholder_img_src();
|
||||
|
||||
$video_load = $noimage;
|
||||
|
||||
echo sprintf('<div class="nasa-wrap-item-thumb nasa-active" data-key="0" data-thumb_org="%s"><a href="javascript:void(0);" class="active-thumbnail" rel="nofollow"><img src="%s" /></a></div>', $noimage, $noimage);
|
||||
endif;
|
||||
|
||||
$loop = 0;
|
||||
if (!empty($attachment_ids)) :
|
||||
foreach ($attachment_ids as $attachment_id) :
|
||||
$image = wp_get_attachment_image($attachment_id, apply_filters('single_product_small_thumbnail_size', 'thumbnail'), false, array('alt' => $image_title, 'class' => 'skip-lazy attachment-thumbnail size-thumbnail'));
|
||||
|
||||
if (!$image) :
|
||||
continue;
|
||||
endif;
|
||||
|
||||
$key = $loop + 1;
|
||||
|
||||
echo '<div class="nasa-wrap-item-thumb" data-key="' . (int) $key . '">';
|
||||
echo apply_filters('single_product_small_thumbnail_size_html', sprintf('%s', $image), $attachment_id);
|
||||
echo '</div>';
|
||||
|
||||
$loop++;
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ($video_url) :
|
||||
$key_video = $loop + 1;
|
||||
|
||||
$video_poster_url = $attach_video_poster_id ? wp_get_attachment_url($attach_video_poster_id) : $video_load;
|
||||
|
||||
echo '<div class="nasa-wrap-item-thumb ns-video-poster" datwer="' . wp_get_attachment_url($attach_video_poster_id) . '" data-key="' . ((int) $key_video) . '"><img class="skip-lazy attachment-thumbnail size-thumbnail ns-video-load" src="' . esc_url($video_poster_url) . '" alt="' . esc_attr('Video Thumbnail', 'elessi-theme') . '" /><svg fill="currentColor" viewBox="-2.4 -2.4 64.80 64.80" stroke="currentColor" stroke-width="3"><path d="M45.563,29.174l-22-15c-0.307-0.208-0.703-0.231-1.031-0.058C22.205,14.289,22,14.629,22,15v30 c0,0.371,0.205,0.711,0.533,0.884C22.679,45.962,22.84,46,23,46c0.197,0,0.394-0.059,0.563-0.174l22-15 C45.836,30.64,46,30.331,46,30S45.836,29.36,45.563,29.174z M24,43.107V16.893L43.225,30L24,43.107z"/><path d="M30,0C13.458,0,0,13.458,0,30s13.458,30,30,30s30-13.458,30-30S46.542,0,30,0z M30,58C14.561,58,2,45.439,2,30 S14.561,2,30,2s28,12.561,28,28S45.439,58,30,58z" /></svg></div>';
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product - Related Products
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
if ($related_products) :
|
||||
global $nasa_opt;
|
||||
|
||||
$_delay = 0;
|
||||
$_delay_item = (isset($nasa_opt['delay_overlay']) && (int) $nasa_opt['delay_overlay']) ? (int) $nasa_opt['delay_overlay'] : 100;
|
||||
|
||||
$layout_buttons_class = '';
|
||||
|
||||
if (isset($nasa_opt['loop_layout_buttons']) && $nasa_opt['loop_layout_buttons'] != '') :
|
||||
$layout_buttons_class = ' nasa-' . $nasa_opt['loop_layout_buttons'];
|
||||
endif;
|
||||
|
||||
$columns_desk = !isset($nasa_opt['relate_columns_desk']) || !(int) $nasa_opt['relate_columns_desk'] ? 5 : (int) $nasa_opt['relate_columns_desk'];
|
||||
$columns_tablet = !isset($nasa_opt['relate_columns_tablet']) || !(int) $nasa_opt['relate_columns_tablet'] ? 3 : (int) $nasa_opt['relate_columns_tablet'];
|
||||
$columns_small = isset($nasa_opt['relate_columns_small']) ? $nasa_opt['relate_columns_small'] : 2;
|
||||
$columns_small_slide = $columns_small == '1.5-cols' ? 1 : (int) $columns_small;
|
||||
|
||||
if (!$columns_small) :
|
||||
$columns_small_slide = 2;
|
||||
endif;
|
||||
|
||||
$ex_class = 'row related-product nasa-slider-wrap related products grid nasa-relative mobile-margin-bottom-20';
|
||||
$head_class = 'nasa-title-relate';
|
||||
if (isset($nasa_opt['product_detail_layout']) && $nasa_opt['product_detail_layout'] == 'new-3') :
|
||||
$layout_buttons_class .= ' nasa-nav-top';
|
||||
$ex_class .= ' title-align-left';
|
||||
$head_class .= ' padding-left-0 padding-right-0';
|
||||
else :
|
||||
$layout_buttons_class .= ' nasa-nav-radius';
|
||||
$ex_class .= ' margin-bottom-30';
|
||||
$head_class .= ' text-center';
|
||||
endif;
|
||||
|
||||
$data_attrs = array(
|
||||
'data-columns="' . esc_attr($columns_desk) . '"',
|
||||
'data-columns-small="' . esc_attr($columns_small_slide) . '"',
|
||||
'data-columns-tablet="' . esc_attr($columns_tablet) . '"',
|
||||
'data-switch-tablet="' . elessi_switch_tablet() . '"',
|
||||
'data-switch-desktop="' . elessi_switch_desktop() . '"',
|
||||
);
|
||||
|
||||
if ($columns_small == '1.5-cols') :
|
||||
$data_attrs[] = 'data-padding-small="20%"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['relate_slide_auto']) && $nasa_opt['relate_slide_auto']) :
|
||||
$data_attrs[] = 'data-autoplay="true"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['relate_slide_loop']) && $nasa_opt['relate_slide_loop']) :
|
||||
$data_attrs[] = 'data-loop="true"';
|
||||
endif;
|
||||
|
||||
$arr_attrs = apply_filters('nasa_attrs_relate_wrap', $data_attrs);
|
||||
|
||||
$attrs_str = !empty($arr_attrs) ? ' ' . implode(' ', $arr_attrs) : '';
|
||||
|
||||
$class_slider = 'ns-items-gap nasa-slick-slider nasa-slick-nav products grid' . $layout_buttons_class;
|
||||
$heading = apply_filters('woocommerce_product_related_products_heading', __('Related Products', 'elessi-theme'));
|
||||
?>
|
||||
<div class="<?php echo esc_attr($ex_class); ?>">
|
||||
<?php if ($heading) : ?>
|
||||
<div class="large-12 columns">
|
||||
<h3 class="<?php echo esc_attr($head_class); ?>">
|
||||
<?php echo esc_html($heading); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="large-12 columns">
|
||||
<div class="<?php echo esc_attr($class_slider); ?>"<?php echo $attrs_str; ?>>
|
||||
<?php
|
||||
foreach ($related_products as $related_product) :
|
||||
$post_object = get_post($related_product->get_id());
|
||||
setup_postdata($GLOBALS['post'] = $post_object);
|
||||
|
||||
// Product Item
|
||||
wc_get_template('content-product.php', array(
|
||||
'_delay' => $_delay,
|
||||
'wrapper' => 'div'
|
||||
));
|
||||
// End Product Item
|
||||
|
||||
$_delay += $_delay_item;
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Sale Flash
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 1.6.4
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
global $nasa_opt, $post, $product;
|
||||
|
||||
if (!$product) :
|
||||
return;
|
||||
endif;
|
||||
|
||||
$badges = '';
|
||||
|
||||
/**
|
||||
* Featured
|
||||
*/
|
||||
if (isset($nasa_opt['featured_badge']) && $nasa_opt['featured_badge'] && $product->is_featured()):
|
||||
$badges .= '<span class="badge featured-label">' . esc_html__('Featured', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* New
|
||||
*/
|
||||
if (isset($nasa_opt['at_badge_new']) && $nasa_opt['at_badge_new']) :
|
||||
$product_id = $product->get_type() == 'variation' ? $product->get_parent_id() : $product->get_id();
|
||||
|
||||
$published_on = get_the_date('d-m-Y', $product_id);
|
||||
$current_date = strtotime(date('Y-m-d'));
|
||||
$target_date = strtotime($published_on);
|
||||
$diff_days = abs(floor(($target_date - $current_date) / (60 * 60 * 24)));
|
||||
|
||||
$max_time = isset($nasa_opt['max_ns_time_at_badge_new']) && (int) $nasa_opt['max_ns_time_at_badge_new'] ? (int) $nasa_opt['max_ns_time_at_badge_new'] : 10;
|
||||
|
||||
$badges .= $diff_days <= $max_time ? '<span class="badge new-label">' . esc_html__('New', 'elessi-theme') . '</span>' : '';
|
||||
|
||||
endif;
|
||||
|
||||
/**
|
||||
* On Sale Badge
|
||||
*/
|
||||
if ($product->is_on_sale()) :
|
||||
$badges_sale = '';
|
||||
|
||||
if ($product->get_type() == 'variable') :
|
||||
$badges_sale = '<span class="badge sale-label sale-variable">' . esc_html__('Sale', 'elessi-theme') . '</span>';
|
||||
else :
|
||||
$maximumper = 0;
|
||||
$regular_price = $product->get_regular_price();
|
||||
$sale_price = $product->get_sale_price();
|
||||
|
||||
if (is_numeric($sale_price)) :
|
||||
$percentage = $regular_price ? round(((($regular_price - $sale_price) / $regular_price) * 100), 0) : 0;
|
||||
|
||||
if ($percentage > $maximumper) :
|
||||
$maximumper = $percentage;
|
||||
endif;
|
||||
|
||||
$badges_sale = '<span class="badge sale-label">' . sprintf(esc_html__('-%s%', 'elessi-theme'), $maximumper) . '</span>';
|
||||
endif;
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Hook onsale WooCommerce
|
||||
*/
|
||||
$badges .= apply_filters('woocommerce_sale_flash', $badges_sale, $post, $product);
|
||||
|
||||
/**
|
||||
* Style show with Deal product
|
||||
*/
|
||||
$badges .= '<span class="badge deal-label">' . esc_html__('Limited', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Out of stock
|
||||
*/
|
||||
if ("outofstock" === $product->get_stock_status()):
|
||||
$badges .= elessi_badge_outofstock();
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Backorders - Allowed
|
||||
*/
|
||||
if (isset($nasa_opt['backorder_badge']) && $nasa_opt['backorder_badge'] && $product->backorders_allowed()) :
|
||||
$badges .= '<span class="badge backorders-label">' . esc_html__('Backorders', 'elessi-theme') . '</span>';
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Hook to Badges
|
||||
*/
|
||||
$badges_content = apply_filters('nasa_badges', $badges);
|
||||
|
||||
if ('' !== $badges_content) :
|
||||
echo '<div class="nasa-badges-wrap">' . $badges_content . '</div>';
|
||||
endif;
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Additional Information tab
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 3.0.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
|
||||
global $product;
|
||||
do_action('woocommerce_product_additional_information', $product);
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product tabs / and sections
|
||||
*
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit; // Exit if accessed directly
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Filter tabs and allow third parties to add their own
|
||||
*
|
||||
* Each tab is an array containing title, callback and priority.
|
||||
* @see woocommerce_default_product_tabs()
|
||||
*/
|
||||
$tabs = apply_filters('woocommerce_product_tabs', array());
|
||||
|
||||
if (!empty($tabs)) :
|
||||
global $nasa_opt, $product;
|
||||
|
||||
$tab_style = apply_filters('nasa_single_product_tabs_style', '2d-no-border');
|
||||
$off_canvas_mobile = $tab_style != 'scroll-down' && isset($nasa_opt['woo_tabs_off_canvas']) && $nasa_opt['woo_tabs_off_canvas'] ? true : false;
|
||||
|
||||
$class_wrap = 'nasa-tabs-content woocommerce-tabs wc-tabs-wrapper';
|
||||
$class_ul = 'nasa-tabs';
|
||||
|
||||
switch ($tab_style) :
|
||||
case 'accordion':
|
||||
case 'accordion-2':
|
||||
$class_wrap = 'nasa-accordions-content fullwidth woocommerce-tabs nasa-no-global';
|
||||
$class_wrap .= $tab_style == 'accordion-2' ? ' nasa-arrow' : '';
|
||||
|
||||
break;
|
||||
|
||||
case 'small-accordion':
|
||||
$class_wrap = 'nasa-accordions-content nasa-no-border nasa-arrow woocommerce-tabs';
|
||||
break;
|
||||
|
||||
case '2d':
|
||||
$class_ul .= ' nasa-classic-style nasa-classic-2d';
|
||||
break;
|
||||
|
||||
case '2d-radius':
|
||||
$class_ul .= ' nasa-classic-style nasa-classic-2d nasa-tabs-no-border nasa-tabs-radius';
|
||||
break;
|
||||
|
||||
case '2d-radius-dashed':
|
||||
$class_ul .= ' nasa-classic-style nasa-classic-2d nasa-tabs-radius-dashed';
|
||||
break;
|
||||
|
||||
case '3d':
|
||||
$class_ul .= ' nasa-classic-style';
|
||||
break;
|
||||
|
||||
case 'slide':
|
||||
$class_ul .= ' nasa-slide-style';
|
||||
break;
|
||||
|
||||
case 'scroll-down':
|
||||
$class_wrap .= ' nasa-scroll-content';
|
||||
break;
|
||||
|
||||
case 'ver-1':
|
||||
$class_wrap .= ' nasa-vertical-style';
|
||||
break;
|
||||
|
||||
case 'ver-2':
|
||||
$class_wrap .= ' nasa-vertical-notabs';
|
||||
break;
|
||||
|
||||
case '2d-no-border':
|
||||
default:
|
||||
$class_ul .= ' nasa-classic-style nasa-classic-2d nasa-tabs-no-border';
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
$class_wrap .= $off_canvas_mobile ? ' mobile-tabs-off-canvas nasa-transition-800' : '';
|
||||
|
||||
?>
|
||||
<div class="product-details" id="nasa-single-product-tabs">
|
||||
<?php
|
||||
echo $off_canvas_mobile ? '<a href="javascript:void(0);" class="nasa-toggle-woo-tabs hidden-tag" rel="nofollow">' . esc_html__('View Product Information', 'elessi-theme') . '</a>' : '';
|
||||
|
||||
if (!isset($nasa_opt['ns_rm_sl']) || $nasa_opt['ns_rm_sl']) :
|
||||
echo '<script type="text/tempalte" id="tmp-read-more-tab">' .
|
||||
'<div class="ns-read-more">' .
|
||||
'<a href="javascript:void(0);" data-show-less="' . esc_attr__("Show less", "elessi-theme") . '" data-show-more="' . esc_attr__("Read more", "elessi-theme") . '" class="ns-btn-read-more primary-color" rel="nofollow">' .
|
||||
'<span class="ns-btn-read-more-text"> ' . esc_html__("Read more", "elessi-theme") . ' </span>'.
|
||||
'<svg width="30" height="30" viewBox="0 0 32 32" fill="currentColor"><path d="M15.233 19.175l0.754 0.754 6.035-6.035-0.754-0.754-5.281 5.281-5.256-5.256-0.754 0.754 3.013 3.013z" /></svg>' .
|
||||
'</a>' .
|
||||
'</div>' .
|
||||
'</script>';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($class_wrap); ?>">
|
||||
<?php
|
||||
echo $off_canvas_mobile ? '<a href="javascript:void(0);" class="nasa-toggle-woo-tabs nasa-stclose hidden-tag" rel="nofollow"></a>' : '';
|
||||
|
||||
switch ($tab_style) :
|
||||
/**
|
||||
* Accordion layout style
|
||||
*/
|
||||
case 'accordion':
|
||||
case 'accordion-2':
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_accordion_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_accordion_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
/**
|
||||
* Accordion layout style
|
||||
*/
|
||||
case 'small-accordion':
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_accordion_small_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_accordion_small_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
/**
|
||||
* Scroll Down layout style
|
||||
*/
|
||||
case 'scroll-down':
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_scroll_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_scroll_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
/**
|
||||
* Vertical layout style #1
|
||||
*/
|
||||
case 'ver-1':
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_ver-1_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_ver-1_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
/**
|
||||
* Vertical layout style #2
|
||||
*/
|
||||
case 'ver-2':
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_ver-2_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_ver-2_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
/**
|
||||
* Tabs layout style
|
||||
*/
|
||||
default :
|
||||
$file = ELESSI_CHILD_PATH . '/includes/nasa-single-product-tabs_tab_layout.php';
|
||||
if(!is_file($file)) :
|
||||
$file = ELESSI_THEME_PATH . '/includes/nasa-single-product-tabs_tab_layout.php';
|
||||
endif;
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
/**
|
||||
* Content WooCommerce Tabs
|
||||
*/
|
||||
include $file;
|
||||
|
||||
/**
|
||||
* Since WooCommerce v9.6.0
|
||||
*/
|
||||
do_action('woocommerce_product_after_tabs');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* Single Product Up-Sells
|
||||
*
|
||||
* This template can be overridden by copying it to elessi-theme/woocommerce/single-product/up-sells.php.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author NasaTheme
|
||||
* @package Elessi-theme/WooCommerce
|
||||
* @version 9.6.0
|
||||
*/
|
||||
if (!defined('ABSPATH')) :
|
||||
exit;
|
||||
endif;
|
||||
|
||||
if ($upsells) :
|
||||
global $nasa_opt;
|
||||
|
||||
$_delay = 0;
|
||||
$_delay_item = (isset($nasa_opt['delay_overlay']) && (int) $nasa_opt['delay_overlay']) ? (int) $nasa_opt['delay_overlay'] : 100;
|
||||
|
||||
$layout_buttons_class = '';
|
||||
|
||||
if (isset($nasa_opt['loop_layout_buttons']) && $nasa_opt['loop_layout_buttons'] != '') :
|
||||
$layout_buttons_class = ' nasa-' . $nasa_opt['loop_layout_buttons'];
|
||||
endif;
|
||||
|
||||
$columns_desk = !isset($nasa_opt['relate_columns_desk']) || !(int) $nasa_opt['relate_columns_desk'] ? 5 : (int) $nasa_opt['relate_columns_desk'];
|
||||
$columns_tablet = !isset($nasa_opt['relate_columns_tablet']) || !(int) $nasa_opt['relate_columns_tablet'] ? 3 : (int) $nasa_opt['relate_columns_tablet'];
|
||||
$columns_small = isset($nasa_opt['relate_columns_small']) ? $nasa_opt['relate_columns_small'] : 2;
|
||||
$columns_small_slide = $columns_small == '1.5-cols' ? 1 : (int) $columns_small;
|
||||
|
||||
if (!$columns_small) :
|
||||
$columns_small_slide = 2;
|
||||
endif;
|
||||
|
||||
$ex_class = 'row related-product nasa-slider-wrap related up-sell products grid nasa-relative mobile-margin-bottom-20';
|
||||
$head_class = 'nasa-title-relate';
|
||||
if (isset($nasa_opt['product_detail_layout']) && $nasa_opt['product_detail_layout'] == 'new-3') :
|
||||
$layout_buttons_class .= ' nasa-nav-top';
|
||||
$ex_class .= ' title-align-left margin-bottom-20';
|
||||
$head_class .= ' padding-left-0 padding-right-0';
|
||||
else :
|
||||
$layout_buttons_class .= ' nasa-nav-radius';
|
||||
$ex_class .= ' margin-bottom-30';
|
||||
$head_class .= ' text-center';
|
||||
endif;
|
||||
|
||||
$data_attrs = array(
|
||||
'data-columns="' . esc_attr($columns_desk) . '"',
|
||||
'data-columns-small="' . esc_attr($columns_small_slide) . '"',
|
||||
'data-columns-tablet="' . esc_attr($columns_tablet) . '"',
|
||||
'data-switch-tablet="' . elessi_switch_tablet() . '"',
|
||||
'data-switch-desktop="' . elessi_switch_desktop() . '"',
|
||||
);
|
||||
|
||||
if ($columns_small == '1.5-cols') :
|
||||
$data_attrs[] = 'data-padding-small="20%"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['relate_slide_auto']) && $nasa_opt['relate_slide_auto']) :
|
||||
$data_attrs[] = 'data-autoplay="true"';
|
||||
endif;
|
||||
|
||||
if (isset($nasa_opt['relate_slide_loop']) && $nasa_opt['relate_slide_loop']) :
|
||||
$data_attrs[] = 'data-loop="true"';
|
||||
endif;
|
||||
|
||||
$arr_attrs = apply_filters('nasa_attrs_relate_wrap', $data_attrs);
|
||||
|
||||
$attrs_str = !empty($arr_attrs) ? ' ' . implode(' ', $arr_attrs) : '';
|
||||
|
||||
$class_slider = 'ns-items-gap nasa-slick-slider nasa-slick-nav products grid' . $layout_buttons_class;
|
||||
|
||||
$heading = apply_filters('woocommerce_product_upsells_products_heading', __('You may also like…', 'elessi-theme'));
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr($ex_class); ?>">
|
||||
<?php if ($heading) : ?>
|
||||
<div class="large-12 columns">
|
||||
<h3 class="<?php echo esc_attr($head_class); ?>">
|
||||
<?php echo esc_html($heading); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="large-12 columns">
|
||||
<div class="<?php echo esc_attr($class_slider); ?>"<?php echo $attrs_str; ?>>
|
||||
<?php
|
||||
foreach ($upsells as $upsell):
|
||||
$post_object = get_post($upsell->get_id());
|
||||
setup_postdata($GLOBALS['post'] = & $post_object);
|
||||
|
||||
// Product Item
|
||||
wc_get_template('content-product.php', array(
|
||||
'_delay' => $_delay,
|
||||
'wrapper' => 'div'
|
||||
));
|
||||
// End Product Item
|
||||
|
||||
$_delay += $_delay_item;
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
Reference in New Issue
Block a user