• Resolved ace0930

    (@ace0930)


    The instruction to replace the template like cart.php is to create a duplicate in the theme directory like /wp-content/themes/yourtheme/woocommerce/cart/cart.php.

    But my question is, can I make it in a plugin instead of a theme like:
    /wp-content/plugins/yourplugin/woocommerce/cart/cart.php

    Will this work? If yes, is it a good practice or it’s not recommended?

Viewing 1 replies (of 1 total)
  • Saif

    (@babylon1999)

    Hello @ace0930,

    Will this work? If yes, is it a good practice or it’s not recommended?

    It’s possible but NOT recommended as your progress will be lost when WooCommerce is updated. It can also introduce unnecessary problems.

    You should always make changes to your child’s theme. To learn more about overriding templates, you can check the following guide: https://woocommerce.com/document/template-structure/

    Hope this helps!

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