Skip Navigation

[Resolved] Content template not working for products

This support ticket is created 3 years, 4 months ago. 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.

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)

This topic contains 10 replies, has 2 voices.

Last updated by Christian Cox 2 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1845165

Tell us what you are trying to do? Use a custom content template to display single products.

Is there any documentation that you are following? https://toolset.com/course-lesson/creating-custom-templates-for-single-product-pages/

Is there a similar example that we can see?

What is the link to your site? hidden link (a link to a product page)

A couple of things to note

Where the document refers to the setting as "WooCommerce Blocks plugin default single product template" I see "WooCommerce Views plugin default single product template"

If I edit a product and change "content template" to "none", I see the same output as when I select the product template

Changing to a core theme makes no difference.

Another older site (that's up to date) but uses Toolset Views instead of Toolset blocks works as expected.

When editing the content template if I click on "view on front end", the product displays as expected.

I have cleared the caches

If I switch back to using the default woocommerce template which leaving "content template" set to product template, the product template is used as the description. Setting "content template" to none shows the standard description. This seems to imply that the incorrect template is being over riden.

#1845169

May I log in to your wp-admin area to see how this is set up? I'd like to test out the Product template updates and see if anything looks suspicious. Private reply fields are enabled so you can share login credentials securely. Let me know if there is a specific product I should test with.

#1845191

Hello can you reply now?

#1845213

Do you have access to the logs for this server? I'd like to see if any server-side errors are being registered. I don't see anything obviously wrong, and I'd like to get some additional information. If you're not familiar with server logs, I can show you how to create one temporarily starting with a default wp-config.php file.

Go in your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);

Then add these lines, just after the WP_DEBUG line:

define('WP_DEBUG_LOG', dirname(__FILE__) . '/error_log.txt');
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define('WP_DISABLE_FATAL_ERROR_HANDLER',true);

Clear the caches and test once more. If any server-side errors are triggered during this process, it will create an error_log.txt file in your site's root directory. Use FTP to look for this file in the same directory as wp-config.php. You may need to click "Refresh" in your FTP browser to see a new file appear. Please download this file to your computer, open it in any text editing software, and copy + paste its contents in your next reply. Once that is done, you can revert the changes you made to wp-config.php and delete the log file using FTP.

#1845259

This is all the log file contains

[15-Nov-2020 20:10:30 UTC] PHP Warning: WP Redis: Connection refused in /chroot/home/adedc984/bethlehembooks.com/html/wp-content/plugins/wp-redis/object-cache.php on line 1389
[15-Nov-2020 20:10:31 UTC] PHP Warning: WP Redis: Connection refused in /chroot/home/adedc984/bethlehembooks.com/html/wp-content/plugins/wp-redis/object-cache.php on line 1389
[15-Nov-2020 20:10:39 UTC] PHP Warning: WP Redis: Connection refused in /chroot/home/adedc984/bethlehembooks.com/html/wp-content/plugins/wp-redis/object-cache.php on line 1389

#1845261

Okay interesting...if the Redis cache isn't being updated or flushed because the connection is being refused, that could be part of the problem. However, I would need to do some more in-depth investigation to be sure. Is it okay for me to create a site clone using the Duplicator plugin? I can run additional tests locally where I can monitor code execution and database manipulation more closely.

#1845281

Fixed the issue with Redis (the plugin was not active). After fixing that, problem with content template persists.

Yes you may run duplicator, please let me know when you are done (I will leave the site alone till then)

Thanks

#1846379

I'm done creating the site clone. It's odd, on my local site I see the same problem for existing products, but if I create a new product the Content Template is applied correctly. On your live site, new products have the same problem so something else is going on. That leads me to suspect a database issue, but I'll need my 2nd tier support team to take a closer look. I am escalating this problem for additional investigation and will let you know what I find out.

#1852009

I recreated the site and now using a toolset content template works.

My issue is resolved now. Thank you!

#1852491

Okay thank you for the update. For future reference, our 2nd tier support team found the source of the problem. You can fix this issue if it occurs again in an existing site by deleting the option “woocommerce_views_theme_template_file” from wp_options (either with phpMyAdmin or code), then make sure you have the intended theme active, update the settings in Toolset > WooCommerce Blocks, and then possibly edit the product Content Template again and make sure to bind it to all product posts. This issue has been escalated to our developers for future resolution.

#2020729

Quick update to let you know we have resolved the issue behind this problem in today's release of Toolset, which is currently being pushed out to clients. If you are not prompted to update yet, you can trigger this update in wp-admin > Plugins > Add New > Commercial tab by clicking 'Check for updates'.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.