Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Shameem (woo-hc)

    (@shameemreza)

    Hi @hebhansen,

    The code snippets you’ve shared are indeed meant to do just that. However, if you’re using a block theme, it might not work as expected due to how block themes handle navigation menus.

    For the issue with the second snippet, it looks like you’re trying to declare the same function twice, which would cause an error. If you want to use both snippets, you’ll need to rename one of the functions to something unique.

    However, I’d recommend looking into block theme compatible solutions for dynamic menu items. There are plugins available that can help with this, such as Block Visibility, or you might need to customize the theme code directly.

    Please note that writing or providing custom code is not within the scope of our support policy. If you still need assistance, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack or the WooCommerce Advanced Facebook group. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter hebhansen

    (@hebhansen)

    I would prefer a snippet to avoid tons of plugins for anything and all. Theme is TT4, so must work for blocks

    Plugin Support omarfpg (woo-hc)

    (@omarfpg)

    Hi @hebhansen,

    Please note that this query is not specific to WooCommerce (changing a menu depending on login status would be a basic WordPress query, not necessarily tied to Woo), and even more the way you require to do it through custom code, means customization. Both things mean this is outside of our support scope, I’m afraid.

    However, I trust a quick Google Search can lead you in the right direction, though. And this thread will be open to answers for a while longer in case someone in the community can provide a ready to go solution for you!

    Cheers!
    -OP

    Thread Starter hebhansen

    (@hebhansen)

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hello @hebhansen,

    also… should this not be a core woo feature?

    Just as my colleague had earlier shared above, this is not a Woo feature, and therefore we are unable to provide support.

    However, you could try running the exact question you’re asking, along with the code provided, through an AI platform like ChatGPT for recommendations/changes to your code.

    Hope it helps!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.