Zen Cart Logo
Forums / General Questions / Show Product Category in Customer Order Screen

Show Product Category in Customer Order Screen

Views: 575

Results 1 to 8 of 8
15 Jan 2012, 9:46 PM
#1
crottmann avatar

crottmann

New Zenner

Join Date:
Dec 2011
Posts:
4
Plugin Contributions:
0

Show Product Category in Customer Order Screen

When looking at the Customer Order Screen I would like to see the category that the product came from in addition to the product name. Any ideas as how to make this happen? Thanks!

16 Jan 2012, 3:23 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Category in Customer Order Screen

For the Admin orders.php or the Catalog tpl_account_history_info_default.php page, you can use:

zen_get_categories_name_from_product($order->products[$i]['id'])

to get the Category Name of the Product ...

17 Jan 2012, 3:43 PM
#3
crottmann avatar

crottmann

New Zenner

Join Date:
Dec 2011
Posts:
4
Plugin Contributions:
0

Re: Show Product Category in Customer Order Screen

Where exactly would i put that line of code in the orders.php file? Thank you for your help!

17 Jan 2012, 3:49 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Category in Customer Order Screen

Around line 567 you will see the code:

      echo '          <tr class="dataTableRow">' . "\n" .
           '            <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
           '            <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

You can add that where you want to see the Category name ...

17 Jan 2012, 4:06 PM
#5
crottmann avatar

crottmann

New Zenner

Join Date:
Dec 2011
Posts:
4
Plugin Contributions:
0

Re: Show Product Category in Customer Order Screen

I cant seem to figure this out. I inserted the code as seen below

echo ' </td>' . "\n" .
' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
' <td class="dataTableContent" valign="top">' . zen_get_categories_name_from_product($order->products[$i]['id']) . '</td>' . "\n" .
' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .
' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

it didnt seem to do anything when i uploaded it to the server and checked it out. any ideas? i honestly dont have much of a clue as to what im doing with this. its been a loooong time since ive touched a zencart install. again, thanks for the help!

17 Jan 2012, 4:13 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Category in Customer Order Screen

Where did you get your code?

I see:
tep_display_tax_value

that is osC code not Zen Cart ...

I am also suspecting we are talking about two different files ...

Are you working on the:
/admin/orders.php

or one of the files in the Catalog?

17 Jan 2012, 4:40 PM
#7
crottmann avatar

crottmann

New Zenner

Join Date:
Dec 2011
Posts:
4
Plugin Contributions:
0

Re: Show Product Category in Customer Order Screen

you are prob right about osC. I was told it was a zen install that we had and i just jumped in. I thought it was weird that the admin folder was damn near empty of files that i expected to see on the server. they both look identical on the back end if it is in fact osC. Thanks for the help on this, guess i need to head to the osc forums after i determine if that is in fact what i am using.

17 Jan 2012, 4:56 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Show Product Category in Customer Order Screen

You might look in your Tools ... Server Info ... and see what you have ...

Or, look at your files and see what the headers read ...