Overriding template
-
Hello!
We really like your plugin but have a question about overriding templates.
We tried to use the filter
cart_suggestion_get_template_part
to hardcode a template that points to our theme, something like:add_filter( 'cart_suggestion_get_template_part', 'pickup_suggestion_template', 10, 2 );
function pickup_suggestion_template( $template_part, $name ) {
return get_template_directory() . '/woocommerce-cart_suggestion/widget.php';
}Then we copied the
widget.php
from the plugin to our theme at the proper place but then widget.php is not really a template… we tried to copy/call a similar function (print_products
) instead of$BeRocket_cart_suggestion->print_products($products, $type, $add_to_cart, $additional);
but it still output the content from the pluginmain.php
file.Our biggest issue is translating the “Suggestions Title” of the widget that we seem unable to do from the admin.
Any help is appreciated, thank you!
The page I need help with: [log in to see the link]
- The topic ‘Overriding template’ is closed to new replies.