Templates problem by design

Some default Wordpress or Woo templates can be created only once, and they can’t be deleted (only reset). E.g. once “Product Search” or “Product Catalog” templates are added, then the same type template can’t be added again. There’s no such selection anymore.

But the problem is here. This button.

image

Duplicate Template button allows duplicating such unique templates, and then WP may start to act unpredictable. E.g. visibility conditions may be ignored for primary and copy templates. Sometimes content of copy template may just gone etc. In short, it looks like there is a reason from the WP team side why some default templates can’t be created twice.

Solution. “Duplicate” button should be disabled for such types of templates, or when duplicate is made, copy should be completely converted to custom template type.

image

Hi @Audrius,

Thank you for bringing this to our attention!

I can confirm errors appear when duplicating default templates.
Please bear with us while we find a fix for this.

Sorry for the inconvenience.

This is the case on my end.
Could you possibly confirm if this is happening with every default template type or specific ones, so I may try to reproduce this on my side?
Thank you in advance.

Duplicating Product search results template is not creating custom template. In example below both templates are “default”, not custom.

What I have found more, if I’m resetting the copy of default template then copy is deleted, and only main default template is kept. It’s a quick solution to fix the default templates copy mess.

I can confirm this happens with default templates provided by WooCommerce, and not WordPress.

Please bear with us while we find a fix for this.

Hello @Audrius,

Thanks for bringing this one up.
WooCommerce template duplication should be fixed in 1.2.9.6.

If you still encounter trouble on your side, I’d be grateful if you could let me know so we can check it out further.

Thanks in advance.

1 Like