Child theme & developer hooks

Never edit the theme or companion plugin files directly; updates replace them. Put custom CSS and PHP in a child theme. Create the folder wp-content/themes/broodweb-commerce-child/ with these two files, then activate Broodweb Commerce Child:

/* style.css */
/*
Theme Name: Broodweb Commerce Child
Template: broodweb-commerce
Version: 1.0.0
*/
<?php
// functions.php
add_action( 'wp_enqueue_scripts', function () {
    wp_enqueue_style( 'broodweb-commerce-child', get_stylesheet_uri(), array( 'broodweb-commerce-main' ), '1.0.0' );
}, 30 );

Theme Options, Elementor templates and your license are stored in the database, so they carry over when you switch to the child theme.

Hooks

Hook Type Purpose
broodweb_commerce_content_width filter Content width for embeds (default 800).
broodweb_commerce_option_defaults filter Default values for Theme Options.
broodweb_commerce_sanitized_options filter Validate your own option fields on save (receives options and raw input).
broodweb_commerce_options_tabs filter Add Theme Options tabs (slug => label).
broodweb_commerce_options_tab_{slug} action Render the content of your custom tab.
broodweb_commerce_options_updated action Runs after Theme Options change; use it to clear your page cache.
bwce_invoice_template filter Return the path of your own invoice template (receives the template path and the order). Invoice numbers are stored in the order meta _bwce_invoice_number.
broodweb_commerce_elementor_location filter Render your own markup for a theme location (header, footer, single, archive) and return true to replace the native output.

CSS custom properties such as --bwc-container en --bwc-accent are available for your child-theme styles.

Was this article helpful to you?

Nieuwsbrief

Blijf op de hoogte

Ontvang meldingen over nieuwe plugins, updates en exclusieve tutorials.

Geen spam ooit. U kunt zich op elk moment uitschrijven.