New — Sohay now answers WooCommerce product, policy & cart questions. See how →

Turning individual shopping tools off

Remove a tool and the chatbot is never told it exists — so it can neither call it nor send its data to your AI provider.

Every shopping tool can be switched off in code, individually. There is no admin screen for it today.

How it works

One filter, sohaychat_tools, holding the tools available for the request. Remove an entry and the chatbot is never told that tool exists — so it can neither call it nor send its data to your AI provider.

That is stronger than it sounds. This is not a permission check the model might argue with; the capability is simply absent from what it was given.

The tool names

Name What it does
sohaychat-wc/search-catalog Search and browse the catalog
sohaychat-wc/lookup-catalog Fetch specific products by ID
sohaychat-wc/get-product One product in detail, with options
sohaychat-wc/search-shop-policies-and-faqs Shipping, returns, refunds
sohaychat-wc/get-cart Read the shopper’s cart
sohaychat-wc/update-cart Change the shopper’s cart
sohaychat-kb/get-information The Knowledge Base lookup

Keep the catalog, drop the cart

The most common request — let the chatbot help people find things, but never touch a basket:

add_filter( 'sohaychat_tools', function ( $tools ) {
    unset( $tools['sohaychat-wc/get-cart'], $tools['sohaychat-wc/update-cart'] );
    return $tools;
} );

This also sidesteps the page-caching trade described in Carts, guests and page caching: with the cart-changing tool gone, the WooCommerce session cookie is never issued early, and guests stay cacheable.

Read-only shopping

Keep everything except the ability to change anything:

add_filter( 'sohaychat_tools', function ( $tools ) {
    unset( $tools['sohaychat-wc/update-cart'] );
    return $tools;
} );

No tools at all

add_filter( 'sohaychat_tools', '__return_empty_array' );

The chatbot still replies — it just has no way to look anything up, including your Knowledge Base. That is rarely what you want, but it is the honest way to test whether a bad answer is a retrieval problem or a model one.

Hiding the WooCommerce integration entirely

Removing the tools stops the chatbot using them. To stop the integration loading at all, remove its bootstrap from the service list with the sohaychat_services filter. The tools are then never registered in the first place.

For most purposes removing the tools is enough, and it is the smaller change.

A caveat worth stating

Tool gating is site-wide, not per-user or per-role. There is no way today to give logged-in customers cart access and deny it to anonymous visitors.

Where to go next

The tools registry for how this fits together, and Adding your own chat tool for going the other way.

Mithun B.
Mithun B.

More articles by Mithun B..

View all posts

Give your website an assistant that answers from your content

Grounded answers, a team inbox, and store-aware tools — free on WordPress.org.

Add Sohay — Free

Free plugin · You bring your OpenAI key · Works with any theme