Zen Follower
- Join Date:
- May 2009
- Posts:
- 105
- Plugin Contributions:
- 0
Post #1 by nishajh
how can I display product model number instead of name in the order history side box?
Thanks
Started by nishajh on 16 Sep 2009, 10:54 PM · Views: 1,911
Zen Follower
how can I display product model number instead of name in the order history side box?
Thanks
Oba-san
Using your templates and overrides you can customize the order_history.php sidebox ...
You need to customize the select statement to grab the products_model field from the products table ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Zen Follower
Can you please give me the step by step instruction and code?
Thanks
Oba-san
Sideboxes are made of two files, in this case:
/includes/modules/sideboxes/order_history.php
/includes/templates/template_default/sideboxes/tpl_order_history.php
Whether I change 1 or both files, I prefer to copy both to my templates and overrides:
/includes/modules/sideboxes/your_template_dir/order_history.php
/includes/templates/your_template_dir/sideboxes/tpl_order_history.php
In the order_history.php file change this code:
$products_history_query = "select products_id, products_name
from " . TABLE_PRODUCTS_DESCRIPTION . "
where products_id in (" . $product_ids . ")
and language_id = '" . (int)$_SESSION['languages_id'] . "'
order by products_name";
to get the products_model to read:
$products_history_query = "select p.products_id, p.products_model, pd.products_name
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id in (" . $product_ids . ")
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by products_name";
Also add under the line:
$customer_orders[$rows]['name'] = $products_history->fields['products_name'];
the line:
$customer_orders[$rows]['model'] = $products_history->fields['products_model'];
Then, in the tpl_order_history.php change this line:
$content .= '<li><a href="' . zen_href_link(zen_get_info_page($customer_orders[$i]['id']), 'products_id=' . $customer_orders[$i]['id']) . '">' . $customer_orders[$i]['name'] . '</a> <a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $customer_orders[$i]['id']) . '">' . zen_image($template->get_template_dir(ICON_IMAGE_TINYCART, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TINYCART, ICON_TINYCART_ALT) . '</a></li>' . "\n" ;
to read:
$content .= '<li><a href="' . zen_href_link(zen_get_info_page($customer_orders[$i]['id']), 'products_id=' . $customer_orders[$i]['id']) . '">' . $customer_orders[$i]['name'] . ' ' . $customer_orders[$i]['model'] . '</a> <a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $customer_orders[$i]['id']) . '">' . zen_image($template->get_template_dir(ICON_IMAGE_TINYCART, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TINYCART, ICON_TINYCART_ALT) . '</a></li>' . "\n" ;
You will now see both the Product Name and Product Model in the sidebox and can adjust it as needed ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Zen Follower
Thank you very much. It works
:smile:
Tell staff why this post should be reviewed.