Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default 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.

    I added this:
    PHP Code:
    <span id="cartProdModel"><?php echo $products['productsModel']; ?></span>
    to the <td class="cartProductDisplay"> section of the tpl and
    this:
    Code:
    line 85: $productsModel = $products[$i]['model'];
    line 156: 'productsModel'=>$productsModel,
    to the header with no luck.

    Any ideas???

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default 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.
    20 years a Zencart User

  3. #3
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default 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.

    Code:
    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'); ?>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Play with it long enough and you will break it.

  4. #4
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Add a column to the shopping cart page

    Quote Originally Posted by usernamenone View Post
    Here is how I add the model number to the item name if it will help.

    Code:
    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!

  5. #5
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Add a column to the shopping cart page

    Worked perfectly, Thanks again.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 18 Jun 2012, 01:02 AM
  2. Replies: 7
    Last Post: 22 Jun 2011, 05:01 PM
  3. All I want to use is the shopping cart and 'add to cart' buttons...?
    By odecom5 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 27 May 2007, 04:03 PM
  4. can I add a text link on the shopping cart page
    By jdsmith8 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Nov 2006, 12:14 AM

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