I am trying to: Develop a layout template for my single product page
Link to a page where the issue can be seen: hidden link
I expected to see: The same result from a Product Listing view that I have on the home page hidden link
Instead, I got: the listing shows the product body content only instead of the Product View content template
Also when I try to display Related Products it does not use the same content template but reverts to the Woocommerce template
Hi Katie,
Thank you for contacting us and I'll be happy to assist.
To troubleshoot why the correct layout is not being applied to the single product pages, I'll need to see how it is currently configured.
Can you please share temporary access (WP-Admin and FTP) to your site, so that I can log in to the admin area?
( preferably to a test/development site, if possible )
Your next answer will be private which means only you and our support team will have access to it.
*** Important Notes ***
- Please backup your database and website before sharing the access information.
- Also, share the exact link to the layout, view and/or content template, which you expected to be used for the single product pages.
regards,
Waqar
Hi Katie,
Thank you for sharing the access details.
During testing, I was able to reproduce this issue on my test website, as well.
The shortcode "[wpv-post-body view_template="None"]" used in the "Single Product layout" ( screenshot: hidden link ), conflicts with the content displayed through the view in the layout (which on your website is "Related products" view).
I'm going to pass on these findings with the concerned team for further investigation and will update you once this has been resolved.
As a quick workaround, you can register a custom shortcode to show product's content and replace it with the "wpv-post-body" shortcode.
Here are the steps:
1. In your active theme's "functions.php" file, please add this code to register a new shortcode:
add_shortcode('show-single-page-content', 'show_single_page_content_func');
function show_single_page_content_func() {
$content = apply_filters( 'the_content', get_the_content() );
return $content;
}
2. In your layout's "Visual Editor" cell ( screenshot: hidden link ), replace:
[wpv-post-body view_template="None"]
With:
[show-single-page-content]
Appreciate you brought this forward and please let me know how it goes.
regards,
Waqar
Thank you for the work around. It is definitely a step forward.It is interesting to see that when I used a very similar layout (including the use of [wpv-post-body view_template="None"] and a similar view with the same content template for a different post type there was no problem.
I look forward to hearing more if there is a further solution
Hi Katie,
Thanks for the update and glad that workaround proved useful.
Your observation is correct and that issue seems to affect only the view that shows product post type.
A fix for this is set to be included in the next major release of Toolset Layouts (version 2.5) and I'll let you as soon as there is an update.
regards,
Waqar