Where can I find a single item template

The WC single item template is located at: yoursite.com/wp-content/plugins/woocommerce/templates/single-product.php See this documentation: https://docs.woocommerce.com/document/template-structure/ So, you would want to move any of those templates to your child theme under /wp-content/themes/your-child-theme/woocommerce/[any_template_you_want] So, for example, if you wanted to edit the single-product.php but safe from WC updates, you would put the file in this directory and do your … Read more

Issue adding text after short description on product pages Woocommerce [closed]

The Correct syntax for writing a add_filter // Define the woocommerce_short_description callback function filter_woocommerce_short_description( $post_excerpt ) { // make filter magic happen here… return $post_excerpt; }; // add the filter add_filter( ‘woocommerce_short_description’,filter_woocommerce_short_description’,10, 1 ); Your code didn’t work well because the reason is that filter are used to modify the output. Here is the function … Read more

Remove word “Category” from WooCommerce product page [closed]

This will definitely remove the word “category”. Add this code in functions.php.As you already know woocommerce_template_single_meta is the hook responsible for meta information of the single-product. File is present in /woocommerce/templates/single-product/meta.php. Either you can use the following code to edit the HTML of meta.php or you can copy the file meta.php to themes/your-theme/woocommerce/single-product/meta.php. Then edit … Read more

Custom URL for each product variation – rewrite rules

Ok, for anyone looking for this, here’s a complete plugin that I came up with, that solves the issue: <?php /* Plugin Name: WooCommerce Variations URL Description: Adds support for variation-specific URL’s for WooCommerce product variations Author: Václav Greif Version: 1.0 Author URI: https://wp-programator.cz */ namespace WCVariationsUrl; final class Init { /** * Call this … Read more

WooCommerce showing star rating review instead of text review string

Suffered with same problem. Finally after lot of search and trial I came up with this solution. This gets the template where the rating is displayed from. But it displays like this: Rated 4.50 out of 5 based on 2 customer ratings (2 customer reviews) <div class=”rating-custom”> <?php wc_get_template( ‘single-product/rating.php’ ); ?> </div> Then paste … Read more

Create a Custom menu item fetched by Product Categories and Sub Categories

You could use the wp_get_nav_menu_items filter add_filter(‘wp_get_nav_menu_items’, ‘prefix_add_categories_to_menu’, 10, 3); Then you could do something like this: function prefix_add_categories_to_menu($items, $menu, $args) { // Make sure we only run the code on the applicable menu if($menu->slug !== ‘replace_this’ || is_admin()) return $items; // Get all the product categories $categories = get_categories(array( ‘taxonomy’ => ‘product_cat’, ‘orderby’ => … Read more