Matthewowo
Matthewowo

Reputation: 23

Should I make woocommerce template via action hooks or edit directly?

I'm learning WooCommerce Theme development. I have a question about making template.

For example, I'm making "archive-product.php". Should I edit some HTML code to this file to design layout? Or should I use action hooks to design? Which is better?

I have copied this file to "mytheme/woocommerce" folder.

Upvotes: 0

Views: 349

Answers (1)

CK MacLeod
CK MacLeod

Reputation: 1042

Working with custom template files was, in my experience, more typical years ago than today, the exception being when you're radically re-designing them. Working with hooks and filters instead will generally be more flexible and maintainable across WC, WC add-on, and theme changes and updates, and, if properly organized, the functions will be easier to switch on and off during debugging, or to remove at whatever point.

Upvotes: 0

Related Questions