[Resolved] Custom field work on shop page but not for single product page
This thread is resolved. Here is a description of the problem and solution.
Problem:
Client is creating a Content Template for single products, but the changes are not reflected on the front-end.
Solution:
The client is mixing Layouts and Views Content Templates, creating both and assigning them to single products. In that case Layouts "wins", and the Views Content Template is not used. If not required the Layout needs to be unassigned from single products.
I am trying to: create a custom single page product. I actually have successfully did it for shop page
but then when i follow this video hidden link to customize single product page. It just manage to remove all the field and not displaying my custom field
Link to a page where the issue can be seen: single product page
I expected to see: custom added fileld
Instead, I got: single product page (default content is no more there)
I am creating a multivendor shop using WC marketplace.
This WC marketplace have their own dashboard
I want to create a add product and also with my own custom fields
I think i know how to display the custom fields own shop but i need a to creae a add/modify product page
And if there is a way do add shortcode to this, i can call this in the WC marketplace vendor dashboard
First, can I point out that we have a policy of one issue per thread, which helps other users research related problems, so I'll help you with the first question and kindly ask you to post a new thread with your second question.
When creating templates to display custom post types you can either use Views (Content Templates), or Layouts (Template Layouts).
I took a quick look at your site and saw that you are using both, in which case Layouts "wins". Your Layout contains a View which doesn't output anything, and does not contain any data or fields from the current post, i.e. the product being displayed.
Hence if you visit a product on the front-end you won't see anything.
You need to choose whether you want to use Layouts or Views and stick with one. If you want to use Views, be sure to edit the Template Layout so that it is no longer assigned to products.
One final piece of the jigsaw when customising WC pages is that you need the Toolset WooCommerce Views plugin activated (which you have) and you need to set it to use the WooCommerce Views templates where you want to customise them. On your settings page you are using the WooCommerce Views template for single products (meaning you can create a custom template) and the standard WooCommerce template for product archives (meaning you cannot customise the shop page).
Thank you for the feedbak.
I plan to use view. But as i am trying to delete the layout,
it shows i cant delete it.
I am just following the youtube video t
first i try this for shop page and it work - hidden link
2nd i try this and dont work - hidden link
I will like use view, but i can find how to edit the Template Layout so that it is no longer assigned to products and completely not using the template layout.
You can't delete the Layout if it is assigned to a post type.
It is assigned to Products.
You need to change the Layout usage so that it is no longer assigned to a post type and then you can delete it (although once it is unassigned it is not doing anything).