$pInfo->products_name = zen_db_prepare_input($products_name[$languages[$i]['id']]); $pInfo->products_description = zen_db_prepare_input($products_description[$languages[$i]['id']]); $pInfo->products_url = zen_db_prepare_input($products_url[$languages[$i]['id']]); } $specials_price = zen_get_products_special_price($pID); ?> <table> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . $pInfo->products_name; ?> </td> <td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price) . ($pInfo->products_virtual == 1 ? '<span class="errorText">' . '<br />' . TEXT_VIRTUAL_PREVIEW . '</span>' : '') . ($pInfo->product_is_always_free_ship == 1 ? '<span class="errorText">' . '<br />' . TEXT_FREE_SHIPPING_PREVIEW . '</span>' : '') . ($pInfo->products_priced_by_attribute == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES_PREVIEW . '</span>' : '') . ($pInfo->product_is_free == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_IS_FREE_PREVIEW . '</span>' : '') . ($pInfo->product_is_call == 1 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_IS_CALL_PREVIEW . '</span>' : '') . ($pInfo->products_qty_box_status == 0 ? '<span class="errorText">' . '<br />' . TEXT_PRODUCTS_QTY_BOX_STATUS_PREVIEW . '</span>' : '') . ($pInfo->products_priced_by_attribute == 1 ? '<br />' . CommerceProduct::getDisplayPriceFromHash($_GET['pID']) : ''); ?> </td> </tr> </table></td> </tr> <tr> <td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?> </td> </tr> <tr> <td class="main"> <?php //auto replace with defined missing image
$catListHash['parent_id'] = $current_category_id; } $catCount = 0; if ($catList = CommerceCategory::getList($catListHash)) { $catCount = count($catList); if ($gCommerceSystem->isConfigActive('SHOW_COUNTS_ADMIN')) { foreach (array_keys($catList) as $catId) { $catList[$catId]['total_products'] = zen_get_products_to_categories($catId, true); $catList[$catId]['total_products_on'] = zen_get_products_to_categories($catId, false); } } $gBitSmarty->assign('catList', $catList); $gBitSmarty->assign('catListHash', $catListHash); } $gBitSmarty->assign('catCount', $catCount); $product = new CommerceProduct(); $offset = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS_CATEGORIES, $products_query_raw, $products_query_numrows); $prodListHash = $_REQUEST; $prodListHash['all_status'] = 1; $prodListHash['category_id'] = $current_category_id; if ($prodList = $product->getList($prodListHash)) { $gBitSmarty->assign_by_ref('prodList', $prodList); $gBitSmarty->assign_by_ref('prodListHash', $prodListHash); $gBitSmarty->assign('prodCount', count($prodList)); } $sql = "SELECT ptc.`product_type_id`, pt.`type_name` FROM " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc, " . TABLE_PRODUCT_TYPES . " pt where ptc.`category_id`=? and pt.`type_id` = ptc.`product_type_id`"; if ($restrictTypes = $gBitDb->getAssoc($sql, array($current_category_id))) { $gBitSmarty->assign('newProductTypes', $restrictTypes); } else { $gBitSmarty->assign('newProductTypes', $product_types_array); }
} if (!empty($_REQUEST['timeframe'])) { $listHash['timeframe'] = $_REQUEST['timeframe']; } if (@BitBase::verifyId($_REQUEST['orders_status_id'])) { $listHash['orders_status_id'] = $_REQUEST['orders_status_id']; $_SESSION['orders_status_id'] = $_REQUEST['orders_status_id']; } if (!empty($_REQUEST['search'])) { $listHash['search'] = $_REQUEST['search']; } if (@BitBase::verifyId($_REQUEST['user_id'])) { $listHash['user_id'] = $_REQUEST['user_id']; } $listHash['orders_products'] = TRUE; $orders = order::getList($listHash); $gBitSmarty->assign_by_ref('listOrders', $orders); $statuses['all'] = 'All'; foreach (commerce_get_statuses(TRUE) as $statusId => $statusName) { $statuses[$statusId] = $statusName; } $gBitSmarty->assign('commerceStatuses', $statuses); $types[''] = 'All'; $productTypes = CommerceProduct::getTypes(); foreach ($productTypes as $typeId => $typeHash) { $types[$typeId] = $typeHash['type_name']; } $gBitSmarty->assign_by_ref('commerceProductTypes', $types); $gBitSmarty->display('bitpackage:bitcommerce/admin_list_orders.tpl'); require 'includes/application_bottom.php'; require DIR_FS_ADMIN_INCLUDES . 'footer.php';
} } else { $display_products_quantity = ''; } if (PRODUCT_ALL_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'date_added')) { $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($products_all->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_DATE_ADDED, 3, 1)); } else { $display_products_date_added = ''; } if (PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) { $display_products_manufacturers_name = $products_all->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $products_all->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MANUFACTURER, 3, 1)) : ''; } else { $display_products_manufacturers_name = ''; } if (PRODUCT_ALL_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y' and zen_check_show_prices() == 'true') { $products_price = CommerceProduct::getDisplayPriceFromHash($products_all->fields['products_id']); $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_all->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_ship($products_all->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : ''); } else { $display_products_price = ''; } // more info in place of buy now if (PRODUCT_ALL_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') { if (zen_has_product_attributes($products_all->fields['products_id'])) { $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else { // $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>'; if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0) { // $how_many++; $link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=0 size=\"4\">"; } else { $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';
$listHash['commissioned'] = TRUE; } $row = 0; $col = 0; $listBoxContents = ''; if (is_object($gBitProduct) && ($listedProducts = $gBitProduct->getList($listHash))) { // show only when 1 or more $num_products_count = count($listedProducts); if ($num_products_count < $columnCount) { $col_width = 100 / $num_products_count; } else { $col_width = 100 / $columnCount; } $_template->tpl_vars['listColWidth'] = new Smarty_variable($col_width); foreach (array_keys($listedProducts) as $productsId) { $products_price = CommerceProduct::getDisplayPriceFromHash($productsId); $listBoxContents[$row][$col] = $listedProducts[$productsId]; $col++; if ($col > $columnCount - 1) { $col = 0; $row++; } } if (isset($new_products_category_id)) { $category_title = zen_get_categories_name((int) $new_products_category_id); $title = $title . ($category_title != '' ? ' - ' . $category_title : ''); } $_template->tpl_vars['productListTitle'] = new Smarty_variable($title); } $_template->tpl_vars['listedProducts'] = new Smarty_variable($listedProducts); $_template->tpl_vars['listBoxContents'] = new Smarty_variable($listBoxContents);
$next_item_image = ''; } } else { $previous_image = ''; $next_item_image = ''; } } // only display when more than 1 if ($products_ids->RecordCount() > 1) { $gBitSmarty->assign('navPosition', $position); $gBitSmarty->assign('navCounter', $counter); if (!empty($previous)) { $gBitSmarty->assign('navPreviousUrl', CommerceProduct::getDisplayUrlFromId($previous)); } if (!empty($next_item)) { $gBitSmarty->assign('navNextUrl', CommerceProduct::getDisplayUrlFromId($next_item)); } /* ?> <table border="1" align="left" width="100%"> <?php if ( empty( $cPath ) ) { $cPath= zen_get_product_path((int)$_GET['products_id']); } if ($module_show_categories != '0') { $cPath_new = zen_get_path(zen_get_products_category_id((int)$_GET['products_id'])); if ((zen_get_categories_image(zen_get_products_category_id((int)$_GET['products_id']))) !='') { switch(true) { case ($module_show_categories=='1'): $align='left';
// +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) { $action = 'new_product'; } else { $_REQUEST['category_id'] = $current_category_id; $newProduct = new CommerceProduct(); // update with a full path so the image is copied to the proper place if (!empty($_REQUEST['products_image'])) { $_REQUEST['products_image'] = STORAGE_PKG_PATH . BITCOMMERCE_PKG_NAME . '/images/' . $_REQUEST['products_image']; } $newProduct->store($_REQUEST); zen_redirect(zen_href_link_admin(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $newProduct->mProductsId . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''))); }
$small_height = SMALL_IMAGE_HEIGHT; $medium_width = MEDIUM_IMAGE_WIDTH; $medium_height = MEDIUM_IMAGE_HEIGHT; $large_width = LARGE_IMAGE_WIDTH; $large_height = LARGE_IMAGE_HEIGHT; $k = max($oiheight / $small_height, $oiwidth / $small_width); //use smallest size $small_width = round($oiwidth / $k); $small_height = round($oiheight / $k); $k = max($oiheight / $medium_height, $oiwidth / $medium_width); //use smallest size $medium_width = round($oiwidth / $k); $medium_height = round($oiheight / $k); $large_width = $oiwidth; $large_height = $oiheight; $products_image = CommerceProduct::getImageUrlFromHash($products_id); $products_image_extention = substr($products_image, strrpos($products_image, '.')); $products_image_base = ereg_replace($products_image_extention, '', $products_image); $filename_medium = DIR_FS_CATALOG . DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . '.' . $fname[2]; $filename_large = DIR_FS_CATALOG . DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . '.' . $fname[2]; // ImageMagick if (IMAGE_MANAGER_HANDLER == '1') { copy($src, $filename_large); copy($src, $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $large_width . " " . $filename_large); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $medium_width . " " . $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $small_width . " " . $filename_small); } } zen_redirect(zen_href_link_admin(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''))); }
function zen_get_products_image($product_id, $width = SMALL_IMAGE_WIDTH, $height = SMALL_IMAGE_HEIGHT) { global $gBitDb; return zen_image(CommerceProduct::getImageUrlFromHash($product_id), zen_get_products_name($product_id), $width, $height, 'hspace="5" vspace="5"'); }
// $Id$ // global $gBitDb, $gBitProduct; require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php'; if ($gBitUser->isRegistered()) { // retreive the last x products purchased $orders_history_query = "select distinct op.`products_id`, o.date_purchased\n\t\t\t\t\tfrom " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p\n\t\t\t\t\twhere o.`customers_id` = ?\n\t\t\t\t\tand o.`orders_id` = op.`orders_id`\n\t\t\t\t\tand op.`products_id` = p.`products_id`\n\t\t\t\t\tand p.`products_status` = '1'\n\t\t\t\t\torder by o.date_purchased desc"; $orders_history = $gBitDb->query($orders_history_query, $gBitUser->mUserId, MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX); if ($orders_history->RecordCount() > 0) { $product_ids = ''; while (!$orders_history->EOF) { $product_ids .= (int) $orders_history->fields['products_id'] . ','; $orders_history->MoveNext(); } $product_ids = substr($product_ids, 0, -1); $rows = 0; $customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1">'; $products_history_query = "select `products_id`, `products_name`\n\t\t\t\t\t\t\tfrom " . TABLE_PRODUCTS_DESCRIPTION . "\n\t\t\t\t\t\t\twhere `products_id` in (" . $product_ids . ")\n\t\t\t\t\t\t\tand `language_id` = '" . (int) $_SESSION['languages_id'] . "'\n\t\t\t\t\t\t\torder by `products_name`"; $products_history = $gBitDb->Execute($products_history_query); while (!$products_history->EOF) { $rows++; $customer_orders[$rows] = $products_history->fields; $customer_orders[$rows]['display_url'] = CommerceProduct::getDisplayUrlFromId($products_history->fields['products_id']); $products_history->MoveNext(); } $_template->tpl_vars['sideboxCustomerOrders'] = new Smarty_variable($customer_orders); } if (empty($moduleTitle)) { $_template->tpl_vars['moduleTitle'] = new Smarty_variable('Order History'); } }
break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>'; } else { $typeClass = BitBase::getParameter($listing->fields, 'type_class', 'CommerceProduct'); if (!empty($listing->fields['type_class_file']) && file_exists(BIT_ROOT_PATH . $listing->fields['type_class_file'])) { require_once BIT_ROOT_PATH . $listing->fields['type_class_file']; } if ($thumbnail = $typeClass::getImageUrlFromHash($listing->fields['products_id'], 'avatar')) { $lc_text = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image($thumbnail, $listing->fields['products_name']) . '</a>'; } } break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text); } $listing->MoveNext(); } $error_categories = false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="odd"'); $list_box_contents[0][] = array('params' => 'class="data"', 'text' => TEXT_NO_PRODUCTS); $error_categories = true; }
$reviews_counter = $gBitDb->getOne($reviews_count_query); // if review must be approved or disabled do not show review $review_status = " and r.`status` = '1'"; $review_info_check_query = "select count(*) as `total`\n from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd\n where r.`reviews_id` = '" . (int) $_GET['reviews_id'] . "'\n and r.`products_id` = '" . (int) $_GET['products_id'] . "'\n and r.`reviews_id` = rd.`reviews_id`\n and rd.`languages_id` = '" . (int) $_SESSION['languages_id'] . "'" . $review_status; $review_info_check = $gBitDb->Execute($review_info_check_query); if ($review_info_check->fields['total'] < 1) { zen_redirect(zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params(array('reviews_id')))); } } else { zen_redirect(zen_href_link(FILENAME_PRODUCT_REVIEWS, zen_get_all_get_params(array('reviews_id')))); } $sql = "update " . TABLE_REVIEWS . "\n set reviews_read = reviews_read+1\n where reviews_id = '" . (int) $_GET['reviews_id'] . "'"; $gBitDb->Execute($sql); $review_info_query = "select rd.reviews_text, r.reviews_rating, r.`reviews_id`, r.customers_name,\n r.`date_added`, r.reviews_read, p.`products_id`, p.`products_price`,\n p.`products_tax_class_id`, p.`products_image`, p.`products_model`, pd.`products_name`\n from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n where r.`reviews_id` = '" . (int) $_GET['reviews_id'] . "'\n and r.`reviews_id` = rd.`reviews_id`\n and rd.`languages_id` = '" . (int) $_SESSION['languages_id'] . "'\n and r.`products_id` = p.`products_id`\n and p.`products_status` = '1'\n and p.`products_id` = pd.`products_id`\n and pd.`language_id` = '" . (int) $_SESSION['languages_id'] . "'" . $review_status; $review_info = $gBitDb->Execute($review_info_query); $products_price = CommerceProduct::getDisplayPriceFromHash($review_info->fields['products_id']); $products_name = $review_info->fields['products_name']; if ($review_info->fields['products_model'] != '') { $products_model = '<br /><span class="smallText">[' . $review_info->fields['products_model'] . ']</span>'; } else { $products_model = ''; } // set image // $products_image = $review_info->fields['products_image']; if ($review_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $products_image = PRODUCTS_IMAGE_NO_IMAGE; } else { $products_image = $review_info->fields['products_image']; } require_once DIR_FS_MODULES . 'require_languages.php'; $breadcrumb->add(NAVBAR_TITLE);
} } else { $display_products_quantity = ''; } if (PRODUCT_FEATURED_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'date_added')) { $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($featured_products->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_DATE_ADDED, 3, 1)); } else { $display_products_date_added = ''; } if (PRODUCT_FEATURED_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'manufacturer')) { $display_products_manufacturers_name = $featured_products->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $featured_products->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_MANUFACTURER, 3, 1)) : ''; } else { $display_products_manufacturers_name = ''; } if (PRODUCT_FEATURED_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y' and zen_check_show_prices() == 'true') { $products_price = CommerceProduct::getDisplayPriceFromHash($featured_products->fields['products_id']); $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($featured_products->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_ship($featured_products->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : ''); } else { $display_products_price = ''; } // more info in place of buy now if (PRODUCT_FEATURED_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y') { if (zen_has_product_attributes($featured_products->fields['products_id'])) { $link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else { // $link= '<a href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>'; if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0) { // $how_many++; $link = TEXT_PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $featured_products->fields['products_id'] . "]\" value=0 size=\"4\">"; } else { $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_FEATURED, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';
$gBitCustomer->mCart->addToCart($_POST['products_id'], $gBitCustomer->mCart->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids)) + $_POST['cart_quantity'], $real_ids); } } if ($the_list == '') { // no errors zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); } else { // errors - display popup message } break; // performed by the 'buy now' button in product listings and review page // performed by the 'buy now' button in product listings and review page case 'buy_now': if (isset($_REQUEST['products_id'])) { if (zen_has_product_attributes($_REQUEST['products_id'])) { zen_redirect(CommerceProduct::getDisplayUrlFromId($_REQUEST['products_id'])); } else { $gBitCustomer->mCart->addToCart($_REQUEST['products_id'], $gBitCustomer->mCart->get_quantity($_REQUEST['products_id']) + zen_get_buy_now_qty($_REQUEST['products_id'])); } } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); break; case 'multiple_products_add_product': while (list($key, $qty) = each($_REQUEST['products_id'])) { if (!zen_has_product_attributes($_REQUEST['products_id'])) { $gBitCustomer->mCart->addToCart($prodId, $gBitCustomer->mCart->get_quantity($prodId) + $qty); } } zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters))); break; case 'notify':
$listHash['sort_mode'] = 'random'; $listHash['commissioned'] = TRUE; $listHash['thumbnail_size'] = 'avatar'; $row = 0; $col = 0; $listBoxContents = ''; // show only when 1 or more if ($commissionedProducts = $gBitProduct->getList($listHash)) { $num_products_count = count($commissionedProducts); if ($num_products_count < $columnCount) { $col_width = 100 / $num_products_count; } else { $col_width = 100 / $columnCount; } foreach (array_keys($commissionedProducts) as $productsId) { $products_price = CommerceProduct::getDisplayPriceFromHash($productsId); $listBoxContents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="' . $col_width . '%" valign="top"', 'text' => '<a href="' . CommerceProduct::getDisplayUrlFromId($productsId) . '">' . zen_image($commissionedProducts[$productsId]['products_image_url'], $commissionedProducts[$productsId]['products_name']) . '</a><br /><a href="' . CommerceProduct::getDisplayUrlFromId($productsId) . '">' . $commissionedProducts[$productsId]['products_name'] . '</a><br />' . $products_price); $col++; if ($col > $columnCount - 1) { $col = 0; $row++; } } if (isset($new_products_category_id)) { $category_title = zen_get_categories_name((int) $new_products_category_id); $title = $title . ($category_title != '' ? ' - ' . $category_title : ''); } $gBitSmarty->assign('listBoxContents', $listBoxContents); $gBitSmarty->assign('productListTitle', $title); $gBitSmarty->display('bitpackage:bitcommerce/list_box_content_inc.tpl'); }
if (!empty($_POST['products_id'])) { $_POST['products_id'] = $_GET['products_id']; } $gBitProduct = bc_get_commerce_product(array('products_id' => $_REQUEST['products_id'])); if ($gBitProduct->isValid()) { if (empty($_REQUEST['cPath']) && !empty($gBitProduct->mInfo['master_categories_id'])) { $_REQUEST['cPath'] = $gBitProduct->mInfo['master_categories_id']; } } else { global $gBitSystem; $gBitSystem->setHttpStatus(HttpStatusCodes::HTTP_NOT_FOUND); unset($gBitProduct); } } if (empty($gBitProduct) && class_exists('CommerceProduct')) { $gBitProduct = new CommerceProduct(); } if (empty($_REQUEST['cPath'])) { $_REQUEST['cPath'] = ''; } $gComCategory = new CommerceCategory($_REQUEST['cPath']); if (!empty($_REQUEST['cPath']) && is_numeric($_REQUEST['cPath'])) { $breadcrumb->add(zen_get_category_name($_REQUEST['cPath'], $_SESSION['languages_id']), zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_REQUEST['cPath'])); } if ($gBitProduct->isValid()) { $breadcrumb->add($gBitProduct->getTitle(), $gBitProduct->getDisplayUrl()); } if (!empty($gBitProduct)) { $gBitSmarty->assign('gBitProduct', $gBitProduct); } $gBitSmarty->assign('runNormal', zen_run_normal());
} ?> <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php print CommerceProduct::getDisplayUrlFromId($products->fields['products_id']); ?> '"> <td class="dataTableContent"><?php echo $rows; ?> </td> <td class="dataTableContent" align="right"><?php echo $products->fields['products_id']; ?> </td> <td class="dataTableContent"><?php echo '<a href="' . CommerceProduct::getDisplayUrlFromId($products->fields['products_id']) . '">' . $products->fields['products_name'] . '</a>'; ?> </td> <td class="dataTableContent" align="center"><?php echo $products->fields['products_ordered']; ?> </td> <td class="dataTableContent" align="center"><?php echo substr($products->fields['first_purchased'], 0, strpos($products->fields['first_purchased'], ' ')); ?> </td> <td class="dataTableContent" align="center"><?php if ($products->fields['first_purchased'] != $products->fields['last_purchased']) { echo substr($products->fields['last_purchased'], 0, strpos($products->fields['last_purchased'], ' ')); } ?>
?> </td> </tr></table></td> </tr> <?php } // split page ?> <tr> <?php $row = 0; $offset = MAX_DISPLAY_SPECIAL_PRODUCTS * (!empty($_REQUEST['page']) ? $_REQUEST['page'] - 1 : 0); $specials = $gBitDb->query($specials_split->sql_query, NULL, MAX_DISPLAY_SPECIAL_PRODUCTS, $offset); while (!$specials->EOF) { $row++; echo ' <td valign="bottom" align="center" width="33%" class="smallText"><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($specials->fields['products_id'], 'avatar'), $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . CommerceProduct::getDisplayPriceFromHash($specials->fields['products_id']) . '</td>' . "\n"; if ($row / 3 == floor($row / 3)) { ?> </tr> <tr> <?php } $specials->MoveNext(); } ?> </tr> <?php if ($specials_split->number_of_rows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3')) { ?> <tr> <td colspan="3"><table width="100%"><tr>
$contents = array('form' => zen_draw_form_admin('products_downloads_edit', FILENAME_PRODUCTS_TO_CATEGORIES, '')); if ($productsId > 0) { $contents[] = array('text' => zen_image(DIR_WS_CATALOG_IMAGES . $product_to_copy->fields['products_image'], $product_to_copy->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); } $contents[] = array('text' => '<b>' . TEXT_PRODUCTS_NAME . $product_to_copy->fields['products_name'] . '<br />' . TEXT_PRODUCTS_MODEL . $product_to_copy->fields['products_model'] . '</b>'); $contents[] = array('text' => '<br />' . TEXT_SET_PRODUCTS_TO_CATEGORIES_LINKS . '<br />' . TEXT_PRODUCTS_ID . zen_draw_input_field('products_id', $productsId)); $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link_admin(FILENAME_PRODUCTS_TO_CATEGORIES, 'products_id=' . $productsId) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>' . '</form>'); break; default: $heading[] = array('text' => '<b>' . $product_to_copy->fields['products_id'] . ' ' . $product_to_copy->fields['products_name'] . '</b>'); if ($productsId > 0) { $contents[] = array('text' => zen_image(DIR_WS_CATALOG_IMAGES . $product_to_copy->fields['products_image'], $product_to_copy->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); } $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_NAME . $product_to_copy->fields['products_name']); $contents[] = array('text' => TEXT_PRODUCTS_MODEL . $product_to_copy->fields['products_model']); $contents[] = array('text' => TEXT_PRODUCTS_PRICE . CommerceProduct::getDisplayPriceFromHash($productsId)); switch (true) { case $product_to_copy->fields['master_categories_id'] == 0 and $productsId > 0: $contents[] = array('text' => '<br /><span class="alert alert-warning">' . WARNING_MASTER_CATEGORIES_ID . '</span><br /> '); break; default: $contents[] = array('text' => '<form action="' . FILENAME_PRODUCTS_TO_CATEGORIES . '.php' . '?action=edit&products_id=' . $productsId . '" method="post">'); $contents[] = array('align' => 'center', 'text' => '<input type="submit" value="' . BUTTON_NEW_PRODUCTS_TO_CATEGORIES . '"></form>'); $contents[] = array('text' => '<br />' . zen_image(DIR_WS_IMAGES . 'pixel_black.gif', '', '100%', '3') . '<br /> '); $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link_admin(FILENAME_ATTRIBUTES_CONTROLLER, 'products_id=' . $productsId) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a> ' . '<a href="' . zen_href_link_admin(FILENAME_PRODUCTS_PRICE_MANAGER, '&products_id=' . $productsId) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a><br /><br />' . '<a href="' . zen_href_link_admin(FILENAME_CATEGORIES, 'cPath=' . zen_get_parent_category_id($productsId) . '&pID=' . $productsId . '&product_type=' . zen_get_products_type($productsId)) . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a> ' . '<a href="' . zen_href_link_admin(FILENAME_CATEGORIES, 'action=new_product' . '&cPath=' . zen_get_parent_category_id($productsId) . '&pID=' . $productsId . '&product_type=' . zen_get_products_type($productsId)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '</a>' . '<br /> '); break; } break; } if (zen_not_null($heading) && zen_not_null($contents)) { echo ' <td width="25%" valign="top">' . "\n";
if ($products_image == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { $products_image = PRODUCTS_IMAGE_NO_IMAGE; } $products_image_extention = substr($products_image, strrpos($products_image, '.')); $products_image_base = str_replace($products_image_extention, '', $products_image); $products_image_medium = $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extention; $products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extention; // check for a medium image else use small if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { $products_image_medium = DIR_WS_IMAGES . $products_image; } else { $products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_medium; } // check for a large image else use medium else use small if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) { if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { $products_image_large = DIR_WS_IMAGES . $products_image; } else { $products_image_large = DIR_WS_IMAGES . 'medium/' . $products_image_medium; } } else { $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large; } */ header('HTTP/1.1 404 Not Found'); exit; $products_image_medium = CommerceProduct::getImageUrlFromHash($_GET['pID'], 'medium'); $products_image_large = CommerceProduct::getImageUrlFromHash($_GET['pID'], 'large');
// +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // global $gBitDb, $gBitProduct, $currencies; require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php'; // test if box should display $listHash['max_records'] = 1; $listHash['sort_mode'] = 'random'; $listHash['specials'] = TRUE; if ($specialsList = $gBitProduct->getList($listHash)) { $sideboxSpecial = current($specialsList); $sideboxSpecial['display_special_price'] = CommerceProduct::getDisplayPriceFromHash($sideboxSpecial['products_id']); $_template->tpl_vars['sideboxSpecial'] = new Smarty_variable($sideboxSpecial); } if (empty($moduleTitle)) { $_template->tpl_vars['moduleTitle'] = new Smarty_variable(tra('Specials')); }
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']); break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing->fields['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($_GET['manufacturers_id'])) { $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a>'; } else { $lc_text = ' <a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($listing->fields['products_id'], 'avatar'), $listing->fields['products_name']) . '</a> '; } break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="data"', 'text' => $lc_text); } $listing->MoveNext(); } $error_categories = false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="odd"'); $list_box_contents[0][] = array('params' => 'class="data"', 'text' => TEXT_NO_PRODUCTS); $error_categories = true; } if ($how_many > 0 and $show_submit == 'true' and $listing_split->number_of_rows > 0 and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3)) {
// |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // ?> <body onload="resize();"> <div class="header"> <h1><?php echo $gBitProduct->getTitle(); ?> </h1> </div> <?php echo zen_image(CommerceProduct::getImageUrlFromHash($gBitProduct->mProductsId, 'large'), $gBitProduct->getTitle()); ?> </body>
$products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extention; // to be built into a single variable string if (file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'products_id=' . $_GET['products_id']) . '\\\')">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> '); //--></script> <?php } else { ?> <script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'products_id=' . $_GET['products_id']) . '\\\')">' . zen_image(CommerceProduct::getImageUrlFromHash($gBitProduct->mProductsId, 'small')) . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> '); //--></script> <?php } ?> <noscript> <?php if (file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) { if (file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) { echo '<a href="' . zen_href_link(DIR_WS_IMAGES . 'large/' . $products_image_large) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; } else { echo '<a href="' . zen_href_link(DIR_WS_IMAGES . $products_image) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . 'medium/' . $products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>'; } } else {
?> <tr> <td class="main" width="200" align="left" valign="top"> </td> <td colspan="2" class="main"><?php echo TEXT_PRODUCT_TO_VIEW; ?> </td> </tr> <tr> <td class="main" width="200" align="center" valign="top"> <?php // FIX HERE $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($_GET['products_id']); echo $display_priced_by_attributes ? '<span class="alert alert-warning">' . TEXT_PRICED_BY_ATTRIBUTES . '</span>' . '<br />' : ''; echo CommerceProduct::getDisplayPriceFromHash($_GET['products_id']) . '<br /><br />'; echo zen_get_products_quantity_min_units_display($_GET['products_id'], $include_break = true); $not_for_cart = $gBitDb->Execute("select p.`products_id` from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCT_TYPES . " pt on p.`products_type`= pt.`type_id` where pt.`allow_add_to_cart` = 'N'"); while (!$not_for_cart->EOF) { $not_for_cart_array[] = $not_for_cart->fields['products_id']; $not_for_cart->MoveNext(); } ?> </td> <td class="attributes-even" align="center"><?php echo zen_draw_products_pull_down('products_id', 'size="5"', $not_for_cart->fields, true, $_GET['products_id'], true, true); ?> </td> <td class="main" align="center" valign="top"> <?php echo zen_image_submit('button_display.gif', IMAGE_DISPLAY);
default: if (is_object($sInfo)) { $heading[] = array('text' => '<b>' . $sInfo->products_name . '</b>'); if ($sInfo->products_priced_by_attribute == '1') { $specials_current_price = zen_get_products_base_price($sInfo->products_id); } else { $specials_current_price = $sInfo->products_price; } $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link_admin(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link_admin(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link_admin(FILENAME_PRODUCTS_PRICE_MANAGER, 'action=edit&products_id=' . $sInfo->products_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->specials_date_added)); $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->specials_last_modified)); $contents[] = array('align' => 'center', 'text' => '<br>' . zen_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); $contents[] = array('text' => '<br>' . TEXT_INFO_ORIGINAL_PRICE . ' ' . $currencies->format($specials_current_price)); $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . ' ' . $currencies->format($sInfo->specials_new_products_price)); $contents[] = array('text' => '' . TEXT_INFO_DISPLAY_PRICE . ' ' . CommerceProduct::getDisplayPriceFromHash($sInfo->products_id)); $contents[] = array('text' => '<br>' . TEXT_INFO_AVAILABLE_DATE . ' <b>' . (($specials->fields['specials_date_available'] != '0001-01-01' and $specials->fields['specials_date_available'] != '') ? zen_date_short($specials->fields['specials_date_available']) : TEXT_NONE) . '</b>'); $contents[] = array('text' => '<br>' . TEXT_INFO_EXPIRES_DATE . ' <b>' . (($specials->fields['expires_date'] != '0001-01-01' and $specials->fields['expires_date'] != '') ? zen_date_short($specials->fields['expires_date']) : TEXT_NONE) . '</b>'); $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . ' ' . zen_date_short($sInfo->date_status_change)); $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link_admin(FILENAME_CATEGORIES, '&action=new_product' . '&cPath=' . zen_get_product_path($sInfo->products_id, 'override') . '&pID=' . $sInfo->products_id . '&product_type=' . zen_get_products_type($sInfo->products_id)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . TEXT_PRODUCT_EDIT . '</a>'); } break; } if (zen_not_null($heading) && zen_not_null($contents)) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box(); echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } } ?>
<tr> <td class="smallText"><?php echo sprintf(TEXT_REVIEW_BY, zen_output_string_protected($reviews->fields['customers_name'])); ?> </td> <td class="smallText" align="left"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, zen_date_long($reviews->fields['date_added'])); ?> </td> </tr> <tr> <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?> " align="left" valign="top" class="main"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews->fields['products_id'] . '&reviews_id=' . $reviews->fields['reviews_id']) . '">' . zen_image(CommerceProduct::getImageUrlFromHash($reviews->fields['products_id'], 'avatar'), $reviews->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?> </td> <td valign="top" class="main"><?php echo zen_break_string(nl2br(zen_output_string_protected(stripslashes(substr($reviews->fields['reviews_text'], 0, 100)))), 60, '-<br />') . (strlen($reviews->fields['reviews_text']) >= 100 ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $reviews->fields['reviews_rating'] . '.png', sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews->fields['reviews_rating'])) . '</i>'; ?> </td> </tr> <?php $reviews->MoveNext(); } } else { ?> <tr> <td class="plainBox" colspan="2"><?php echo TEXT_NO_REVIEWS;
// |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id$ // global $gBitDb, $gBitProduct, $currencies; require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php'; $listHash['freshness'] = SHOW_NEW_PRODUCTS_LIMIT; $listHash['max_records'] = 1; $listHash['sort_mode'] = 'products_date_added_desc'; if (empty($moduleTitle)) { $_template->tpl_vars['moduleTitle'] = new Smarty_variable(tra('New Products')); } if ($productList = $gBitProduct->getList($listHash)) { $newProduct = current($productList); $whats_new_price = CommerceProduct::getDisplayPriceFromHash($newProduct['products_id']); $_template->tpl_vars['newProduct'] = new Smarty_variable($newProduct); }
if ($show_shopping_cart_box == true) { if ($gBitCustomer->mCart->count_contents() > 0) { $id = 'shoppingcart'; $content = ""; if ($gBitCustomer->mCart->count_contents() > 0) { $content = '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; foreach (array_keys($gBitCustomer->mCart->contents) as $productKey) { $product = $gBitCustomer->mCart->getProductObject($productKey); $productId = zen_get_prid($productKey); $content .= '<tr><td align="right" valign="top" class="infoboxcontents">'; if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) { $content .= '<span class="newItemInCart">'; } else { $content .= '<span class="infoboxcontents">'; } $content .= $gBitCustomer->mCart->contents[$productKey]['products_quantity'] . ' x </span></td><td valign="top" class="infoboxcontents"><a href="' . CommerceProduct::getDisplayUrlFromId(zen_get_prid($productId)) . '">'; if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) { $content .= '<span class="newItemInCart">'; } else { $content .= '<span class="infoboxcontents">'; } $content .= $product->getTitle() . '</span></a></td></tr>'; if (!empty($_SESSION['new_products_id_in_cart']) && $_SESSION['new_products_id_in_cart'] == $productId) { $_SESSION['new_products_id_in_cart'] = ''; } } $content .= '</table>'; if ($gvBalance = CommerceVoucher::getGiftAmount()) { $content .= '<table style="margin-top:10px;" cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . tra('Gift Certificate Balance') . '</td><td class="smalltext" align="right" valign="bottom">' . $gvBalance . '</td></tr></table>'; $content .= '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="' . zen_href_link(FILENAME_GV_SEND) . '">' . tra('Send Gift Certificate') . '</a></td></tr></table>'; }
function store(&$pParamHash) { // we have already done all the permission checking needed for this user to upload an image $pParamHash['no_perm_check'] = TRUE; $this->StartTrans(); if (CommerceProduct::verify($pParamHash) && LibertyMime::store($pParamHash)) { if (isset($pParamHash['pID'])) { $this->mProductsId = zen_db_prepare_input($pParamHash['pID']); } if ($this->isValid()) { $action = 'update_product'; $this->mDb->associateUpdate(TABLE_PRODUCTS, $pParamHash['product_store'], array('products_id' => $this->mProductsId)); } else { $pParamHash['product_store']['content_id'] = $pParamHash['content_id']; $action = 'insert_product'; $this->mDb->associateInsert(TABLE_PRODUCTS, $pParamHash['product_store']); $this->mProductsId = zen_db_insert_id(TABLE_PRODUCTS, 'products_id'); $this->mDb->query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " ( `products_id`, `categories_id` ) values (?,?)", array($this->mProductsId, $pParamHash['product_store']['master_categories_id'])); } $languages = zen_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $language_id = $languages[$i]['id']; $bindVars = array(); if (!empty($pParamHash['products_name'][$language_id])) { $bindVars['products_name'] = substr(zen_db_prepare_input($pParamHash['products_name'][$language_id]), 0, 64); } if (!empty($pParamHash['products_description'][$language_id])) { $bindVars['products_description'] = zen_db_prepare_input($pParamHash['products_description'][$language_id]); } if (!empty($pParamHash['products_url'][$language_id])) { $bindVars['products_url'] = substr(zen_db_prepare_input($pParamHash['products_url'][$language_id]), 0, 255); } if ($action == 'insert_product') { $bindVars['products_id'] = $this->mProductsId; $bindVars['language_id'] = $language_id; $this->mDb->associateInsert(TABLE_PRODUCTS_DESCRIPTION, $bindVars); } elseif ($action == 'update_product') { if (!empty($bindVars)) { $query = "UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET `" . implode(array_keys($bindVars), '`=?, `') . '`=?' . " WHERE `products_id` =? AND `language_id`=?"; $bindVars['products_id'] = $this->mProductsId; $bindVars['language_id'] = $language_id; $this->mDb->query($query, $bindVars); } } } // add meta tags for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $language_id = $languages[$i]['id']; $bindVars = array(); if (!empty($pParamHash['metatags_title'][$language_id])) { $bindVars['metatags_title'] = zen_db_prepare_input($pParamHash['metatags_title'][$language_id]); } if (!empty($pParamHash['metatags_keywords'][$language_id])) { $bindVars['metatags_keywords'] = zen_db_prepare_input($pParamHash['metatags_keywords'][$language_id]); } if (!empty($pParamHash['metatags_description'][$language_id])) { $bindVars['metatags_description'] = zen_db_prepare_input($pParamHash['metatags_description'][$language_id]); } $this->mDb->query("DELETE FROM " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " WHERE `products_id`=?", array($this->mProductsId)); if (!empty($bindVars)) { if (!empty($bindVars)) { $bindVars['products_id'] = $this->mProductsId; $bindVars['language_id'] = $language_id; $this->mDb->associateInsert(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $bindVars); } } $this->storeProductImage($pParamHash); } } $this->CompleteTrans(); $this->load(); return count($this->mErrors) == 0; }