I am upgrading the ancient Orders Export mod to add functionality I need, make it fully configurable and more modern in coding. (The new JK Order Export doesn't do what I need, and does not use ZC standard db interfacing anyway.)
The original used mysql_connect() and mysql_fetch_array() which I was able to convert to current Zen Cart handling, but I am stuck on querying the db for order attribute info. The original had attribute output added to it, but I don't know if that ever functioned correctly. I have rebuilt the select construction, but the form of the segments added matches the original.
PHP Code:
//building the SELECT...
case 'v_products_options':
$filelayout[] = 'v_products_options';
$filelayout_sql .= ' products_options as v_products_options,';
break;
case 'v_products_options_values':
$filelayout[] = 'v_products_options_values';
$filelayout_sql .= ' products_options_values as v_products_options_values,';
break;
//(other select cases are fully functional, and these get added to the select, just do not return results)
//...
$filelayout_sql .= "
FROM ".TABLE_ORDERS_PRODUCTS." op LEFT JOIN ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES." opa
ON(op.orders_products_id = opa.orders_products_id), ".TABLE_ORDERS." o, ".TABLE_ORDERS_STATUS." os";
(I added
PHP Code:
if (in_array('v_orders_comment',$filelayout)) $filelayout_sql .= ", ".TABLE_ORDERS_STATUS_HISTORY." osh";
which gets the comments correctly.)
I get fields for the option name and value in the download, but no output in the fields.
Any ideas?
Bookmarks