📖 Documentation

Cartexa – Smart Cart
for WooCommerce

AJAX side cart drawer, floating cart button, free shipping bar, trust badges, scarcity messages & more. Zero jQuery. 8 conversion modules.

● Version 1.0.0 ● WooCommerce 7.0+ ● WordPress 6.3+ ● Zero jQuery ● GPL-2.0 Free
01 — Overview

What is Cartexa?

Cartexa is a lightweight WooCommerce cart plugin that replaces the default cart redirect with a smooth AJAX side drawer — and bundles 8 independent conversion modules you can toggle on or off without touching a line of code.

Every module loads zero overhead when disabled. The entire frontend weighs under 40 KB minified. No jQuery dependency.

🛒
AJAX Side Cart Drawer
Slide-in cart that opens on add-to-cart or icon click. Qty update and item remove happen in-place — no page reload.
🚀
Floating Cart Button
Persistent FAB in the corner of the page. Shows a live item count badge. Fully configurable icon, position, and offset.
📦
Free Shipping Bar
Progress bar inside the drawer that motivates customers toward your free shipping threshold. Auto-reads WooCommerce free shipping rules.
🔒
Trust Badges
Four built-in badges (Secure Checkout, Easy Returns, Fast Shipping, 24/7 Support) plus two custom badge slots.
⚠️
Scarcity Messages
Pulls real WooCommerce stock counts and shows a configurable low-stock alert per cart line item to drive urgency.
🍞
Toast Notifications
A lightweight add-to-cart confirmation popup with product name and thumbnail. Auto-dismisses after a configurable delay.
↩️
Undo Remove
After removing an item, a temporary undo banner lets shoppers restore it within a configurable timeout window.
🔗
Nav Menu Cart Icon
Shortcode and widget to place a live cart icon anywhere — in menus, headers, or sidebars — with real-time count badge.
✅
All 8 modules are free. Toggle any combination on or off from the admin panel — disabled modules load no assets and add zero database queries.
02 — Requirements

Requirements

RequirementMinimumRecommended
WordPress6.37.1+
WooCommerce7.09.0+
PHP7.48.2+
MySQL5.68.0+
BrowserAny modern browser — no IE11 support
⚠️
WooCommerce must be installed and activated before activating Cartexa. The plugin declares Requires Plugins: woocommerce in its header — WordPress will warn you if WooCommerce is missing.
03 — Getting Started

Installation

1
Upload the plugin
Go to WordPress Admin → Plugins → Add New → Upload Plugin. Select the cartexa-smart-cart-for-woocommerce.zip file and click Install Now.
2
Activate
Click Activate Plugin. Cartexa saves its default settings on first activation — no database tables are created.
3
Open the settings page
Navigate to WooCommerce → Cartexa in your admin menu.
WooCommerce → Cartexa
4
Enable the Side Cart & save
On the Side Cart tab, toggle Enable module on and click Save Settings. The drawer is live instantly.
5
Enable optional modules
Visit the Floating Cart, Shipping Bar, Trust Badges, and other tabs to activate the modules you need. Each module is fully independent.
04 — Reference

File Structure

cartexa-smart-cart-for-woocommerce/ ├── cartexa-smart-cart.php ← Main plugin file (headers, constants) ├── uninstall.php ← Clean-up on delete ├── readme.txt ├── admin/ │ ├── class-cartexa-admin-panel.php ← All admin UI tabs & sections │ ├── css/ cartexa-admin.css │ └── js/ cartexa-admin.js ├── includes/ │ ├── class-cartexa-core.php ← Bootstrap, subsystem registration │ ├── class-cartexa-settings.php ← Settings CRUD, sanitization │ ├── class-cartexa-assets.php ← wp_enqueue, JS config, inline styles │ ├── class-cartexa-ajax.php ← AJAX handlers (qty, remove, fragments) │ ├── class-cartexa-frontend.php ← Drawer HTML output │ ├── class-cartexa-install.php ← Activation / deactivation / upgrades │ ├── class-cartexa-shortcodes.php ← [cartexa_cart_icon] shortcode │ ├── class-cartexa-widget.php ← WP_Widget for cart icon │ └── modules/ │ ├── class-cartexa-module-loader.php │ ├── class-cartexa-module-floating-cart.php │ ├── class-cartexa-module-shipping-bar.php │ ├── class-cartexa-module-trust-badges.php │ ├── class-cartexa-module-scarcity.php │ └── class-cartexa-module-nav-menu.php ├── frontend/ │ ├── css/ cartexa.css · cartexa-modules.css │ ├── js/ cartexa.js │ └── templates/ │ ├── cart-drawer.php │ ├── cart-item.php │ ├── cart-empty.php │ └── cart-overlay.php └── languages/ └── cartexa-smart-cart-for-woocommerce.pot
05 — Admin UI

Side Cart

The core module. When enabled, the Side Cart intercepts all add-to-cart events and cart icon clicks, then opens an AJAX-powered slide-in drawer instead of redirecting to /cart.

🧴
🕯️
🌿
Lumière Studio · Shop
Cart 3
✕
Add $16 more for free shipping
🧴
Botanical Face Serum
30ml · Rosehip
−
1
+
Only 4 left!
$48
🕯️
Lavender Soy Candle
200g · Single Wick
−
2
+
$68
🔒 Secure
↩️ Returns
🚚 Fast Ship
yourstore.com/wp-admin/admin.php?page=cartexa-smart-cart
🛒
Cartexa
Smart Cart
Active
v1.0.0
🛒
Side Cart
🚀
Floating Cart
📦
Shipping Bar
🔒
Trust Badges
⚠️
Scarcity
🎨
Display
🛒
Side Cart Settings
🛒
Side Cart
Enable module
Drawer position
Open drawer on
Open animation
Drawer width
420px
Close on overlay click
🎨
Appearance
Accent color
Cart icon size
22px

Settings Reference

KeyTypeDefaultDescription
enable_drawerboolyesEnable the AJAX side cart drawer
drawer_positionstringrightright or left — which side the drawer slides in from
drawer_triggerstringbothboth · add_to_cart · icon_click
animation_stylestringslideslide · fade · none
drawer_widthint420Drawer width in pixels (280–680)
overlay_closeboolyesClose drawer when clicking the backdrop overlay
accent_colorstring#7c3aedPrimary brand color for buttons and progress fill
cart_icon_sizeint22Cart icon size in pixels (16–40)
06 — Admin UI

Floating Cart Button

A persistent floating action button (FAB) that stays visible as the visitor scrolls. Shows a live item count badge that updates on every cart change — no page reload needed.

💡
The FAB is independent of the Side Cart module. You can enable one, both, or neither. When both are active, clicking the FAB opens the Side Cart drawer.
KeyTypeDefaultDescription
enable_floating_cartboolnoEnable the floating cart button
floating_cart_positionstringbottom-rightbottom-right or bottom-left
floating_cart_iconstringbagbag · basket · trolley
floating_cart_labelstring""Optional text label next to the icon. Leave blank for icon only.
floating_cart_offset_xint24Horizontal edge offset in pixels (8–120)
floating_cart_offset_yint24Vertical bottom offset in pixels (8–120)
07 — Admin UI

Free Shipping Bar

Displays a progress bar at the top of the cart drawer showing how close the visitor is to earning free shipping. The bar reads your WooCommerce free shipping method automatically — no manual threshold required unless you prefer to override it.

Use {amount} in your message templates as a placeholder for the remaining amount, formatted in the store's active currency.

✅
Leave Manual threshold at 0 to auto-detect from your active WooCommerce Free Shipping method. The plugin reads the minimum order amount directly from WooCommerce settings.
KeyTypeDefaultDescription
enable_shipping_barboolyesEnable the free shipping progress bar
shipping_thresholdint0Manual threshold override. 0 = auto-detect from WooCommerce
shipping_bar_msg_progressstringSpend {amount} more for free shipping!Message shown while below the threshold. Use {amount} for remaining amount.
shipping_bar_msg_reachedstring🎉 You've unlocked free shipping!Message shown when the threshold is met or exceeded
shipping_bar_colorstring#10b981Fill color of the progress bar (hex)
08 — Admin UI

Trust Badges

Displays a row of trust signals inside the cart drawer. Four pre-built badge types are available as toggles, plus two free-text custom badge slots for your own messaging.

KeyTypeDefaultDescription
enable_trust_badgesboolyesEnable the trust badges row
trust_badges_positionstringafter_actionsafter_actions — below checkout buttons · drawer_bottom — pinned to bottom
trust_badge_secureboolyesShow "🔒 Secure Checkout" badge
trust_badge_returnsboolyesShow "🔄 Easy Returns" badge
trust_badge_shippingboolyesShow "🚚 Fast Shipping" badge
trust_badge_supportboolnoShow "💬 24/7 Support" badge
trust_custom_text_1string""Custom badge slot 1 (e.g. "Money-back guarantee")
trust_custom_text_2string""Custom badge slot 2 (e.g. "Free gift wrapping")
09 — Admin UI

Stock Scarcity Messages

Reads the actual WooCommerce stock quantity for each cart line item and displays a configurable low-stock warning when the count falls at or below your threshold. The warning appears directly below the quantity controls for that item.

ℹ️
Only products with stock management enabled in WooCommerce show scarcity messages. Products set to "In stock" without a quantity are silently skipped.
KeyTypeDefaultDescription
enable_scarcityboolyesEnable stock scarcity messages
scarcity_thresholdint5Show message when stock is at or below this number (1–50)
scarcity_messagestringOnly {qty} left in stock!Message template. Use {qty} for the actual stock count.
scarcity_colorstring#ef4444Text color of the scarcity message (hex)
10 — Admin UI

Display & Labels

Controls what elements appear in the drawer footer — buttons, subtotal, tax note — and lets you customise the button labels and the empty cart state.

Drawer Footer

KeyTypeDefaultDescription
show_subtotalboolyesShow cart subtotal above the checkout button
show_tax_noteboolyesShow "Taxes & shipping calculated at checkout" note
show_checkout_btnboolyesShow the primary Checkout button
show_view_cart_btnboolyesShow the secondary View Cart button
show_continue_btnboolnoShow a "Continue Shopping" link that closes the drawer
show_item_count_badgeboolyesShow the item count badge in the drawer header

Button Labels

KeyTypeDefaultDescription
checkout_btn_textstringCheckoutCheckout button label. Leave blank for WooCommerce default.
view_cart_btn_textstringView CartView Cart button label. Leave blank for WooCommerce default.

Empty Cart State

KeyTypeDefaultDescription
empty_cart_messagestringYour cart is empty.Heading shown when the cart has no items
empty_cart_btn_textstringStart ShoppingCTA button label on the empty state
empty_cart_btn_urlstring/shopURL the empty state CTA links to (defaults to WooCommerce shop page)
11 — Admin UI

Cart Icon

Configures the cart icon style and accent color used across the whole plugin — in the floating cart button, nav menu widget, and the drawer header trigger icon.

KeyTypeDefaultDescription
enable_mini_cartboolyesRequired to use the [cartexa_cart_icon] shortcode and widget
cart_icon_stylestringbagbag · basket · trolley — SVG icon set
accent_colorstring#7c3aedGlobal accent color (CSS custom property --cartexa-accent)
12 — Developer

Shortcode & Widget

Cartexa provides one shortcode and one WordPress widget for placing a cart icon anywhere on your storefront.

Shortcode

// Basic usage — uses settings from admin panel [cartexa_cart_icon] // With all attributes [cartexa_cart_icon show_label="yes" label="Cart" icon="bag"]
AttributeDefaultDescription
show_labelnoSet to yes to show a text label alongside the icon
label""Custom label text. Defaults to the value in the Cart Icon settings tab.
icon(from settings)Override the icon style: bag · basket · trolley

Widget

A WP_Widget is registered as Cartexa Cart Icon. Add it to any sidebar or widget area from Appearance → Widgets. It renders the same cart icon shortcode with a live badge count.

PHP function

// Output the cart icon anywhere in your theme <?php echo do_shortcode( '[cartexa_cart_icon]' ); ?>
13 — Developer

AJAX Endpoints

All cart mutations use WordPress AJAX with nonce verification. The nonce is passed in the JS config object (window.cartexaConfig.nonce) and verified on every request.

ActionMethodParametersDescription
cartexa_get_fragmentsPOST nonce Returns updated cart HTML fragments and item count. Called after any cart change.
cartexa_update_qtyPOST nonce, cart_item_key, qty Updates the quantity of a cart line item. Returns fragments on success.
cartexa_remove_itemPOST nonce, cart_item_key Removes a line item from the cart. Returns fragments and the removed item data for Undo.
cartexa_refresh_noncePOST — Returns a fresh nonce. Called automatically when a nonce expires (e.g. after user login/logout).
cartexa_export_settingsPOST nonce Admin only. Returns all plugin settings as a downloadable JSON object.
cartexa_import_settingsPOST nonce, settings Admin only. Imports and validates a JSON settings object. Overwrites current settings.
⚠️
All AJAX endpoints are available to both logged-in and guest users except cartexa_export_settings and cartexa_import_settings which require manage_options capability.
14 — Reference

All Settings

All settings are stored in a single WordPress option: cartexa_settings (serialised array). You can read any setting programmatically:

<?php // Read a single setting $drawer_width = Cartexa\Settings::fetch( 'drawer_width', 420 ); // Read a boolean setting $is_enabled = Cartexa\Settings::fetch_bool( 'enable_drawer' );
KeyTypeDefaultDescription
enable_drawerboolyesEnable AJAX side cart drawer
drawer_positionstringrightright · left
drawer_triggerstringbothboth · add_to_cart · icon_click
animation_stylestringslideslide · fade · none
drawer_widthint420Drawer width in px (280–680)
overlay_closeboolyesClose on backdrop click
accent_colorstring#7c3aedGlobal CSS accent color
cart_icon_sizeint22Icon size in px (16–40)
cart_icon_stylestringbagbag · basket · trolley
enable_mini_cartboolyesEnable shortcode & widget
enable_floating_cartboolnoEnable floating cart FAB
floating_cart_positionstringbottom-rightbottom-right · bottom-left
floating_cart_iconstringbagbag · basket · trolley
floating_cart_labelstring""Optional FAB text label
floating_cart_offset_xint24Horizontal offset px
floating_cart_offset_yint24Vertical offset px
enable_shipping_barboolyesEnable free shipping progress bar
shipping_thresholdint0Manual threshold (0 = auto)
shipping_bar_msg_progressstringSpend {amount} more…Progress message — use {amount}
shipping_bar_msg_reachedstring🎉 You've unlocked…Threshold reached message
shipping_bar_colorstring#10b981Progress bar fill color
enable_trust_badgesboolyesEnable trust badges row
trust_badges_positionstringafter_actionsafter_actions · drawer_bottom
trust_badge_secureboolyes🔒 Secure Checkout badge
trust_badge_returnsboolyes🔄 Easy Returns badge
trust_badge_shippingboolyes🚚 Fast Shipping badge
trust_badge_supportboolno💬 24/7 Support badge
trust_custom_text_1string""Custom badge slot 1
trust_custom_text_2string""Custom badge slot 2
enable_scarcityboolyesEnable stock scarcity messages
scarcity_thresholdint5Show message when stock ≤ this
scarcity_messagestringOnly {qty} left!Template — use {qty}
scarcity_colorstring#ef4444Scarcity text color
enable_toastboolyesEnable add-to-cart toast notification
enable_undo_removeboolyesEnable undo banner after item remove
enable_nav_menuboolyesEnable nav menu cart icon integration
show_subtotalboolyesShow subtotal in drawer footer
show_checkout_btnboolyesShow Checkout button
show_view_cart_btnboolyesShow View Cart button
checkout_btn_textstringCheckoutCheckout button label
view_cart_btn_textstringView CartView Cart button label
empty_cart_messagestringYour cart is empty.Empty state heading
empty_cart_btn_textstringStart ShoppingEmpty state CTA label
empty_cart_btn_urlstring/shopEmpty state CTA URL
15 — Developer

Hooks & Filters

Filters

HookArgumentsDescription
cartexa_load_assets $load (bool) Force assets to load on a specific page. Return true to enqueue on any page.
cartexa_js_config $config (array) Modify the JavaScript config object passed to window.cartexaConfig. Useful for injecting custom data for extensions.
cartexa_drawer_classes $classes (array) Add or remove CSS classes from the drawer wrapper element.
cartexa_sanitize_settings $clean (array), $input (array) Runs after the built-in settings sanitization. Return the final clean array.

Actions

HookDescription
cartexa_loadedFires after the plugin core finishes bootstrapping. Receives the core instance as the first argument.
cartexa_activatedFires on plugin activation, after default settings are saved.
cartexa_deactivatedFires on plugin deactivation.
cartexa_before_drawerFires immediately before the drawer template is output to the page. Use to inject HTML before the drawer.
cartexa_after_drawerFires immediately after the drawer template. Use to inject HTML after the drawer.
cartexa_modules_loadedFires after all active modules have been registered and hooked.

Usage example

// Force assets to load on your homepage add_filter( 'cartexa_load_assets', function( $load ) { if ( is_front_page() ) { return true; } return $load; } ); // Add a custom class to the drawer add_filter( 'cartexa_drawer_classes', function( $classes ) { $classes[] = 'my-custom-theme'; return $classes; } ); // Run code after the drawer is output add_action( 'cartexa_after_drawer', function() { echo '<div class="my-extra-element"></div>'; } );
16 — FAQ

Frequently Asked Questions

Does this work with my theme?
Yes. Cartexa hooks into WooCommerce's standard cart actions and does not override any theme templates. It renders its drawer as a separate layer appended to <body> — completely independent of your theme's layout. It has been tested with Storefront, Astra, Flatsome, Divi, and block themes including the default Twenty-series.
Will it work with variable products?
Yes. Cartexa intercepts the standard WooCommerce add-to-cart flow after WooCommerce itself has resolved the variation. The cart drawer shows the selected variation attributes (size, color, etc.) below each item name. Quantity updates and removals work identically for simple and variable products.
Does it conflict with other cart plugins?
Cartexa is built on standard WooCommerce hooks and does not monkey-patch core classes. Conflict is most likely with other side-cart or mini-cart plugins that hook into the same events. We recommend running only one cart replacement plugin at a time. Use the cartexa_load_assets filter to conditionally disable loading on specific pages if needed.
Will it slow down my site?
No. Assets are only enqueued on shop, product, cart, and checkout pages (plus any page where the shortcode is used). Disabled modules load zero assets. The frontend JS is under 40 KB minified with no jQuery dependency. No external scripts or fonts are loaded.
How do I translate the plugin?
Cartexa is fully translation-ready. A .pot file is included in the languages/ folder. All strings use the text domain cartexa-smart-cart-for-woocommerce. You can translate using Loco Translate, PoEdit, or the WordPress.org GlotPress translation system. On WordPress 4.6+, translation files are auto-loaded from wp-content/languages/plugins/.
Can I customise the drawer templates?
Template override is not yet built in, but you can use the cartexa_before_drawer and cartexa_after_drawer action hooks to inject HTML around the drawer, and the cartexa_drawer_classes filter to add your own CSS classes. Full template override support is planned for a future version.
Does it support HPOS (High-Performance Order Storage)?
Yes. Cartexa does not read order data directly — it only reads the WooCommerce cart session. HPOS compatibility is therefore unconditional. The plugin declares WooCommerce\Blocks\Compatibility headers for Block themes as well.
How do I export and import my settings?
Go to Cartexa → Tools tab in the admin. Click Export Settings to download a JSON file of all your settings. On another site, go to the same tab and upload the JSON file with Import Settings. The import validates the JSON before applying it — invalid files are rejected with an error message.
17 — Changelog

Changelog

v1.0.0
September 2026
Initial Release
AJAX Side Cart Drawer — slide in from right or left, with slide/fade/none animation
Floating Cart Button (FAB) — persistent corner button with live item count badge
Free Shipping Progress Bar — auto-reads WooCommerce free shipping rules, custom messages with {amount} placeholder
Trust Badges — 4 built-in badges + 2 custom text slots, configurable position
Stock Scarcity Messages — reads live WooCommerce stock, configurable threshold and {qty} template
Toast Notifications — add-to-cart confirmation with product thumbnail
Undo Remove — restore removed items from a temporary undo banner
Nav Menu Cart Icon — [cartexa_cart_icon] shortcode and WP_Widget
Settings Export / Import — JSON export/import from the Tools tab
Zero jQuery — vanilla ES6 throughout, under 40 KB minified
HPOS compatible — no direct order table reads
WPCS clean — 0 errors, 0 warnings under WordPress Coding Standard
Translation ready — .pot file included, text domain cartexa-smart-cart-for-woocommerce