If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Product Downloads: Attribute Names vs File Names

Product Downloads: Attribute Names vs File Names

Started by sgtpepper on 28 Jun 2011, 8:01 PM · Views: 1,162

Results 1 to 1 of 1
28 Jun 2011, 8:01 PM
#1
sgtpepper avatar

sgtpepper

New Zenner

Join Date:
Jan 2008
Posts:
15
Plugin Contributions:
0

Product Downloads: Attribute Names vs File Names

Order Information page: When a product purchased has downloadable attributes, the "name" is listed as the product's name, but the attribute name is never listed, only the file name. (The product is a book and the chapters are the attributes)

I've been trying to display the attribute name (instead of the file name) but have been unsuccessful. Any suggestions?

Editing the relative header_php.php file for tpl_modules_downloads.php to pull products_options_values from TABLE_ORDERS_PRODUCTS_ATTRIBUTES

header_php.php Original:

$sql = "SELECT date_format(o.date_purchased, '%Y-%m-%d')
          AS date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename
          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd 
          WHERE o.customers_id = customersID
          AND o.orders_id = ordersID
          AND o.orders_id = op.orders_id
          AND op.orders_products_id = opd.orders_products_id
          AND opd.orders_products_download_id = downloadID
          AND opd.orders_products_filename != ''";

header_php.php My edits:

$sql = "SELECT date_format(o.date_purchased, '%Y-%m-%d')
          AS date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename, [B]opa.products_options_values[/B]
          FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . [B]TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " opa, " .[/B] TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd 
          WHERE o.customers_id = customersID
          AND o.orders_id = ordersID
          AND o.orders_id = op.orders_id
          AND op.orders_products_id = opd.orders_products_id		  
	 [B] AND op.orders_products_id = opa.orders_products_attributes_id[/B]
          AND opd.orders_products_download_id = downloadID
          AND opd.orders_products_filename != ''";

tpl_modules_downloads.php - Adding in:

<?php echo $downloads->fields['products_options_values'];?>

Result: No errors but nothing to echo

Thanks for your help!