Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / how can I display product model number instead of name in the order history side box?

how can I display product model number instead of name in the order history side box?

Locked

Started by nishajh on 16 Sep 2009, 10:54 PM · Views: 1,911

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
16 Sep 2009, 10:54 PM
#1
nishajh avatar

nishajh

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

17 Sep 2009, 4:01 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

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 ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

18 Sep 2009, 8:22 AM
#3
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Post #3 by nishajh

Can you please give me the step by step instruction and code?
Thanks

18 Sep 2009, 1:54 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

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 ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

18 Sep 2009, 10:05 PM
#5
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Post #5 by nishajh

Thank you very much. It works
:smile: