| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Manipulate product extra fields display | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I hope someone can help. The template /common_files/modules/Extra_Fields/product.tpl
is as follows: {foreach from=$extra_fields item=v} {if $v.active eq "Y" and $v.field_value} <tr> <td class="property-name">{$v.field}</td> <td class="property-value" colspan="2">{$v.field_value}</td> </tr> {/if} {/foreach} What i'm looking to do is to only display certain extra fields on the product details page. I've therefore created a new tpl called: /common_files/modules/Extra_Fields/product2.tpl Then I'm stuck as I can't work out how to display two extra fields. I've tried: {if $product.extra_fields} {foreach from=$product.extra_fields item=extra_field name=extra_fields} {* Display the Availability and Delivery fields *} {if $extra_field.service_name eq "SERVICE_NAME02"} <br><b>{$extra_field.value}</b> {/if} {if $extra_field.service_name eq "SERVICE_NAME05"} <br>{$extra_field.value} <br><br>{/if} {/foreach} {/if} but it doesn't show up on the product details page. The same code on the subcateogires page /common_files/customer/main/products_t.tpl does show up correctly? Where am I going wrong please?
__________________
X-Cart Gold V 4.4.1 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Try using
{if $v.field eq "NAMEHERE"} instead of the service name bit.
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
|
#3
|
|||||||
|
|||||||
![]() Thanks for the reply, how do you change this if you want 2 to show instead of one? is there an "or" statement you can use? On second thoughts that wouldn't work, you would simply right another if statement! Sorry for not thinking before typing!
__________________
X-Cart Gold V 4.4.1 |
|||||||
#5
|
|||||||
|
|||||||
![]() The last thing I'm trying to do is change the text in an particular extra field dependant on stock levels i.e if out of stock it would read "stock arriving soon" and if in stock it would read "In stock".
I would just use the following code to display stock levels on the page: {if $product.appearance.empty_stock} <b><p class="message">Stock arriving soon</p></b> {else} <b><p class="message">In stock</p></b>{/if} But i'm using a pre-order / back order mod which allows customers to purchase if stock levels are 0 and this in turn makes the website read "in Stock" for back order purchases when actually it's not in stock, so a little confusing for the customer.
__________________
X-Cart Gold V 4.4.1 |
|||||||
#6
|
|||||||
|
|||||||
![]() Quote:
Do you need to use an extra field for stock level display? This thread may point you in the right direction: http://forum.x-cart.com/showthread.php?t=65938
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
|
|||
X-Cart forums © 2001-2020
|