Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add a column to the shopping cart page

Add a column to the shopping cart page

Views: 906

Results 1 to 5 of 5
30 Nov 2011, 4:16 AM
#1
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Add a column to the shopping cart page

I have been trying to change the shopping cart layout from
QTY - ITEM NAME - UNIT - TOTAL
to
QTY - MODEL - ITEM NAME - UNIT - TOTAL
for about the last few hours.
I'm pretty sure I'm going to need to edit the pages/shopping_cart/header_php.php file as well as the tpl_shopping_cart_default.php (both in overrides, of course!) but I have been running into a dead end on exactly how to do this. :frusty:

I added this:

<span id="cartProdModel"><?php echo $products['productsModel']; ?></span>
``` to the <td class="cartProductDisplay"> section of the tpl and
this:

line 85: $productsModel = $products[$i]['model'];
line 156: 'productsModel'=>$productsModel,


Any ideas???
30 Nov 2011, 8:50 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Add a column to the shopping cart page

I did this a couple of years ago, and you have to make a change to a module file as well. I'll try to find my notes and if I do I will post the solution. But yes... adding a column for model number is indeed possible.

30 Nov 2011, 8:51 AM
#3
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Add a column to the shopping cart page

Here is how I add the model number to the item name if it will help.

In your templates > templates > tpl_shopping_cart_default.php

Find this 
        <td class="cartProductDisplay">
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<br class="clearBoth" />
 
 And replace with this 
 
 
 <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>'; ?><br />Model #: <br /><?php echo zen_products_lookup($product['id'], 'products_model'); ?></div></a>
<br class="clearBoth" />

It will show the model number along with the name

This is probably the code you need

Model #: <br /><?php echo zen_products_lookup($product['id'], 'products_model'); ?>

30 Nov 2011, 7:52 PM
#4
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Add a column to the shopping cart page

usernamenone:

Here is how I add the model number to the item name if it will help.

In your templates > templates > tpl_shopping_cart_default.php

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

And replace with this

<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>'; ?><br />Model #: <br /><?php echo zen_products_lookup($product['id'], 'products_model'); ?></div></a> <br class="clearBoth" /> ``` > > It will show the model number along with the name > > This is probably the code you need > > Model #: <br /><?php echo zen_products_lookup($product['id'], 'products_model'); ?>

looks like this should work! I'll let you know for sure.
Thanks!:thumbsup:

30 Nov 2011, 8:14 PM
#5
mikestaps avatar

mikestaps

Zen Follower

Join Date:
Aug 2010
Location:
Grand Blanc, MI
Posts:
305
Plugin Contributions:
1

Re: Add a column to the shopping cart page

Worked perfectly, Thanks again.