![]() |
Extra Fields by Category
We have about 25 categories (and sub cats) with anywhere from 5 -50 products in each
Each category product has a bunch of extra field information which I need to collect. I added all the "extra fields" via the admin - but now there are so many - so when a new product comes up - like 100 extra fields come up - when really maybe only 15-20 apply to that product. Is there a way I can show only the fields for that category ? I numbered them in batches - so if I could say if catid = "devices" show fields 100-150 ...I would be good. Just not sure where to look for this code ? SInce this is in the admin Thanks |
Ok - I got it ! I need some tweaking for all the categories but it will look like this - I"ll post this in case anyone needs it - and I need it again in the future !
First copy the products_modify.tpl to your skin/skinname/modules/Extra_fields folder - so you always have the original to go back to then add this into the loop replacing the code that writes out the field/ value <code> {if $geid ne ''} <td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[efields][{$ef.fieldid}]" /> </td>{/if} {if $product.categoryid eq '31' && $ef.orderby lt '400' } <td class="FormButton" nowrap="nowrap"> {product.categoryid} {$ef.field}: </td> <td class="ProductDetails"> <input type="text" name="efields[{$ef.fieldid}]" size="70" value="{if $ef.is_value eq 'Y'}{$ef.field_value|escape:html}{else}{$ef.value| escape:html} {/if}" /> </td> {elseif $product.categoryid eq '49' } {if $ef.orderby gt '400' && $ef.orderby lt '500' } <td class="FormButton" nowrap="nowrap"> 49 only {$ef.field}: </td> <td class="ProductDetails"> <input type="text" name="efields[{$ef.fieldid}]" size="70" value="{if $ef.is_value eq 'Y'}{$ef.field_value|escape:html}{else}{$ef.value| escape:html}{/if}" /> </td> {/if} {else} <td> Other specs needed here </td> {/if} </tr> </code> |
| All times are GMT +8. The time now is 10:54 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.