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)
-   -   Including Extra Form Fields on Registration Page (https://forum.x-cart.com/showthread.php?t=47602)

presson83 05-18-2009 06:11 AM

Conditional Extra Form Fields on Registration Page
 
Hi All,

I'm trying to include a couple of additional fields on my registration.tpl page, but only when a product has a certain extra field applied to it and when the product option has a certain title. I have this working perfectly on my order invoice template like so :

Code:

{foreach from=$products item=product}
      {if $product.extra_fields.0.value ne '' && $product.product_options_txt eq "Product Options: Online Streaming Course"}
          {include file="customer/main/register_additional_info.tpl" section='A'}
      {/if}
{/foreach}


For whatever reason, this is NOT working on my register.tpl page. Any ideas why I can't loop through the products array and specify the extra product field id or the product option title, but I can on my order_invoice.tpl page?

presson83 05-18-2009 01:12 PM

Re: Including Extra Form Fields on Registration Page
 
UPDATE:

I believe I have found the correct item in the $products array that I need - 'option_name'. According to the smarty debug console that item is available in the products array on the register.tpl page. Unfortunately my effort at getting ahold of that value is not working. Here was my attempt:

Code:

{foreach from=$products item=product}
            {if $product.option_name eq "Online Streaming Course"}
            <br />{include file="customer/main/register_additional_info.tpl" section='A'}
            {/if}
            {/foreach}


That would appear to be all I would need to do but it doesn't work. Anyone know how I should be getting ahold of the "option_name" value in the $products array?


All times are GMT -8. The time now is 07:22 PM.

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