I’m developing a theme with Sage 9 for a woocommerce-Shop. It’s my first Sage-Project, so I’m struggling with some stuff here. When using WooCommerce-Specific Functions in my IDE (VS Code with Intelephense) all these Woocommerce-specific functions and classes and so on are shown as undefined:
Undefined function 'App\wc_get_template_html'. intelephense(1010)
This for example comes from my setup.php where I want to run the wc_get_template_html
-function.
I already installed the Woocommerce Integration from sage (https://github.com/roots/sage-woocommerce) and was hoping that this provides me a namespace I could use inside my controllers and other files. But it doesn’t (Or does it?).
I also installed the WooCommerce Stubs from https://github.com/php-stubs/woocommerce-stubs and added it to the intelephense.environment.includePaths
like so:
"intelephense.environment.includePaths": [
"${workspaceFolder}/vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php"
]
But still: Showing undefined function.
Can anybody please point me into the correct direction to get my IDE recognise WooCommerce-Functions?