WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Menu Cart
[resolved] Menu Cart Link Problem (18 posts)

  1. golfer300
    Member
    Posted 1 year ago #

    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/

  2. Jeremiah
    Member
    Plugin Author

    Posted 12 months ago #

    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

  3. golfer300
    Member
    Posted 12 months ago #

    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?

  4. golfer300
    Member
    Posted 12 months ago #

    Sorry double post

  5. Jeremiah
    Member
    Plugin Author

    Posted 12 months ago #

    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.

  6. Jeremiah
    Member
    Plugin Author

    Posted 10 months ago #

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

  7. superflymarketing
    Member
    Posted 9 months ago #

    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

  8. Jeremiah
    Member
    Plugin Author

    Posted 9 months ago #

    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?

  9. superflymarketing
    Member
    Posted 9 months ago #

    Thanks so much for your help Jeremiah, but that didn't work. :-(

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

    Cheers!

    Nick

  10. Jeremiah
    Member
    Plugin Author

    Posted 9 months ago #

    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;
    }
  11. superflymarketing
    Member
    Posted 9 months ago #

    This worked!

    What a hero!

  12. Jeremiah
    Member
    Plugin Author

    Posted 9 months ago #

    Great, glad to hear it! Enjoy. :)

  13. superflymarketing
    Member
    Posted 9 months ago #

    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

  14. Jeremiah
    Member
    Plugin Author

    Posted 9 months ago #

    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/

  15. sharongraylac
    Member
    Posted 8 months ago #

    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

  16. Ewout
    Member
    Plugin Author

    Posted 8 months ago #

    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;
    }
  17. sharongraylac
    Member
    Posted 8 months ago #

    Thanks a bunch, Ewout!

    And just to make sure I'm understanding correctly, did you say do NOT place this at the end of the functions.php file?

    I'm just a little concerned about needing to change the php files for this. I was hoping I would be able to keep this the same in case I made any changes later... I suppose this is the only way to fix this?

    Thanks again!
    Sharon

  18. sharongraylac
    Member
    Posted 8 months ago #

    Hi again!

    I did what you suggested (or at least I believe I did), and it's still not working...

    Anything else I can try?

    Thanks!
    Sharon

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.