Site logo

Archived topic

product categories breadcumbs

4 replies · Started by Oscar on March 31, 2021

Viewing posts 1–5 of 5

Hi, I am working with WooCommerce and I have a problem that I would like to help me.

The breadcrumbs of product categories is not displayed in the product detail.

As you can see in the product: https://brightled-3d9351.ingress-daribow.easywp.com/product/arbotante-cabered-13w/

Currently this site I have disabled the add to cart option with the following snippet:

add_action( 'init', 'odao_catalog_mode_on' );

function odao_catalog_mode_on(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
}

How could I display breadcrumbs in the description of each product?

Thanks

Hi there,

I'm not exactly sure I fully understand what you're trying to do.

If you simply want to move the default breadcrumbs from their default place, first, you have to remove the breadcrumbs.

You do that by either disabling it on Appearance > Customize > Layout > WooCommerce and uncheck "Display breadcrumbs" as shown here: https://share.getcloudapp.com/7KuP24xD

It's actual code - https://github.com/tomusborne/gp-premium/blob/d14f71aff599a6a5941f03a8e082a70607d12092/woocommerce/functions/functions.php#L427

or we could go by the WooCommerce documentation which involves a bit of PHP snippet.
https://docs.woocommerce.com/document/customise-the-woocommerce-breadcrumb/#section-5

How could I display breadcrumbs in the description of each product?

Now we can hook woocommerce_breadcrumb in to where you want it.

Example:

add_action('woocommerce_short_description', 'woocommerce_breadcrumb',15);

I don't exactly know what the hooks are for the description of single product page, you should refer to WooCommerce documentation as this is outside of our scope of support.
https://woocommerce.github.io/code-reference/hooks/hooks.html

Hello Elvin, thanks for you response.

I think I misspoke by calling "breadcrumbs" what is actually the product meta data:
SKU: htr554yn
Category: Bracelets
Tags: tag1, tag2

For some reason, this information is not being displayed in each product description.

I tried to add it with woocommerce_product_meta_start hook but it doesn't show up.

Thanks

Hey Elvin!
Sorry, I noticed that I had unchecked the option to show "Display Product Meta Data".

I am marking the ticket as resolved.
Thank you very much for your help.
You are the best!

No problem. Glad you got it sorted out. :)

This archived topic is closed to new replies.