get_id() ) ) . '#reviews" class="woocommerce-review-link scroll-to" rel="nofollow">( ' . $product->get_review_count() . ' )';
}
}
/**
* shop page - select form for products count
*
* @since 1.0
*/
if ( ! function_exists( 'alpha_wc_count_per_page' ) ) {
function alpha_wc_count_per_page() {
global $alpha_layout;
/**
* Filters the count of showing products.
*
* @since 1.0
*/
$count_select = apply_filters( 'alpha_products_count_select', alpha_get_loop_prop( 'products_count_select', '9, _12, 24, 36' ) );
$ts = ! empty( $alpha_layout['top_sidebar'] ) && 'hide' != $alpha_layout['top_sidebar'] && is_active_sidebar( $alpha_layout['top_sidebar'] );
?>
' . preg_replace( '/^\s+|\n|\r|\s+$/m', '', $links ) . '
';
}
return $links;
}
}
/**
* Update my account menu items
*
* @since 1.1.0
* @see woocommerce_account_menu_items
* @param array $items
*/
if ( ! function_exists( 'alpha_woocommerce_account_menu_items' ) ) {
function alpha_woocommerce_account_menu_items( $items ) {
$has_logout = false;
// Move customer logout to last
if ( isset( $items['customer-logout'] ) ) {
$has_logout = $items['customer-logout'];
unset( $items['customer-logout'] );
}
if ( defined( 'ALPHA_VENDORS' ) ) {
$items['vendor_dashboard'] = esc_html__( 'Vendor Dashboard', 'alpus' );
}
if ( $has_logout ) {
$items['customer-logout'] = $has_logout;
}
return $items;
}
}
/**
* Print page title bar.
*
* @since 1.0
*/
if ( ! function_exists( 'alpha_print_title_bar' ) ) {
function alpha_print_title_bar() {
global $alpha_layout;
if ( is_front_page() ) {
// Do not show page title bar and breadcrumb in home page.
$site_desc = get_option( 'blogdescription' );
if ( is_home() && ! empty( $site_desc ) ) {
?>
setup_titles();
$page_title = get_post_meta( $page_id, 'page_title', true );
if ( ! $page_title ) {
$page_title = $alpha_layout['title'];
}
$page_subtitle = get_post_meta( $page_id, 'page_subtitle', true );
if ( ! $page_subtitle ) {
$page_subtitle = $alpha_layout['subtitle'];
}
if ( $page_title || $page_subtitle ) {
?>
1 ) {
?>
$menu_obj,
'container' => 'nav',
'container_class' => $menu_obj->slug,
'items_wrap' => '',
'walker' => class_exists( 'Alpha_Walker_Nav_Menu' ) ? new Alpha_Walker_Nav_Menu() : new Walker_Nav_Menu(),
'theme_location' => '',
)
);
}
}
?>
'nav',
'container_class' => '',
'items_wrap' => '',
'walker' => class_exists( 'Alpha_Walker_Nav_Menu' ) ? new Alpha_Walker_Nav_Menu() : new Walker_Nav_Menu(),
'theme_location' => 'main-menu',
)
);
?>
(int) $settings['autoplay_timeout'],
'disableOnInteraction' => false,
);
}
}
if ( ! empty( $settings['show_dots'] ) && ! empty( $settings['dots_type'] ) && $id ) {
if ( 'thumb' == $settings['dots_type'] ) {
$extra_options['dotsContainer'] = '.slider-thumb-dots-' . $id;
} else {
$extra_options['dotsContainer'] = '.slider-custom-html-dots-' . $id;
}
}
if ( ! empty( $settings['show_nav'] ) ) {
$extra_options['navigation'] = true;
}
if ( ! empty( $settings['show_dots'] ) ) {
$extra_options['pagination'] = true;
}
if ( isset( $settings['autoheight'] ) && 'yes' == $settings['autoheight'] ) {
$extra_options['autoHeight'] = true;
}
// Disable Mouse Drag
if ( isset( $settings['disable_mouse_drag'] ) && 'yes' == $settings['disable_mouse_drag'] ) {
$extra_options['allowTouchMove'] = false;
}
// Effect
if ( isset( $settings['effect'] ) ) {
$extra_options['effect'] = $settings['effect'];
}
if ( ! empty( $settings['speed'] ) ) {
$extra_options['speed'] = $settings['speed'];
}
$responsive = array();
$w = array(
'min' => 'mobile',
'sm' => 'mobile_extra',
'md' => 'tablet',
'lg' => 'tablet_extra',
'xl' => 'laptop',
'xlg' => '',
'xxl' => 'widescreen',
);
$col_cnt = function_exists( 'alpha_get_responsive_cols' ) ? alpha_get_responsive_cols( $col_cnt ) : $col_cnt;
$parent_sp_custom = $extra_options['spaceBetween'];
$parent_sp_global = $extra_options['spaceBetween'];
foreach ( array_reverse( $w ) as $key => $device ) {
if ( $device ) {
$device = '_' . $device;
}
if ( ! empty( $col_cnt[ $key ] ) ) {
$responsive[ $max_breakpoints[ $key ] ] = array(
'slidesPerView' => $col_cnt[ $key ],
);
}
if ( empty( $settings['col_sp'] ) ) {
if ( ! empty( $settings[ 'col_sp_custom' . $device ]['size'] ) ) {
if ( ! isset( $responsive[ $max_breakpoints[ $key ] ] ) ) {
$responsive[ $max_breakpoints[ $key ] ] = array();
}
$parent_sp_custom = $settings[ 'col_sp_custom' . $device ]['size'];
$responsive[ $max_breakpoints[ $key ] ]['spaceBetween'] = $settings[ 'col_sp_custom' . $device ]['size'];
} elseif ( $parent_sp_custom != $extra_options['spaceBetween'] ) {
if ( ! isset( $responsive[ $max_breakpoints[ $key ] ] ) ) {
$responsive[ $max_breakpoints[ $key ] ] = array();
}
$responsive[ $max_breakpoints[ $key ] ]['spaceBetween'] = $parent_sp_custom;
} elseif ( ! empty( $site_settings[ 'gutter_space' . $device ]['size'] ) ) {
if ( ! isset( $responsive[ $max_breakpoints[ $key ] ] ) ) {
$responsive[ $max_breakpoints[ $key ] ] = array();
}
$parent_sp_global = $site_settings[ 'gutter_space' . $device ]['size'];
$responsive[ $max_breakpoints[ $key ] ]['spaceBetween'] = $site_settings[ 'gutter_space' . $device ]['size'];
} elseif ( $parent_sp_global != $extra_options['spaceBetween'] ) {
if ( ! isset( $responsive[ $max_breakpoints[ $key ] ] ) ) {
$responsive[ $max_breakpoints[ $key ] ] = array();
}
$responsive[ $max_breakpoints[ $key ] ]['spaceBetween'] = $parent_sp_global;
}
}
}
if ( isset( $col_cnt['xlg'] ) ) {
$extra_options['slidesPerView'] = $col_cnt['xlg'];
} elseif ( isset( $col_cnt['xl'] ) ) {
$extra_options['slidesPerView'] = $col_cnt['xl'];
} elseif ( isset( $col_cnt['lg'] ) ) {
$extra_options['slidesPerView'] = $col_cnt['lg'];
}
if ( ! empty( $settings['dots_type'] ) && $id ) {
$extra_options['pagination'] = false;
foreach ( $responsive as $w => $c ) {
$responsive[ $w ]['pagination'] = false;
}
}
$extra_options['breakpoints'] = $responsive;
$extra_options['statusClass'] = trim( ( empty( $settings['status_class'] ) ? '' : $settings['status_class'] ) . alpha_get_slider_status_class( $settings ) );
return $extra_options;
}
}
/**
* Echo or Return inline css.
* This function only uses for composed by style tag.
*
* @since 1.0
*/
if ( ! function_exists( 'alpha_filter_inline_css' ) ) :
function alpha_filter_inline_css( $inline_css, $is_echo = true ) {
if ( ! class_exists( 'Alpha_Optimize_Stylesheets' ) ) {
if ( $is_echo ) {
echo alpha_escaped( $inline_css );
return;
} else {
return $inline_css;
}
}
if ( empty( Alpha_Optimize_Stylesheets::get_instance()->is_merged ) ) { // not merge
if ( $is_echo ) {
echo alpha_escaped( $inline_css );
} else {
return $inline_css;
}
} else {
if ( 'no' == Alpha_Optimize_Stylesheets::get_instance()->has_merged_css() ) {
global $alpha_body_merged_css;
if ( isset( $alpha_body_merged_css ) ) {
$inline_css = str_replace( PHP_EOL, '', $inline_css );
$inline_css = preg_replace( '/
/s', '', $inline_css ) ? : $inline_css;
$inline_css = preg_replace( '/<\/style.*?>/s', '', $inline_css ) ? : $inline_css;
$alpha_body_merged_css .= $inline_css;
}
}
return '';
}
}
endif;
', '' ); ?>