NO BUG: A Potential Overwriting of Custom PHP Templates

Hi,

I created a new endpoint for WooCommerce and have a template for it. There’s a .PHP file saved in > /wp-content/themes/bricks/woocommerce

When a new Bricks version is available and the theme is updated, won’t the file be overwritten? i.e be removed as it wasn’t known to be there by Bricks Builder theme.

I feel it’s a potential issue.

Not with Bricks support, but you should be saving PHP templates into a child theme, which will only ever be overwritten by you.

Hey,
The child theme folder has nowhere to upload custom WooCommerce PHP files.

I’m not super familiar with woocommerce, but I believe all you need to do is create a woocommerce folder in the child theme and add your php files there.

You should never overwrite any plugin or theme directly with your own code modifications, because they will be lost every time you update.

1 Like

As per @blakmarkitcreative explained, you should create a woocommerce folder inside the child theme.

Reference: Template structure & Overriding templates via a theme Documentation - WooCommerce

Example: To override the admin order notification, copy:
wp-content/plugins/woocommerce/templates/emails/admin-new-order.php to wp-content/themes/your-child-theme/woocommerce/emails/admin-new-order.php

Regards,
Jenn

1 Like

How can I override this into my child theme?

wp-content\themes\bricks\woocommerce\checkout\form-checkout.php

@abey

Duplicate that file and place it in
wp-content/themes/your-child-theme/woocommerce/checkout/

Regards,
Jenn