dan1234
12-12-2011, 12:22 PM
I added an attribute to each product, "Is this a gift?", selections are Yes and No. I have made up a duplicate Customers/orders.php page in admin, calling it gift_list.php. My idea is to have this page show only the orders where the attribute Yes was selected. I have added the code
$gift_query = tep_db_query("select orders_id, products_options_values from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "'");
and edited the code
if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
echo '
to read
if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id) && $gift_query['products_options_values'] == 'Yes') {
echo '
It did not work at all. I'm not sure I added the db query in the right place and if the addition to the above line makes any sense at all. How can I get this page to just display those orders that have selected the Yes attribute?
Thanks for your help,
Dan
$gift_query = tep_db_query("select orders_id, products_options_values from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "'");
and edited the code
if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
echo '
to read
if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id) && $gift_query['products_options_values'] == 'Yes') {
echo '
It did not work at all. I'm not sure I added the db query in the right place and if the addition to the above line makes any sense at all. How can I get this page to just display those orders that have selected the Yes attribute?
Thanks for your help,
Dan