Hi guys, im updating one of my sites to sage 10 (from 9) and one thing that worked before is not working anymore…
i was adding an action to include a blade template in some woocommerce hooks using the following code:
add_action( 'woocommerce_after_add_to_cart_form' , 'variations_list' , 8 );
add_action( 'woocommerce_product_thumbnails' , 'variations_list' , 8 );
function variations_list() {
return get_template_part('partials.variations_table');
}
and that totally worked in sage 9. the template was added in those 2 parts from my product. But now when i try to use the same code, it just returns an empty string
after reviewing some code in the forum i found that you could do something like
include template_path(locate_template ('resources/views/partials/variations_table.blade.php'));
but when i do that, i get this error.
Fatal error:
Uncaught Symfony\Component\Debug\Exception\FatalThrowableError:
Call to undefined function template_path()
Also if I namespace the file
namespace App;
the error changes to:
( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘variations_list’ not found or invalid function name
and returns nothing… also other functions on the same file fail with similar errors. please notice i’m not a hardcore developer and i’m just a guy who hacks around into sage’s code…
thanks for your help