• Resolved aissamhidoussi

    (@aissamhidoussi)


    Hello,

    Thank you for the plugin.

    I’ve an RTL website, the mini wallet in the menu is shown like this:
    Currency_symbol Icon Amount
    I need them to be:
    Currency_symbol Amount Icon

    Is there a possible solution to do it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Moumita Adak

    (@moumitaadak)

    Hi @aissamhidoussi
    Thanks for pointing out this issue. We will push the fix in our next plugin update. For now, you can download the updated plugin from GitHub Repository.

    Thread Starter aissamhidoussi

    (@aissamhidoussi)

    Thank you very much, i’ll wait for the next update.

    For now, as a temporary solution, I’ve added the wallet to menus dynamically, with a check; if primary at the end, if handheld at the 2nd position. About the icon, i couldn’t figure its css, i tried the unicode with awesomfont css and i’ve found that it’s a user profile icon, not a wallet icon.

    // Add mini-wallet to primary and handheld menus
    function new_nav_menu_items($items, $args) {
    	if (!function_exists('woo_wallet') || !is_user_logged_in()) {
    		return $items;
    	}
    	$title = __('Current wallet balance', 'woo-wallet');
    	$mini_wallet = '<li id="menu-item-4661" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-4661 focus"><a style="color:#FFFFFF;" href="' . esc_url(wc_get_account_endpoint_url(get_option('woocommerce_woo_wallet_endpoint', 'woo-wallet'))) . '" title="' . $title . '"><i class="fas fa-wallet"></i> ';
    	$mini_wallet .= woo_wallet()->wallet->get_wallet_balance($user_id);
    	$mini_wallet .= '</a></li>';
    	if($args->theme_location == 'primary')
     	{
    		// add the mini wallet link to the end of the menu
    		$items = $items . $mini_wallet;
    	}
    	else if($args->theme_location == 'handheld')
    	{
    		// add the mini wallet link to the second plage of the menu
    		$items_array = array();
    		while ( false !== ( $item_pos = strpos ( $items, '<li', 2 ) ) ) // Add the position where the menu item is placed
    		{
    			$items_array[] = substr($items, 0, $item_pos);
    			$items = substr($items, $item_pos);
    		}
    		$items_array[] = $items;
    		array_splice($items_array, 1, 0, $mini_wallet); // insert custom item after 1th item one
    		$items = implode('', $items_array);
    	}
    	return $items;
    }
    add_filter( 'wp_nav_menu_items', 'new_nav_menu_items', 10, 2);

    I appreciate if you could add options to control mini-wallet’s position in different available menus in the next update/release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ordering mini wallet items (price, currency symbol, wallet icon)’ is closed to new replies.