X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Displaying Product options using "if" statements (https://forum.x-cart.com/showthread.php?t=57686)

sinobest 01-23-2011 02:06 AM

Displaying Product options using "if" statements
 
I want to show Product options at different places, how to use "if" statement to control, pls?

cflsystems 01-23-2011 07:30 AM

Re: Displaying Product options using "if" statements
 
Open /skin/common_files/modules/Extra_Fields/product.tpl and use it as a guide. Turning on the debuger will help you with the variables available to use

sinobest 01-23-2011 04:15 PM

Re: Displaying Product options using "if" statements
 
I do not know how to use, would you pls give me an example?

cflsystems 01-23-2011 04:51 PM

Re: Displaying Product options using "if" statements
 
It all depends what you want to show and how

sinobest 01-23-2011 08:47 PM

Re: Displaying Product options using "if" statements
 
give me some examples, pls.

cflsystems 01-24-2011 04:55 AM

Re: Displaying Product options using "if" statements
 
Code:

{foreach from=$extra_fields item=v}
  {if $v.active eq "Y" && $v.field_value}
    <tr>
    <td class="property-name">{$v.field}</td>
    <td class="property-value">{$v.field_value}</td>
    </tr>
  {/if}
{/foreach}


This will show only active fields with values

sinobest 01-25-2011 12:09 AM

Re: Displaying Product options using "if" statements
 
for example, i have 2 Product options , and i want to show them at differn place, how to do?

cflsystems 01-25-2011 03:18 AM

Re: Displaying Product options using "if" statements
 
Code:

{foreach from=$extra_fields item=v}
  {if $v.active eq "Y" && $v.field_value && $v.service_name eq "xxx"}
    <tr>
    <td class="property-name">{$v.field}</td>
    <td class="property-value">{$v.field_value}</td>
    </tr>
  {/if}
{/foreach}



replace "xxx" with the service name for the field

cherie 01-25-2011 12:18 PM

Re: Displaying Product options using "if" statements
 
Is this for Product Options or Extra Fields?

cflsystems 01-25-2011 02:33 PM

Re: Displaying Product options using "if" statements
 
Quote:

Originally Posted by cherie
Is this for Product Options or Extra Fields?

Silly me :oops:

Scratch all posts above - it is for extra fields not options


All times are GMT -8. The time now is 03:38 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.