Okay, I found a modification on the OcCommerce forums to add a link to view the file/image from the edit order function in admin
http://forums.oscommerce.com/lofiver...p/t202695.html
I've gotten to the point where it doesn't throw any errors, but it still doesn't display a link either.
I added this this a file under admin/includes/extra_configures
define('DIR_WS_CATALOG_IMAGES_UPLOADS', DIR_WS_CATALOG_IMAGES .
'uploads/');
define('DIR_FS_CATALOG_IMAGES_UPLOADS', DIR_FS_CATALOG_IMAGES .
'uploads/');
I added this to a file under admin/includes/extra_datafiles/
define('TABLE_PRODUCTS_OPTIONS_TYPES', 'products_options_types');
Then in the orders.php, I tried to convert it to Zencart format from instructions I found online, but I must be missing something. This is what I have
if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
// Customization #31101 for file_upload view begin
$option = $order->products[$i]['attributes'][$j]['option'];
## Build a query to check if this option is of 'File' Type
$file_check_sql = " select count(*) from ".TABLE_PRODUCTS_OPTIONS ." o,
".TABLE_PRODUCTS_OPTIONS_TYPES." ot WHERE o.products_options_type = ot.products_options_types_id AND products_options_types_name='File' AND o.products_options_name='".$option."'";
$file_check_sql = $db->Execute($file_check_sql);
$isFile = $file_check_sql->RecordCount();
if($isFile == 1 &&
@file_exists(DIR_FS_CATALOG_IMAGES_UPLOADS.$order->products[$i]['attributes'][$j]['value'])){
$link = "<a href=". DIR_WS_CATALOG_IMAGES_UPLOADS.$order->products[$i]['attributes'][$j]['value']." target='_blank'><i>Click to View</i></a>";
}else {
$link = "";
}
echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
echo ' '. $link.' </i></small></nobr>';
// Customization #31101 end
Should this be in another directory, like extra_functions rather than in the orders file? Can anyone tell why the link isn't displaying?


Reply With Quote
