Skip Navigation

[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.

Relevant Documentation:
https://toolset.com/documentation/user-guides/when-to-use-content-templates-instead-of-layouts/

This support ticket is created 6 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#621279
Capture5.JPG

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)

#621299

Another question i will like to know is

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

thank you very much

#621464

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

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).

#621506
Capture4JPG.JPG

Hi,

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.

Kindly assist.

#621979

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

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).