I am trying to create a custom WooCommerce single product page using the WooCommerce Views plugin and a Content Template.
I have copied the views single-product template to a /woocommerce sub directory in my theme. I can tell by the html rendered that this template is being used, however the content of this page seems to be the WooCommerce standard output, rather than my allocated Content Template, and I can't figure out why.
All I have put in my Content Template is the title and sku, in a big white box.
What's outputting is the product image and the standard product entry-summary (though hidden on screen).
Link to a page where the issue can be seen: hidden link
Content Template assigned to WC Products (for testing purposes only!): hidden link
I keep getting the following message when editing the Content Template:
"WooCommerce is currently overriding the template for products and your design will not be used". Clicking on 'switch to the WooCommerce Views template' doesn't appear to do anything.
I tried every option in Toolset > WooCommerce Views.
Can you please have a look and see if you can tell me where I'm going wrong?
Go to Toolset > WooCommerce Views and you have the option to choose which template is used to render products (there are separate settings for the single product and product archive templates).
If you want to use Toolset to design custom templates then you must choose the WooCommerce Views templates.
You could, if it made sense for your project, choose to use the standard WooCommerce template for the shop page, and the custom Views template for your single product pages.
There is no need to copy any files to your theme or WooCommerce.
Hi,
Sorry I should have emphasised this part of my question:
"I tried every option in Toolset > WooCommerce Views."
I tried the WooCommerce views template first but my Content Template still did not display.
I followed the instructions in this article: https://toolset.com/home/WooCommerce-views/ and the link you sent above.
The issue is that no matter what template I use, it is not displaying the contents of my assigned Content Template.
Are you able to investigate any further?
Thank you for your help so far.
Sorry we had to swap staging servers for this site. The new URL is :woocommerce-160855-556673.cloudwaysapps.com.
How do I update FTP and admin credentials for you on this thread? Or do I need to open a new one?
I checked Toolset > WooCommerce Views and can see that you have set the WooCommerce Views template as the template for single products (which is what is required if you want your custom Content Template made with Views to be used).
I edited a product ("Clean Lean Bars") and see that it is assigned to use the Content Template "Single Product".
Looking in Toolset > Content Templates I found that template.
When I view the product on the front end it looks how I would expect when using that Content Template.
Now, I see that you also have a template "Woo Single Product" which is assigned to single products.
That is a global assignment which can be overwritten at the level of individual posts.
Although you have "Woo Single Product" assigned to product posts, the first product I looked at (above) is not using that template, it is using the "Single Product" template.
If your intention is that all single products should use the "Woo Single Product" template then you may need to edit that template, use the Change Usage button, de-select it, save, then re-select it, at which point you should be offered the option to apply this template to existing product posts.
I suspect you were using the Single Product template for some time, changed to use the Woo Single Product template, but didn't check the option to assign to existing posts.
I’m sorry for the confusion here. Before installing WooCommerce I had a CPT called ‘Products’ (slug ‘products’). I will obviously need to change the name of this to avoid confusion with WC ‘Products’ with slug ‘product’.
The Product post you were looking at was not WC Product and yes, those are using their assigned Content Templates exactly as I would expect them to.
There are two products in WooCommerce - ’Test GGS’ and ‘Test CLP’.
The correct setup should be:
WooCommerce product post should use the assigned content template ‘Woo Single Product’.
This Content Template should be displayed on the site using the Toolset WooCommerce Views template.
The issue is that the Woo Single Product Content Template is assigned correctly but is not displaying on the site.
I hope this clarifies the issue and sorry again for the confusion!
When I edited the product "Test CLP" there was no template assigned (see screenshot), and looking in the list of templates at Toolset > Content Templates I couldn't find "Woo Single Product", I guess you deleted it.
So I made a new test template "Toolset WC Product" and I assigned it to the Test CLP product post. I then viewed the product on the front end and confirmed that the template was being used.
I think it would help if you renamed the product post type you registered with Toolset so that it is clear at all times when assigning templates whether you are assigning them to WC products or to your Types product post type.