Can’t get product id with $Id -> $product->get_id()
-
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 7This 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
- The topic ‘Can’t get product id with $Id -> $product->get_id()’ is closed to new replies.