//$featured_res = $db->Execute($feature_query); $pid = $products_res->fields['products_id']; $sid = $specials_res->fields['products_id']; $attribute_product = $product_attribute_query_result->fields['products_id']; if ($fid == $pid) { $msg_product = "<div class='tag tag-orange' title=''><div class='text'>HOT</div></div>"; } else { if ($fid == $sid) { $msg_product = "<div class='tag tag-orange' title=''><div class='text'>SALE</div></div>"; } else { $msg_product = "<div class='tag tag-blue' title=''><div class='text'>NEW</div></div>"; } } //$products_description_hover = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); //To Display Product Desc on hover //$products_description_hover = ltrim(substr($products_description_hover, 0, 115) . '...'); //Trims and Limits the desc on hover $products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); //To Display Product Desc $products_description = ltrim(substr($products_description, 0, 350) . '..'); //Trims and Limits the desc //Productname Trim //$products_name_hover = $featured_products->fields['products_name']; //$products_name_hover = ltrim(substr($products_name_hover, 0, 50) . '...'); $products_name = $featured_products->fields['products_name']; //$products_name = ltrim(substr($products_name, 0, 30) . ''); if (!isset($productsInCategory[$featured_products->fields['products_id']])) { $productsInCategory[$featured_products->fields['products_id']] = zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']); } /*Wishlist/Compare Links*/ if (UN_MODULE_WISHLISTS_ENABLED) { $wishlist_link = zen_href_link(UN_FILENAME_WISHLIST, 'products_id=' . $featured_products->fields['products_id'] . '&action=wishlist_add_product'); } else {
<tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <script language="javascript"><!-- updateGross(); //--></script> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars((isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td> <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td> </tr> <tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
* @copyright Portions Copyright 2003 osCommerce */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $show_submit = zen_run_normal(); $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page'); $zco_notifier->notify('NOTIFY_MODULE_PRODUCT_LISTING_RESULTCOUNT', $listing_split->number_of_rows); $how_many = 0; $tpl_products = array('title' => '', 'products' => array()); if ($listing_split->number_of_rows > 0) { $listing = $db->Execute($listing_split->sql_query, false, true, CACHE_TIMELIFT); while (!$listing->EOF) { $the_categories_name_query = "select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id= '" . $listing->fields['master_categories_id'] . "' and language_id= '" . $_SESSION['languages_id'] . "'"; $the_categories_name = $db->Execute($the_categories_name_query, null, true, CACHE_TIMELIFT); $tpl_products['products'][$listing->fields['products_id']] = array('name' => $listing->fields['products_name'], 'image' => $listing->fields['products_image'], 'quantity' => $listing->fields['products_quantity'], 'weight' => $listing->fields['products_weight'], 'type' => $listing->fields['products_type'], 'categories_id' => $listing->fields['master_categories_id'], 'categories_name' => $the_categories_name->fields['categories_name'], 'categories_href' => zen_href_link(FILENAME_DEFAULT, 'cPath=' . $listing->fields['master_categories_id']), 'manufacturers_id' => $listing->fields['manufacturers_id'], 'products_price' => $listing->fields['products_price'], 'tax_class_id' => $listing->fields['products_tax_class_id'], 'description' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION), 'content' => $listing->fields['products_description'], 'specials_price' => $listing->fields['specials_new_products_price'], 'final_price' => $listing->fields['final_price'], 'sort_order' => $listing->fields['products_sort_order'], 'is_call' => $listing->fields['product_is_call'], 'is_always_free_shipping' => $listing->fields['product_is_always_free_shipping'], 'qty_box_status' => $listing->fields['products_qty_box_status'], 'href' => zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']), 'display_price' => zen_get_products_display_price($listing->fields['products_id']), 'is_free' => get_product_is_free($listing->fields['products_id']), 'display_normal_price' => get_normal_price($listing->fields['products_id']), 'display_special_price' => get_special_price($listing->fields['products_id']), 'display_sale_price' => get_sale_discount_price($listing->fields['products_id'])); if (PRODUCT_LIST_MANUFACTURER != 0) { $tpl_products['products'][$listing->fields['products_id']]['show_manufacturer'] = true; $tpl_products['products'][$listing->fields['products_id']]['manufacturers_name'] = $listing->fields['manufacturers_name']; $tpl_products['products'][$listing->fields['products_id']]['manufacturers_href'] = zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']); } $listing->MoveNext(); } $error_categories = false; } else { $tpl_products = array('title' => '', 'products' => array()); $error_categories = true; } $multiple_buy = false; 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)) { $show_top_submit_button = true;
$zc_col_count_description = 0; $lc_align = ''; $list_box_contents = array(); //echo $listing_split->sql_query; //print_r(explode(' ',zen_products_id_in_category($current_category_id))); if (zen_count_products_in_category($current_category_id) > 0) { $listing = $db->Execute($listing_split->sql_query); $row = 0; while (!$listing->EOF) { if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { $list_box_contents[$row]['products_image'] = ''; } else { $list_box_contents[$row]['products_image'] = $listing->fields['products_image']; } $list_box_contents[$row]['products_name'] = $listing->fields['products_name']; $list_box_contents[$row]['products_description'] = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), 100); $list_box_contents[$row]['products_price'] = zen_get_products_base_price($listing->fields['products_id']); $list_box_contents[$row]['actual_price'] = $currencies->display_price(zen_get_products_actual_price($listing->fields['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id'])); $list_box_contents[$row]['products_status'] = $listing->fields['products_status']; if ($listing->fields['product_is_always_free_shipping'] == 0) { $list_box_contents[$row]['product_is_always_free_shipping'] = ''; } else { $list_box_contents[$row]['product_is_always_free_shipping'] = '<span class="free_shipping"></span>'; } if ($listing->fields['product_is_free'] == 0) { $list_box_contents[$row]['product_is_free'] = ''; } else { $list_box_contents[$row]['product_is_free'] = '<span class="free"></span>'; } $list_box_contents[$row]['products_quantity_order_min'] = $listing->fields['products_quantity_order_min']; $list_box_contents[$row]['products_id'] = $listing->fields['products_id'];
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = $listing->fields['products_model']; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>'; break; case 'PRODUCT_LIST_PRICE': $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />'; $lc_align = 'right'; $lc_text = $lc_price; // more info in place of buy now $lc_button = ''; if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else {
$rows = 0; $listing = $db->Execute($listing_split->sql_query); $extra_row = 0; $sese_icons = BootstrapUtils::sese_product_icons($template, $current_page_base); while (!$listing->EOF) { $rows++; $cur_row = sizeof($list_box_contents) - 1; $product_link = BootstrapProductListing::product_link($listing); $product_image = "<a href='{$product_link}'>" . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], 0, 0, 'class="img-responsive img-center listingProductImage"') . '</a>'; for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) { $lc_class = $lc_text = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_NAME': $lc_class = 'product-name'; $icons = BootstrapProductListing::product_icon_html($sese_icons, $listing); $product_description = zen_trunc_string(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION); $lc_text = "<h4 class='itemTitle'><a href='{$product_link}'><b>" . "{$listing->fields['products_name']}</b></a>{$icons}</h4>" . "<div class='hidden-xs listingDescription'>{$product_description}</div>\n" . "<div class='visible-xs'>{$product_image}</div>\n"; break; case 'PRODUCT_LIST_PRICE': $lc_price = "<div class='text-center product-price'><b>" . zen_get_products_display_price($listing->fields['products_id']) . "</b></div>\n"; $lc_text = $lc_price; $the_button = BootstrapProductListing::product_cart_button($listing, $product_link); $products_link = "<a href='{$product_link}'>" . MORE_INFO_TEXT . '</a>'; $buy_now_button = zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($listing->fields['products_id']); $lc_text .= BootstrapUtils::clean_buy_now_button($buy_now_button, $product_link); $has_free_shipping = zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') && zen_get_product_is_always_free_shipping($listing->fields['products_id']); if ($has_free_shipping) { $lc_text .= TEXT_PRODUCT_FREE_SHIPPING_ICON . "<br />"; } if (isset($listing->fields['products_model'])) { $lc_text .= "<div class='text-center'><small class='item-number'><i>Item # {$listing->fields['products_model']}" . "</i></small></div>";
$pInfo = new objectInfo($_POST); $products_name = $_POST['products_name']; $products_description = $_POST['products_description']; $products_url = $_POST['products_url']; } else { $product = $db->Execute("select p.products_id, pd.language_id, pd.products_name,\r\n pd.products_description, pd.products_url, p.products_quantity,\r\n p.products_model, p.products_image, p.products_price, p.products_virtual,\r\n p.products_weight, p.products_date_added, p.products_last_modified,\r\n p.products_date_available, p.products_status, p.manufacturers_id,\r\n p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,\r\n p.product_is_free, p.product_is_call, p.products_quantity_mixed,\r\n p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,\r\n p.products_sort_order\r\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n where p.products_id = pd.products_id\r\n and p.products_id = '" . (int) $_GET['pID'] . "'"); $pInfo = new objectInfo($product->fields); $products_image_name = $pInfo->products_image; } $form_action = isset($_GET['pID']) ? 'update_product' : 'insert_product'; echo zen_draw_form($form_action, $type_admin_handler, 'cPath=' . $cPath . (isset($_GET['product_type']) ? '&product_type=' . $_GET['product_type'] : '') . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=' . $form_action . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'post', 'enctype="multipart/form-data"'); $languages = zen_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { if (isset($_GET['read']) && $_GET['read'] == 'only') { $pInfo->products_name = zen_get_products_name($pInfo->products_id, $languages[$i]['id']); $pInfo->products_description = zen_get_products_description($pInfo->products_id, $languages[$i]['id']); $pInfo->products_url = zen_get_products_url($pInfo->products_id, $languages[$i]['id']); } else { $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 border="0" width="100%" cellspacing="0" cellpadding="2"> <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; ?>
$link = TEXT_PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_new->fields['products_id'] . "]\" value=\"0\" size=\"4\" />"; } else { $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> '; } } $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } else { $link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } if (PRODUCT_NEW_LIST_DESCRIPTION > '0') { $disp_text = zen_get_products_description($products_new->fields['products_id']); $disp_text = zen_clean_html($disp_text); $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_NEW_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '"> ' . MORE_INFO_TEXT . '</a>')); } else { $display_products_description = ''; } ?> <ul class="list_product clear"> <li class="relative"><?php echo $display_products_image; ?> </li> <li class="li_con"> <dl> <dt><?php
?> </td> <td class="main" width="100%"> <?php if ($_SESSION['html_editor_preference_status'] == "FCKEDITOR") { $oFCKeditor = new FCKeditor('products_description[' . $languages[$i]['id'] . ']'); $oFCKeditor->Value = isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']); $oFCKeditor->Width = '99%'; $oFCKeditor->Height = '350'; // $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ; // $oFCKeditor->Create() ; $output = $oFCKeditor->CreateHtml(); echo $output; } else { // using HTMLAREA or just raw "source" echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', isset($products_description[$languages[$i]['id']]) ? htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])) : htmlspecialchars(zen_get_products_description($pInfo->products_id, $languages[$i]['id']))); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); } ?> </td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?> </td>
} break; } $list_box_contents[$rows][$col] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); } // add description and match alternating colors if (PRODUCT_LIST_DESCRIPTION > 0) { $rows++; if ($extra_row == 1) { $list_box_description = "productListing-data-description-even"; $extra_row = 0; } else { $list_box_description = "productListing-data-description-odd"; $extra_row = 1; } $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"', 'text' => zen_trunc_string(zen_clean_html(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION)); } $listing->MoveNext(); } $error_categories == false; } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-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)) { $show_top_submit_button = 'true'; } if ($how_many > 0 and $show_submit == 'true' and $listing_split->number_of_rows > 0 and PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) { $show_bottom_submit_button = 'true';
function back_in_stock_send($product_id = 0, $bis_id = 0, $preview = true) { global $db; cleanse_back_in_stock_subscriptions(); if ($product_id != 0) { $addtl_where = ' AND product_id=' . $product_id; } else { $addtl_where = ''; } if ($bis_id != 0) { $addtl_where .= ' AND bis_id=' . $bis_id; } // Find all Items in notifications $bis_emails = array(); $now = time(); $bis_products = $db->Execute("SELECT p.products_id, pd.products_name, b.product_id, b.last_sent, b.email, b.name, b.bis_id, b.active_til_purch, b.sub_active FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_BACK_IN_STOCK . " b WHERE p.products_id = pd.products_id AND p.products_id = b.product_id AND p.products_quantity > 0 AND sub_active=1 " . $addtl_where); while (!$bis_products->EOF) { echo 'Back in stock: ' . $bis_products->fields['products_name'] . "\n" . "<br/>"; $your_date = strtotime($bis_products->fields['last_sent']); $datediff = $now - $your_date; $days_since = floor($datediff / (60 * 60 * 24)); if (BACK_IN_STOCK_DAYS_WAITING > $days_since && BACK_IN_STOCK_DAYS_WAITING != '0') { $bis_products->MoveNext(); } $bis_emails[] = array('email' => $bis_products->fields['email'], 'name' => stripslashes($bis_products->fields['name']), 'product_id' => $bis_products->fields['product_id'], 'bis_id' => $bis_products->fields['bis_id'], 'active_til_purch' => $bis_products->fields['active_til_purch']); $bis_products->MoveNext(); } $counted = 0; if (!$preview) { foreach ($bis_emails as $emails) { if ($emails['email'] == '') { continue; } if ($counted >= (int) BACK_IN_STOCK_MAX_EMAILS_PER_BATCH && BACK_IN_STOCK_MAX_EMAILS_PER_BATCH != '0') { break; } $customers_name = stripslashes($emails['name']); $customers_email = $emails['email']; $html_message = array(); $html_message['CUSTOMERS_NAME'] = $customers_name; $html_message['PRODUCT_NAME'] = strip_tags(zen_get_products_name($emails['product_id'])); $html_message['SPAM_LINK'] = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=back_in_stock&bis_id=' . $emails['bis_id']; $html_message['TOP_MESSAGE'] = BACK_IN_STOCK_MAIL_TOP . $html_message['PRODUCT_NAME'] . "\n" . "\n" . BACK_IN_STOCK_MAIL_AVAILABLE; if (BACK_IN_STOCK_DESC_IN_EMAIL == 1) { $html_message['PRODUCT_DESCRIPTION'] = zen_get_products_description($emails['product_id']); } else { $html_message['PRODUCT_DESCRIPTION'] = " "; } $html_message['PRODUCT_IMAGE'] = zen_get_products_image($emails['product_id'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT); $html_message['PRODUCT_LINK'] = zen_href_link('product_info', 'products_id=' . $emails['product_id']); $html_message['BOTTOM_MESSAGE'] = BACK_IN_STOCK_MAIL_BOTTOM; $email_text = BACK_IN_STOCK_MAIL_GREETING . $customers_name . ',' . "\n" . "\n" . $html_message['TOP_MESSAGE'] . "\n" . "\n" . $html_message['PRODUCT_NAME'] . "\n" . $html_message['PRODUCT_DESCRIPTION'] . "\n" . $html_message['PRODUCT_LINK'] . "\n" . "\n" . $html_message['BOTTOM_MESSAGE'] . "\n" . "\n" . BACK_IN_STOCK_MAIL_CANCEL . "\n" . $html_message['SPAM_LINK'] . "\n"; $counted++; zen_mail($customers_name, $customers_email, $html_message['PRODUCT_NAME'] . BACK_IN_STOCK_MAIL_BACK . STORE_NAME, $email_text, STORE_NAME, EMAIL_FROM, $html_message, 'back_in_stock_notification'); if (BACK_IN_STOCK_SEND_ADMIN_EMAIL == 'true') { zen_mail('', BACK_IN_STOCK_ADMIN_EMAIL, $html_message['PRODUCT_NAME'] . BACK_IN_STOCK_MAIL_BACK . STORE_NAME, $email_text, STORE_NAME, EMAIL_FROM, $html_message, 'back_in_stock_notification'); } echo BACK_IN_STOCK_MAIL_SENT . $customers_email . "\n" . "<br/>"; $modify_subscription = array('bis_id' => $emails['bis_id'], 'sub_active' => $emails['active_til_purch'], 'last_sent' => "NOW()"); back_in_stock_subscription($modify_subscription, "modify"); } ?> <br/> Processed <?php echo $counted; ?> Notifications <?php if ($counted == (int) BACK_IN_STOCK_MAX_EMAILS_PER_BATCH) { echo BACK_IN_STOCK_MAIL_MANY; } } if ($preview) { ?> <br/>Preview:</br> <table> <tr> <th>Customers Name</th> <th>Customers Email</th> <th>Product</th> </tr> <?php foreach ($bis_emails as $emails) { if ($counted >= (int) BACK_IN_STOCK_MAX_EMAILS_PER_BATCH && BACK_IN_STOCK_MAX_EMAILS_PER_BATCH != '0') { break; } $counted++; ?> <tr> <td><?php echo stripslashes($emails['name']); ?> </td> <td><?php echo $emails['email']; ?> </td> <td><?php echo zen_get_products_name($emails['product_id']); ?> </td> </tr> <?php } ?> </table> <br/> You can Process <?php echo $counted; ?> Notifications by clicking: <?php echo '<a href="' . zen_href_link("cron/send_back_in_stock_notifications.php", zen_get_all_get_params(array('preview')), 'NONSSL', true, true, true) . '">' . 'HERE' . '</a>'; echo "\n" . '<br/>'; if ($counted == (int) BACK_IN_STOCK_MAX_EMAILS_PER_BATCH) { echo BACK_IN_STOCK_MAIL_MANY; } } }
$lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = $listing->fields['products_model']; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; 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']) . '">' . $listing->fields['products_name'] . '</a>'; } else { $lc_text = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a>'; } // add description if (PRODUCT_LIST_DESCRIPTION > 0) { $lc_text .= '<div>' . zen_trunc_string(zen_clean_html(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = ' <a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a> '; break; case 'PRODUCT_LIST_PRICE': $lc_price = CommerceProduct::getDisplayPriceFromHash($listing->fields['products_id']) . '<br />'; $lc_align = 'right'; $lc_text = ' ' . $lc_price . ' '; // more info in place of buy now $lc_button = ''; if ($listing->fields['products_priced_by_attribute'] || PRODUCT_LIST_PRICE_BUY_NOW == '0' || zen_has_product_attributes($listing->fields['products_id'])) { $lc_button = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; } else {
$link = '<span>' . TEXT_PRODUCT_SPECIALS_MULTIPLE_ADD_TO_CART . "</span><input class='input-text' type=\"text\" name=\"products_id[" . $specials->fields['products_id'] . "]\" value=\"0\" size=\"4\" />"; } else { $link = '<a href="' . zen_href_link(FILENAME_SPECIALS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $specials->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> '; } } $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($specials->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($specials->fields['products_id']) . str_repeat('', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } else { $link = '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($specials->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($specials->fields['products_id']) . str_repeat('', substr(PRODUCT_NEW_BUY_NOW, 3, 1)); } if (PRODUCT_SPECIALS_DESCRIPTION > '0') { $disp_text = zen_get_products_description($specials->fields['products_id']); $disp_text = zen_clean_html($disp_text); $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_SPECIALS_DESCRIPTION)); } else { $display_products_description = ''; } $get_discount_prod = mb_discount_product($specials->fields['products_id']); $sid = $specials->fields['products_id']; $products_query = "select * from " . TABLE_PRODUCTS . " where products_id='{$sid}'"; $products_res = $db->Execute($products_query); $feature_query = "select * from " . TABLE_FEATURED . " where products_id='{$sid}'"; $featured_res = $db->Execute($feature_query); $pid = $products_res->fields['products_id']; $fid = $featured_res->fields['products_id']; if ($pid == $sid) { $msg_product = "<div class='tag tag-orange' title=''><div class='text'>SALE</div></div>";
$list_box_contents[$rows] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_align = ''; $lc_text = $listing->fields['products_model']; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } else { $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>'; break; case 'PRODUCT_LIST_PRICE': $lc_price = '<span class="table-price">' . zen_get_products_display_price($listing->fields['products_id']) . '</span><br />'; $lc_align = 'right'; $lc_text = $lc_price; // more info in place of buy now $lc_button = ''; if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') { $lc_button = '<span class="more-info"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a></span>'; } else {
$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_FEATURED_PRODUCTS, 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> '; } } $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($featured_products->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($featured_products->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_BUY_NOW, 3, 1)); } else { $link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $the_button = $link; $products_link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; $display_products_button = zen_get_buy_now_button($featured_products->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($featured_products->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_BUY_NOW, 3, 1)); } if (PRODUCT_FEATURED_LIST_DESCRIPTION > '0') { $disp_text = zen_get_products_description($featured_products->fields['products_id']); $disp_text = zen_clean_html($disp_text); $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_FEATURED_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '"> ' . MORE_INFO_TEXT . '</a>')); } else { $display_products_description = ''; } ?> <tr> <td width="<?php echo IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH + 10; ?> " valign="top" class="main" align="center"> <?php $disp_sort_order = $db->Execute("select configuration_key, configuration_value from " . TABLE_CONFIGURATION . " where configuration_group_id='" . $group_id . "' and (configuration_value >= 1000 and configuration_value <= 1999) order by LPAD(configuration_value,11,0)"); while (!$disp_sort_order->EOF) { if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_FEATURED_LIST_IMAGE') {
<td class="main" width="100%"> <?php if (is_null($_SESSION['html_editor_preference_status'])) { echo TEXT_HTML_EDITOR_NOT_DEFINED; } ?> <?php if ($_SESSION['html_editor_preference_status'] == "FCKEDITOR") { // if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") require(DIR_FS_ADMIN_INCLUDES.'fckeditor.php'); $oFCKeditor = new FCKeditor(); $oFCKeditor->Value = isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']); $oFCKeditor->CreateFCKeditor('products_description[' . $languages[$i]['id'] . ']', '99%', '230'); //instanceName, width, height (px or %) } else { // using HTMLAREA or just raw "source" echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id'])); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); } ?> </td> <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> </tr> </table> </td> </tr> <?php }
$advanced_search->MoveNext(); $row++; } } $advanced_search_split2 = new splitPageResults($listing_sql2, isset($_GET['pagesize']) ? $_GET['pagesize'] : MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page'); $advanced_search2 = $db->Execute($advanced_search_split2->sql_query); if ($advanced_search2->RecordCount() > 0) { $row = 0; while (!$advanced_search2->EOF) { if ($advanced_search2->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { $list_box_contents2[$row]['products_image'] = ''; } else { $list_box_contents2[$row]['products_image'] = $advanced_search2->fields['products_image']; } $list_box_contents2[$row]['products_name'] = $advanced_search2->fields['products_name']; $list_box_contents2[$row]['products_description'] = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($advanced_search2->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); $list_box_contents2[$row]['products_price'] = zen_get_products_base_price($advanced_search2->fields['products_id']); $list_box_contents2[$row]['actual_price'] = $currencies->display_price(zen_get_products_actual_price($advanced_search2->fields['products_id']), zen_get_tax_rate($product_check->fields['products_tax_class_id'])); $list_box_contents2[$row]['products_status'] = $advanced_search2->fields['products_status']; if ($advanced_search2->fields['product_is_always_free_shipping'] == 0) { $list_box_contents2[$row]['product_is_always_free_shipping'] = ''; } else { $list_box_contents2[$row]['product_is_always_free_shipping'] = '<span class="free_shipping"></span>'; } $list_box_contents2[$row]['products_quantity_order_min'] = $advanced_search2->fields['products_quantity_order_min']; $list_box_contents2[$row]['products_id'] = $advanced_search2->fields['products_id']; $list_box_contents2[$row]['products_quantity'] = $advanced_search2->fields['products_quantity']; $list_box_contents2[$row]['products_price_retail'] = $currencies->display_price($advanced_search2->fields['products_price_retail'], zen_get_tax_rate($product_check->fields['products_tax_class_id'])); $list_box_contents2[$row]['products_price_sample'] = $currencies->display_price($advanced_search2->fields['products_price_sample'], zen_get_tax_rate($product_check->fields['products_tax_class_id'])); $list_box_contents2[$row]['product_is_wholesale'] = $advanced_search2->fields['product_is_wholesale']; $list_box_contents2[$row]['product_wholesale_min'] = $advanced_search2->fields['product_wholesale_min'];
?> <tr> <td class="main" valign="top"><?php if ($i == 0) { echo TEXT_PRODUCTS_DESCRIPTION; } ?> </td> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars(isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?> </td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?> </td> </tr>
$lc_align = ''; if ($listing->fields['manufacturers_name'] != '') { $trg_extra_val .= '<div class="product-model">' . TABLE_HEADING_MODEL . ' : ' . $listing->fields['products_model'] . "</div>"; } //$lst_lc_text = '<div class="product-model">'.$listing->fields['products_model']."</div>"; break; case 'PRODUCT_LIST_NAME': $lc_align = ''; if (isset($_GET['manufacturers_id'])) { $product_name = '<h2 class="product-name"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $products_name . '</a></h2>'; $product_name_only = $products_name; $product_desc = '<div class="text"><p>' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</p></div>'; } else { $product_name = '<h2 class="product-name"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $products_name . '</a></h2>'; $product_name_only = $products_name; $product_desc = '<div class="text"><p>' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</p></div>'; } break; case 'PRODUCT_LIST_MANUFACTURER': $lc_align = ''; if ($listing->fields['manufacturers_name'] != '') { $trg_extra_val .= '<div class="product-menufacture">' . TABLE_HEADING_MANUFACTURER . ' : ' . '<span><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></span></div>'; } //$lst_lc_text = '<div class="product-menufacture"><a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a></div>'; break; case 'PRODUCT_LIST_PRICE': // $lc_price = '<div class="price-box">'.zen_get_products_display_price($listing->fields['products_id']) . '</div>'; $product_price_box = zen_mb_get_products_display_price($listing->fields['products_id']); $lc_align = 'right'; $lc_text = $lc_price; $lst_lc_text = $lc_price;