Using a woocommerce function in your wordpress child-theme?

admin

Administrator
Staff member
I am currently working on a e-commerce site using wordpress and woocommerce and the theme The Retailer.

The theme does not have breadcrumbs links and now I have decided that I want to add them. From my understanding Woocommerce should have support for this.

I will enable the breadcrumbs links on the
Code:
single-product.php
page. The woocommerce documentation says that I should use
Code:
<?php woo_breadcrumbs(); ?>
function to enable the breadcrumb links.

But when I add the
Code:
<?php woo_breadcrumbs(); ?>
statement to my
Code:
single-product.php
page I get a fatal error saying that the function is undefined. My questions is how to make my child-theme "recognise" this function?

If I use "brute force" method and copy all the original woocommerce breadcrumbs code (found in:
Code:
woocommerce/templates/global/breadcrumbs.php
) to my own function inside my themes
Code:
functions.php
the breadcrumbs are working, although I do not get the delimiters and other things that should come with them...

This is not an elegant solution. Instead there must be some way for me to "register" the woocommerce breadcrumbs function inside my theme so that I can use the standard recommended woocommerce prodcedure. How would I do this?

Thank you for your help! Kind regards, Lukas