This commit is contained in:
nguyen dung
2022-02-18 16:43:41 +07:00
commit 39b8cb3612
4470 changed files with 1378320 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<?php $icon_style = flatsome_option('account_icon_style'); ?>
<li class="account-item has-icon">
<?php if($icon_style && $icon_style !== 'image' && $icon_style !== 'plain') echo '<div class="header-button">'; ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"
class="account-link-mobile <?php echo get_flatsome_icon_class($icon_style, 'small');?>" title="<?php _e('My account', 'woocommerce'); ?>">
<?php echo get_flatsome_icon('icon-user'); ?>
</a>
<?php if($icon_style && $icon_style !== 'image' && $icon_style !== 'plain') echo '</div>'; ?>
</li>

View File

@@ -0,0 +1,41 @@
<?php if(is_woocommerce_activated()){ ?>
<li class="account-item has-icon menu-item">
<?php if ( is_user_logged_in() ) { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" class="account-link account-login" title="<?php _e('My account', 'woocommerce'); ?>">
<?php if(flatsome_option('account_icon') == 'icon'){
echo get_flatsome_icon('icon-user');
} else if(flatsome_option('account_icon') == 'avatar'){
echo '<i class="image-icon circle">'.get_avatar(get_current_user_id()).'</i>';
}
?>
<span class="header-account-title">
<?php _e('My account', 'woocommerce'); ?>
</span>
</a>
<?php } else { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"
class="nav-top-link nav-top-not-logged-in">
<?php
if(flatsome_option('account_icon') == 'icon' || flatsome_option('account_icon') == 'avatar'){ echo get_flatsome_icon('icon-user');
}
?>
<span class="header-account-title">
<?php _e('Login', 'woocommerce'); ?>
</span>
</a>
<?php } ?>
<?php
// Show Dropdown for logged in users
if ( is_user_logged_in() ) { ?>
<ul class="children">
<?php wc_get_template('myaccount/account-links.php'); ?>
</ul>
<?php } ?>
</li>
<?php } else {
echo 'WooCommerce not Found';
}
?>

View File

@@ -0,0 +1,68 @@
<?php $icon_style = get_theme_mod('account_icon_style'); ?>
<?php if(is_woocommerce_activated()){ ?>
<li class="account-item has-icon
<?php if(is_account_page()) echo ' active'; ?>
<?php if ( is_user_logged_in() ) { ?> has-dropdown<?php } ?>"
>
<?php if($icon_style && $icon_style !== 'image' && $icon_style !== 'plain') echo '<div class="header-button">'; ?>
<?php if ( is_user_logged_in() ) { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" class="account-link account-login
<?php if($icon_style && $icon_style !== 'image') echo get_flatsome_icon_class($icon_style, 'small'); ?>"
title="<?php _e('My account', 'woocommerce'); ?>">
<?php if ( get_theme_mod( 'header_account_title', 1 ) ) { ?>
<span class="header-account-title">
<?php
if ( get_theme_mod( 'header_account_username' ) ) {
$current_user = wp_get_current_user();
echo apply_filters( 'flatsome_header_account_username', esc_html( $current_user->display_name ) );
} else {
esc_html_e( 'My account', 'woocommerce' );
}
?>
</span>
<?php } ?>
<?php if($icon_style == 'image'){
echo '<i class="image-icon circle">'.get_avatar(get_current_user_id()).'</i>';
} else if($icon_style){
echo get_flatsome_icon('icon-user');
} ?>
</a>
<?php } else { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"
class="nav-top-link nav-top-not-logged-in <?php if($icon_style && $icon_style !== 'image') echo get_flatsome_icon_class($icon_style, 'small'); ?>"
<?php if( get_theme_mod('account_login_style','lightbox') == 'lightbox' && !is_checkout() && !is_account_page() ) echo 'data-open="#login-form-popup"'; ?>
>
<?php if(get_theme_mod('header_account_title', 1)) { ?>
<span>
<?php _e('Login', 'woocommerce'); ?>
<?php if(get_theme_mod('header_account_register')){
echo ' / '.__('Register', 'woocommerce');
} ?>
</span>
<?php } else {
echo get_flatsome_icon('icon-user');
} ?>
</a>
<?php } ?>
<?php if($icon_style && $icon_style !== 'image' && $icon_style !== 'plain') echo '</div>'; ?>
<?php
// Show Dropdown for logged in users
if ( is_user_logged_in() ) { ?>
<ul class="nav-dropdown <?php flatsome_dropdown_classes(); ?>">
<?php wc_get_template('myaccount/account-links.php'); ?>
</ul>
<?php } ?>
</li>
<?php } else {
fl_header_element_error( 'woocommerce' );
}
?>

View File

@@ -0,0 +1,9 @@
<li class="html header-button-1">
<div class="header-button">
<?php
echo do_shortcode('[button text="'.flatsome_option('header_button_1').'" link="'.flatsome_option('header_button_1_link').'" target="'.flatsome_option('header_button_1_link_target').'" rel="'.get_theme_mod('header_button_1_link_rel').'" radius="'.flatsome_option('header_button_1_radius').'" size="'.flatsome_option('header_button_1_size').'" color="'.flatsome_option('header_button_1_color').'" depth="'.flatsome_option('header_button_1_depth').'" depth_hover="'.flatsome_option('header_button_1_depth_hover').'" style="'.flatsome_option('header_button_1_style').'"]');
?>
</div>
</li>

View File

@@ -0,0 +1,7 @@
<li class="html header-button-2">
<div class="header-button">
<?php
echo do_shortcode('[button text="'.flatsome_option('header_button_2').'" link="'.flatsome_option('header_button_2_link').'" target="'.flatsome_option('header_button_2_link_target').'" rel="'.get_theme_mod('header_button_2_link_rel').'" radius="'.flatsome_option('header_button_2_radius').'" size="'.flatsome_option('header_button_2_size').'" color="'.flatsome_option('header_button_2_color').'" depth="'.flatsome_option('header_button_2_depth').'" depth_hover="'.flatsome_option('header_button_2_depth_hover').'" style="'.flatsome_option('header_button_2_style').'"]');
?>
</div>
</li>

View File

@@ -0,0 +1,64 @@
<?php if ( is_woocommerce_activated() && flatsome_is_wc_cart_available() ) { ?>
<?php
// Get Cart replacement for catalog_mode
if(flatsome_option('catalog_mode')) { get_template_part('template-parts/header/partials/element','cart-replace'); return;}
$cart_style = flatsome_option('header_cart_style');
$custom_cart_content = flatsome_option('html_cart_header');
$icon_style = flatsome_option('cart_icon_style');
$icon = flatsome_option('cart_icon');
$disable_mini_cart = apply_filters( 'flatsome_disable_mini_cart', is_cart() || is_checkout() );
if ( $disable_mini_cart ) {
$cart_style = 'link';
}
?>
<li class="cart-item has-icon">
<?php if($icon_style && $icon_style !== 'plain') { ?><div class="header-button"><?php } ?>
<?php if ( $cart_style === 'link' ) : ?>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php _e('Cart', 'woocommerce'); ?>" class="header-cart-link <?php echo get_flatsome_icon_class($icon_style, 'small'); ?>">
<?php else : ?>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="header-cart-link off-canvas-toggle nav-top-link <?php echo get_flatsome_icon_class($icon_style, 'small'); ?>" data-open="#cart-popup" data-class="off-canvas-cart" title="<?php _e('Cart', 'woocommerce'); ?>" data-pos="right">
<?php endif; ?>
<?php
if(flatsome_option('custom_cart_icon')) { ?>
<span class="image-icon header-cart-icon" data-icon-label="<?php echo WC()->cart->cart_contents_count; ?>">
<img class="cart-img-icon" alt="<?php _e('Cart', 'woocommerce'); ?>" src="<?php echo do_shortcode(flatsome_option('custom_cart_icon')); ?>"/>
</span>
<?php }
else { ?>
<?php if(!$icon_style) { ?>
<span class="cart-icon image-icon">
<strong><?php echo WC()->cart->cart_contents_count; ?></strong>
</span>
<?php } else { ?>
<i class="icon-shopping-<?php echo $icon;?>"
data-icon-label="<?php echo WC()->cart->cart_contents_count; ?>">
</i>
<?php } ?>
<?php } ?>
</a>
<?php if($icon_style && $icon_style !== 'plain') { ?></div><?php } ?>
<?php if ( $cart_style !== 'off-canvas' && $cart_style !== 'link' ) { ?>
<!-- Cart Sidebar Popup -->
<div id="cart-popup" class="mfp-hide widget_shopping_cart">
<div class="cart-popup-inner inner-padding">
<div class="cart-popup-title text-center">
<h4 class="uppercase"><?php _e('Cart', 'woocommerce'); ?></h4>
<div class="is-divider"></div>
</div>
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart(); ?>
</div>
<?php if($custom_cart_content) {
echo '<div class="header-cart-content">'.do_shortcode($custom_cart_content).'</div>'; }
?>
<?php do_action('flatsome_cart_sidebar'); ?>
</div>
</div>
<?php } ?>
</li>
<?php } ?>

View File

@@ -0,0 +1 @@
<?php if(flatsome_option('catalog_mode_header')) echo '<li class="html cart-replace">'.do_shortcode(flatsome_option('catalog_mode_header')).'</li>'; ?>

View File

@@ -0,0 +1,52 @@
<?php if ( is_woocommerce_activated() && flatsome_is_wc_cart_available() ) { ?>
<?php
// Get Cart replacement for `catalog_mode`.
if ( get_theme_mod( 'catalog_mode' ) ) {
get_template_part( 'template-parts/header/partials/element', 'cart-replace' );
return;
}
$custom_cart_content = get_theme_mod( 'html_cart_header' );
$icon_style = get_theme_mod( 'cart_icon_style' );
$icon = get_theme_mod( 'cart_icon', 'basket' );
$cart_title = get_theme_mod( 'header_cart_title', 1 );
$cart_total = get_theme_mod( 'header_cart_total', 1 );
?>
<li class="menu-item cart-item has-icon has-child">
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php _e( 'Cart', 'woocommerce' ); ?>" class="header-cart-link">
<?php if ( $cart_total || $cart_title ) { ?>
<span class="header-cart-title">
<?php if ( $cart_title ) { _e( 'Cart', 'woocommerce' ); } ?>
<?php /* divider */ if ( $cart_total && $cart_title ) { ?>/<?php } ?>
<?php if ( $cart_total ) { ?>
<span class="cart-price"><?php echo WC()->cart->get_cart_subtotal(); ?></span>
<?php } ?>
</span>
<?php } ?>
</a>
<ul class="children">
<li>
<!-- Cart Sidebar Popup -->
<div id="cart-popup" class="widget_shopping_cart">
<div class="cart-popup-inner inner-padding">
<div class="cart-popup-title text-center">
<h4 class="uppercase"><?php _e('Cart', 'woocommerce'); ?></h4>
<div class="is-divider"></div>
</div>
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart(); ?>
</div>
<?php if($custom_cart_content) {
echo '<div class="header-cart-content">'.do_shortcode($custom_cart_content).'</div>'; }
?>
<?php do_action('flatsome_cart_sidebar'); ?>
</div>
</div>
</li>
</ul>
</li>
<?php } else {
fl_header_element_error( 'woocommerce' );
}
?>

View File

@@ -0,0 +1,94 @@
<?php if(is_woocommerce_activated() && flatsome_is_wc_cart_available() ) { ?>
<?php
// Get Cart replacement for catalog_mode
if(get_theme_mod('catalog_mode')) { get_template_part('template-parts/header/partials/element','cart-replace'); return;}
$cart_style = get_theme_mod('header_cart_style','dropdown');
$custom_cart_content = get_theme_mod('html_cart_header');
$icon_style = get_theme_mod('cart_icon_style');
$icon = get_theme_mod('cart_icon','basket');
$cart_title = get_theme_mod('header_cart_title', 1);
$cart_total = get_theme_mod('header_cart_total', 1);
$disable_mini_cart = apply_filters( 'flatsome_disable_mini_cart', is_cart() || is_checkout() );
if ( $disable_mini_cart ) {
$cart_style = 'link';
}
?>
<li class="cart-item has-icon<?php if($cart_style == 'dropdown') { ?> has-dropdown<?php } ?>">
<?php if($icon_style && $icon_style !== 'plain') { ?><div class="header-button"><?php } ?>
<?php if($cart_style !== 'off-canvas') { ?>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php _e('Cart', 'woocommerce'); ?>" class="header-cart-link <?php echo get_flatsome_icon_class($icon_style, 'small'); ?>">
<?php } else if($cart_style == 'off-canvas') { ?>
<a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="header-cart-link off-canvas-toggle nav-top-link <?php echo get_flatsome_icon_class($icon_style, 'small'); ?>" data-open="#cart-popup" data-class="off-canvas-cart" title="<?php _e('Cart', 'woocommerce'); ?>" data-pos="right">
<?php } ?>
<?php if($cart_total || $cart_title) { ?>
<span class="header-cart-title">
<?php if($cart_title) { ?> <?php _e('Cart', 'woocommerce'); ?> <?php } ?>
<?php /* divider */ if($cart_total && $cart_title) { ?>/<?php } ?>
<?php if($cart_total) { ?>
<span class="cart-price"><?php echo WC()->cart->get_cart_subtotal(); ?></span>
<?php } ?>
</span>
<?php } ?>
<?php
if(get_theme_mod('custom_cart_icon')) { ?>
<span class="image-icon header-cart-icon" data-icon-label="<?php echo WC()->cart->cart_contents_count; ?>">
<img class="cart-img-icon" alt="<?php _e('Cart', 'woocommerce'); ?>" src="<?php echo do_shortcode(get_theme_mod('custom_cart_icon')); ?>"/>
</span>
<?php }
else { ?>
<?php if(!$icon_style) { ?>
<span class="cart-icon image-icon">
<strong><?php echo WC()->cart->cart_contents_count; ?></strong>
</span>
<?php } else { ?>
<i class="icon-shopping-<?php echo $icon;?>"
data-icon-label="<?php echo WC()->cart->cart_contents_count; ?>">
</i>
<?php } ?>
<?php } ?>
</a>
<?php if($icon_style && $icon_style !== 'plain') { ?></div><?php } ?>
<?php if($cart_style == 'dropdown') { ?>
<ul class="nav-dropdown <?php flatsome_dropdown_classes(); ?>">
<li class="html widget_shopping_cart">
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart(); ?>
</div>
</li>
<?php if($custom_cart_content){
echo '<li class="html">'.do_shortcode($custom_cart_content).'</li>';
}
?>
</ul>
<?php } ?>
<?php if($cart_style == 'off-canvas') { ?>
<!-- Cart Sidebar Popup -->
<div id="cart-popup" class="mfp-hide widget_shopping_cart">
<div class="cart-popup-inner inner-padding">
<div class="cart-popup-title text-center">
<h4 class="uppercase"><?php _e('Cart', 'woocommerce'); ?></h4>
<div class="is-divider"></div>
</div>
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart(); ?>
</div>
<?php if($custom_cart_content) {
echo '<div class="header-cart-content">'.do_shortcode($custom_cart_content).'</div>'; }
?>
<?php do_action('flatsome_cart_sidebar'); ?>
</div>
</div>
<?php } ?>
</li>
<?php } else {
fl_header_element_error( 'woocommerce' );
}
?>

View File

@@ -0,0 +1,14 @@
<?php
if ( ! is_woocommerce_activated() ) {
fl_header_element_error( 'woocommerce' );
return;
}
?>
<li>
<div class="cart-checkout-button header-button">
<a href="<?php echo esc_url( wc_get_checkout_url() ); ?>" class="<?php if ( is_checkout() ) { ?>disabled<?php } ?> button cart-checkout secondary is-small circle">
<span class="hide-for-small"><?php esc_html_e( 'Checkout', 'woocommerce' ); ?></span>
<span class="show-for-small">+</span>
</a>
</div>
</li>

View File

@@ -0,0 +1,61 @@
<li class="header-contact-wrapper">
<?php
$class = 'has-icon';
$icon_size = flatsome_option('contact_icon_size');
$class_link = 'tooltip';
$nav = 'nav-divided nav-uppercase';
$label = true;
if(flatsome_option('contact_style') == 'icons'){
$label = false;
}
if(flatsome_option('contact_style') == 'top'){
$class .= ' icon-top';
}
?>
<div class="header-button"><a href="#"
data-open="#header-contact"
data-visible-after="true" data-class="text-center" data-pos="center"
class="icon show-for-medium"><?php echo get_flatsome_icon('icon-envelop',$icon_size); ?></a>
</div>
<ul id="header-contact" class="nav <?php echo $nav; ?> header-contact hide-for-medium">
<?php if(flatsome_option('contact_location')){ ?>
<li class="<?php echo $class; ?>">
<a target="_blank" rel="noopener noreferrer" href="https://maps.google.com/?q=<?php echo flatsome_option('contact_location'); ?>" title="<?php echo flatsome_option('contact_location'); ?>" class="<?php echo $class_link;?>">
<?php echo get_flatsome_icon('icon-map-pin-fill',$icon_size); ?>
<?php if($label) _e('Location','flatsome'); ?>
</a>
</li>
<?php } ?>
<?php if(flatsome_option('contact_email')){ ?>
<li class="<?php echo $class; ?>">
<a href="mailto:<?php echo flatsome_option('contact_email'); ?>" class="<?php echo $class_link;?>" title="<?php echo flatsome_option('contact_email'); ?>">
<?php echo get_flatsome_icon('icon-envelop',$icon_size); ?>
<?php if($label) _e('Contact','flatsome'); ?>
</a>
</li>
<?php } ?>
<?php if(flatsome_option('contact_hours')){ ?>
<li class="<?php echo $class; ?>">
<a class="<?php echo $class_link;?>" title="<?php echo flatsome_option('contact_hours').' | '.flatsome_option('contact_hours_details'); ?>">
<?php echo get_flatsome_icon('icon-clock',$icon_size); ?>
<?php if($label) echo flatsome_option('contact_hours'); ?>
</a>
</li>
<?php } ?>
<?php if(flatsome_option('contact_phone')){ ?>
<li class="<?php echo $class; ?>">
<a href="tel:<?php echo flatsome_option('contact_phone'); ?>" class="<?php echo $class_link;?>" title="<?php echo flatsome_option('contact_phone'); ?>">
<?php echo get_flatsome_icon('icon-phone',$icon_size); ?>
<?php if($label) echo flatsome_option('contact_phone'); ?>
</a>
</li>
<?php } ?>
</ul>
</li>

View File

@@ -0,0 +1,72 @@
<li class="header-contact-wrapper">
<?php
$class = '';
$icon_size = flatsome_option('contact_icon_size');
$class_link = 'tooltip';
$nav = 'nav-divided nav-uppercase';
$label = true;
if(flatsome_option('contact_style') == 'icons'){
$label = false;
}
?>
<ul id="header-contact" class="nav <?php echo $nav; ?> header-contact">
<?php if(flatsome_option('contact_location')){ ?>
<li class="<?php echo $class; ?>">
<a target="_blank" rel="noopener noreferrer" href="https://maps.google.com/?q=<?php echo flatsome_option('contact_location'); ?>" title="<?php echo flatsome_option('contact_location'); ?>" class="<?php echo $class_link;?>">
<?php echo get_flatsome_icon('icon-map-pin-fill',$icon_size); ?>
<span>
<?php
$location_label = flatsome_option('contact_location_label');
if($location_label && $label){
echo $location_label;
} else if($label){
_e('Location','flatsome');
} ?>
</span>
</a>
</li>
<?php } ?>
<?php
$contact_email = get_theme_mod('contact_email','youremail@gmail.com');
if($contact_email){ ?>
<li class="<?php echo $class; ?>">
<a href="mailto:<?php echo $contact_email; ?>" class="<?php echo $class_link;?>" title="<?php echo $contact_email; ?>">
<?php echo get_flatsome_icon('icon-envelop',$icon_size); ?>
<span>
<?php
$contact_label = get_theme_mod('contact_email_label');
if($contact_label && $label) {
echo $contact_label;
} else if($label){
_e('Contact','flatsome');
} ?>
</span>
</a>
</li>
<?php } ?>
<?php
$contact_hours = get_theme_mod('contact_hours','08:00 - 17:00');
if($contact_hours){
$contact_hours_details = get_theme_mod('contact_hours_details');
?>
<li class="<?php echo $class; ?>">
<a class="<?php echo $class_link;?>" title="<?php echo $contact_hours; ?><?php if($contact_hours_details) echo ' | '.$contact_hours_details; ?> ">
<?php echo get_flatsome_icon('icon-clock',$icon_size); ?>
<span><?php if($label) echo $contact_hours; ?></span>
</a>
</li>
<?php } ?>
<?php if(flatsome_option('contact_phone')){ ?>
<li class="<?php echo $class; ?>">
<a href="tel:<?php echo flatsome_option('contact_phone'); ?>" class="<?php echo $class_link;?>" title="<?php echo flatsome_option('contact_phone'); ?>">
<?php echo get_flatsome_icon('icon-phone',$icon_size); ?>
<span><?php if($label) echo flatsome_option('contact_phone'); ?></span>
</a>
</li>
<?php } ?>
</ul>
</li>

View File

@@ -0,0 +1,31 @@
<li class="menu-item">
<a href="#sitemap" data-color="light" data-open="#departments-overlay" data-pos="dropdown">
Departments
</a>
<div id="departments-overlay" class="mfp-hide container">
<ul class="nav nav-vertical nav-uppercase tabs">
<li class="description_tab active">
<a href="#tab-description">Description</a>
</li>
<li class="additional_information_tab">
<a href="#tab-additional_information">Additional Information</a>
</li>
<li class="reviews_tab">
<a href="#tab-reviews">Reviews (3)</a>
</li>
</ul>
<div class="tab-panels">
<div id="tab-description" class="panel"></div>
<div class="panel"></div>
<div class="panel"></div>
</div>
</div>
</li>

View File

@@ -0,0 +1,53 @@
<?php
/**
* Custom Languages dropdown for sidebar
*/
$current_lang = 'Languages';
$flag = null;
$languages = null;
// Polylang elseif WMPL.
if ( function_exists( 'pll_the_languages' ) ) {
$languages = pll_the_languages( array( 'raw' => 1 ) );
foreach ( $languages as $lang ) {
if ( $lang['current_lang'] ) {
$flag = '<i class="image-icon"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '"/></i>';
$current_lang = $lang['name'];
}
}
} elseif ( function_exists( 'icl_get_languages' ) ) {
$languages = icl_get_languages();
foreach ( $languages as $lang ) {
if ( $lang['active'] ) {
$flag = '<i class="image-icon"><img src="' . $lang['country_flag_url'] . '" alt="' . $lang['native_name'] . '"/></i>';
$current_lang = $lang['native_name'];
}
}
}
?>
<li>
<a href="#">
<?php echo $current_lang; ?>
<?php echo $flag; ?>
</a>
<ul class="children">
<?php
// Polylang elseif WMPL.
if ( $languages && function_exists( 'pll_the_languages' ) ) {
foreach ( $languages as $lang ) {
if ( $lang['current_lang'] ) $current = 'class="active"';
echo '<li><a href="' . $lang['url'] . '" hreflang="' . $lang['slug'] . '"><i class="icon-image"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '"/></i> ' . $lang['name'] . '</a></li>';
}
} elseif ( $languages && function_exists( 'icl_get_languages' ) ) {
foreach ( $languages as $lang ) {
$current = '';
echo '<li><a href="' . $lang['url'] . '" hreflang="' . $lang['language_code'] . '"><i class="icon-image"><img src="' . $lang['country_flag_url'] . '" alt="' . $lang['native_name'] . '"/></i> ' . $lang['native_name'] . '</a></li>';
}
}
if ( ! function_exists( 'pll_the_languages' ) && ! function_exists( 'icl_get_languages' ) ) {
echo '<li><a>You need Polylang or WPML plugin for this to work. You can remove it from Theme Options.</a></li>';
}
?>
</ul>
</li>

View File

@@ -0,0 +1,54 @@
<?php
/**
* Custom Languages dropdown
*/
$current_lang = 'Languages';
$flag = null;
$languages = null;
// Polylang elseif WMPL.
if ( function_exists( 'pll_the_languages' ) ) {
$languages = pll_the_languages( array( 'raw' => 1 ) );
foreach ( $languages as $lang ) {
if ( $lang['current_lang'] ) {
$flag = '<i class="image-icon"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '"/></i>';
$current_lang = $lang['name'];
}
}
} elseif ( function_exists( 'icl_get_languages' ) ) {
$languages = icl_get_languages();
foreach ( $languages as $lang ) {
if ( $lang['active'] ) {
$flag = '<i class="image-icon"><img src="' . $lang['country_flag_url'] . '" alt="' . $lang['native_name'] . '"/></i>';
$current_lang = $lang['native_name'];
}
}
}
?>
<li class="has-dropdown header-language-dropdown">
<a href="#">
<?php echo $current_lang; ?>
<?php echo $flag; ?>
<?php echo get_flatsome_icon( 'icon-angle-down' ); ?>
</a>
<ul class="nav-dropdown <?php flatsome_dropdown_classes(); ?>">
<?php
// Polylang elseif WMPL.
if ( $languages && function_exists( 'pll_the_languages' ) ) {
foreach ( $languages as $lang ) {
if ( $lang['current_lang'] ) $current = 'class="active"';
echo '<li><a href="' . $lang['url'] . '" hreflang="' . $lang['slug'] . '"><i class="icon-image"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '"/></i> ' . $lang['name'] . '</a></li>';
}
} elseif ( $languages && function_exists( 'icl_get_languages' ) ) {
foreach ( $languages as $lang ) {
$current = '';
echo '<li><a href="' . $lang['url'] . '" hreflang="' . $lang['language_code'] . '"><i class="icon-image"><img src="' . $lang['country_flag_url'] . '" alt="' . $lang['native_name'] . '"/></i> ' . $lang['native_name'] . '</a></li>';
}
}
if ( ! function_exists( 'pll_the_languages' ) && ! function_exists( 'icl_get_languages' ) ) {
echo '<li><a>You need Polylang or WPML plugin for this to work. You can remove it from Theme Options.</a></li>';
}
?>
</ul>
</li>

View File

@@ -0,0 +1,48 @@
<?php
$site_logo_id = flatsome_option( 'site_logo' );
$site_logo_sticky_id = flatsome_option( 'site_logo_sticky' );
$site_logo_dark_id = flatsome_option( 'site_logo_dark' );
$site_logo = wp_get_attachment_image_src( $site_logo_id, 'large' );
$site_logo_sticky = wp_get_attachment_image_src( $site_logo_sticky_id, 'large' );
$site_logo_dark = wp_get_attachment_image_src( $site_logo_dark_id, 'large' );
$logo_link = get_theme_mod( 'logo_link' );
$logo_link = $logo_link ? $logo_link : home_url( '/' );
$width = get_theme_mod( 'logo_width', 200 );
$height = get_theme_mod( 'header_height', 90 );
if ( ! empty( $site_logo_id ) && ! is_numeric( $site_logo_id ) ) {
// Fallback to `logo_width` and `header_height` if
// the logo is a string, ie. it's the default value.
$site_logo = array( $site_logo_id, $width, $height );
}
if ( ! empty( $site_logo_sticky_id ) && ! is_numeric( $site_logo_sticky_id ) ) {
$site_logo_sticky = array( $site_logo_sticky_id, $width, $height );
}
if ( ! empty( $site_logo_dark_id ) && ! is_numeric( $site_logo_dark_id ) ) {
$site_logo_dark = array( $site_logo_dark_id, $width, $height );
}
?>
<!-- Header logo -->
<a href="<?php echo esc_url( $logo_link ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?><?php echo get_bloginfo( 'name' ) && get_bloginfo( 'description' ) ? ' - ' : ''; ?><?php bloginfo( 'description' ); ?>" rel="home">
<?php
if ( $site_logo ) {
$site_title = esc_attr( get_bloginfo( 'name', 'display' ) );
if ( $site_logo_sticky ) echo '<img width="' . esc_attr( $site_logo_sticky[1] ) . '" height="' . esc_attr( $site_logo_sticky[2] ) . '" src="' . esc_url( $site_logo_sticky[0] ) . '" class="header-logo-sticky" alt="'.$site_title.'"/>';
echo '<img width="' . esc_attr( $site_logo[1] ) . '" height="' . esc_attr( $site_logo[2] ) . '" src="' . esc_url( $site_logo[0] ) . '" class="header_logo header-logo" alt="'.$site_title.'"/>';
if ( $site_logo_dark ) echo '<img width="' . esc_attr( $site_logo_dark[1] ) . '" height="' . esc_attr( $site_logo_dark[2] ) . '" src="' . esc_url( $site_logo_dark[0] ) . '" class="header-logo-dark" alt="'.$site_title.'"/>';
else echo '<img width="' . esc_attr( $site_logo[1] ) . '" height="' . esc_attr( $site_logo[2] ) . '" src="' . esc_url( $site_logo[0] ) . '" class="header-logo-dark" alt="'.$site_title.'"/>';
} else {
bloginfo( 'name' );
}
?>
</a>
<?php
if(get_theme_mod('site_logo_slogan')){
echo '<p class="logo-tagline">'.get_bloginfo('description').'</p>';
}
?>

View File

@@ -0,0 +1,11 @@
<?php $icon_style = flatsome_option('menu_icon_style'); ?>
<li class="nav-icon has-icon">
<?php if($icon_style) { ?><div class="header-button"><?php } ?>
<a href="#" data-open="#main-menu" data-pos="<?php echo flatsome_option('mobile_overlay');?>" data-bg="main-menu-overlay" data-color="<?php echo flatsome_option('mobile_overlay_color');?>" class="<?php echo get_flatsome_icon_class($icon_style, 'small'); ?>" aria-label="<?php echo __('Menu','flatsome'); ?>" aria-controls="main-menu" aria-expanded="false">
<?php echo get_flatsome_icon('icon-menu'); ?>
<?php if(flatsome_option('menu_icon_title')) echo '<span class="menu-title uppercase hide-for-small">'.__('Menu','flatsome').'</span>'; ?>
</a>
<?php if($icon_style) { ?> </div> <?php } ?>
</li>

View File

@@ -0,0 +1,53 @@
<?php
/**
* Header vertical menu template.
*
* @package Flatsome
*/
$classes_opener = array( 'header-vertical-menu__opener' );
$classes_fly_out = array( 'header-vertical-menu__fly-out' );
if ( get_theme_mod( 'header_nav_vertical_text_color', 'dark' ) === 'dark' ) $classes_opener[] = 'dark';
if ( get_theme_mod( 'header_nav_vertical_fly_out_text_color', 'light' ) === 'dark' ) $classes_fly_out[] = 'dark';
if ( is_front_page() && get_theme_mod( 'header_nav_vertical_fly_out_frontpage', 1 ) ) $classes_fly_out[] = 'header-vertical-menu__fly-out--open';
if ( get_theme_mod( 'header_nav_vertical_fly_out_shadow', 1 ) ) $classes_fly_out[] = 'has-shadow';
?>
<li class="header-vertical-menu" role="navigation">
<div class="<?php echo esc_attr( implode( ' ', $classes_opener ) ); ?>">
<?php if ( get_theme_mod( 'header_nav_vertical_icon_style', 'plain' ) ) : ?>
<span class="header-vertical-menu__icon">
<?php echo get_flatsome_icon( 'icon-menu' ); ?>
</span>
<?php endif; ?>
<span class="header-vertical-menu__title">
<?php if ( get_theme_mod( 'header_nav_vertical_tagline' ) ) : ?>
<span class="header-vertical-menu__tagline"><?php echo esc_html( get_theme_mod( 'header_nav_vertical_tagline' ) ); ?></span>
<?php endif; ?>
<?php
if ( get_theme_mod( 'header_nav_vertical_text' ) ) :
echo esc_html( get_theme_mod( 'header_nav_vertical_text' ) );
else :
esc_html_e( 'Categories', 'flatsome' );
endif;
?>
</span>
<?php echo get_flatsome_icon( 'icon-angle-down' ); ?>
</div>
<div class="<?php echo esc_attr( implode( ' ', $classes_fly_out ) ); ?>">
<?php
// TODO maybe refactor flatsome_header_nav() to render here?
if ( has_nav_menu( 'vertical' ) ) {
wp_nav_menu( array(
'theme_location' => 'vertical',
'menu_class' => 'ux-nav-vertical-menu nav-vertical-fly-out',
'walker' => new FlatsomeNavDropdown(),
) );
} else {
$admin_url = get_admin_url() . 'customize.php?url=' . get_permalink() . '&autofocus%5Bsection%5D=menu_locations';
echo '<li><a href="' . $admin_url . '">Assign a menu in Theme Options > Menus</a></li>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
</li>

View File

@@ -0,0 +1,15 @@
<?php
$label = get_theme_mod('header_newsletter_label','Newsletter');
$title = get_theme_mod('header_newsletter_title','Sign up for Newsletter');
?>
<li class="header-newsletter-item has-icon">
<a href="#header-newsletter-signup" class="tooltip" title="<?php echo $title; ?>">
<i class="icon-envelop"></i>
<span class="header-newsletter-title">
<?php echo $label; ?>
</span>
</a>
</li>

View File

@@ -0,0 +1,46 @@
<?php
$icon_style = get_theme_mod( 'newsletter_icon_style', 'plain' );
$label = get_theme_mod( 'header_newsletter_label', 'Newsletter' );
$title = get_theme_mod( 'header_newsletter_title', 'Sign up for Newsletter' );
$newsletter_block = get_theme_mod( 'header_newsletter_block' );
if ( ! $newsletter_block ) {
$sub_title = get_theme_mod( 'header_newsletter_sub_title', 'Signup for our newsletter to get notified about sales and new products. Add any text here or remove it.' );
$bg = do_shortcode( get_theme_mod( 'header_newsletter_bg', flatsome_dummy_image() ) );
$height = get_theme_mod( 'header_newsletter_height', '500px' );
}
$auto_open = get_theme_mod( 'header_newsletter_auto_open', false );
$auto_timer = get_theme_mod( 'header_newsletter_auto_timer', 3000 );
$auto_show = get_theme_mod( 'header_newsletter_auto_show', 'always' );
$version = get_theme_mod( 'header_newsletter_version', '1' );
$behavior = $auto_open ? ' auto_open="true"' : '';
$behavior .= $auto_open ? ' auto_timer="' . $auto_timer . '"' : '';
$behavior .= $auto_open ? ' auto_show="' . $auto_show . '"' : '';
$behavior .= ' version="' . $version . '"';
?>
<li class="header-newsletter-item has-icon">
<?php if($icon_style && $icon_style !== 'plain') echo '<div class="header-button">'; ?>
<a href="#header-newsletter-signup" class="tooltip <?php if($icon_style) echo get_flatsome_icon_class($icon_style, 'small'); ?>"
title="<?php echo $title; ?>">
<?php if($icon_style) { ?>
<i class="icon-envelop"></i>
<?php } ?>
<?php if($label) { ?>
<span class="header-newsletter-title hide-for-medium">
<?php echo $label; ?>
</span>
<?php } ?>
</a>
<?php if($icon_style && $icon_style !== 'plain') echo '</div>'; ?>
<?php if(!$newsletter_block){ ?>
<?php $content = '<h3 class="uppercase">'.$title.'</h3><p class="lead">'.$sub_title.'</p>'.get_theme_mod('header_newsletter_shortcode','[contact-form-7 id="7042" title="Newsletter Vertical"]'); ?>
<?php echo do_shortcode('[lightbox' . $behavior . ' width="700px" padding="0px" id="header-newsletter-signup"][ux_banner bg="'.$bg.'" border="2px 2px 2px 2px" border_color="rgba(255,255,255,.3)" border_style="dashed" border_margin="10px" bg_overlay="rgba(0,0,0,.4)" height="'.$height.'"][text_box animate="fadeInUp" position_x="10" text_align="left" width="50%" width__sm="60%"]'.$content.'[/text_box][/ux_banner][/lightbox]'); ?>
<?php } else { ?>
<?php echo do_shortcode('[lightbox' . $behavior . ' width="700px" padding="0px" id="header-newsletter-signup"]'.do_shortcode('[block id="'.$newsletter_block.'"]').'[/lightbox]'); ?>
<?php } ?>
</li>

View File

@@ -0,0 +1,5 @@
<li class="header-search-form search-form html relative has-icon">
<div class="header-search-form-wrapper">
<?php echo do_shortcode('[search style="'.flatsome_option('header_search_form_style').'"]'); ?>
</div>
</li>

View File

@@ -0,0 +1,24 @@
<?php $icon_style = get_theme_mod('search_icon_style'); ?>
<?php if(get_theme_mod('header_search_style') !== 'lightbox') { ?>
<li class="header-search header-search-dropdown has-icon has-dropdown menu-item-has-children">
<?php if($icon_style) { ?><div class="header-button"><?php } ?>
<a href="#" aria-label="<?php echo __('Search','woocommerce'); ?>" class="<?php echo get_flatsome_icon_class(flatsome_option('search_icon_style'), 'small'); ?>"><?php echo get_flatsome_icon('icon-search'); ?></a>
<?php if($icon_style) { ?></div><?php } ?>
<ul class="nav-dropdown <?php flatsome_dropdown_classes(); ?>">
<?php get_template_part('template-parts/header/partials/element-search-form'); ?>
</ul>
</li>
<?php } else if(get_theme_mod('header_search_style') == 'lightbox') { ?>
<li class="header-search header-search-lightbox has-icon">
<?php if($icon_style) { ?><div class="header-button"><?php } ?>
<a href="#search-lightbox" aria-label="<?php echo __('Search','woocommerce'); ?>" data-open="#search-lightbox" data-focus="input.search-field"
class="<?php echo get_flatsome_icon_class(get_theme_mod('search_icon_style'), 'small'); ?>">
<?php echo get_flatsome_icon('icon-search', '16px'); ?></a>
<?php if($icon_style) { ?></div>
<?php } ?>
<div id="search-lightbox" class="mfp-hide dark text-center">
<?php echo do_shortcode('[search size="large" style="'.get_theme_mod('header_search_form_style').'"]'); ?>
</div>
</li>
<?php } ?>

View File

@@ -0,0 +1,3 @@
<li class="html header-social-icons ml-0">
<?php echo do_shortcode('[follow defaults="true" style="'.flatsome_option('follow_style').'"]')?>
</li>

View File

@@ -0,0 +1,19 @@
<?php
// Exit if class does not exist.
if ( ! class_exists( 'YITH_WCWL' ) ) {
return;
}
$icon_style = get_theme_mod( 'wishlist_icon_style' );
?>
<li class="header-wishlist-icon has-icon">
<?php if($icon_style) { ?><div class="header-button"><?php } ?>
<a href="<?php echo YITH_WCWL()->get_wishlist_url(); ?>" class="wishlist-link <?php if ( $icon_style ) echo get_flatsome_icon_class( $icon_style, 'small' ); ?>">
<i class="wishlist-icon icon-<?php echo get_theme_mod( 'wishlist_icon', 'heart' ); ?>"
<?php if ( YITH_WCWL()->count_products() > 0 ){ ?> data-icon-label="<?php echo YITH_WCWL()->count_products(); ?>" <?php } ?>>
</i>
</a>
<?php if($icon_style) { ?> </div> <?php } ?>
</li>

View File

@@ -0,0 +1,25 @@
<?php
// Exit if class does not exist.
if(!class_exists( 'YITH_WCWL' )) return;
$icon = flatsome_option('wishlist_icon');
$icon_style = flatsome_option('wishlist_icon_style');
?>
<li class="header-wishlist-icon">
<?php if($icon_style) { ?><div class="header-button"><?php } ?>
<a href="<?php echo YITH_WCWL()->get_wishlist_url(); ?>" class="wishlist-link <?php echo get_flatsome_icon_class($icon_style, 'small'); ?>">
<?php if(flatsome_option('wishlist_title')) { ?>
<span class="hide-for-medium header-wishlist-title">
<?php if(flatsome_option('header_wishlist_label')) {echo flatsome_option('header_wishlist_label');} else{ _e('Wishlist', 'woocommerce');} ?>
</span>
<?php } ?>
<?php if($icon){ ?>
<i class="wishlist-icon icon-<?php echo $icon; ?>"
<?php if(YITH_WCWL()->count_products() > 0){ ?>data-icon-label="<?php echo YITH_WCWL()->count_products() ; ?>" <?php } ?>>
</i>
<?php } ?>
</a>
<?php if($icon_style) { ?> </div> <?php } ?>
</li>