December 21, 2020

Editing product data tabs on WooCommerce Product Page

You need to add the 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. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

Removing Tabs

Use the following snippet to remove specific tabs

Renaming Tabs

Use the following snippet to rename tabs.

Re-ordering Tabs

Use the following snippet to change the tab order

Customize a tab

Add a custom tab

Use the following snippet to add a custom global product tab

If you have custom field provided in your admin dashboard for your product, then the following code would be useful to achieve the required result.

The Additional Information tab

Please note that the “Additional Information” tab will only show if the product has weight, dimensions or attributes (with “Visible on the product page” checked). 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()

Related Post

How do I change the link of the Return to shop button WooCommerce?

WooCommerce default redirect on shop page when Cart is empty. The filter woocommerce_return_to_shop_redirect makes it easy to change Return to shop link. Code goes in function.php file of your active child theme (or active theme).

Only Allow 1 Product in the Cart WooCommerce

We can set add to cart limit on WooCommerce cart using woocommerce_add_to_cart_validation filter. Add below code on functions.php file to limit your WooCommerce Cart to just 1 product.

Add an Empty Cart button in WooCommerce

WooCommerce default not provide Empty Cart button but we can two simple steps to add Empty Cart button on cart page. The first one is to add below code in your functions.php file (this file is located in your theme folder): Second step is to add Empty Cart Button after Apply Coupon button. This code […]

How to disable all payment methods in WooCommerce

You will have the need to disable all payment gateways on the site, but just disabling them in WooCommerce > Settings > Payments will not work because then the customers will get an error message since there are no payment methods available. We’re going to be using a different method here. The way to go […]

How to Change “Return to Shop” Button text in WooCommerce

Change “Return to Shop” Button text in WooCommerce a WordPress plugin this is quit easy to change it using gettext filter. If you are not using shop or name it something like back to home or store. Code goes in function.php file of your active child theme (or active theme).

Display Total Product Sold Quantity to WooCommerce Page

Currently your customers have no idea how many quantity or downloads have been ordered from your WooCommerce site. So in order to apply this change, you can add below code into your child theme’s functions.php file. This snippet code show you how to display total product sold quantity WooCommerce page.

Leave a Reply

Your email address will not be published. Required fields are marked *