Docs

Template actions

2 min readUpdated November 29, 2026

All are actions. Print markup or do nothing. Shopper text should come from nbwt_text(), so the site owner can edit and translate it.

Cart#

ActionArgumentsWhere
nbwt_cart_before_itemsnoneAbove the items card.
nbwt_cart_item_afterarray $item, string $keyUnder an item’s name and details.
nbwt_cart_after_itemsnoneUnder the items card, above the coupon row.
nbwt_cart_sidebar_beforenoneAbove the totals card.
nbwt_cart_sidebar_afternoneUnder the totals card.
nbwt_cart_empty_afternoneUnder the empty cart card.

Mini cart#

The drawer content is replaced after every cart change, so these run again each time.

ActionArgumentsWhere
nbwt_mini_cart_before_itemsnoneAbove the items (under the free-shipping bar).
nbwt_mini_cart_item_afterarray $item, string $keyUnder an item’s name and details.
nbwt_mini_cart_after_itemsnoneUnder the items.
nbwt_mini_cart_before_buttonsnoneAbove View cart and Checkout.

The drawer also fires WooCommerce’s own mini cart hooks (woocommerce_before_mini_cart, woocommerce_widget_shopping_cart_buttons, woocommerce_after_mini_cart and the others), without WooCommerce’s own subtotal and buttons, so payment plugins can add express buttons. The “Payment buttons in the mini cart” switch turns this off.

Checkout#

ActionArgumentsWhere
nbwt_checkout_header_beforenoneTop of the checkout header, where the distraction-free bar prints.
nbwt_checkout_header_afternoneUnder the checkout title and the sign-in box.
nbwt_checkout_before_paymentnoneAbove the payment methods, after the free-shipping bar and the coupon box. Printed once; WooCommerce’s checkout refresh doesn’t replace it.
nbwt_optin_subscribedstring $key, WC_Order $orderAfter the newsletter checkbox added the customer to a plugin.

Thank-you page#

ActionArgumentsWhere
nbwt_thankyou_after_heroWC_Order $orderUnder the order summary at the top.
nbwt_thankyou_main_beforeWC_Order $orderTop of the main column.
nbwt_thankyou_main_afterWC_Order $orderBottom of the main column.
nbwt_thankyou_side_beforeWC_Order $orderTop of the side column.
nbwt_thankyou_side_afterWC_Order $orderBottom of the side column.

Use <div class="wcty__card"> for a card that matches the page.

WooCommerce’s own hooks#

The templates also fire WooCommerce’s standard hooks and filters, so code written for WooCommerce’s templates keeps working:

  • Quantity rules: woocommerce_quantity_input_args for the cart and mini cart pickers, and woocommerce_update_cart_validation before the mini cart saves a change.
  • Prices: woocommerce_cart_item_price (shown only with a crossed-out price, see nbwt_show_cart_item_price), woocommerce_cart_item_subtotal.
  • Cart: woocommerce_before_cart, woocommerce_cart_collaterals, woocommerce_cart_totals_after_order_total, woocommerce_proceed_to_checkout, woocommerce_cart_item_name, woocommerce_after_cart_item_name, woocommerce_cart_item_quantity, woocommerce_cart_item_remove_link, woocommerce_cart_item_class.
  • Mini cart: woocommerce_widget_cart_item_visible, woocommerce_mini_cart_item_class, woocommerce_cart_item_permalink.
  • Thank-you: woocommerce_before_thankyou, woocommerce_order_details_before_order_table, woocommerce_thankyou, woocommerce_thankyou_order_received_text, woocommerce_order_item_visible, woocommerce_order_item_meta_start and _end, woocommerce_order_details_after_order_table.