X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   display product Extra Fields on "View Cart" (https://forum.x-cart.com/showthread.php?t=29839)

gfiebich 03-20-2007 11:41 AM

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


All times are GMT -8. The time now is 01:03 PM.

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