WP Manifestindependent plugin directory
manifest / ecommerce / add-to-cart-anywhere

Add to Cart Anywhere + Quantity Stepper

Adds a shortcode that renders WooCommerce add-to-cart forms anywhere, including variation forms and plus/minus quantity controls.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/reaganm02/add-to-cart-anywhere/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Add To Cart Anywhere provides a shortcode that renders WooCommerce add-to-cart forms outside the single product page. It supports variable products using WooCommerce's native variation form template and adds plus/minus buttons around the quantity input.

Features

  • Render add-to-cart forms anywhere via shortcode.
  • Variable product support using the same template as the product page.
  • Quantity stepper with min/max/step support.

Usage

Shortcode:

[atca_product id="123"]

Replace 123 with the WooCommerce product ID.

Installation (Composer Required)

This plugin uses Composer for autoloading. Install Composer and install dependencies before activating the plugin.

  1. Install Composer:

    • Windows: download and run the Composer-Setup executable from getcomposer.org.
    • macOS/Linux: follow the installer on getcomposer.org.
  2. Install dependencies without dev packages (recommended for production):

composer install --no-dev --optimize-autoloader --classmap-authoritative

This installs only production dependencies and generates an optimized class map so classes load correctly.

Internals

  • Main shortcode handler class: AddToCartAnywhereShortcode (previously ProductFrontend).
  • Template rendering uses WooCommerce templates:
    • single-product/add-to-cart/variable.php
    • single-product/add-to-cart/simple.php

Notes

  • This plugin relies on WooCommerce being active.
  • Quantity stepper behavior is powered by assets/js/plus-and-minus.js.