Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add Checkout button to product page

Add Checkout button to product page

Locked

Views: 1,380

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Dec 2009, 2:46 PM
#1
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Add Checkout button to product page

I looked through forum and could not find answer. Please direct me if I missed it.

I would like to add the go to checkout button at product page right next to add this to my cart button. I use TPP-tabed products pro

Here is link to product..I want it on main product information page.

http://www.burnerbooks.com/index.php?main_page=product_info&cPath=660_504_526&products_id=827

I am thinking I insert into this file. Not sure if correct and coding?

/includes/templates/YOURTEMPLATE/templates/tpl_product_info_display.php

Kim

24 Dec 2009, 11:52 PM
#2
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Add Checkout button to product page

kburner:

I looked through forum and could not find answer. Please direct me if I missed it.

I would like to add the go to checkout button at product page right next to add this to my cart button. I use TPP-tabed products pro

Here is link to product..I want it on main product information page.

http://www.burnerbooks.com/index.php?main_page=product_info&cPath=660_504_526&products_id=827

I am thinking I insert into this file. Not sure if correct and coding?

/includes/templates/YOURTEMPLATE/templates/tpl_product_info_display.php

Kim

Anyone know how to add checkout button to product page? :frusty:

29 Dec 2009, 12:11 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Add Checkout button to product page

What if there are NO products in the cart? Surely you will also need a CONDITIONAL that makes the button display ONLY when there is something to checkout?

29 Dec 2009, 12:34 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Add Checkout button to product page

Actually, while this can be done, there is no logic to it.

The Product Info page is there to ADD a product to a cart. If you also have a button that goes to checkout, then your shoppers could go to checkout "by accident", and before they have a chance to ADD the product they are currently viewing...

They will be offered TWO buttons. Either they:-

  1. ADD the product on display to the cart, OR
  2. Don't add it - but go to checkout

You would do better to invoke the shopping cart sidebox and put some buttons in there. I have done this, with the sidebox to show ONLY when there is something in the cart, and ONLY when not on the shopping cart main page.

GO HERE and add the product you see to the cart, then look at the top left column.

Tell me if this is a better idea.

If you are determined to have the button on the INFO page (which I think is a bad idea) then the following code in tpl_product_info_display.php may be what you are after:

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>    
<div id="checkoutOnInfoPage"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
<?php
 }
?>

The above DIV is given a style ID of checkoutOnInfoPage, allowing you set a style in the CSS.

29 Dec 2009, 2:05 PM
#5
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Add Checkout button to product page

schoolboy:

Actually, while this can be done, there is no logic to it.

The Product Info page is there to ADD a product to a cart. If you also have a button that goes to checkout, then your shoppers could go to checkout "by accident", and before they have a chance to ADD the product they are currently viewing...

They will be offered TWO buttons. Either they:-

  1. ADD the product on display to the cart, OR
  2. Don't add it - but go to checkout

You would do better to invoke the shopping cart sidebox and put some buttons in there. I have done this, with the sidebox to show ONLY when there is something in the cart, and ONLY when not on the shopping cart main page.

GO HERE and add the product you see to the cart, then look at the top left column.

Tell me if this is a better idea.

If you are determined to have the button on the INFO page (which I think is a bad idea) then the following code in tpl_product_info_display.php may be what you are after:

<?php if ($_SESSION['cart']->count_contents() != 0) { ?> <div id="checkoutOnInfoPage"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div> <?php } ?> ``` > > The above DIV is given a style ID of **checkoutOnInfoPage**, allowing you set a style in the CSS.

Yes! Your site with sidebox will work! I am using the Shopping cart sidebox. It does not have edit cart button. How did you add code to your sidebox?

You have really nice site! I like way it is lay out and colors.

29 Dec 2009, 2:49 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Add Checkout button to product page

This is a quick and easy "hack" that you can use to put the buttons into the shopping cart sidebox.

Steps:

  1. create TWO small image buttons called button_edit_cart.gif and **button_checkout_sm.gif
    **.

If you like, you can COPY those little images off my site's sidebox using these URL's:

http://www.modshops.co.uk/demoshop/includes/templates/your_template/buttons/english/button_edit_cart.gif

and

http://www.modshops.co.uk/demoshop/includes/templates/your_template/buttons/english/button_checkout_sm.gif
  1. SAVE those images to: includes/templates/kim/buttons/english/

  2. Open the following file for editing:

includes/templates/template_default/sideboxes/tpl_shopping_cart.php

right at the bottom you will see:

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

Just underneath the $content .='</div>';

add this:

  $content .= '<div id="checkoutButton"><center><a href="index.php?main_page=shopping_cart"><img src="includes/templates/kim/buttons/english/button_edit_cart.gif" alt="Edit Cart" title=" Edit Cart " width="61" height="20" /></a> <a href="index.php?main_page=checkout_shipping"><img src="includes/templates/kim/buttons/english/button_checkout_sm.gif" alt="Checkout" title=" Checkout " width="61" height="20" /></a></center></div>';

... so you get:

   $content .= '</div>';
  $content .= '<div id="checkoutButton"><center><a href="index.php?main_page=shopping_cart"><img src="includes/templates/kim/buttons/english/button_edit_cart.gif" alt="Edit Cart" title=" Edit Cart " width="61" height="20" /></a> <a href="index.php?main_page=checkout_shipping"><img src="includes/templates/kim/buttons/english/button_checkout_sm.gif" alt="Checkout" title=" Checkout " width="61" height="20" /></a></center></div>';
  ?>

You should actually SAVE this to your custom template system (kim), so you have it in...

includes/templates/kim/sideboxes/tpl_shopping_cart.php

30 Dec 2009, 4:17 PM
#7
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Add Checkout button to product page

schoolboy:

This is a quick and easy "hack" that you can use to put the buttons into the shopping cart sidebox.

Steps:

  1. create TWO small image buttons called button_edit_cart.gif and **button_checkout_sm.gif
    **.

If you like, you can COPY those little images off my site's sidebox using these URL's:

http://www.modshops.co.uk/demoshop/includes/templates/your_template/buttons/english/button_edit_cart.gif

> and
> ```
http://www.modshops.co.uk/demoshop/includes/templates/your_template/buttons/english/button_checkout_sm.gif
  1. SAVE those images to: includes/templates/kim/buttons/english/

  2. Open the following file for editing:

includes/templates/template_default/sideboxes/tpl_shopping_cart.php

right at the bottom you will see:

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

> 
> Just underneath the ***$content .='</div>';***
> 
> add this:
> 
> ```php
  $content .= '<div id="checkoutButton"><center><a href="index.php?main_page=shopping_cart"><img src="includes/templates/kim/buttons/english/button_edit_cart.gif" alt="Edit Cart" title=" Edit Cart " width="61" height="20" /></a> <a href="index.php?main_page=checkout_shipping"><img src="includes/templates/kim/buttons/english/button_checkout_sm.gif" alt="Checkout" title=" Checkout " width="61" height="20" /></a></center></div>';

... so you get:

$content .= '</div>';
$content .= '<div id="checkoutButton"><center><a href="index.php?main_page=shopping_cart"><img src="includes/templates/kim/buttons/english/button_edit_cart.gif" alt="Edit Cart" title=" Edit Cart " width="61" height="20" /></a> <a href="index.php?main_page=checkout_shipping"><img src="includes/templates/kim/buttons/english/button_checkout_sm.gif" alt="Checkout" title=" Checkout " width="61" height="20" /></a></center></div>';
?>

> 
> You should actually SAVE this to your custom template system (kim), so you have it in...
> 
> includes/templates/kim/sideboxes/tpl_shopping_cart.php


Thank you!:clap: :clap:Thank you! It looks so much better!

Kim