Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting extra fields into invoice w/code


Guest

Recommended Posts

I have been playing around getting this to work as an extra field in my invoice..

 

//mod column data

// echo ' <td class="dataTableContent" valign="top" >' . $order->products[$i]['model'] . '</td>' . "\n" .

 

echo ' <td> </td>' . "\n" .

' <td class="dataTableContent" valign="top" align="center">' . $order->products[$i]['model'] . '</td>' . "\n" .

// ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['price'] . '</td>' . "\n" .

// ' </tr>' . "\n";

 

$extra_fields_query = tep_db_query("

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value

FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef

LEFT JOIN ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf

ON ptf.products_extra_fields_id=pef.products_extra_fields_id

WHERE ptf.products_id=".(int)$order->orders_products_id." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')

");

 

while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {

echo ' <td class="dataTableContent" valign="top" align="right">' . $extra_fields['value']. '</td></tr>' . "\n" ;

}

 

 

I keep getting an error, and no matter what tracing I use, I cannot seem to pull the extra fields in from the extra table...

 

 

 

I was trying WHERE ptf.products_id=$order->products[$i]['id']

 

instead of

 

WHERE ptf.products_id=".(int)$order->orders_products_id."

 

But no luck.. any suggestions?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...