| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Extra Fields 4.1.x products_t.tpl | ||||
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Hi toltion,
How does this work for multiple extra fields on the product.tpl page? Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
#22
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
The code allows you to selectively display any extra field. I sometimes like to display the extra fields in different locations on the template, so I run the code at the top of the page and assign variables to the values. In this code I chose to identify the extra_fields by their Service Name instead of index position in the loop -
Code:
Then I can display the variables "no_ship_air" & "clearance_price" anywhere on the page using {if $no_ship_air ne ""}{$no_ship_air}{/if}.
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
#23
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
With your suggested code, I believe I have the "loop through" working in /modules/Extra_Fields/product.tpl, though I haven't been able to place each of my extra fields separately in customer/main/product.tpl.
This is what I have for my product.tpl {if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} When I tried adding just one field name, there was no change {if $active_modules.Extra_Fields ne ""}{$product.extra_fields.11.value} {include file="modules/Extra_Fields/product.tpl"} Can you see what I'm missing to call out individual extra fields where I need in my customer/main/product.tpl? Christine Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
#24
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
In customer/main/product.tpl, you have to replace -
{include file="modules/Extra_Fields/product.tpl"} With the code I suggested. You are basically looping through the extra fields directly on product.tpl instead of including "modules/Extra_Fields/product.tpl".
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
#25
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Awesome! I have one more piece to this that I need working. I have a custom button that I'm trying to get working for 3 of my extra fields. Here's what I've done with trying to add my custom button .tpl:
In customer/main/product.tpl I commented out <!--{if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if}--> and added from your code suggestion <table align="left" cellspacing="0" cellpadding="0"> {section name=field loop=$extra_fields} <td>{if $extra_fields[field].service_name eq "products_PDF"} {include file="buttons/pdf_button.tpl" href="javascript:window.open $extra_fields[field].field_value=products_PDF" style="button"} {/if}</td> <td> </td> <td>{if $extra_fields[field].service_name eq "products_manual"} {$extra_fields[field].field_value eq "products_manual"} {/if}</td> <td> </td> <td>{if $extra_fields[field].service_name eq "product_image"} {$extra_fields[field].field_value eq "product_image"} {/if}</td> {/section} </table> The bold is my attempt for my custom button. The image of my custom button is now showing, though it's not clickable to my product. Do you have any suggestions? Christine Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
#26
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Try this...
<table align="left" cellspacing="0" cellpadding="0"> {section name=field loop=$extra_fields} <td>{if $extra_fields[field].service_name eq "products_PDF"} {include file="buttons/pdf_button.tpl" href="javascript:window.open $extra_fields[field].field_value" style="button"} {/if}</td> <td> </td> <td>{if $extra_fields[field].service_name eq "products_manual"} {$extra_fields[field].field_value} {/if}</td> <td> </td> <td>{if $extra_fields[field].service_name eq "product_image"} {$extra_fields[field].field_value} {/if}</td> {/section} </table> Not too sure about your javascript window.open code. Doesn't look like that will work...
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
|
#27
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Great job. Thanks for your help! I have the loop through working.
For my custom button, I will need to get mod work done. Christine
__________________
______________ version 4.1.9 Gold |
|||||||
#28
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Thank you thank you!
__________________
4.0.18 |
|||||||
#29
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Hi,
I can't find where to insert the code in 4.1.11 as I can't find the $smarty->assign line mentioned. Where should I insert this to call up the extra fields? Thanks, Chris
__________________
Chris Wilson 4.7.10 (after 9 years with 4.1.12) CDSEO Pro |
|||||||
#30
|
|||||||||
|
|||||||||
Re: Extra Fields 4.1.x products_t.tpl
Are you modifying products.php? It should be near the last lines of the file. The php code goes in the products.php file, the smarty and html changes go in the template files.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|