StuSays
StuSays

Reputation: 67

Using Big Commerce Product Custom Fields in Templates

I have come to a road block in my search to the answer to using custom fields in templates.

I have tried adding

%%SNIPPET_ProductCustomFields%%  

in the ProductDescription.html but nothing shows.

Is there ANY documentation about this?

Can this snippet be used in certain places only? if so which ones?

What needs to be in place for this to display in the products description?

Any help, tips or pointers would be great.

Upvotes: 0

Views: 750

Answers (1)

user1893702
user1893702

Reputation:

The CustomFields Snippet, %%SNIPPET_ProductCustomFields%%, can only be used if being referenced through its own Panel.

By default, the Panel that calls this snippet is named %%Panel.ProductOtherDetails%%

You can also create your own custom Panels by uploading them to the Panels folder via WebDav.
For example, if you created a template file called CustomFieldsPanel.html, you would upload it to the /dav/template/Panels folder, and reference it in your theme by %%Panel.CustomFieldsPanel%%


To answer your question though, you can do one of the following to display Custom Fields in the Product Description:

  1. Insert it into ProductDescription.html via its default Panel - %%Panel.ProductOtherDetails%% - modifying it by editing the template file ProductOtherDetails.html
  2. Create your own custom panel, include the Snippet within that same custom panel, and insert it into ProductDescription.html by the custom panel's name. An example of that file might look like so:


<!-- 
* /dav/template/Panels/MyCustomFieldsPanel.html 
* %%Panel.MyCustomFieldsPanel%%
-->
<div id="MyCustomFieldsPanel">
  <h1> Custom Fields Below </h1>
  %%SNIPPET_ProductCustomFields%%
</div>

enter image description here

Hope this helps :-)

Upvotes: 1

Related Questions