Template actions
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#
| Action | Arguments | Where |
|---|---|---|
nbwt_cart_before_items | none | Above the items card. |
nbwt_cart_item_after | array $item, string $key | Under an item’s name and details. |
nbwt_cart_after_items | none | Under the items card, above the coupon row. |
nbwt_cart_sidebar_before | none | Above the totals card. |
nbwt_cart_sidebar_after | none | Under the totals card. |
nbwt_cart_empty_after | none | Under the empty cart card. |
Mini cart#
The drawer content is replaced after every cart change, so these run again each time.
| Action | Arguments | Where |
|---|---|---|
nbwt_mini_cart_before_items | none | Above the items (under the free-shipping bar). |
nbwt_mini_cart_item_after | array $item, string $key | Under an item’s name and details. |
nbwt_mini_cart_after_items | none | Under the items. |
nbwt_mini_cart_before_buttons | none | Above 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#
| Action | Arguments | Where |
|---|---|---|
nbwt_checkout_header_before | none | Top of the checkout header, where the distraction-free bar prints. |
nbwt_checkout_header_after | none | Under the checkout title and the sign-in box. |
nbwt_checkout_before_payment | none | Above the payment methods, after the free-shipping bar and the coupon box. Printed once; WooCommerce’s checkout refresh doesn’t replace it. |
nbwt_optin_subscribed | string $key, WC_Order $order | After the newsletter checkbox added the customer to a plugin. |
Thank-you page#
| Action | Arguments | Where |
|---|---|---|
nbwt_thankyou_after_hero | WC_Order $order | Under the order summary at the top. |
nbwt_thankyou_main_before | WC_Order $order | Top of the main column. |
nbwt_thankyou_main_after | WC_Order $order | Bottom of the main column. |
nbwt_thankyou_side_before | WC_Order $order | Top of the side column. |
nbwt_thankyou_side_after | WC_Order $order | Bottom 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_argsfor the cart and mini cart pickers, andwoocommerce_update_cart_validationbefore the mini cart saves a change. - Prices:
woocommerce_cart_item_price(shown only with a crossed-out price, seenbwt_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_startand_end,woocommerce_order_details_after_order_table.