Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Manipulate product extra fields display

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-15-2013, 02:26 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default Manipulate product extra fields display

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
Reply With Quote
  #2  
Old 02-15-2013, 02:40 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default Re: Manipulate product extra fields display

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.
Reply With Quote

The following user thanks pauldodman for this useful post:
Paulw (02-15-2013)
  #3  
Old 02-15-2013, 03:25 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default Re: Manipulate product extra fields display

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
Reply With Quote
  #4  
Old 02-15-2013, 05:15 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Manipulate product extra fields display

This thread may help you?

http://forum.x-cart.com/showthread.php?t=65220
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote

The following user thanks carpeperdiem for this useful post:
Paulw (02-15-2013)
  #5  
Old 02-15-2013, 05:39 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default Re: Manipulate product extra fields display

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
Reply With Quote
  #6  
Old 02-15-2013, 06:32 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Manipulate product extra fields display

Quote:
Originally Posted by Paulw
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".

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
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:26 PM.

   

 
X-Cart forums © 2001-2020