Glenn,
I added the code but the product name and image are not displaying. All that is showing is this "()" and it links to the index page. I will leave the code in so you can see what it is doing.
Do I have to define these?
define('CART_PRODUCT_QTY_PRE', ' (');//put in cart_header_defines.php
define('CART_PRODUCT_QTY_POST', ') ');//put in cart_header_defines.php
The entire code that I have in tpl_cart_header.php is below. I don't know how to add code to the forum like you did above. Is there a button to do that?
<?php
/**
* tpl_cart_header.php
* @copyright Copyright 2012 Glenn Herbert
* @copyright Portions Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license <http://www.gnu.org/licenses/> GNU Public License V3.0
* /includes/templates/your_template/templates/tpl_cart_header.php
* Shoppingcart/Freeship in Header - Glenn Herbert (gjh42) - 2012-11-20
*/
$cart_count = $_SESSION['cart']->count_contents();
?>
<div id="cartHeader">
<h3><?php echo ($cart_count? '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . CART_HEADER_TITLE . '</a>':CART_HEADER_TITLE); ?></h3>
<div id="cartCount">
<?php
if ($cart_count) {
$cart_header_products = $_SESSION['cart']->get_products();
define('CART_PRODUCT_QTY_PRE', ' (');//put in cart_header_defines.php
define('CART_PRODUCT_QTY_POST', ') ');//put in cart_header_defines.php
echo '<div id="cartProducts">';
for ($item=0; $item<sizeof($cart_header_products); $item++) {
echo '<a href="' . $cart_header_products[$item]['linkProductsName'] . '"><span class="cartProdImage">' . $cart_header_products[$item]['productsImage'] . '</span><span class="cartProdQty">' . CART_PRODUCT_QTY_PRE . $cart_header_products[$item]['quantityField'] . CART_PRODUCT_QTY_POST . '</span><span class="cartProdTitle">' . $cart_header_products[$item]['productsName'] . '<span class="alert bold">' . $cart_header_products[$item]['flagStockCheck'] . '</span></span></a>' . "\n";
}
echo '</div>';
$basket_total = $_SESSION['cart']->show_total();
echo '<span id="cartTotal">' . CART_HEADER_TOTAL . $currencies->format($basket_total) . '</span><br />
' ;
}
echo ($cart_count? '':'') . CART_HEADER_IN_CART_PRE . $cart_count . (($cart_count == 1)? CART_HEADER_IN_CART_SINGULAR: CART_HEADER_IN_CART_PLURAL) . ($cart_count? '': '');
?>
</div>
<?php
if ($cart_count) {
echo '<div class="buttonRow back"><a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_VIEW_CART, BUTTON_VIEW_CART_ALT) . '</a></div>';
echo '<div class="buttonRow forward"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>';
} ?>
</div>