| 开发者 | keyvahardani |
|---|---|
| 更新时间 | 2026年11月27日 19:33 |
| PHP版本: | 8.3 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv3 or later |
| 版权网址: | 版权信息 |
{name} (product name) and {price} (current price), e.g. "Buy {name} for {price}".{products} and {count}; the "View cart" button is kept.add-to-cart-text/get-button-text for AI agents and automations (WordPress 7.x).adtct_button_text – filter the resolved text: ( string $text, WC_Product $product, string $context ), context is single or archive.adtct_product_types – add your own product type slugs to the settings screen.add-to-cart-text/get-button-text – input { product_id, context }, output { text, source, source_id, … }. Requires the edit_products or manage_woocommerce capability. Example: wp_get_ability( 'add-to-cart-text/get-button-text' )->execute( array( 'product_id' => 42, 'context' => 'archive' ) )."Product page" changes the button on single product pages. "Shop & archives" changes the buttons in the shop, on category and tag pages, in product blocks and wherever WooCommerce uses the loop button text.
Check the priority list above: a text on the product or its category wins over the product type. If the product is out of stock, the out of stock text is used. Also clear your page cache after changing texts.
No. Button texts are plain text for security reasons. Emojis and all Unicode characters work.
Yes. Variable products have their own row ("Select options" in the shop, "Add to cart" on the product page).
PHP 8.3 or newer (tested with PHP 8.3, 8.4 and 8.5) and WordPress 7.0 or newer. On older PHP versions WordPress will not activate the plugin.
They are moved to the new settings automatically on the first page load after the update.
No. It only stores your button texts.
{name} and {price}, custom "added to cart" message.add-to-cart-text/get-button-text (Abilities API).