View Single Post
  #1  
Old 03-20-2007, 11:41 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default display product Extra Fields on "View Cart"

The following was done on X-Cart Pro 4.0.19

To display each product's Extra Field information on the "View Cart" screen, add the following code to skin1/customer/main/cart.tpl:

PHP Code:
{assign var="productId" value=$products[product].productid}
{
php}
global 
$sql_tbl;

// Get the product id from the smarty var

$productid=$this->get_template_vars('productId');

// Get the rows from extra_field_values and extra_fields for this product id

if($productid) {
    
$extra_field_values func_query(
       
"SELECT
               xcart_extra_fields.active AS field_active,
            xcart_extra_fields.field AS field_name,
            xcart_extra_field_values.value AS field_value
    
        FROM
            xcart_extra_fields,
            xcart_extra_field_values
    
        WHERE
            xcart_extra_fields.active = 'Y' AND
            xcart_extra_field_values.fieldid = xcart_extra_fields.fieldid AND
            xcart_extra_field_values.productid = 
$productid"
          
);
    
    }
$this->assign("extra_field_values",$extra_field_values);

{/
php}

{if 
$extra_field_values ne ''}

<
B>{$lng.lbl_product_details}:</B><BR>

<
TABLE border="0" cellspacing="1" cellpadding="0">
{foreach 
from=$extra_field_values item=v}
{if 
$v.field_value ne ''}
<
TR>
    <
TD>{$v.field_name}:&nbsp;</TD>
    <
TD>{$v.field_value}</TD>
</
TR>
{/if}
{/foreach}
</
TABLE>
<
br>

{/if} 

just above

PHP Code:
{if $products[product].product_options ne ""

This was done with help from this thread.

-Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote