Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    105
    Plugin Contributions
    0

    Default 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?
    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: how can I display product model number instead of name in the order history side

    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!

  3. #3
    Join Date
    May 2009
    Posts
    105
    Plugin Contributions
    0

    Default Re: how can I display product model number instead of name in the order history side

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

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: how can I display product model number instead of name in the order history side

    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:
    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:
    Code:
          $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:
    Code:
            $customer_orders[$rows]['name'] = $products_history->fields['products_name'];
    the line:
    Code:
            $customer_orders[$rows]['model'] = $products_history->fields['products_model'];
    Then, in the tpl_order_history.php change this line:
    Code:
            $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>&nbsp;&nbsp;<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:
    Code:
            $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>&nbsp;&nbsp;<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!

  5. #5
    Join Date
    May 2009
    Posts
    105
    Plugin Contributions
    0

    Default Re: how can I display product model number instead of name in the order history side

    Thank you very much. It works

 

 

Similar Threads

  1. v138a Can I show the Search Results in Product Model number Order?
    By nishajh in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 31 Mar 2012, 01:21 AM
  2. Search box not searching capitalized product name/model number
    By saitomedia in forum General Questions
    Replies: 2
    Last Post: 10 Feb 2010, 08:01 AM
  3. display model number on side box and main page
    By nishajh in forum General Questions
    Replies: 0
    Last Post: 17 Jun 2009, 06:27 AM
  4. Can't search product name / model in order box.
    By kimsonvu in forum General Questions
    Replies: 1
    Last Post: 26 Aug 2008, 09:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg