Settings and texts
| Filter | Arguments | Purpose |
|---|
nbwt_settings | array $settings | The settings the templates use on this page. Change a value for one page, one role or one market without saving it. Applied again on wp, so conditional tags, the user and the WooCommerce customer are known. |
nbwt_text | array $texts, string $lang, string $group | All texts of a group, after edits and translations. |
nbwt_string_groups | array $groups | The text groups (prefer nbwt_register_texts()). |
nbwt_text_packs | array $packs | Built-in text files: language code => path of a PHP file that returns English text => translation. |
nbwt_group_labels | array $labels | Group titles on Text & translations. |
nbwt_setup_checklist | array[] $items | Items of the setup checklist. Each has label, ok, url and fix. |
nbwt_design_css | string $css | The inline design CSS. Append rules for your integration. |
Cart and mini cart
| Filter | Arguments | Purpose |
|---|
nbwt_cart_item_lock | array $lock, string $key, array $item | Whether an item can be removed (remove) or its quantity changed (qty), and whether it is a child item (child). |
nbwt_show_cart_item_price | bool $show, array $item, string $key, string $html | Show the unit price under an item. By default only with a crossed-out old price. |
nbwt_cart_savings | float $amount, WC_Cart $cart | The You save amount. Return 0 to hide the line. |
nbwt_free_shipping_min | float or null $min | The free-shipping minimum in the shopper’s currency. null hides the bar. |
nbwt_convert_limit | float $converted, float $amount, string $currency | A store-currency limit converted to the shopper’s currency. |
nbwt_recommended_products | WC_Product[] $products, string $where | The products You may also like shows (cart, minicart or empty). |
nbwt_low_stock_amount | int $low, WC_Product $product | The stock level at or under which “Only N left” shows. |
nbwt_gift_message_max | int $max | Gift message length (default 200). |
nbwt_gift_wrap_taxable | bool $taxable | Whether the gift wrap fee is taxable (default no). |
nbwt_wishlist_provider | string $provider | The wishlist plugin for Save for later. |
nbwt_wishlist_add | bool $added, int $product_id, string $provider | Add a product to a custom wishlist. |
nbwt_coupon_link_param | string $param | The link parameter that applies a coupon. Default coupon. |
nbwt_mini_cart_fragments | array $fragments | Extra parts to refresh with the mini cart: CSS selector => HTML. |
nbwt_mini_cart_open_on_add | bool $open | Whether the drawer opens after an AJAX add to cart. |
nbwt_allowed_origins | string[] $hosts | Hosts the storefront requests are accepted from. Add a host for a headless front end. |
Checkout
| Filter | Arguments | Purpose |
|---|
nbwt_show_checkout_login | bool $show | Show Sign in at checkout on this page. |
nbwt_show_checkout_coupon | bool $show | Show the checkout coupon box on this page. |
nbwt_country_top | string[] $codes | Countries pinned to the top of the country lists. |
nbwt_gulf_address_locale | array $locale | The Gulf address labels and rules. |
nbwt_spl_hourly_limit | int $max | Saudi short address lookups per hour. Default 500. |
nbwt_trust_icons | array $icons | Payment icon URLs by method key. |
nbwt_optin_after_account | bool $move | Whether newsletter checkboxes move after the account fields. |
nbwt_optin_providers | array $list | Plugins the newsletter checkbox adds contacts to. |
nbwt_wpsc_font_size | string $size | WP Smart Consent checkbox text size (default 15px). |
nbwt_is_funnel_page | bool $funnel | Whether this page belongs to a checkout funnel plugin. |
Thank-you page
| Filter | Arguments | Purpose |
|---|
nbwt_whatsapp_number | string $digits, WC_Order or null $order | The WhatsApp number for an order. |
nbwt_order_courses | array $courses, WC_Order $order | Courses the “Your courses” card links to. |
nbwt_order_memberships | array $list, WC_Order $order | Memberships the page shows. |
nbwt_membership_name | string $name, string $plugin, int $id | A membership’s name. |
nbwt_member_url | string $url | Where Go to your member area leads. |
Integrations and tracking
| Filter | Arguments | Purpose |
|---|
nbwt_partner_plugins | array $plugins | Third-party plugins listed on the Integrations tab, by group. |
nbwt_trackers | array $list | Tracking plugins that get cart events. |
nbwt_track_item | array $item, WC_Product $product | The item data sent with cart events. |
Examples
// Lock gift wrap items: no quantity change, no remove.
add_filter( 'nbwt_cart_item_lock', function ( $lock, $key, $item ) {
if ( ! empty( $item['acme_gift_wrap'] ) ) {
$lock['qty'] = false;
$lock['remove'] = false;
}
return $lock;
}, 10, 3 );
// Refresh a points badge in the header with the mini cart.
add_filter( 'nbwt_mini_cart_fragments', function ( $fragments ) {
$fragments['span.acme-points-badge'] = '<span class="acme-points-badge">' . (int) acme_cart_points() . '</span>';
return $fragments;
} );