Skip Navigation

[Resuelto] New Woo Commerce Blocks and issues with some template and views configurations

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: It seems that Toolset's Content Templates are interfering with the templates I want to display on Product single posts.

Solution: Unassign all Toolset Content Templates from Product posts if you do not want to use Toolset's design for Product posts.

This support ticket is created hace 3 años, 7 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Stephen Vaughan hace 3 años, 7 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#2021937

So I am bringing some issues here on the recommendation of Dario on the blog post announcing the new Blocks 1.5 and associated WooCommerce Blocks update.

So I generally use WooCommerce Blocks on my sites so that I can access the [wpv-woo-product-price] shortcode to display in my hand build HTML/CSS views.

I have some concerns regarding the removal of the settings screen from the latest update of WooCommerce Blocks. I have had some issues with this in the past where if you temporarily disabled the plugin fro troubleshooting purposes and enabled it again you would find your page layout template replaced by something else. So, a quick visit to the WooCommerce Blocks settings to adjust. To be honest this only happened on a certain version we were using last year and I am not even certain that the issues I am seeing now relate to this or the fact that access to their settings page has now been removed with the latest version on WooCommerce Blocks? It maybe just something that is an entry in the database?

To demonstrate I have a link to the live site where I now have WooCommerce Blocks disabled and everything is fine:

enlace oculto

It just so happens that in the view where I am listing theses guided tours (Guided Tours in top nav) I don't need to show the woo price as the woo price is actually a deposit (€500) and what you see on the Guided Tours page is the full price dynamically pulled from another custom field I set up.

I am though being thorough here as I do foresee a number of use cases where I may want WooCommerce Blocks. I am using the Divi Theme and am utilising a number of configurations between Theme Builder templates, and various mix-ins of Toolset templates and views implemented with both blocks and traditional methods. These do work and there are advantages, to using either a block or traditional based implementation, depending on the uses case.

For example, if you navigate into one of the Classic Spins you will see an example of where I am composing the layout with a Divi Theme builder template topped with the page header, then a Divi Post Content module pulling in the block based content template for this cycling itinerary custom post type (including repeating field groups for cycling routes and then nested day by day grouped fields for daily itineraries). The end of the main Divi template is finished off with an enquiry form.

enlace oculto

All good so far, till we have WooCommerce Blocks enabled. To illustrate this I have set this scenario up on a staging site.

Going back to the Guided tour Wild Atlantic Étape West on this staging site you will see what is happening:

enlace oculto

To me it looks like WooCommerce Blocks is interfering with how my template (Divi/toolset composition) is being applied. Note, I have moved to the product post type for eCommerce purposes for these Guided Tours. All the other posts under the cycling itinerary post type are unaffected by WooCommerce Blocks being activated. In the guided tour product I have reused and refactored the custom field grouping to fit this uses case. For example for the Day by Day area in guided tours I have used a traditional view instead of the block version in the other cycling itineraries. When I built the cycling itineraries last year I wanted to test out the block version. When I did the guided tours more recently, it was easier for me to set it up with html and css. Inversely I stuck with the block version of the gallery of images to the right of Day by Day.

You are welcome for me to give you access to the staging version of the site, if you want to investigate.

I include the debug information from the staging site below

One last observation. As I said above I generally only use WooCommerce Blocks to access the [wpv-woo-product-price] shortcode. Find building WordPress sites a precarious balancing act of adding too many plugins, just to achieve the functionality that projects dictate. Where I can, I will go out and research on the net simple functions that will provide this functionality to avoid Swiss army knife solutions. Is there any way we could have a Toolset repository of functions where we could pick and chose parts of plugins as needed? I have seen this with Dan Mossop's plugin Divi Booster. It is a bit of a Frankenstein of settings but at least you could reference the site for this plugin and it would offer the features function by function, so you didn't need to install the full plugin.

#2022439

It's my understanding that now you can manage the template applied to each product, all products, or certain product categories, all through the Content Template editor, with priority assignment handling overlapping cases. Perhaps there is a Content Template assigned to some product or product category inadvertently, and that template needs to be unassigned now that there is no longer a universal on/off switch, as was present in the WooCommerce Blocks setting page? I'll be glad to take a closer look if you provide login credentials in the private reply fields here.

It is a bit of a Frankenstein of settings but at least you could reference the site for this plugin and it would offer the features function by function, so you didn't need to install the full plugin.
I don't foresee a build-your-own type solution for our plugin suite, as that would make interoperability and interconnection between the various moving parts difficult. It would also be difficult to keep up-to-date as new features are introduced and implemented. I do suspect that WooCommerce Blocks will be eventually absorbed into the Blocks / Views plugins, but I do not suspect that you will be able to create more streamlined custom plugin builds based on specific requirements.

In this case, a custom shortcode to display the product price is probably a reasonable way to avoid use of the WooCommerce Blocks plugin altogether, if you're only utilizing it for the price shortcode. There are many examples out there, like this Stack Overflow post:
https://stackoverflow.com/questions/47224791/display-product-prices-with-a-shortcode-by-product-id-in-woocommerce

#2022583
Screen Shot 2021-04-15 at 4.54.22 PM.png
Screen Shot 2021-04-15 at 4.54.11 PM.png

Okay the reason you see an impact is there is a Toolset Content Template currently assigned to the Products post type called "Organized Tour Images" (screenshots here). That template must be unassigned from the Products post type (in the template editor screen). If an individual Product had a Content Template assigned explicitly, apart from the assignment to the Product post type in general, then that Product must be edited and the template must be set to "None". When the WooCommerce Blocks plugin had its own dedicated settings page, you could disable all Toolset Product templates applied to single product posts with a single dedicated on/off switch. That would override the template assignment set in each template and each Product. Now that switch is no longer available, and you must accurately manage template assignments to the Product post type, as well as individual Product template assignment if that was ever implemented in the past.

After unassigning this Content Template from Products single posts, a quick scan of Product posts should tell you if any other individual Products have Toolset templates assigned explicitly. If so, you would need to edit those Products and choose "None" in those specific cases.

#2023029

My issue is resolved now. Thank you!

Ok, I get it now. Thanks Christian for being a second set of eyes on this. It might have taken me a while to twig this. I will keep this in mind as I got forward.

Cheers!