Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! It’s clickable for me (Chrome), but I see that it’s not pickup up all Mega Menu styles, the link needs a ‘mega-menu-link’ class added to it. The following filter does this.

    add_filter( 'wpmenucart_submenu_item_li', 'wpmenucart_add_submenu_item_a_class', 10, 2 );
    function wpmenucart_add_submenu_item_a_class ( $cart_submenu_item_li, $submenu_item_data ) {
        $anchor = sprintf('<a href="%s" class="clearfix">', $submenu_item_data['item_permalink']);
        $anchor_new = str_replace('clearfix', 'clearfix mega-menu-link', $anchor);
        $cart_submenu_item_li = str_replace($anchor, $anchor_new, $cart_submenu_item_li);
        return $cart_submenu_item_li;
    }

    Read this if you don’t know what to do with this code!
    Ewout

    Plugin Contributor Ewout

    (@pomegranate)

    Whoops, sorry! Mixed up the filters for the submenu (pro) and the main menu. Try this instead:

    add_filter('wpmenucart_menu_item_a', 'wpmenucart_menu_item_a', 10, 7);
    function wpmenucart_menu_item_a ( $menu_item,  $item_data, $options, $menu_item_a_content, $viewing_cart, $start_shopping, $cart_contents ) {
    	$menu_item = str_replace('a class="', 'a class="mega-menu-link ', $menu_item);
    	return $menu_item;
    }

    Thread Starter saladjas

    (@saladjas)

    I copied that code to my function.php and it only turned the cart button to white, it is still not clickable ?? It doesn’t do anything when I click it. ??

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! Which browser do you use? It’s perfectly clicklable for me. When I have nothing in my cart it takes me to the shop and when I have added something to the cart it takes me to the cart.

    The filter was just so that it would integrate better with Mega Menu.

    If you let me know which browser and version you use, I try to replicate! Also, did you test on a mobile device or on a regular computer?

    Ewout

    Thread Starter saladjas

    (@saladjas)

    I’m using chrome Version 49.0.2623.110 (64-bit)
    So here is the problem I’m having. Yes it works when I first get to the site, once… and it works after I have added something to the cart.
    But it only works once and then it stops working again…
    Try this on your computer and let me know if it works for you.
    1. Go to saladskateboards.com
    2. hit the cart button
    3. after it took you to the shop page or the cart page, hit the logo to go back to the home page
    4. try the cart button again.
    For me, it doesn’t work again after I have already clicked it once.

    Plugin Contributor Ewout

    (@pomegranate)

    I see – I was able to replicate this and think this is Mega Menu related. You can see the same for the “Shop” menu on the left. It should link (if you hover it shows a target url in the bottom of your screen), but because of the way Mega Menu works, it shows the submenu instead. It’s possible that it’s trying to do the same with the Menu Cart menu item, except there’s no submenu to show.

    I’m afraid that at this point there’s not much I can do about this… ??

    Ewout

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘cart not clickable’ is closed to new replies.