HomePage Forums Themes Support Theme freshio – menu mobile Reply To: Theme freshio – menu mobile

#2080
AvatarMarwit
Supported
<?php
$theme           = wp_get_theme('freshio');
$freshio_version = $theme['Version'];

if (!isset($content_width)) {
	$content_width = 980; /* pixels */
}
require get_theme_file_path('inc/class-tgm-plugin-activation.php');
$freshio = (object)array(
	'version' => $freshio_version,
	/**
	 * Initialize all the things.
	 */
	'main'    => require 'inc/class-main.php',
);

require get_theme_file_path('inc/functions.php');
require get_theme_file_path('inc/template-hooks.php');
require get_theme_file_path('inc/template-functions.php');

require_once get_theme_file_path('inc/merlin/vendor/autoload.php');
require_once get_theme_file_path('inc/merlin/class-merlin.php');
require_once get_theme_file_path('inc/merlin-config.php');

$freshio->options = require get_theme_file_path('inc/options/class-options.php');

if (freshio_is_woocommerce_activated()) {
	$freshio->woocommerce = require get_theme_file_path('inc/woocommerce/class-woocommerce.php');

	require get_theme_file_path('inc/woocommerce/class-woocommerce-adjacent-products.php');

	require get_theme_file_path('inc/woocommerce/woocommerce-functions.php');
	require get_theme_file_path('inc/woocommerce/woocommerce-template-functions.php');
	require get_theme_file_path('inc/woocommerce/woocommerce-template-hooks.php');
	require get_theme_file_path('inc/woocommerce/template-hooks.php');
	require get_theme_file_path('inc/woocommerce/class-woocommerce-size-chart.php');

    if (class_exists('WeDevs_Dokan')) {
        require get_theme_file_path('inc/dokan/class-dokan.php');
        require get_theme_file_path('inc/dokan/dokan-template-functions.php');
        require get_theme_file_path('inc/dokan/dokan-template-hooks.php');
    }
}

if (freshio_is_elementor_activated()) {
	require get_theme_file_path('inc/elementor/functions-elementor.php');
	$freshio->elementor = require get_theme_file_path('inc/elementor/class-elementor.php');
	$freshio->megamenu  = require get_theme_file_path('inc/megamenu/megamenu.php');

	if (freshio_get_theme_option('enable-footer-builder', false)) {
		require get_theme_file_path('inc/builder/class-footer-builder.php');
	}
	if (defined('ELEMENTOR_PRO_VERSION')) {
		require get_theme_file_path('inc/elementor/class-elementor-pro.php');
	}
}

if (!is_user_logged_in()) {
	require get_theme_file_path('inc/modules/class-login.php');
}

if (is_admin()) {
	$freshio->admin = require get_theme_file_path('inc/admin/class-admin.php');
}
	 
function freshio_fnc_custom_link($links){
	$links = array(
			'shop'       => array(
				'priority' => 5,
				'callback' => 'freshio_handheld_footer_bar_shop_link',
			),
			'my-account' => array(
				'priority' => 10,
				'callback' => 'freshio_handheld_footer_bar_account_link',
			),
			'search'     => array(
				'priority' => 20,
				'callback' => 'freshio_handheld_footer_bar_search',
			),
			'wishlist'   => array(
				'priority' => 30,
				'callback' => 'freshio_handheld_footer_bar_wishlist',
			),
		);
	
	return $links;
}

add_filter('freshio_handheld_footer_bar_links', 'freshio_fnc_custom_link', 10, 1);

//Change cart link and Menu name
function freshio_handheld_footer_bar_cart_link() {
		?>
        <a class="footer-cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'freshio' ); ?>">
            <span class="count"><?php echo wp_kses_data( WC()->cart->get_cart_contents_count() ); ?></span>
        </a>
		<?php
	}
//Change Account Link and Menu name
function freshio_handheld_footer_bar_account_link() {
		echo '<a href="https://www.site.fr/moje-konto/' . esc_url( get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ) ) . '"><span class="title">' . esc_attr__( 'Konto', 'freshio' ) . '</span></a>';
	}
//Change Shop link
function freshio_handheld_footer_bar_shop_link() {
		echo '<a href="https://www.site.fr/artykuly-spozywcze/' . esc_url( get_permalink( get_option( 'woocommerce_shop_page_id' ) ) ) . '"><span class="title">' . esc_attr__( 'Sklep', 'freshio' ) . '</span></a>';
	}

//Change wishlist link
function freshio_handheld_footer_bar_wishlist() {
		if ( function_exists( 'yith_wcwl_count_all_products' ) ) {
			?>
            <a class="footer-wishlist" href="<?php echo esc_url( get_permalink( get_option( 'yith_wcwl_wishlist_page_id' ) ) ); ?>">
                <span class="title"><?php echo esc_html__( 'Ulubione', 'freshio' ); ?></span>
                <span class="count"><?php echo esc_html( yith_wcwl_count_all_products() ); ?></span>
            </a>
			<?php
		}
	}