• I’m developing a site locally using Wamp.

    When creating a Category I enter Name, Slug, Description and Image, choosing “Standard” as display type.

    When clicking “Add New Category” a message in Red appears at the top of the screen saying “Undefined”.

    The new category doesn’t appear until I navigate away from the page and click to view it again.

    I’ve looked around online and found this snippet of code which I added to the functions.php in my child theme –

    function woocommerceCategorySlug( $id ){
        $term = get_term_by('id', $id, 'product_cat', 'ARRAY_A');
        return $term['slug'];       
    }

    It hasn’t had any impact though, and I continue to get the “Undefined” message each time I create a category.

    Can anyone advise on this please? I’m running the latest version of WordPress 4.7.5 and latest version of WooCommerce 3.0.7

    • This topic was modified 7 years, 6 months ago by magicalwonders. Reason: Added info
Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter magicalwonders

    (@magicalwonders)

    I’ve heard back from my software vendor and this is what they’ve had to say –

    “There was some formatting issue with functions.php file of the theme, there should not be unnecessary blank spaces or blank lines in the file. Your theme’s function.php file should be properly formatted”

    Maybe that might be of help, or something to look at.

    petebm

    (@petebm)

    I can confirm the ‘blank lines’ part of @magicalwonder’s post above. I had a functions.php in a child theme in which I’d put blank lines to separate the parts I’d added. Took them out & the ‘undefined’ error went away.

    Thanks for sharing

    I had the same problem and found out that I added this to my functions:

    add_action( 'after_setup_theme', 'woocommerce_support' );

    After deleting the action all was ok

    I had the same issue.

    De-activated WooCommerce plugin then re-enabled. Cleaned it up

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Undefined message when creating Category’ is closed to new replies.