WordPress.org

Support

Support » Plugins and Hacks » WooCommerce Menu Cart » [Resolved] Menu Cart Link Problem

[Resolved] Menu Cart Link Problem

  • My site is codingmadesimple.com though it is currently under maintenance mode. The menu cart seems to link (when clicked with no products inside) to codingmadesimple.com/courses even though I deleted the original Courses page and am using a Product Category (courses) instead for that page. How can I update the link from codingmadesimple.com/courses to codingmadesimple.com/product-category/courses/
    Any help is much appreciated.

    http://wordpress.org/plugins/woocommerce-menu-bar-cart/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Jeremiah

    @jprummer

    Hi there!

    Are you using the paid version? If so we’ve implemented filters that will allow you to manually set that. If not, we’ll be adding it to the current version in the next couple of weeks. Please advise!

    Jeremiah

    I am currently not using the paid version though I am going to upgrade once I increase cash flow. Is there anything I can do in the mean time or should I look for a way to adapt for the next couple weeks?

    Sorry double post

    Plugin Author Jeremiah

    @jprummer

    Actually, I forgot that you shouldn’t need any filters for this. Our plugin grabs whatever page is set as your “shop base page”. If you go into WooCommerce Settings -> Pages make sure you set the “Shop Base Page” to the page you want the plugin to point to.

    Otherwise, we can do a temporary fix and then when we update to the latest version you’ll have to change it but it’ll be easy.

    Plugin Author Jeremiah

    @jprummer

    Hi golfer! Since I haven’t heard anything I assume you got this figured out. Let me know if you need any more help!

    Hi Jeremiah,

    Has this version been upgraded so you can change the link when there is nothing in the cart?

    Tried changing the base page, but I want it to actually link to a page that has nothing to do with the shop!

    Please advise.

    Cheers,

    Nick

    Plugin Author Jeremiah

    @jprummer

    Yep, it has been! Although, you’ll need to download that version from here: http://wordpress.org/plugins/wp-menu-cart/ or search for wp menu cart in your add plugin menu to find it. Delete WooCommerce Menu Cart before activating WP Menu Cart.

    Are you familiar with filters? Actually, even if you’re not, it doesn’t really matter i guess. 😉 Take the below code and add it to your theme’s functions.php file:

    /**
     * Set page url when cart is empty
     */
    //add_filter('wpmenucart_emptyurl', 'add_wpmenucart_emptyurl', 1, 1);
    function add_wpmenucart_emptyurl ($empty_url) {
    	$empty_url = 'https://yoursite.com/empty';
    	return $empty_url;
    }

    Just change $empty_url to be the url that you want. Does that all make sense?

    Thanks so much for your help Jeremiah, but that didn’t work. 🙁

    http://shop.jameslegal.co.uk/

    Cheers!

    Nick

    Plugin Author Jeremiah

    @jprummer

    I think I know why. The add_filter function is commented out in the example I gave you. Try the following:

    /**
     * Set page url when cart is empty
     */
    add_filter('wpmenucart_emptyurl', 'add_wpmenucart_emptyurl', 1, 1);
    function add_wpmenucart_emptyurl ($empty_url) {
    	$empty_url = 'https://yoursite.com/empty';
    	return $empty_url;
    }

    This worked!

    What a hero!

    Plugin Author Jeremiah

    @jprummer

    Great, glad to hear it! Enjoy. 🙂

    Hi guys,

    Love the plugin, great idea!

    My menu cart seems to timeout and not work when you click on it with 0 products in the cart.

    http://shop.jameslegal.co.uk/

    Any idea why?

    Cheers,

    Nick

    Plugin Author Jeremiah

    @jprummer

    Hi Nick,

    Looks like your site isn’t https, but you’re directing users to https. Just change the link in the function above to be http://shop.jameslegal.co.uk/cart/

    sharongraylac

    @sharongraylac

    Hello there,

    I’m also having issues with the link (unless I’m misunderstanding something)…

    Right now, when there is nothing in the cart, if I click on the icon, it takes me to my Shop page. I was hoping if someone clicked on the cart icon, it would go to my cart page (even if it’s empty). Is this possible?

    Thanks!
    Sharon

    Plugin Author Ewout

    @pomegranate

    Sure! You just need WP Menu Cart instead of WooCommerce Menu Cart.

    Put the following snippet in your functions.php (make sure you don’t put it after any ?> at the end of the file)

    /**
     * Set page url when cart is empty
     */
    add_filter('wpmenucart_emptyurl', 'add_wpmenucart_emptyurl', 1, 1);
    function add_wpmenucart_emptyurl ($empty_url) {
    	global $woocommerce;
    	$empty_url = $woocommerce->cart->get_cart_url();
    	return $empty_url;
    }
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Resolved] Menu Cart Link Problem’ is closed to new replies.
Skip to toolbar