Skip to content

Free Shipping Bar and Sticky Add to Cart Blocks for WooCommerce Block Themes

• By Jasper Frumau WooCommerce

Two small features turn up on many WooCommerce stores: a bar that shows shoppers how far they are from free shipping, and an add to cart button that stays in reach on a long product page. Both aim to help a shopper finish the purchase. Both are usually bolted on with separate plugins, and they can clash with a block theme or disappear when you change themes. So we built them as blocks in Aludra, our block library plugin, for Winespring and any other full-site-editing WooCommerce theme.

Aludra 2.39.0 adds the Free Shipping Progress and Sticky Add to Cart blocks, the first WooCommerce-specific blocks in the plugin. Winespring, our lean WooCommerce block theme, places them in its templates, and because the code lives in the plugin, a client who switches themes keeps them. This post covers what each block does, how to place it, and one setup step that catches people out. You can see both on the Winespring demo store.

Quick Summary: Aludra 2.39.0 adds two WooCommerce blocks for block themes. Free Shipping Progress shows how far the cart is from free shipping and updates as items change. Sticky Add to Cart shows a bar with the product name, price and a button once the add to cart form scrolls out of view. Winespring places both in its templates, and any full-site-editing WooCommerce theme can do the same, because the code lives in the plugin. The progress bar needs a free shipping method with a minimum order amount, or it renders nothing.

In This Guide

Why Store Blocks Live in a Plugin, Not the Theme

Winespring started as a copy of Aviendha, our minimal FSE starter, and kept its rule: a small, curated set of patterns, not a library. Reusable logic belongs in Aludra’s aludra/* blocks. That keeps the theme thin, keeps it clean for the WordPress.org theme review, and means a client who changes theme later keeps the features.

Winespring is the theme: design tokens in theme.json, WooCommerce block templates for the single product and the shop, three style variations (Twilight, Store and Skincare) and five page patterns. It is built for client store work and you can click through it on the live demo. Aludra is the plugin: a block library with a mega menu, carousel, FAQ tabs, hero and stat blocks and, since 2.39.0, the store blocks below. Both are open source on GitHub (winespring, aludra).

The two store blocks follow the same split. The theme decides where they go. The plugin decides what they do. Both blocks are skipped at registration when WooCommerce is not active, so Aludra on a non-shop site is unaffected.

The Free Shipping Progress Bar

Shoppers who see “You are $12 away from free shipping” often add one more item. That nudge is a staple of good stores, and it is easy to build badly with a cached HTML snippet that goes stale. Aludra’s Free Shipping Progress block renders on the server, then keeps itself current from the WooCommerce Store API as items are added or removed. No page reload needed.

  • Empty cart: “Free shipping on orders over $75.00”
  • Part-way: “You are $X away from free shipping”, with a filling progress bar
  • Reached: “You have unlocked free shipping”

In Winespring it sits in the announcement bar template part, under the static “Free returns within 30 days” line, so it shows on every page of the store without anyone adding it page by page.

For the developers: where the threshold comes from

The block does not ask you to type a number. By default it reads the lowest minimum order amount on an enabled free shipping method in the customer’s shipping zone, so the bar and the real shipping rules cannot drift apart. You can override it per block with the threshold attribute, or globally with a filter. Return 0 from the filter to hide the bar.

<!-- In the template part -->
<!-- wp:aludra/free-shipping-bar /-->

<!-- Or pin a value on one block -->
<!-- wp:aludra/free-shipping-bar {"threshold":100} /-->

// Or filter it in PHP
add_filter( 'aludra_free_shipping_threshold', function ( $threshold ) {
	return 100.0; // 0 hides the bar.
} );

The Sticky Add to Cart Bar

On a long product page the add to cart button scrolls away while the shopper reads reviews and details. The Sticky Add to Cart block adds a bar with the product name, price and a button that appears once the main form has left the viewport.

One design choice is worth noting: the button scrolls the shopper back up to the form instead of adding to cart directly. That way quantity and variation choices (size, colour) are never skipped. It also renders nothing for products that cannot be bought, such as out-of-stock items, so a shopper never sees a button that fails.

To place it yourself in the editor instead of code: open Appearance > Editor > Templates > Single Product, click the + inserter, search for “Sticky Add to Cart” (it sits in Aludra’s Convert category), add it at the bottom of the template and press Save. Winespring already includes it, so this is only needed on another theme.

For the developers: placing it in the single product template

It is one self-closing block, placed once in templates/single-product.html. It takes the product from the template’s post context, so the same line works for simple and variable products.

<!-- wp:aludra/sticky-add-to-cart /-->

Setup: What Each Block Needs

Both blocks need a little store setup, so keep this checklist in mind:

  • Free Shipping Progress needs a threshold. Add an enabled Free shipping method with a minimum order amount to the customer’s shipping zone under WooCommerce > Settings > Shipping. Without one, the block renders nothing, which is what happened on our demo store at first. You can also set the threshold on the block itself or with the aludra_free_shipping_threshold filter.
  • Zones need their own minimums. If you ship to several zones, set the minimum on each zone’s free shipping method so every customer sees their own threshold. Our guide to WooCommerce shipping zones for EU stores covers the zone setup.
  • Sticky Add to Cart goes in the single product template. Place it once under Appearance > Editor > Templates > Single Product. Winespring already includes it. It renders nothing for products that cannot be bought.

What I Have Not Verified

I have confirmed that both blocks render on the live Winespring demo and that the free shipping bar shows the right empty-cart message. I have not yet measured their effect on average order value or conversion, so this post makes no claim about uplift. Test the sticky bar on your own theme and product types before relying on it, and check the cart-update behaviour of the progress bar with a real product added.

Frequently Asked Questions

  • Does Winespring need Aludra? No. Winespring is a plain block theme that works with core blocks and WooCommerce on its own. The store blocks and the Store Home pattern need the Aludra plugin, which is recommended but not required.
  • Why does the free shipping bar not show on my store? The Free Shipping Progress block renders nothing when no threshold is set. By default the threshold comes from an enabled free shipping method with a minimum order amount in the customer’s shipping zone. Add that method, or set the threshold on the block.
  • Can I set the free shipping threshold without a shipping method? Yes. Set the threshold attribute on the block, or return a value from the aludra_free_shipping_threshold filter. Returning 0 hides the bar.
  • Does the sticky add to cart button add the product directly? No. It scrolls the shopper back to the add to cart form so quantity and variation choices are not skipped.
  • Do the blocks work without WooCommerce? No. Both blocks are skipped at registration when WooCommerce is not active, so they never appear on a non-shop site.

Need a WooCommerce Developer for Your Store?

We build and optimize WooCommerce stores for SMEs, from block theme builds and custom checkout flows to performance tuning and ongoing maintenance. Fixed-price quotes available.

  • WooCommerce block theme builds and store templates
  • Cart, shipping and product-page conversion work
  • WooCommerce performance and speed optimization
  • Ongoing store maintenance and support

Leave a Reply

Your email address will not be published.