Dragwyb Click to Chat can display an Add action on WooCommerce product cards in the AI Assistant. For an in-stock simple product, the plugin builds an add-to-cart URL and opens it in a new browser tab. For other product types, the generated action links to the product page instead, so customers can choose required options before adding the item.
Before you begin
- Install and activate WooCommerce.
- Make sure the product is published and its price, stock status, product type, and permalink are correct.
- Activate and configure the Dragwyb AI Assistant so visitors can ask product-related questions.
- Use a test product and test account or session when checking cart behavior.
How the Add action works
The current plugin source does not provide a separate one-click cart setting. The Add action is rendered automatically on a product card when the product data reports that the item is in stock. The destination URL depends on the WooCommerce product type.
- Simple product in stock: the plugin creates a product permalink with WooCommerce’s
add-to-cartquery parameter and the product ID. This requests WooCommerce to add the product using its normal URL-based cart handling. - Other in-stock product types: the product formatter uses the product permalink as the Add action destination. For variable products, customers should use the product page to choose the required variation and options.
- Out-of-stock product: the product card does not display the Add action when the returned product data says it is not in stock.
- New browser tab: both View and Add links are configured to open in a new tab. The plugin does not perform an in-chat AJAX cart update in this product-card component.
Find the product card in chat
There is no separate admin page for configuring this Add action. Product cards are shown when the AI conversation returns WooCommerce products. To check the related product-discovery setup:
- In WordPress admin, open Click to Chat → AI Assistant.
- Choose Chatbot Settings and open the Advance tab.
- Under AI Business Tools & Workflow Automation, check the main switch and the WooCommerce Product Search tool if you want the model to use the dedicated product-search tool. This option is available when WooCommerce is active.
- Save the settings using the available save action.
- Open a front-end page with the chat widget and ask a product question that matches a published item.
Automatic product context and the optional product-search tool are separate paths. Enabling the tool does not create a separate cart setting; the Add action is part of the product card rendering.
Test adding a simple product
- Choose a published simple product that is in stock and has a valid price and permalink.
- Open the site frontend and ask the AI Assistant to find that product.
- Confirm the returned product card matches the product you selected.
- Click Add. The plugin opens the generated URL in a new browser tab.
- In that tab, inspect the WooCommerce cart and confirm the expected product was added.
- Check the quantity, cart total, and any store notices. Repeat the test with a product that should not match to ensure you can recognize an incorrect result.
Test variable and unavailable products
For a variable product, the Add link currently falls back to the product permalink rather than selecting a variation inside the chat. Open the product page and choose the required variation there. Also test an out-of-stock product: the Add action should be hidden when the product card’s stock flag is false.
Cart behavior can also depend on the site’s WooCommerce configuration, theme, extensions, redirects, and product rules. Verify the result on your own store before describing the action as a guaranteed one-click purchase flow.
Troubleshooting
- No product card appears: confirm WooCommerce is active, the product is published, and the AI Assistant responds to a specific product-related message. See Search WooCommerce Products with AI.
- The Add action is missing: check whether the product card reports the item as in stock. The component only renders Add when
in_stockis true. - Add opens the product page instead of adding directly: this is expected for product types other than simple products in the current formatter. Choose required options on the product page.
- The cart does not contain the expected item: confirm the URL is for the correct product and inspect WooCommerce notices, cart redirects, product restrictions, and any cart-related extensions.
- The displayed stock or price is unexpected: check the current WooCommerce product record and test again with a fresh conversation.
Related WooCommerce guides
- WooCommerce Shopping and Orders
- Search WooCommerce Products with AI
- Configure AI Product Recommendations
- Configure Secure WooCommerce Order Tracking
Screenshot
Screenshot to add: Capture a real front-end product card with the Add action, then capture the resulting WooCommerce cart for an in-stock simple product. Hide customer details and other private store information. No screenshot has been captured for this guide yet.