• Resolved gwenauger

    (@gwenauger)


    Hi, I’m developing a inline shop with woocommerce and wordpress and I still have that error :
    Fatal error : Uncaught Error: Call to a member function get_id() on string in /Users/gwenauger/Desktop/SLAM5/print/wp-content/themes/blank/blocs/productsingle/productsingle.php:7 Stack trace: #0 /Users/gwenauger/Desktop/SLAM5/print/wp-content/themes/blank/woocommerce/single-product.php(13): include_once() #1 /Users/gwenauger/Desktop/SLAM5/print/wp-includes/template-loader.php(106): include(‘/Users/gwenauge…’) #2 /Users/gwenauger/Desktop/SLAM5/print/wp-blog-header.php(19): require_once(‘/Users/gwenauge…’) #3 /Users/gwenauger/Desktop/SLAM5/print/index.php(17): require(‘/Users/gwenauge…’) #4 {main} thrown in on line 7

    This is what create the error

    global $product;
    $id = $product->get_id();

    I’m a french student and it’s my first using of woocommerce I’m in local this why I didn’t give you a link.
    Have a nice day.
    From a young french

    • This topic was modified 4 years ago by gwenauger.
Viewing 2 replies - 1 through 2 (of 2 total)
  • laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Hi there,

    Thanks for reaching out!

    This would require more complex development. I’ll go ahead and leave this thread open for a while in case anyone else wants to chime in, but in the meantime, I can also recommend the following resources for more development-oriented questions:

    – WooCommerce Slack Community: https://woocommerce.com/community-slack/
    – Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    laceyrod

    (@laceyrod)

    Automattic Happiness Engineer

    Hi there,

    Since this thread has been inactive for a bit, I’m going to mark it as Resolved now for the overall health of the forums. Please check out the resources we listed above for additional assistance, or you can look into hiring developer-level help here: https://woocommerce.com/customizations/

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t get product id with $Id -> $product->get_id()’ is closed to new replies.