Forums / Templates, Stylesheets, Page Layout / Add checkout link to shopping cart side box below items

Add checkout link to shopping cart side box below items

Locked

Views: 3,017

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
24 May 2009, 4:54 PM
#1
makoshark avatar

makoshark

Zen Follower

Join Date:
Jun 2007
Location:
Laurinburg, NC
Posts:
165
Plugin Contributions:
0

Add checkout link to shopping cart side box below items

I have bee looking for an hour now but have not found what I am looking for
What I want to do is add a function to the shopping cart side box. I know you can click on the side box header to go to checkout, but to a customer it is not that obvious. So what I would like to do is add a link to the bottom of the shopping cart list that says checkout. Having this bringing them to the checkout page. I am learning how to use the template override system, but I do not know PHP (maybe I could fake it so everyone thinks I do):cool:
I am using 1.3.8a at http://shop.nilandsplace.com
Thanks James

24 May 2009, 7:52 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Add checkout link to shopping cart side box below items

You're talking about the shopping cart sidebox, right?

Two ways to do this...

Both are edits of the following file:

includes/templates/template_default/sideboxes/tpl_shopping_cart.php

FTP a copy of this file to your local machine.

Open it for editing, with a good PLAIN TEXT EDITOR, such as Crimson Editor.

Right at the bottom of the file, the following appears:

  }
  $content .= '</div>';
?>

You can either HARD CODE (the untidy method) the button link as follows

}
$content .= '</div>';

$content .= '<div id="checkoutButton"><a href="https://www.yourwebsite.com/index.php?main_page=checkout_shipping"><img src="includes/templates/your_template/buttons/english/button_checkout.gif" alt="Checkout" title=" Checkout " width="114" height="20" /></a></center></div>';

?>
``` NB: make sure you put in your website URL and apply any other custom stuff like width and height settings for your button image.

-----------------------------------------------------

Or use the tidy method (recommended):

```php
}
$content .= '</div>';

$content .= '<div class="checkoutButton"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div>';

?>

SAVE the file on your local drive.

On your remote server, navigate to:

includes/templates/YOUR_TEMPLATE/sideboxes/

and then FTP the edited file to that folder. If there is no folder called "sideboxes" in your template folder, create it.

NOTE: I have given this its own style ID (checkoutButton) so I can give it a style later if I like.

20 years a Zencart User

25 May 2009, 3:51 PM
#3
soyabeane avatar

soyabeane

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

thanks so much for this! Just what i was looking for :)

just a tiny problem. The color of the bar on which the checkout button sits is different from the rest of the sidebox.

is there any way i can change the color of that bar?

thks!

26 May 2009, 12:41 AM
#4
makoshark avatar

makoshark

Zen Follower

Join Date:
Jun 2007
Location:
Laurinburg, NC
Posts:
165
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

I did it the tidy method way and the code works great. Just one thing how do I center the button in the box?

26 May 2009, 10:21 AM
#5
soyabeane avatar

soyabeane

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

hey Makoshark,

try this:

add <div align="center"> after <div class="checkoutButton">

worked for me :)

26 May 2009, 2:28 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Add checkout link to shopping cart side box below items

soyabeane:

hey Makoshark,

try this:

add <div align="center"> after <div class="checkoutButton">

worked for me :)

Better like this:

<div align="center" class="checkoutButton">

or you'll need two closing </div> tags with your method... because you are nesting a <div> inside a <div>.

20 years a Zencart User

27 May 2009, 12:10 AM
#7
soyabeane avatar

soyabeane

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

cool thanks!

27 May 2009, 12:57 AM
#8
makoshark avatar

makoshark

Zen Follower

Join Date:
Jun 2007
Location:
Laurinburg, NC
Posts:
165
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

I got the code right the first time:D

/* modified to add checkout button to shopping cart sidebox*/
$content .= '<div class="checkoutButton"><div align="center"><a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a></div></div>';
?>
```> If anyone wants to see this in action I have set up a test account. So **please do not create accounts for testing**
> You can use this to test. User You can use this to test. User [email protected] and the password is test1234
> Here is my website click   [Nilands Place Campsite](http://shop.nilandsplace.com/camp/)
Have Fun makoshark AKA James
27 May 2009, 1:13 AM
#9
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

Ma,
Looks nice, thanks for the update on the fix..

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

7 Jun 2009, 5:59 PM
#10
scottdev avatar

scottdev

New Zenner

Join Date:
Dec 2008
Location:
San Diego, California
Posts:
54
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

That worked well for me too.

I would like to display the button only if there is something in the cart.

Otherwise, it does not display.

1.3.8
Go Daddy Hosted

16 Jun 2009, 3:51 PM
#11
hadi avatar

hadi

New Zenner

Join Date:
Jun 2009
Posts:
2
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

When using the "tidy" method, the zen_image_button() call seems to bring back the default_template button, not the one I've set up in my custom folders.

Is there a call needed somewhere in the overridden tpl_shopping_cart.php to make sure that zen_image_button() brings back the right image?

I'm using the "untidy" version for the time being!

16 Jun 2009, 3:58 PM
#12
hadi avatar

hadi

New Zenner

Join Date:
Jun 2009
Posts:
2
Plugin Contributions:
0

Re: Add checkout link to shopping cart side box below items

Many apologies - I'd mis-named the button image file.

Works a treat now.