Forums / All Other Contributions/Addons / Shopping cart sidebox with checkout button BUT doesn't go to checkout

Shopping cart sidebox with checkout button BUT doesn't go to checkout

Locked

Views: 5,489

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
28 Jan 2008, 2:31 PM
#1
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Shopping cart sidebox with checkout button BUT doesn't go to checkout

I've just installed the add-on Shopping cart sidebox with checkout button and product image. According to the readme, this module is a combination of: 1) Shopping cart with checkout button sidebox by Wilkesy and 2) Shopping Cart with Image Sidebox by kuroi. It consists of one page that over-writes tpl_shopping_cart.php.

I love the idea of this simple add-on but when I click on the Go to Checkout button it takes me to the shopping_cart page instead. It seems as though it should go to the login page, correct? This happens both when I'm logged in and when I'm not.

I looked into the contents of the php file but can't see where I might make changes to affect this. I've included the entire contents below:

<?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
 * @version $Id: tpl_shopping_cart.php 2007-03-15 kuroi $
 */
  $content ="";

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  if ($_SESSION['cart']->count_contents() > 0) {
  $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 .= zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '<br>' . $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 id="cartBoxEmpty">' . 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->RecordCount() && $gv_result->fields['amount'] > 0 ) {
      $content .= '<div id="cartBoxGVButton"><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 id="cartBoxVoucherBalance">' . VOUCHER_BALANCE . $currencies->format($gv_result->fields['amount']) . '</div>';
    }
  }
  $content .= '</div>';
?>

Any idea how to re-direct the checkout button to the login page? I am running 1.3.6 and this may be the culprit.

Thanks

29 Jan 2008, 6:57 PM
#2
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

It does to the checkout for me on your Beadlily site.

29 Jan 2008, 8:15 PM
#3
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

helpme:

It does to the checkout for me on your Beadlily site.

Really?! That's odd - For me it goes to the shopping cart in both IE & FF. :huh:

Would anyone else be willing to throw something in the shopping cart at BeadedLily and hit the checkout button located within the shopping cart sidebox? Thanks!!

29 Jan 2008, 9:46 PM
#4
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

Oh, I'm sorry I miss read your post.....yes it goes to the shopping cart, and actually I just installed this on my site and it also goes to the shopping cart, I'm using 1.3.7
At first I thought it should go to the login page also, but then nowone could revise their cart. Right?

30 Jan 2008, 6:55 AM
#5
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

helpme:

Oh, I'm sorry I miss read your post.....yes it goes to the shopping cart, and actually I just installed this on my site and it also goes to the shopping cart, I'm using 1.3.7
At first I thought it should go to the login page also, but then nowone could revise their cart. Right?

It seems to me that it should go to the same place that the checkout button on the shopping cart page goes to: Either to checkout_shipping if you are logged in or to the login page.

30 Jan 2008, 10:30 AM
#6
kuroi avatar

kuroi

Totally Zenned

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

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

The code that you have posted is from the shopping cart sidebox with image that I corrected (but had completely forgotten about!) not from the version with image and button. That's why you can't find the the button code.

When you go into the correct version, the code that you are looking for is this ```php
$content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>';


Don't worry about whether a visitor is already logged in or not. Zen Cart will take care of that automatically if they're not.

Kuroi Web Design and Development | Twitter

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

30 Jan 2008, 2:00 PM
#7
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

kuroi:

The code that you have posted is from the shopping cart sidebox with image that I corrected (but had completely forgotten about!) not from the version with image and button. That's why you can't find the the button code.

When you go into the correct version, the code that you are looking for is this ```php
$content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>';

> 
> Don't worry about whether a visitor is already logged in or not. Zen Cart will take care of that automatically if they're not.

I, too saw that I had posted the wrong code, although I did use the proper code on my site. 

I hate to be thick (I just can't help it!) but the necessary change is not obvious. I did look at the code and made a few changes but certainly not the correct ones! Would you be so kind as to clarify a bit? Thanks for your help!

Tim
31 Jan 2008, 2:38 PM
#8
kuroi avatar

kuroi

Totally Zenned

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

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

Provided all the conditions are met to allow the checkout to proceed to shipping page, you would need to replace FILENAME_SHOPPING_CART with FILENAME_CHECKOUT_SHIPPING and set Admin > Configuration > My Store > Show Cart after adding product to false.

However, there is still a risk that Zen Cart will return you to page from which you came, rather than onward to checkout shipping. You'd have to try it and see.

Kuroi Web Design and Development | Twitter

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

31 Jan 2008, 5:35 PM
#9
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

kuroi:

Provided all the conditions are met to allow the checkout to proceed to shipping page, you would need to replace FILENAME_SHOPPING_CART with FILENAME_CHECKOUT_SHIPPING and set Admin > Configuration > My Store > Show Cart after adding product to false.

However, there is still a risk that Zen Cart will return you to page from which you came, rather than onward to checkout shipping. You'd have to try it and see.

Beautiful - That did the trick. Thanks for taking the time to help. I certainly do muck around with php all the time but sometimes the logic eludes me.

Thanks again!

30 May 2008, 9:21 AM
#10
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

I've installed this module into a new zencart and have included the modifications discussed in this thread. Everything works as it should.

My question concerns the checkout image that is called to be displayed in the sidebox. What changes would I need to make to tpl_shopping_cart.php so that a different checkout image is called? The problem is that the sidebox is a dark background while the main page is light and therefore the same image won't work visually on both.

Thanks for whatever help or hints you can offer.

20 Jun 2008, 4:53 PM
#11
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

MeltDown:

I've installed this module into a new zencart and have included the modifications discussed in this thread. Everything works as it should.

My question concerns the checkout image that is called to be displayed in the sidebox. What changes would I need to make to tpl_shopping_cart.php so that a different checkout image is called? The problem is that the sidebox is a dark background while the main page is light and therefore the same image won't work visually on both.

Thanks for whatever help or hints you can offer.

I'm still having trouble with this one. My attempts so far at calling a second, darker background checkout image have proven to be painfully unsuccessful. Any hints on how this might be achieved?

Thanks

20 Jun 2008, 5:10 PM
#12
kuroi avatar

kuroi

Totally Zenned

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

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

This is the button being called includes/templates/cherry_zen/buttons/english/button_checkout.gif. If you add a button to that folder called say button_checkout_dark.gif, and then change the following line > $content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>';to> $content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button('button_checkout_dark.gif', BUTTON_CHECKOUT_ALT) . '</a>';then you should get the result you're after.

P.S. You have a whole heap of serious validation errors on your site of the sort that compromise each page's structure. I recommend taking a look at how you can sort them out.

Kuroi Web Design and Development | Twitter

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

21 Jun 2008, 4:45 AM
#13
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

kuroi:

This is the button being called includes/templates/cherry_zen/buttons/english/button_checkout.gif. If you add a button to that folder called say button_checkout_dark.gif, and then change the following line tothen you should get the result you're after.

P.S. You have a whole heap of serious validation errors on your site of the sort that compromise each page's structure. I recommend taking a look at how you can sort them out.

Thanks for the help, Kuroi, I really appreciate you taking the time.

Tell me, what is the best way to see those validation errors?

21 Jun 2008, 9:14 AM
#14
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

Nevermind - I found a validation site

21 Jun 2008, 10:37 AM
#15
kuroi avatar

kuroi

Totally Zenned

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

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

Other quicker ways to validate are from the Tool menu in Firefox's Firebug or the Validate menu in Internet Explorer's Developer Toolbar.

Kuroi Web Design and Development | Twitter

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

27 Aug 2008, 3:56 PM
#16
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Shopping cart sidebox with checkout button BUT doesn't go to checkout

I'm using PayPal Express Checkout as my only checkout option. Because of this I've removed the standard zen checkout button from the shopping_cart page, leaving just the PayPal checkout button. Now I would like to replace the standard Zen checkout button that is in use in this Shopping cart sidebox with checkout button module with a PayPal button. Is that possible? If so, which filename would I call?

Thanks!!
PS I would think that this module modified to be shopping cart with PayPal checkout button and product image could be quite popular!