WooCommerce · Elementor

WC Add To Cart Button widget for Elementor

A standalone add-to-cart button for a chosen product ID.

Open live demo

Get King Addons

This page describes the PHP/JS for this widget — not a renamed stub. Install the free plugin from WordPress.org.

Get King Addons

What it actually does

A standalone add-to-cart button for a chosen product ID.

Woo Shortcode Add To Cart widget. Renders an add-to-cart button using [add_to_cart] shortcode.

Output depends on WooCommerce objects (products, cart, or account). Empty without WooCommerce data.

How to add it in Elementor

  1. Install King Addons. Install Elementor and King Addons. Get King Addons from WordPress.org.
  2. Edit with Elementor. Open a page and click Edit with Elementor.
  3. Insert the widget. Search the panel for “WC Add To Cart Button”. Typing “king” lists every King Addons widget.
  4. Set inspector controls from this widget’s PHP. Configure “Product Source”, “Product ID”, “Product SKU”, “Show Price”. Style and Content tabs are listed on this page.

When to use it

Tip: After King Addons is active, type king in the Elementor search box to list every widget, including WC Add To Cart Button.

Inspector controls from this widget’s PHP

ControlWhat the code does
Product Selection — Product SourceThe chosen value is read in render() and applied on the front end. Options: Current Product (Dynamic); Specific Product ID; Specific Product SKU.
Product Selection — Product IDEnter the numeric ID of the product.
Product Selection — Product SKUEnter the SKU of the product.
Display Settings — Show PriceSwitcher inspector control (`show_price`).
Display Settings — Default QuantityNumeric value used in this widget’s render/JS (default 1, min 1).
Display Settings — Additional CSS ClassAdd custom CSS class to the button wrapper.
Container — Background ColorWrites CSS `background-color` onto the widget’s front-end markup.
Container — PaddingWrites CSS `padding` onto the widget’s front-end markup.
Container — BorderElementor border group: type, width, color, and radius when the group includes it. Selector: `{{WRAPPER}} .product`.
Container — Border RadiusWrites CSS `border-radius` onto the widget’s front-end markup.
Price — ColorWrites CSS `color` onto the widget’s front-end markup.
Price — TypographyElementor typography group: family, size, weight, transform, style, decoration, line-height, letter-spacing. Selector: `{{WRAPPER}} .product .price, {{WRAPPER}} .product .woocommerce-Price-amount`.
Price — SpacingWrites CSS `margin-right` onto the widget’s front-end markup.
Add to Cart Button (Normal) — Text ColorWrites CSS `color` onto the widget’s front-end markup.
Add to Cart Button (Normal) — Background ColorWrites CSS `background-color` onto the widget’s front-end markup.
Add to Cart Button (Hover) — Text ColorWrites CSS (button, color) onto the widget’s front-end markup.
Add to Cart Button (Hover) — Background ColorWrites CSS (button, background-color) onto the widget’s front-end markup.
Add to Cart Button — TypographyElementor typography group: family, size, weight, transform, style, decoration, line-height, letter-spacing. Selector: `{{WRAPPER}} .product a.add_to_cart_button, {{WRAPPER}} .product a.button`.
Add to Cart Button — PaddingWrites CSS `padding` onto the widget’s front-end markup.
Add to Cart Button — Border RadiusWrites CSS `border-radius` onto the widget’s front-end markup.
Add to Cart Button — Box ShadowElementor box-shadow group for the selector. Selector: `{{WRAPPER}} .product a.add_to_cart_button, {{WRAPPER}} .product a.button`.
Add to Cart Button — BorderElementor border group: type, width, color, and radius when the group includes it. Selector: `{{WRAPPER}} .product a.add_to_cart_button, {{WRAPPER}} .product a.button`.
Add to Cart Button — MarginWrites CSS `margin` onto the widget’s front-end markup.
Add to Cart Button — Full WidthSwitcher inspector control (`button_full_width`).

Content and Style tabs from this widget’s PHP, including repeater fields and group controls (typography, background, border, shadow). Elementor’s Advanced tab is core Elementor and is not listed here.

FAQ

Which WC Add To Cart Button options need King Addons Pro?

Controls marked with the Pro icon in this widget’s PHP. King Addons Pro is a separate license from Elementor Pro.

Does WC Add To Cart Button require WooCommerce?

Yes. Install WooCommerce and add products (or complete a cart) before this widget has anything to show.

Do I need Elementor Pro?

No. King Addons runs on free Elementor. Some King Addons options (for example template-in-accordion, extra popup conditions, parts of the template catalog) need King Addons Pro — not Elementor Pro.

Related woocommerce widgets

Get King Addons

One free plugin. 80+ Elementor widgets, 650+ templates, and 4,000+ sections. Search for WC Add To Cart Button after you activate it.

Get King Addons