• 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 plugin main.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]

Viewing 1 replies (of 1 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    You can just place template in theme folder/woocommerce-cart_suggestion/ and it will be used instead template in plugin.

    Regards,
    Oleg

Viewing 1 replies (of 1 total)
  • The topic ‘Overriding template’ is closed to new replies.