Skip to main content
BoxBuilder uses a single frontend template file to render the box builder UI on product pages. You can customize the builder’s output using hooks, CSS, or by modifying the template directly in child themes.

Frontend Template

The builder UI is rendered from a single template file:
boxbuilder-pro/templates/boxbuilder-frontend.php
This template handles the complete builder interface including:
  • Product grid / list layout
  • Box summary panel
  • Progress indicators
  • Gift message field
  • Add to Cart button
  • Size selector (Pro)

Template Variables

The following variables are available inside the template:
VariableTypeDescription
$box_idintThe WooCommerce product ID for the box
$configarrayThe box configuration array (capacity, pricing model, product source, etc.)
$css_varsstringCSS custom properties for theming (primary color, success color, etc.)
The template also reads global plugin options:
Option KeyDescription
boxbuilder_mobile_layoutMobile layout mode (stacked or tabbed)
boxbuilder_mobile_summary_positionSummary position on mobile
boxbuilder_mobile_sticky_cartWhether sticky cart button is enabled
boxbuilder_summary_display_modeSummary panel display mode
boxbuilder_summary_show_thumbnailsShow thumbnails in summary
boxbuilder_summary_show_pricesShow prices in summary
boxbuilder_progress_styleProgress indicator style
boxbuilder_add_modeAdd to box interaction mode
boxbuilder_qty_controls_displayQuantity controls display behavior

Customizing with Hooks

The recommended way to add content before or after the builder is with hooks:
// Add content before the product grid
add_action( 'boxbuilder/before_product_grid', function( $box_id, $config ) {
    echo '<div class="my-custom-banner">Build your perfect gift!</div>';
}, 10, 2 );

// Add content after the add to cart button
add_action( 'boxbuilder/after_add_to_cart_button', function( $box_id ) {
    echo '<p class="my-custom-note">Free shipping on all boxes!</p>';
}, 10, 1 );

Customizing with CSS

For visual changes, use the Appearance settings or add custom CSS. All BoxBuilder elements are namespaced under .boxbuilder-wrap with .boxbuilder- prefixed class names.
/* Example: customize product cards */
.boxbuilder-wrap .boxbuilder-product-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
}

Customizing with JavaScript

BoxBuilder’s frontend is a Vue.js application. You can interact with it via the localized boxbuilderData object:
// Available data from wp_localize_script
console.log( boxbuilderData.ajaxUrl );  // AJAX endpoint
console.log( boxbuilderData.nonce );    // Security nonce
console.log( boxbuilderData.i18n );     // Translatable strings
Modifying the Vue.js application directly is not recommended as it may break with plugin updates. Use hooks and CSS for customizations whenever possible.