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

display product Extra Fields on "View Cart"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 11:30 AM.

   

 
X-Cart forums © 2001-2020