Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add Category Name to Product Listing above description

Add Category Name to Product Listing above description

Views: 4,865

Results 21 to 27 of 27
17 May 2011, 12:41 AM
#21
ev8321 avatar

ev8321

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Add Category Name to Product Listing above description

Worked Perfectly - Thank you so so much!

17 May 2011, 1:05 AM
#22
ajeh avatar

ajeh

Oba-san

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

Re: Add Category Name to Product Listing above description

You are most welcome ... thanks for the update that this is working for you ... :smile:

17 May 2011, 2:21 AM
#23
ev8321 avatar

ev8321

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: Add Category Name to Product Listing above description

Yep Shopping Cart Page working perfectly.

tpl_checkout_confirmation_default not so well.

This seems to be a but trickier.

tpl_checkout_confirmation_default

<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
        <tr class="<?php echo $order->products[$i]['rowClass']; ?>">

I HAVE ADDED -->        
<td class="cartSize"><?php echo zen_get_categories_name(zen_products_lookup($order->products[$i]['master_categories_id'])); ?></td>
-->

          <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
          <td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
          <?php  echo $stock_check[$i]; ?>

Any ideas.
I am pretty sure I am way off here. <-- Now that's confidence.

Thank you once again in advance.

17 May 2011, 5:43 AM
#24
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Add Category Name to Product Listing above description

You have
$order->products[$i]['master_categories_id']
when you want to look up from the product's id.
$order->products[$i]['id']
or whatever that field name is in this instance...

17 May 2011, 1:24 PM
#25
ajeh avatar

ajeh

Oba-san

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

Re: Add Category Name to Product Listing above description

I do not believe that the master_categories_id is available from the order class ... you will need to obtain the categories_id from the products_id with a different function ...

18 May 2011, 12:59 AM
#26
ev8321 avatar

ev8321

New Zenner

Join Date:
May 2011
Posts:
10
Plugin Contributions:
0

Re: Add Category Name to Product Listing above description

Thanks guys - any suggestions on where I can start with this?

18 May 2011, 1:07 AM
#27
ajeh avatar

ajeh

Oba-san

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

Re: Add Category Name to Product Listing above description

You can use the function:

function zen_get_categories_name_from_product($product_id) {