zencart購物車修改調用顯示購物車圖片,修改邊欄購物車模版

zencart購物車修改調用顯示購物車圖片,修改邊欄購物車模版

顯示購物車圖片教程

 

屏幕調暗了所以圖片截取有點暗 開始是這樣的 本來是沒有圖片的現在改了有圖片 的 自己舉一反三吧

  zencart修改購物車

事例 調用邊欄購物車的圖片 避免出錯請直接覆蓋

修改之後效果zencart購物車修改

代碼開始(爲了安全沒有寫<?php?>這樣的標籤  可以直接複製 我用的1.39版本  修改的是 tpl_shopping_cart.php 這個文件 ):

/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2007 Zen Cart 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 7192 2007-10-06 13:30:46Z drbyte $
*/
$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 (isset($_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 (isset($_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]['name'] . '</span></a>'.zen_image(DIR_WS_IMAGES. $products[$i]['image'],'').'</li>' . "\n";

if (isset($_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>';

zencart購物車修改調用購物車圖片顯示,zencart教程 

來源 http://zencart.me/archives/148

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章