Zen Cart Logo
Forums / Addon Sideboxes / shopping cart with checkout button and product image

shopping cart with checkout button and product image

Locked

Views: 4,372

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
14 Nov 2007, 3:41 PM
#1
metalarea avatar

metalarea

New Zenner

Join Date:
Sep 2007
Posts:
23
Plugin Contributions:
0

shopping cart with checkout button and product image

This module will put an image of the product in your shopping cart sidebox and also provide a checkout button at the bottom of the shopping cart sidebox.

This module is a combination of:

  1. Shopping cart with checkout button sidebox by Wilkesy

and

  1. Shopping Cart with Image Sidebox by kuroi

all i did was put the 2 together. It works perfectly on 1.3.7

There is only 1 file to replace - please make a copy of the file you are replacing or backup your site before using.

14 Nov 2007, 5:47 PM
#2
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: shopping cart with checkout button and product image

Sounds great..have you submitted to downloads section?
If not, where can it be downloaded please?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

28 Jul 2008, 11:07 PM
#4
dreamguard avatar

dreamguard

New Zenner

Join Date:
Feb 2008
Posts:
1
Plugin Contributions:
0

Re: shopping cart with checkout button and product image

Hi,

I will modify this sidebox for show the price of the products that have add to cart, but I don't know how can show the price plus the quantity.

this is my code:

<?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">';
      }

        $products_price = zen_get_products_display_price($products[$i]);
		$content .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER . $products[$i]['name'] . $products_price . '</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) . '</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" />';
	$content .= '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>';
  }

  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>';
?>

Sorry I not programer and my english is not good.

Regards

12 Dec 2008, 1:16 AM
#5
jgraphics avatar

jgraphics

New Zenner

Join Date:
Oct 2006
Posts:
75
Plugin Contributions:
0

Re: shopping cart with checkout button and product image

Hello all,
I have combined the side shopping cart with product images and checkout button with the free shipping side shopping cart.

I have two issues that I need some help with:

1.) The text that reads "Your order qualifies for free shipping!" Is aligned kinda crappy. It starts to the right and at the top of the "Checkout Button" image, then proceeds to finish the sentence under the button. I would like the text to be all above the "Checkout Button".

2.) Id like to add the "Checkout with PayPal" button into the side cart as well. I need the word "or" in between the "Checkout Button" and the "Checkout with PayPal Button"

Here is the code I have so far:

[B][URL="http://www.zen-cart.com/forum/../index.php?main_page=product_contrib_info&products_id=787"]<title></title><?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" />';
    $content .= '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>';
  }

//Begin free shipping qualifier
$free_ship_on = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING;

if ($free_ship_on == 'true') {
  $free_limit = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
  if ($_SESSION['cart']->count_contents() > 0) { 
     $_SESSION['cart']->get_products(); 
     $basket_total = $_SESSION['cart']->show_total(); 
     if ($basket_total < $free_limit) { 
        $diff_to_free = ($free_limit - $basket_total); 
        $content .= '<span class="alert">' . 'Add '. $currencies->format($diff_to_free) .' to your order to qualify for Free Shipping in the USA!' . '</span>'; 
     } else { 
        $content .= '<span class="alert">' . 'Your order qualifies for Free Shipping in the USA!' . '</span>'; 
     } 
  } else { 
        $content .= '<span class="alert">' . 'Free Shipping for orders of ' . $currencies->format($free_limit) . ' or more in the USA!' . '</span>'; 
  }
  } 
//End of free shipping qualifier

  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>';
?>

[/URL][/B]
22 Dec 2008, 6:29 PM
#6
pglad avatar

pglad

Zen Follower

Join Date:
Jun 2007
Posts:
198
Plugin Contributions:
0

Re: shopping cart with checkout button and product image

Do you have the URL for your site?