• i want to hide some plugin if product go out of stock. Is it possible to disable some plugins if product go out of stock?

    Also how we can disable some plugins using regex for some product pages having a specific word.
    For example if this is the URL https://www.xyz.com/products/some-words-FOO-other-words

    Here if url is containing word FOO then how can we hide plugin on such URLs?
    I wrote an expression but that is not working.

Viewing 1 replies (of 1 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @rashtra

    i want to hide some plugin if product go out of stock. Is it possible to disable some plugins if product go out of stock?

    There’s no such function in Asset CleanUp. To prevent a plugin from loading, you need to implement a custom function in a MU plugin and use the option_active_plugins filter hook to determine based on various conditions the plugin that you want to deactivate (e.g. you get the product based on the URI and then check its stock).

    Here if url is containing word FOO then how can we hide plugin on such URLs?

    If you want to match any URI with the word FOO (in this example it’s with caps lock) then you can simply do something like #FOO# (this will match anything that contains FOO). To match it between dash lines you can do something like #-FOO-#. Have you checked the following post: https://assetcleanup.com/docs/what-are-plugins-unload-rules/? See if it helps! If not, let me know and I will further assist you.

    I wrote an expression but that is not working.

    What’s the expression you wrote?

Viewing 1 replies (of 1 total)
  • The topic ‘How to disable specific plugin according to product condition’ is closed to new replies.