Wow - Very well constructed and complete add-on! Installed and succesfully running it through the hoops on Zen version 1.3.6. (I have a manual credit card POS so no PayPal testing here)
Previously I had the shopping_cart_sidebox_with_checkout_button_and_product_image_1.1 add-on installed and was pleased with it. (It is a 1-page add-on that modifies tpl_shopping_cart.php) Because I didn't want to lose the image and checkout button in the sidebox I merged the modified tpl_shopping_cart.php with the tpl_shopping_cart_with_rewards.php from this add-on. After quite a bit of live-store testing in both IE and FF, the modification doesn't seem to have negatively influenced the Rewards add-on. If anyone is interested, here is the modified tpl_shopping_cart_with_rewards.php:
PHP Code:
<?php
/**
* Side Box Template for a shopping cart with reward points
*
* @package templateSystem
* @copyright Copyright 2008 Andrew Moore
* @copyright Portions Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
*/
$content ="";
$reward_points=0;
$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($products[$i]['products_priced_by_attribute'])
$reward_points+=(GetRewardPoints($products[$i]['id'],$products[$i]['attributes'])*$products[$i]['quantity']);
else
$reward_points+=(GetRewardPoints($products[$i]['id'])*$products[$i]['quantity']);
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 .= '<div class="cartBoxRewardPoints">' . (int)$reward_points . ' ' . PRODUCT_REWARD_POINT_TAG . '</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>';
}
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>';
?>
The store where this is installed is: BeadedLily
Thanks for such a great mod!!
Bookmarks