Posted on

Customize the WooCommerce breadcrumb

Change the ‘Home’ text

For the Storefront theme, you need to increase the priority of execution:

add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_home_text', 20 );

Change the breadcrumb separator

For the Storefront theme, you need to increase the priority of execution:

add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_delimiter', 20 );

Change all the things

For the Storefront theme, you need to increase the priority of execution:

add_filter( 'woocommerce_breadcrumb_defaults', 'jk_woocommerce_breadcrumbs', 20 );

Change the home link to a different URL

Remove the breadcrumbs

Most themes can use this:

For the Storefront theme, use this:

If you prefer using CSS code to hide the breadcrumbs, then use this:

.woocommerce-breadcrumb {
visibility:hidden;
}

Using a Woo theme 

If you’re using a Woo theme, the breadcrumbs are already removed and replaced with the WooFramework breadcrumb function.

To remove the breadcrumbs in a WooTheme, the following must be added. Be aware that this removes breadcrumbs site-wide, not only on WooCommerce pages:

If you want to remove breadcrumbs on WooCommerce pages when using a Woo theme, use:

Read more about the WooFramework breadcrumb function at WooCommerce Breadcrumb.

Posted on

Add a surcharge to cart and checkout – uses fees API

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

Add a percentage based surcharge to all transactions 

Add a standard $ value surcharge to all transactions

Add a surcharge based on the delivery country

Posted on

Automatically Complete Orders

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

You could also change the “Completed” status to be another order status, like “Processing”

Posted on

Editing product data tabs

Removing Tabs

Use the following snippet to remove specific tabs

Renaming Tabs 

Use the following snippet to rename tabs.

Customize a tab 

The following snippet will replace the description tab with a custom function

Add a custom tab 

Use the following snippet to add a custom global product tab

The Additional Information tab 

Please note that the “Additional Information” tab will only show if the product has weight, dimensions or attributes (not used for variation for variable products). If you try to apply a change to that tab and if the product does not have weight, dimensions or attribute, you will get an error message similar to :

Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /mysite/wp-content/plugins/woocommerce/templates/single-product/tabs/tabs.php on line 35

In that case, you have to use WooCommerce conditional tags:

  • has_attributes()
  • has_dimensions()
  • has_weight()