Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / how do i show model # in shopping cart

how do i show model # in shopping cart

Locked

Views: 2,544

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
27 Oct 2006, 12:40 AM
#1
flowerguy avatar

flowerguy

New Zenner

Join Date:
Jun 2006
Posts:
9
Plugin Contributions:
0

how do i show model # in shopping cart

A little more help if you please. I found a post by "ingenuitor" dated Sept. 20 where he (she) posted some code to make the modle # show in the shopping cart.
This was - ```
$products_name = '<table border="0" cellspacing="0" cellpadding="0" width=100%>' .
' <tr>' .
' <td class="ZZZproductListing-data" align="center" width=85><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">' . (IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT,'class=image_border') : '') . '</a> </td>'

' <td class="ZZZproductListing-data" valign="top"><a style="font-size:10px;" href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">' . $products[$i]['model'] . '<br>' . $products[$i]['name'] . '</a> <span>' . $products[$i]['description'] .'<span>';


but I don't know where to place it. Can anyone help me with this?
27 Oct 2006, 1:16 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: how do i show model # in shopping cart

You could do a lookup for any additional field that you want based on:
$products[$i]['id']

But you may need to write a function to do so ...

27 Oct 2006, 3:36 AM
#3
flowerguy avatar

flowerguy

New Zenner

Join Date:
Jun 2006
Posts:
9
Plugin Contributions:
0

Re: how do i show model # in shopping cart

It works:yes: If you go to includes/template_default/templates/tpl_shopping_cart_default.php and find line 159 thru 163. It should start with "$product_name" and end with "<span>';". If you replace that code with the one listed above your customers will then see the mobel number in the shopping cart. Thanks all you guys are great!:D

18 Nov 2006, 12:02 AM
#4
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: how do i show model # in shopping cart

I would like to display the category name just before the product name instead of the model #. Any suggestions? I looked at the code, but this one doesn't quite jump out at me.

18 Nov 2006, 12:35 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: how do i show model # in shopping cart

The easiest method is to use a function ...

Oh lookie a handy dandy function built into Zen Cart ... :eek:

echo zen_get_categories_name_from_product($product_id);

Where $products_id would be the Product products_id based on where you are when you use it ...

On the shopping_cart that would be:
$products[$i]['id']

echo zen_get_categories_name_from_product($products[$i]['id']);

Now just stick that somewhere nice in the code ... :smartass:

18 Nov 2006, 2:37 PM
#6
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: how do i show model # in shopping cart

thanks a bunch. I knew there should be a function already set for pulling the category name but I hadn't had a chance to go through the general functions to see what I could find -

I want to add it between the image and the Item name referring to it as "Item Type, so this should be tricky on the layout. Fortunately this site is a 100% layout and offers a bit more space in the cart area.

I'll try your code and let you know how it works out.

Once again.. Linda has the answer!!

Thanks

18 Nov 2006, 6:20 PM
#7
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: how do i show model # in shopping cart

Ok, I've got the layout figured out and the code is in, but it is not pulling a result, but no error - Here's a link to my testing site - All you need do is just stick something in the cart. My header name for this cell is "Item Type"

http://www.randbhosting.net/zen135/index.php?main_page=shopping_cart

Here's my code from tpl_shopping_cart_default

</td>
<td class="cartCatDisplay"><?php echo zen_get_categories_name_from_product($products[$i]['id']);?></div></td>

   <td class="cartProductDisplay">

<a href="<?php echo $product['linkProductsName']; ?>"><div id="cartImage" class="back"><?php echo $product['productsImage']; ?></div><div id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></div></a>

<br class="clearBoth" />

Any ideas? I would have thought it would have pulled it right in.

Thanks for your help!!

18 Nov 2006, 6:38 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: how do i show model # in shopping cart

Try using $product['id'] instead ...

Note: your cross-sell is not having a good day and throwing errors all around ... :cry:

18 Nov 2006, 8:24 PM
#9
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: how do i show model # in shopping cart

Ajeh:

Try using $product['id'] instead ...

Note: your cross-sell is not having a good day and throwing errors all around ... :cry:
That worked just perfect!! Thank you!!

On the Cross Sell -

That's because I just threw this template and it's configs on this test site. Not all the files are there. I'll revert it back to generic now that I have this figure out. This is just where I try stuff out when the site I'm working on is live.

Thanks again!!