Forums / Basic Configuration / Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

Locked

Started by dandy on 22 Jan 2007, 2:43 PM · Views: 3,730

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
22 Jan 2007, 2:43 PM
#1
dandy avatar

dandy

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

My shopping cart sidebox does not show the totals etc even though that's what I chose in the admin. Instead it shows a random New Product.

Is this how it should be or am I doing something wrong. I haven't messed with the template code. I am native to ASP:smartass: so PHP is not so easy for me to read LOL. So I'll post the sidebox code. Maybe you can see easier than I can if there's something missing.

Perhaps I am missing some step in Admin.

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cartt Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*/
  $content ='';
  if ($_SESSION['cart']->count_contents() > 0) {
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content .= '<div id="cartBoxListWrapper">' . "\n" . '<ul>' . "\n";
    $products = $_SESSION['cart']->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $content .= '<li>';
      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }
      $content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><a href="' . zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">';
      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $content .= '<span class="cartNewItem">';
      } else {
        $content .= '<span class="cartOldItem">';
      }
      $content .= $products[$i]['name'] . '</span></a></li>' . "\n";
      if (($_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
        $_SESSION['new_products_id_in_cart'] = '';
      }
    }
    $content .= '</ul>' . "\n" . '</div>';
  } else {
    $content = '<div class="sideBoxContent center bold">' . BOX_SHOPPING_CART_EMPTY . '</div>';
  }
  if ($_SESSION['cart']->count_contents() > 0) {
    $content .= '<hr />';
    $content .= '<div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
    $content .= '<br class="clearBoth" />';
  }
  if (isset($_SESSION['customer_id'])) {
    $gv_query = "select amount
                 from " . TABLE_COUPON_GV_CUSTOMER . "
                 where customer_id = '" . $_SESSION['customer_id'] . "'";
   $gv_result = $db->Execute($gv_query);
    if ($gv_result->fields['amount'] > 0 ) {
      $content .= '<div id="cartBoxGVButton"  class="sideBoxContent"><a href="' . zen_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_SEND_A_GIFT_CERT , BUTTON_SEND_A_GIFT_CERT_ALT) . '</a></div>'; 
      $content .= '<div class="sideBoxContent center bold">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
    }
  $content .= '';
  }
   $content_head = tm_box_head(BOX_HEADING_SHOPPING_CART,FILENAME_SHOPPING_CART);
 $content_cont = tm_box_cont($content_tm);
 
 $content = $content_head.$content_cont;
?>
 
22 Jan 2007, 3:24 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

Check in the admin > tools > layoutboxes controller > that sideboxes/shopping_cart.php is enabled..

Sounds like you are seeing the "Featured product" sidebox....

Note you must have items in the cart to see this

Zen-Venom Get Bitten

22 Jan 2007, 3:27 PM
#3
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

What version of Zen Cart are you running ... 'cos that code isn't from the current version.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

22 Jan 2007, 3:40 PM
#4
dandy avatar

dandy

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

kobra:

Check in the admin > tools > layoutboxes controller > that sideboxes/shopping_cart.php is enabled..

Sounds like you are seeing the "Featured product" sidebox....

Note you must have items in the cart to see this
I already have the New Products enabled on the left side. This shopping cart box is showing up on the right and is enabled. The product that is shows is always the same as what's on the left side...so it's the New Products that keep showing.

22 Jan 2007, 3:43 PM
#5
dandy avatar

dandy

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

kuroi:

What version of Zen Cart are you running ... 'cos that code isn't from the current version.
Intersting...
It's the latest version that I am running. I only downloaded it and installed it last week on about Thursday I believe.

The template is from Template Monster. For the price you'd think it would be up to date.

:censored:

22 Jan 2007, 3:45 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

Sorry that you got duped into a TM Template, these are full of issues.

Check that file against the one in includes/templates/template_default/sideboxes

Zen-Venom Get Bitten

22 Jan 2007, 3:46 PM
#7
dandy avatar

dandy

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

OK, well I just pasted the default template shopping cart side box page over the current and I see it. Now I just need to get it looking like my current template.

Ok, here goes....

:lamo:

22 Jan 2007, 3:48 PM
#8
dandy avatar

dandy

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

kobra:

Sorry that you got duped into a TM Template, these are full of issues.
Yes they are and they refuse to believe it. I loaded them up with over 2 dozen problems in a support ticket and all they could reply was:

"Read the instructions"

If I didn't like the template so much, they'd have been looking at a chargeback.

22 Jan 2007, 3:50 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

You will grow to like it less and less as the problems compound

Zen-Venom Get Bitten

23 Jan 2007, 9:38 AM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Shopping cart sidebox keeps showing random 'New Product' and no cart info :(

dandy:

The template is from Template Monster. For the price you'd think it would be up to date.That just explains so much.

I looked again at the code you posted and then in the last few lines throughs it away in favor of something generated by a couple of Template Monster functions.

I suspect that the idea is that you can comment out the Template Monster routines which are probably designed specifically to make the template look good with the very specific design that they have given it, and revert to the more flexible Zen Cart code. The troble is that this is a routine that has gone through a few evolutions recently and they haven't kept the bit they're not using up-to-date.

Your approach of replacing it with the one from the template_default, or better still simply deleting it from your template (in which case the template_default version will be used anyway) is exactly what I would have recommended.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)