Extra Fields not showing

Questions and answers about ShopSite Custom Templates

Extra Fields not showing

Postby MgmtSpec » Wed Jun 12, 2013 9:25 am

Hello,
I've done lots of custom templates with older versions of SS (8 and earlier). Newer templates are so loaded with options I'm having trouble
getting things to work by copying existing template and editing code.

Using 3Column-Product template. Copied and renamed. Assigned new template to product - put on test page. Set up names and number of extra product fields I will be using.

1) In the original template about 515 lines down it shows
[-- ELSE_IF VAR.ExtraProductFields "yes" --]
This seems to imply to me that extra fields should work in this SS template as long as set up in back office.
Looks like they should display below PRODUCT.MoreInformationText

The info does not show up....

2) I want the extra fields to show on main product description - not more info page - I cannot find where I would insert the code.

[-- IF PRODUCT.Field1 --]<p><b>[-- STORE.ProductField1 --]:</b> [-- PRODUCT.Field1 --]</p>[-- END_IF --]
[-- IF PRODUCT.Field2 --]<p><b>[-- STORE.ProductField2 --]:</b> [-- PRODUCT.Field2 --]</p>[-- END_IF --]
[-- IF PRODUCT.Field3 --]<p><b>[-- STORE.ProductField3 --]:</b> [-- PRODUCT.Field3 --]</p>[-- END_IF --]

Appreciate help if someone can clue me in so this displays under the image - or anywhere at this point.
Between all the code/processes for w/ or w/o sub products I can't figure where to place.

3) No, I don't want to build template from scratch ;-)
MgmtSpec
 
Posts: 200
Joined: Mon Apr 30, 2007 8:25 am

Re: Extra Fields not showing

Postby Jim » Wed Jun 12, 2013 10:02 am

I hear you on the "Newer templates are so loaded with options I'm having trouble getting things to work by copying existing template and editing code." I have the same issue. :( One thing you can do to help debug issues is to check the box on the Utilities > Publish >Insert an html comment before each include file. When that box is checked the html source will include statements saying which include file is being inserted in the code so you can narrow down where to look for things. (You don't want to leave the box checked all the time, just when debugging)

I searched through all the template files for VAR.ExtraProductFields and it only occurs in a few files. The only instance of the VAR being set is in this file
includes/3Column-SelectTheme.sst:[-- VAR.ExtraProductFields "no" --].
So make a copy of that include file (then make another copy and give it the name 3Column-SelectTheme.sst and change the [-- VAR.ExtraProductFields "no" --] to [-- VAR.ExtraProductFields "yes" --]. Then publish and see if that fixes the problem.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Extra Fields not showing

Postby Jim » Wed Jun 12, 2013 10:36 am

http://www.shopsite.com/templates/cookbook/builtintemplates-3column.shtml describes the files used in the 3Column theme, color setting and some Tips and Tricks for using some other functionality. One of whic how to use the various VARs defined in the template files.

For your second question about where to put the code so the custom fields display on the product screen but not the more info page. (you can ignore my previous post since that would make them display on the moreinfo page).

Where do you want the fields to display, by the image, by the description, by the price? If you want it by the description is a line of code (about line 87) [-- IF PRODUCT.ProductDescription --]<p>[-- PRODUCT.ProductDescription --]</p>[-- END_IF --] which outputs the product description. You could put the code before or after that line of code. If you want them by the product image you could put it just before the line
[-- IF PRODUCT.UseMultiMenus checked --] All of the above [-- IF... --] statement appear to be closed at that point so it should display the fields.

For your 3rd point "No, I don't want to build template from scratch ;-)" I understand your concern but sometimes it is easier to just code to what you want on the page and not have to worry about all other possible feature that you might not be using. As we add more feature to the product that means that the templates ShopSite provides must be more complex to take into account all possible scenarios since we don't know what a particular merchant may want to use. You could probably create a template 1/3 the size and complexity by just removing things that you will never use in your store.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Extra Fields not showing

Postby MgmtSpec » Sun Jun 23, 2013 8:06 pm

Thanks Jim,

I just found your reply. I thought I was set up for auto notification when a reply was posted but I guess not.
Sorry I forgot to include which template I was working with as a 'base' in my original post.
Based on the code I get the impression the extra fields would show in the base template - is that correct?

Still not much luck...

http://totalmusicsource.pairsite.com/test.html

http://totalmusicsource.pairsite.com/TMS-TEMPLATE.html

[-- IF VAR.ExtraProductFields "yes" --] (tried with this line opening and closing and w/o)

[-- IF PRODUCT.Field1 --]<p><b>[-- STORE.ProductField1 --]:</b> [-- PRODUCT.Field1 --]</p>[-- END_IF --]

[-- IF PRODUCT.Field2 --]<p><b>[-- STORE.ProductField2 --]:</b> [-- PRODUCT.Field2 --]</p>[-- END_IF --]

[-- IF PRODUCT.Field3 --]<p><b>[-- STORE.ProductField3 --]:</b> [-- PRODUCT.Field3 --]</p>[-- END_IF --]
[-- END_IF --]
[-- IF PRODUCT.ProductDescription --]<p>[-- PRODUCT.ProductDescription --]</p>[-- END_IF --]

Used to do all custom templates - but the hours added to do that often are out of my avg client's budget range.

On the backside I don't see anywhere to turn ExtraProductFields "on" aside from (Extra Field Setup) where I selected 3 fields and gave them names.
MgmtSpec
 
Posts: 200
Joined: Mon Apr 30, 2007 8:25 am

Re: Extra Fields not showing

Postby Jim » Tue Jul 02, 2013 1:54 pm

The tag [-- IF VAR.ExtraProductFields "yes" --] is checking to see if you have a variable ExtraProductFields defined and if it has "yes" as its value.
Do you have a template tag [-- VAR.ExtraProductFields "yes" --] defined anywhere in a template or include file that will be loaded before the product template is accessed? If you know that you will always be using the ExtraProduct fields you could leave out the [-- IF VAR.ExtraProductFields "yes" --] and corresponding [-- end_if --] out of the template. If you need to have it in then you should probably put the [-- VAR.ExtraProductFields "yes" --] in the page template just before the loop product section.

Sorry for the late reply I have been on "vacation" taking care of 7 of my grandkids while their parents were on a real vacation.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 11 guests

cron