Skip Navigation

[Resuelto] Trying to migrate from Layouts but can't create Products Archive

This support ticket is created hace 4 años, 8 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Etiquetado: 

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Nigel hace 4 años, 8 meses.

Asistido por: Nigel.

Autor
Mensajes
#1539545

Tell us what you are trying to do?
On several sites that have used Layouts and WooCommerce Views, I'd like to remove Layouts. To do that I need to replace the Shop Layout with an Archive but it appears I cannot use a Toolset WordPress Archive for the Shop if Layouts is installed. WooCommerce Views wants to use either a Toolset Layout or the theme's Shop template only. I cannot remove Layouts until I replace each of several Product, Product Category, and Custom Product Taxonomy Layouts so I can't change any of them because they won't work until I change all of them and remove Layouts.

A Toolset WordPress Archive for Products works fine on a test site that does not have Layouts installed so I know where I want to end up will work. I just can't get there without something being broken for a while along the way.

I could make all the changes on a staging site then replace the live site with the staging site but I'll lose orders and form entries if I do that.

Is there any documentation that you are following?
No. I could not find any relevant documentation.

Is there a similar example that we can see?
Any site with Layouts and WooCommerce Views with a Layout for the Products Archive. If you build a WordPress Archive for Products then remove the Product Archive Usage for the Layout, you'll get the default WooCommerce Shop page regardless of the WooCommerce Archive Template setting in the WooCommerce Views settings.

What is the link to your site?
enlace oculto
You won't see a problem here as I've had to re-enable the Layout in order for the site to work properly.

#1540099

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi Scott

The logic which imposes Layouts if it is active is in the custom archive-product.php template of WooCommerce Views (at plugins/woocommerce-views/templates/).

In your case it sounds like you need to edit that file so that you can prevent Layouts being forced.

The logic is fairly easy to follow, the key part is the test for Layouts (in several places) using function_exists( 'the_ddlayout' ) which you could replace with FALSE so that each of those tests fail.

Can you try that?

#1541085

Hi Nigel,

Thanks. I was hoping there was a non-code way around this but you pointing me the right direction. Does the archive template in WC Views apply only to the Shop / standard products archive or does it also affect archives for custom taxonomies on the product post type? The complexity here is that I need to migrate the shop, product categories & tags, product colors (a custom taxonomy),
and product shapes (also a custom taxonomy) and I can't break any of them while I migrate each.

My first pass at changing the archive-product.php template didn't do what I wanted but I'll keep working on it and shouldn't need any more help from you other than the answer to whether this template applies to custom product taxonomies?

#1542145

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

The template is used just for the product archive, i.e. the shop page.

If you look in the WC plugin folder you'll see templates for the likes of taxonomy-product_cat.php and taxonomy-product_tag.php which are used for the product category and tag archives.

If you have a custom taxonomy it will likely use the theme's generic archive.php.