Support » Plugin: WooCommerce Cart Count Shortcode » Hide cart link when cart empty and shop link when cart full

  • Resolved drConsolidated

    (@drconsolidated)


    Hi,

    I have added the shortcode to my navigation menu, but the shortcode is adding two links and breaking the layout of the menu. One link is for the shop, and is supposed to show when there is nothing in the cart. The other link points to the cart, and should show when there is something in the cart. Both links are showing at all times right now:

    http://prntscr.com/ggr09d

    You can see in the code that there are two anchor tags in the li for the menu item, with no selector for “active” or logic to only show the relevant link:

    http://prntscr.com/ggr0xg

    How can I only show the relevant one?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author prontotools

    (@prontotools)

    Hi @drconsolidated sorry for late response.

    Could you please provide the shortcode that you’ve added?

    Anyway, I’ve tried to add shortcode in my website like this [cart_button show_items="true" items_in_cart_text="Cart" empty_cart_text="Store"] on my website, it should show one link for cart (if has item in cart) or one link for shop (if no any item in cart).

    Thank You!
    Pronto Tools

    • This reply was modified 4 years, 8 months ago by prontotools.
    Thread Starter drConsolidated

    (@drconsolidated)

    Hi, thanks for the response.

    The code I have added is basically the same, except it also includes the basket icon:

    [cart_button icon=”basket” show_items=”true” items_in_cart_text=”Cart” empty_cart_text=”Store”]

    Any ideas why it might be showing both links at once?

    Thank you!

    Thread Starter drConsolidated

    (@drconsolidated)

    Hi ProntoTools,

    Any word on this?

    Many thanks!

    Plugin Author prontotools

    (@prontotools)

    Hi @drconsolidated

    I’m Sandy, developer from Pronto Tools. Sorry for late response.

    So I’ve tried with the shortcode that you’ve provided but I didn’t show both cart and shop links. It will show shop when nothing in cart and show cart when have item in cart.

    You can see this site: https://bossyong.pi.bypronto.com/shop/
    I’ve added your short to the header.

    So please help check the plugin that activated on your site, may be has some conflict with the plugin list.

    Thanks
    Pronto Tools.

    Thread Starter drConsolidated

    (@drconsolidated)

    Hi,

    I have disabled all plugins not required for this feature as advised, but the problem has not gone away. Both links still appear in the menu at all times:

    https://dev-black-market.pantheonsite.io/

    These 4 plugins are the only ones still enabled:

    • Cornerstone (required for content render, but did verify problem persists with it off)
    • Shortcodes in Menus
    • WooCommerce
    • WooCommerce Cart Count Shortcode

    Thank you

    Plugin Author prontotools

    (@prontotools)

    Hi drConsolidated,

    Could please help setup user to give me permission access the website’s admin? It’s easy to investigate because I’m still doesn’t know why it shows duplicate links.

    I’m not sure for Shortcodes in Menus plugin, are there any Cart menu setting in this plugin?

    Which version of Woocommerce that your website using?

    Thanks for the information,
    Pronto Tools.

    Thread Starter drConsolidated

    (@drconsolidated)

    Hi Pronto Tools,

    I have figured out that this issue was a misconfiguration on my part of the Shortcodes in Menus plugin functionality.

    I had added the menu item as a Page, not with the special Shortcode menu item type created by that plugin.

    Thanks for taking the time to assist me!

    Plugin Author prontotools

    (@prontotools)

    Great. Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hide cart link when cart empty and shop link when cart full’ is closed to new replies.