• Resolved bwph

    (@bwph)


    Dear Support-Team,

    by default, you can overwrite templates via placing them inside your theme. Is this possible through a custom plugin as well, e.g. by using a hook to set the folder for template overwrites?

    The case: We are developing a site with Oxygen Builder, which does not load themes as usual and all custom functionality will be put in a separate plugin. Now we were wondering if and how we could place our custom templates in our functionality plugin.

    Thanks in advance – your assistance is greatly appreciated!
    Kind Regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @bwph

    The function wc_braintree_get_template that is called for all Braintree plugin tempaltes is just a wrapper for the WooCommerce function wc_get_template.

    The wc_get_template function has a filter of the same name that can be used to provide a custom location for the Braintree plugin’s templates.

    That filter is located in the woocommerce/includes/wc-core-functions.php file.

    Kind Regards,

    Thread Starter bwph

    (@bwph)

    Hi @mrclayton,

    thank you for your quick answer!

    We have set a custom template location for Woocommerce by adding a filter to woocommerce_locate_template() which is called in wc_get_template(), so it should be as easy as adding the plugin’s templates next to the already existing Woocommerce templates inside our functionality plugin.

    Kind Regards!

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @bwph

    Yep, that should work nicely.

    If you have a moment we always appreciate a good review.

    https://wordpress.org/support/plugin/woo-payment-gateway/reviews/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Template overwrites via custom plugin?’ is closed to new replies.