跳到内容

Ajaxified Cart

v2.0.2

Abhishek Kumar · 2017年3月14日 上架

AJAX add-to-cart for WooCommerce: simple & variable products on archives/blocks via accessible modal and instant cart refresh.

正在使用
300+
评分
4.8 / 5
累计下载
9,397
最近更新
2026年8月3日
13 条评价需要 WordPress 5.8+已测试到 7.0.9PHP 8.0+

贡献者

WooCommerce core does not provide AJAX add-to-cart on the single product page or for variable products listed on archive pages (it redirects to the single view). This plugin adds an unobtrusive AJAX workflow for:

  • Simple products (single product page button becomes AJAX)
  • Variable products on archive & block-based Product Collection (opens an accessible modal to choose attributes, then adds via AJAX)
  • Classic themes and modern block/FSE themes (2025 and later) with Product Collection blocks

Highlights:
* Works with WooCommerce fragments (mini-cart updates automatically)
* Accessible modal (focus trap, ESC to close, restore focus)
* Nonce-secured AJAX endpoints; sanitized and validated input
* Settings page to enable/disable variable product archive functionality
* Block theme compatibility (intercepts “Select options” buttons) with slug/product_id fallback
* Performance-minded (loads minified bundles built via Webpack; falls back to source if missing)
* Translations auto-loaded from WordPress.org (no manual POT/PO generation required)

Privacy: This plugin does not send any data to external services. It only uses WooCommerce cart/session APIs.

Development

Build commands:

  1. Install dependencies:
    npm install
  2. Production build (minified + source maps):
    npm run build
  3. Watch during development:
    npm run watch
  4. Lint JS:
    npm run lint

Translations: WordPress.org language packs auto-load this plugin’s strings. The former POT/PO/MO tooling and i18n loader file were removed (WP 4.6+). Do not add a load_plugin_textdomain() call; simply keep the Text Domain header accurate.

WooCommerce is a registered trademark of Automattic Inc. This plugin is not affiliated with or endorsed by Automattic/WooCommerce.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums