![]() |
I don't think that will work on the products.tpl page. I think you will have to do some SQL there to get the $extra_fields from the database for the "current product".
|
I don't know SQL that well or I would create a statement. I'll give it a try but I don't think I will be able to do much.
-Mike |
Quote:
You are right, this would work on the product.tpl, not the products.tpl file :oops: |
Bringing this back to life... has anyone tackled this for the products.tpl page? I am trying to use an Extra Field as a way to group all my products into unofficial subcategories all on one page.
Thanks much, Brian |
So why would this work on product.tpl and not products.tpl?
Code:
{if $active_modules.Extra_Fields ne ""} Do I need to call the individual extra fields explicitly? I want to display the extra fields on the home page in featured listings, as well as on the category displays. Thanks. |
It works on product.tpl because product.php gets the extra fields info from the database. Unfortunately products.php does not do this so the variable is not availble to products.tpl.
|
Ok.
Does anyone know if this is "does not" or "can not" though? Can the calls that pull the info into product.tpl be called into productS.tpl? Is there a reason why it isn't or couldn't be? Should this be a thread for the "program logic" area? Thanks, dash. |
Here is the code that I used to get to the extra fields in products.tpl. This code must go inside the product loop. I put it immediately after this code:
Add this code: Code:
{* Get the product ID as we loop through the products to be displayed *} The extra fields are referenced in your code using $extra_fields[<field number>] like this: Code:
{$extra_fields[2].field_value} Have fun. |
Thanks Willirl.
Do you have a working example? I put your code in the same spot as you indicated, however I am not able to get the extra fields to display. I tried calling via Code:
{if $active_modules.Extra_Fields ne ""} Code:
{$extra_fields[2].field_value} Is there any way to see what field numbers are in use? I don't see that info in the admin view. Thanks for the help. |
Oops. I forgot about products_t.tpl. Add the same code following these lines:
Code:
{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"} The fields are assigned (I think) in the order you specify them in your upload or on your product edit page. The first one is [1] etc.. |
All times are GMT -8. The time now is 02:55 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.