public function initialize() { global $lC_Services, $lC_RecentlyVisited, $lC_Language, $lC_Image, $lC_Product; if ($lC_Services->isStarted('recently_visited') && $lC_RecentlyVisited->hasHistory()) { $this->_content = ''; if ($lC_RecentlyVisited->hasProducts()) { foreach ($lC_RecentlyVisited->getProducts() as $product) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW $lC_Product = new lC_Product($product['id']); $this->_content .= '<div class="content-recently-visited-container">' . "\n" . ' <div class="content-recently-visited-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Product->getTitle()) . '</div>' . "\n"; if ($lC_Product->hasImage()) { $this->_content .= '<div class="content-recently-visited-image">' . (SERVICE_RECENTLY_VISITED_SHOW_PRODUCT_IMAGES == '1' ? lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="content-recently-visited-image-src"', 'small')) : NULL) . '</div>' . "\n"; } $this->_content .= ' <div class="content-recently-visited-price pricing-row">' . $lC_Product->getPriceFormated(true) . '</div>' . "\n" . ' <div class="content-recently-visited-from">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . '</div>' . "\n" . '</div>' . "\n"; } } if ($lC_RecentlyVisited->hasCategories()) { foreach ($lC_RecentlyVisited->getCategories() as $category) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW if (!empty($category['parent_id'])) { $this->_content .= '<div class="content-recently-visited-container">' . "\n" . ' <div class="content-recently-visited-name">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $product['category_path']), $product['category_name'])) . '</div>' . "\n"; if (isset($category['image']) && empty($category['image']) === false) { $this->_content .= '<div class="content-recently-visited-image">' . (SERVICE_RECENTLY_VISITED_SHOW_CATEGORY_IMAGES == '1' ? lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['id']), lc_image('images/categories/' . $category['image'], $category['name'], null, null, 'class="content-recently-visited-image-src"')) : NULL) . '</div>' . "\n"; } $this->_content .= ' <div class="content-recently-visited-price pricing-row"></div>' . "\n" . ' <div class="content-recently-visited-from">' . sprintf($lC_Language->get('recently_visited_item_in_category'), lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $category['parent_id']), $category['parent_name'])) . '</div>' . "\n" . '</div>' . "\n"; } } } if ($lC_RecentlyVisited->hasSearches()) { foreach ($lC_RecentlyVisited->getSearches() as $searchphrase) { // $this->_content .= '<div class="content-recently-visited-searches">' . lc_link_object(lc_href_link(FILENAME_SEARCH, 'keywords=' . $searchphrase['keywords']), lc_output_string_protected($searchphrase['keywords'])) . ' <i>(' . number_format($searchphrase['results']) . ' results)</i></div>'; } } } }
public function initialize() { global $lC_Database, $lC_Language, $lC_Product, $lC_Customer; $this->_title_link = lc_href_link(FILENAME_ACCOUNT, 'notifications', 'SSL'); if (isset($lC_Product) && is_a($lC_Product, 'lC_Product')) { if ($lC_Customer->isLoggedOn()) { $Qcheck = $lC_Database->query('select global_product_notifications from :table_customers where customers_id = :customers_id'); $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS); $Qcheck->bindInt(':customers_id', $lC_Customer->getID()); $Qcheck->execute(); if ($Qcheck->valueInt('global_product_notifications') === 0) { $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where products_id = :products_id and customers_id = :customers_id limit 1'); $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qcheck->bindInt(':products_id', $lC_Product->getID()); $Qcheck->bindInt(':customers_id', $lC_Customer->getID()); $Qcheck->execute(); if ($Qcheck->numberOfRows() > 0) { $this->_content = '<li class="box-product-notifications-remove-image"><span class="box-product_notifications-image-container"></span>' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')) . '&action=notify_remove', 'AUTO'), sprintf($lC_Language->get('box_product_notifications_remove'), $lC_Product->getTitle())) . '</li>'; } else { $this->_content = '<li class="box-product-notifications-add-image"><span class="box-product_notifications-image-container"></span>' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')) . '&action=notify_add', 'AUTO'), sprintf($lC_Language->get('box_product_notifications_add'), $lC_Product->getTitle())) . '</li>'; } } } } }
protected function _process() { global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Vqmod; require_once $lC_Vqmod->modCheck('includes/classes/account.php'); $Qcheck = $lC_Database->query('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS); $Qcheck->bindValue(':customers_email_address', $_POST['email_address']); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 1) { $password = lc_create_random_string(ACCOUNT_PASSWORD); if (lC_Account::savePassword($password, $Qcheck->valueInt('customers_id'))) { if (ACCOUNT_GENDER > -1) { if ($data['gender'] == 'm') { $email_text = sprintf($lC_Language->get('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } else { $email_text = sprintf($lC_Language->get('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } } else { $email_text = sprintf($lC_Language->get('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n"; } $email_text .= sprintf($lC_Language->get('email_password_reminder_body'), getenv('REMOTE_ADDR'), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS); lc_email($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), sprintf($lC_Language->get('email_password_reminder_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login&success=' . urlencode($lC_Language->get('success_password_forgotten_sent')), 'SSL')); } else { $lC_MessageStack->add('password_forgotten', $lC_Language->get('error_password_forgotten_no_email_address_found')); } }
public function initialize() { global $lC_Database, $lC_Language, $current_category_id; if (isset($current_category_id) && $current_category_id > 0) { $Qbestsellers = $lC_Database->query('select distinct p.products_id, pd.products_name, pd.products_keyword from :table_products p, :table_products_description pd, :table_products_to_categories p2c, :table_categories c where p.products_status = 1 and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and :current_category_id in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit :max_display_bestsellers'); $Qbestsellers->bindTable(':table_products', TABLE_PRODUCTS); $Qbestsellers->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qbestsellers->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES); $Qbestsellers->bindTable(':table_categories', TABLE_CATEGORIES); $Qbestsellers->bindInt(':language_id', $lC_Language->getID()); $Qbestsellers->bindInt(':current_category_id', $current_category_id); $Qbestsellers->bindInt(':max_display_bestsellers', BOX_BEST_SELLERS_MAX_LIST); if (BOX_BEST_SELLERS_CACHE > 0) { $Qbestsellers->setCache('box_best_sellers-' . $current_category_id . '-' . $lC_Language->getCode(), BOX_BEST_SELLERS_CACHE); } $Qbestsellers->execute(); } else { $Qbestsellers = $lC_Database->query('select p.products_id, pd.products_name, pd.products_keyword from :table_products p, :table_products_description pd where p.products_status = 1 and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_ordered desc, pd.products_name limit :max_display_bestsellers'); $Qbestsellers->bindTable(':table_products', TABLE_PRODUCTS); $Qbestsellers->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qbestsellers->bindInt(':language_id', $lC_Language->getID()); $Qbestsellers->bindInt(':max_display_bestsellers', BOX_BEST_SELLERS_MAX_LIST); if (BOX_BEST_SELLERS_CACHE > 0) { $Qbestsellers->setCache('box_best_sellers-0-' . $lC_Language->getCode(), BOX_BEST_SELLERS_CACHE); } $Qbestsellers->execute(); } if ($Qbestsellers->numberOfRows() >= BOX_BEST_SELLERS_MIN_LIST) { $this->_content = ''; while ($Qbestsellers->next()) { $this->_content .= '<li class="box-best-sellers-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qbestsellers->value('products_keyword')), $Qbestsellers->value('products_name')) . '</li>'; } } $Qbestsellers->freeResult(); }
public function initialize() { global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image; if (MODULE_CONTENT_FEATURED_PRODUCTS_MAX_DISPLAY > 0) { $limit = ' limit ' . MODULE_CONTENT_FEATURED_PRODUCTS_MAX_DISPLAY; } $Qfeatured = $lC_Database->query('select products_id from :table_featured_products where (str_to_date(expires_date, "%Y-%m-%d") >= str_to_date(now(), "%Y-%m-%d") or expires_date = "0000-00-00 00:00:00") and status = 1 order by rand() asc' . $limit); $Qfeatured->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS); $Qfeatured->bindInt(':max_display_featured_products', MODULE_CONTENT_FEATURED_PRODUCTS_MAX_DISPLAY); $Qfeatured->execute(); if (MODULE_CONTENT_FEATURED_PRODUCTS_CACHE > 0) { $Qfeatured->setCache('featured_products-' . $lC_Language->getCode() . '-' . $lC_Currencies->getCode(), MODULE_CONTENT_FEATURED_PRODUCTS_CACHE); } if ($Qfeatured->numberOfRows() > 0) { $this->_content = ''; while ($Qfeatured->next()) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW $lC_Product = new lC_Product($Qfeatured->valueInt('products_id')); $this->_content .= '<div class="content-featured-products-container">' . "\n" . ' <div class="content-featured-products-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Product->getTitle()) . '</div>' . "\n"; if ($lC_Product->hasImage()) { $this->_content .= ' <div class="content-featured-products-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="content-featured-products-image-src"')) . '</div>' . "\n"; } $this->_content .= ' <div class="content-featured-products-desc">' . substr(lc_clean_html($lC_Product->getDescription()), 0, 62) . '...</div>' . "\n" . ' <div class="content-featured-products-price pricing-row">' . $lC_Product->getPriceFormated(true) . '</div>' . "\n" . ' <div class="content-featured-products-button pricing-row buy-btn-div"><button class="content-featured-products-add-button" onclick="window.location.href=\'' . lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword() . '&action=cart_add') . '\'" type="button">' . $lC_Language->get('new_products_button_buy_now') . '</button></div>' . "\n" . '</div>' . "\n"; } } $Qfeatured->freeResult(); }
protected function _process() { global $lC_Language, $lC_MessageStack, $lC_Product; if (empty($_POST['from_name'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_customers_name_empty')); } if (!lc_validate_email_address($_POST['from_email_address'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_customers_email_address')); } if (empty($_POST['to_name'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_friends_name_empty')); } if (!lc_validate_email_address($_POST['to_email_address'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_friends_email_address')); } if ($lC_MessageStack->size('tell_a_friend') < 1) { $email_subject = sprintf($lC_Language->get('email_tell_a_friend_subject'), lc_sanitize_string($_POST['from_name']), STORE_NAME); $email_body = sprintf($lC_Language->get('email_tell_a_friend_intro'), lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['from_name']), $lC_Product->getTitle(), STORE_NAME) . "\n\n"; if (!empty($_POST['message'])) { $email_body .= lc_sanitize_string($_POST['message']) . "\n\n"; } $email_body .= sprintf($lC_Language->get('email_tell_a_friend_link'), lc_href_link(HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCTS, $lC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($lC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); lc_email(lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, lc_sanitize_string($_POST['from_name']), lc_sanitize_string($_POST['from_email_address'])); lc_redirect(lc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $lC_Product->getID() . '&success=' . urlencode(sprintf($lC_Language->get('success_tell_a_friend_email_sent'), $lC_Product->getTitle(), lc_output_string_protected($_POST['to_name']))))); } }
public function initialize() { global $lC_Cache, $lC_Database, $lC_Services, $lC_Currencies, $lC_Specials, $lC_Language, $lC_Image; $this->_title_link = lc_href_link(FILENAME_PRODUCTS, 'new'); $data = array(); if ($lC_Cache->isEnabled() && BOX_WHATS_NEW_CACHE > 0 && $lC_Cache->read('box-whats_new-' . $lC_Language->getCode() . '-' . $lC_Currencies->getCode(), BOX_WHATS_NEW_CACHE)) { $data = $lC_Cache->getCache(); } else { $Qnew = $lC_Database->query('select products_id from :table_products where products_status = :products_status order by products_date_added desc limit :max_random_select_new'); $Qnew->bindTable(':table_products', TABLE_PRODUCTS); $Qnew->bindInt(':products_status', 1); $Qnew->bindInt(':max_random_select_new', BOX_WHATS_NEW_RANDOM_SELECT); $Qnew->executeRandomMulti(); if ($Qnew->numberOfRows()) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW $lC_Product = new lC_Product($Qnew->valueInt('products_id')); $data = $lC_Product->getData(); $data['display_price'] = $lC_Product->getPriceFormated(true); $data['display_image'] = $lC_Product->getImage(); } if ($lC_Cache->isEnabled()) { $lC_Cache->write($data); } } if (!empty($data)) { $this->_content = ''; if (empty($data['display_image']) === false) { $this->_content = '<li class="box-whats-new-image"><div class="thumbnail">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $data['keyword']), $lC_Image->show($data['display_image'], $data['name'], 'class="box-whats-new-image-src"')) . '</div></li>'; } $this->_content .= '<li class="box-whats-new-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $data['keyword']), $data['name']) . '</li>'; $this->_content .= '<li class="box-whats-new-price pricing-row">' . $data['display_price'] . '</li>'; $this->_content .= '<li class="box-whats-new-buy-now pricing-row buy-btn-div"><button onclick="window.location.href=\'' . lc_href_link(FILENAME_PRODUCTS, $data['keyword'] . '&action=cart_add') . '\'" title="" type="button">' . $lC_Language->get('button_buy_now') . '</button>'; } }
protected function _process() { global $lC_Database, $lC_Session, $lC_Language, $lC_ShoppingCart, $lC_MessageStack, $lC_Customer, $lC_NavigationHistory, $lC_Vqmod; require $lC_Vqmod->modCheck('includes/classes/account.php'); if (lC_Account::checkEntry($_POST['email_address'])) { if (lC_Account::checkPassword($_POST['password'], $_POST['email_address'])) { if (SERVICE_SESSION_REGENERATE_ID == '1') { $lC_Session->recreate(); } $lC_Customer->setCustomerData(lC_Account::getID($_POST['email_address'])); $Qupdate = $lC_Database->query('update :table_customers set date_last_logon = :date_last_logon, number_of_logons = number_of_logons+1 where customers_id = :customers_id'); $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS); $Qupdate->bindRaw(':date_last_logon', 'now()'); $Qupdate->bindInt(':customers_id', $lC_Customer->getID()); $Qupdate->execute(); if ($lC_ShoppingCart->hasContents() === true) { $lC_ShoppingCart->synchronizeWithDatabase(); } $lC_NavigationHistory->removeCurrentPage(); lC_Cache::clearAll(); if ($lC_NavigationHistory->hasSnapshot()) { $lC_NavigationHistory->redirectToSnapshot(); } else { lc_redirect(lc_href_link(FILENAME_DEFAULT, null, 'AUTO')); } } else { $lC_MessageStack->add('login', $lC_Language->get('error_login_no_match')); } } else { $lC_MessageStack->add('login', $lC_Language->get('error_login_no_match')); } }
public function initialize() { global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image; $Qupcoming = $lC_Database->query('select p.products_id, pa.value as date_expected from :table_products p, :table_templates_boxes tb, :table_product_attributes pa where tb.code = :code and tb.id = pa.id and to_days(str_to_date(pa.value, "%m/%d/%Y")) >= to_days(now()) and pa.products_id = p.products_id and p.products_status = :products_status order by pa.value limit :max_display_upcoming_products'); $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS); $Qupcoming->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES); $Qupcoming->bindTable(':table_product_attributes', TABLE_PRODUCT_ATTRIBUTES); $Qupcoming->bindValue(':code', 'date_available'); $Qupcoming->bindInt(':products_status', 1); $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY); if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) { $Qupcoming->setCache('upcoming_products-' . $lC_Language->getCode() . '-' . $lC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE); } $Qupcoming->execute(); if ($Qupcoming->numberOfRows() > 0) { $this->_content = ''; while ($Qupcoming->next()) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW $lC_Product = new lC_Product($Qupcoming->valueInt('products_id')); $this->_content .= '<div class="content-upcoming-products-container">' . "\n" . '<div class="content-upcoming-products-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Product->getTitle()) . '</div>' . "\n"; if ($lC_Product->hasImage()) { $this->_content .= '<div class="content-upcoming-products-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), $lC_Image->show($lC_Product->getImage(), $lC_Product->getTitle(), 'class="content-upcoming-products-image-src"', 'small')) . '</div>' . "\n"; } $this->_content .= '<div class="content-upcoming-products-price pricing-row">' . $lC_Product->getPriceFormated(true) . '</div>' . "\n" . '<div class="content-upcoming-products-date">' . $Qupcoming->value('date_expected') . '</div>' . "\n" . '</div>' . "\n"; } } $Qupcoming->freeResult(); }
function execute() { global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer; if (!$lC_Customer->isLoggedOn()) { $lC_NavigationHistory->setSnapshot(); lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL')); return false; } $id = false; foreach ($_GET as $key => $value) { if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) { $id = $key; } break; } if ($id !== false && lC_Product::checkEntry($id)) { $lC_Product = new lC_Product($id); $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1'); $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qcheck->bindInt(':customers_id', $lC_Customer->getID()); $Qcheck->bindInt(':products_id', $lC_Product->getID()); $Qcheck->execute(); if ($Qcheck->numberOfRows() > 0) { $Qn = $lC_Database->query('delete from :table_products_notifications where customers_id = :customers_id and products_id = :products_id'); $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qn->bindInt(':customers_id', $lC_Customer->getID()); $Qn->bindInt(':products_id', $lC_Product->getID()); $Qn->execute(); } } lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')))); }
public function initialize() { global $lC_Database, $lC_Language, $lC_Customer; if ($lC_Customer->isLoggedOn()) { $Qorders = $lC_Database->query('select distinct op.products_id from :table_orders o, :table_orders_products op, :table_products p where o.customers_id = :customers_id and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = 1 group by products_id order by o.date_purchased desc limit :limit'); $Qorders->bindTable(':table_orders', TABLE_ORDERS); $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS); $Qorders->bindTable(':table_products', TABLE_PRODUCTS); $Qorders->bindInt(':customers_id', $lC_Customer->getID()); $Qorders->bindInt(':limit', BOX_ORDER_HISTORY_MAX_LIST); $Qorders->execute(); if ($Qorders->numberOfRows()) { $product_ids = ''; while ($Qorders->next()) { $product_ids .= $Qorders->valueInt('products_id') . ','; } $product_ids = substr($product_ids, 0, -1); $Qproducts = $lC_Database->query('select products_id, products_name, products_keyword from :table_products_description where products_id in (:products_id) and language_id = :language_id order by products_name'); $Qproducts->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qproducts->bindRaw(':products_id', $product_ids); $Qproducts->bindInt(':language_id', $lC_Language->getID()); $Qproducts->execute(); $this->_content = ''; while ($Qproducts->next()) { $this->_content .= '<li class="box-order-history-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qproducts->value('products_keyword')), $Qproducts->value('products_name')) . '</li>'; } } } }
function execute() { global $lC_Session, $lC_ShoppingCart; if (is_numeric($_GET['item'])) { $lC_ShoppingCart->remove($_GET['item']); } lc_redirect(lc_href_link(FILENAME_CHECKOUT)); }
public function lC_Products_Specials() { global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_Specials; $this->_page_title = $lC_Language->get('specials_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_specials'), lc_href_link(FILENAME_PRODUCTS, $this->_module)); } }
function lC_Info_Cookie() { global $lC_Services, $lC_Language, $lC_Breadcrumb; $this->_page_title = $lC_Language->get('info_cookie_usage_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_cookie_usage'), lc_href_link(FILENAME_INFO, $this->_module)); } }
public function lC_Info_Sitemap() { global $lC_Services, $lC_Language, $lC_Breadcrumb; $this->_page_title = $lC_Language->get('info_sitemap_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_sitemap'), lc_href_link(FILENAME_INFO, $this->_module)); } }
public function initialize() { global $lC_Language, $request_type; $this->_content = ''; foreach ($lC_Language->getAll() as $value) { $this->_content .= '<li class="box-languages-selection">' . lc_link_object(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('language', 'currency')) . '&language=' . $value['code'], 'AUTO'), $lC_Language->showImage($value['code'])) . '</li>'; } }
public function lC_Products_New() { global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_Vqmod; require $lC_Vqmod->modCheck('includes/classes/products.php'); $this->_page_title = $lC_Language->get('new_products_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_new_products'), lc_href_link(FILENAME_PRODUCTS, $this->_module)); } }
protected function _process() { global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod; require_once $lC_Vqmod->modCheck('includes/classes/account.php'); $data = array(); if (ACCOUNT_GENDER >= 0) { if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) { $data['gender'] = $_POST['gender']; } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_gender_error')); } } if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) { $data['firstname'] = $_POST['firstname']; } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME)); } if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) { $data['lastname'] = $_POST['lastname']; } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME)); } if (ACCOUNT_DATE_OF_BIRTH == '1') { $dateParts = explode("/", $_POST['dob']); if (isset($_POST['dob']) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) { $data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]); } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_date_of_birth_error')); } } if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) { if (lc_validate_email_address($_POST['email_address'])) { if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) { $data['email_address'] = $_POST['email_address']; } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_exists_error')); } } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_check_error')); } } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS)); } if ($lC_MessageStack->size('account_edit') === 0) { if (lC_Account::saveEntry($data)) { // reset the session variables if (ACCOUNT_GENDER > -1) { $lC_Customer->setGender($data['gender']); } $lC_Customer->setFirstName(trim($data['firstname'])); $lC_Customer->setLastName(trim($data['lastname'])); $lC_Customer->setEmailAddress($data['email_address']); $lC_MessageStack->add('account', $lC_Language->get('success_account_updated'), 'success'); } lc_redirect(lc_href_link(FILENAME_ACCOUNT, null, 'SSL')); } }
public function start() { global $lC_Breadcrumb, $lC_Language, $lC_Vqmod; include $lC_Vqmod->modCheck('includes/classes/breadcrumb.php'); $lC_Breadcrumb = new lC_Breadcrumb(); $template = isset($_SESSION['template']['code']) ? $_SESSION['template']['code'] : 'core'; $lC_Breadcrumb->add('<span id="breadcrumb-top">' . $lC_Language->get('text_home') . '</span>', lc_href_link(FILENAME_DEFAULT)); return true; }
public function lC_Checkout_Cart() { global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_MessageStack, $lC_Customer, $lC_NavigationHistory; $this->_page_title = $lC_Language->get('shopping_cart_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_checkout_shopping_cart'), lc_href_link(FILENAME_CHECKOUT, null, 'SSL')); } if (isset($_SESSION['messageToStack'])) { $lC_MessageStack = new lC_MessageStack(); } }
public function lC_Products_Featured_products() { global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_Vqmod, $lC_Featured_products; require $lC_Vqmod->modCheck('includes/classes/featured_products.php'); $lC_Featured_products = new lC_Featured_products(); //$lC_Featured_products->expireAll(); $this->_page_title = $lC_Language->get('featured_products_heading'); if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_featured_products'), lc_href_link(FILENAME_PRODUCTS, $this->_module)); } }
protected function _process() { global $lC_Language, $lC_MessageStack; $name = lc_sanitize_string($_POST['name']); $email_address = lc_sanitize_string($_POST['email']); $inquiry = lc_sanitize_string($_POST['inquiry']); if (lc_validate_email_address($email_address)) { lc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $lC_Language->get('contact_email_subject'), $inquiry, $name, $email_address); lc_redirect(lc_href_link(FILENAME_INFO, 'contact&success=' . urlencode($lC_Language->get('contact_email_sent_successfully')), 'AUTO')); } else { $lC_MessageStack->add('contact', $lC_Language->get('field_customer_email_address_check_error')); } }
public function initialize() { global $lC_Database, $lC_Services, $lC_Cache, $lC_Language, $lC_Product, $lC_Image; $this->_title_link = lc_href_link(FILENAME_PRODUCTS, 'reviews'); if ($lC_Services->isStarted('reviews')) { if ($lC_Cache->isEnabled() && BOX_REVIEWS_CACHE > 0 && $lC_Cache->read('box-reviews' . (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid() ? '-' . $lC_Product->getID() : '') . '-' . $lC_Language->getCode(), BOX_REVIEWS_CACHE)) { $data = $lC_Cache->getCache(); } else { $data = array(); $Qreview = $lC_Database->query('select r.reviews_id, r.reviews_rating, p.products_id, pd.products_name, pd.products_keyword, i.image from :table_reviews r, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where r.products_id = p.products_id and p.products_status = 1 and r.languages_id = :language_id and p.products_id = pd.products_id and pd.language_id = :language_id and r.reviews_status = 1'); $Qreview->bindTable(':table_reviews', TABLE_REVIEWS); $Qreview->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES); $Qreview->bindTable(':table_products', TABLE_PRODUCTS); $Qreview->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qreview->bindInt(':default_flag', 1); $Qreview->bindInt(':language_id', $lC_Language->getID()); $Qreview->bindInt(':language_id', $lC_Language->getID()); if (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid()) { $Qreview->appendQuery('and p.products_id = :products_id'); $Qreview->bindInt(':products_id', $lC_Product->getID()); } $Qreview->appendQuery('order by r.reviews_id desc limit :max_random_select_reviews'); $Qreview->bindInt(':max_random_select_reviews', BOX_REVIEWS_RANDOM_SELECT); $Qreview->executeRandomMulti(); if ($Qreview->numberOfRows()) { $Qtext = $lC_Database->query('select substring(reviews_text, 1, 60) as reviews_text from :table_reviews where reviews_id = :reviews_id and languages_id = :languages_id'); $Qtext->bindTable(':table_reviews', TABLE_REVIEWS); $Qtext->bindInt(':reviews_id', $Qreview->valueInt('reviews_id')); $Qtext->bindInt(':languages_id', $lC_Language->getID()); $Qtext->execute(); $data = array_merge($Qreview->toArray(), $Qtext->toArray()); $Qtext->freeResult(); $Qreview->freeResult(); } if ($lC_Cache->isEnabled()) { $lC_Cache->write($data); } } $this->_content = ''; if (empty($data)) { if (isset($lC_Product) && is_a($lC_Product, 'lC_Product') && $lC_Product->isValid()) { $this->_content = '<li class="box-reviews-write">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=new&' . $lC_Product->getKeyword()), $lC_Language->get('box_reviews_write')) . '</li>' . "\n"; } } else { if (!empty($data['image'])) { $this->_content = '<li class="box-reviews-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), $lC_Image->show($data['image'], $data['products_name'], 'class="box-reviews-image-src"')) . '</li>'; } $this->_content .= '<li class="box-reviews-text">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, 'reviews=' . $data['reviews_id'] . '&' . $data['products_keyword']), wordwrap(lc_output_string_protected($data['reviews_text']), 15, "\n") . '...') . "\n" . '<li class="box-reviews-rating">' . $lC_Language->get('box_reviews_average_rating') . ' ' . lc_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $data['reviews_rating'] . '.png', sprintf($lC_Language->get('box_reviews_stars_rating'), $data['reviews_rating'])) . '</li>'; } } }
public function initialize() { global $lC_Language, $lC_ShoppingCart, $lC_Currencies; $this->_title_link = lc_href_link(FILENAME_CHECKOUT, null, 'SSL'); if ($lC_ShoppingCart->hasContents()) { $this->_content = ''; foreach ($lC_ShoppingCart->getProducts() as $products) { $this->_content .= '<li class="box-shopping-cart-product">' . $products['quantity'] . ' x ' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $products['keyword']), $products['name']) . '</li>'; } $this->_content .= '<li class="box-shopping-cart-subtotal">' . $lC_Language->get('box_shopping_cart_subtotal') . ' ' . $lC_Currencies->format($lC_ShoppingCart->getSubTotal()) . '</li>'; } else { $this->_content = '<li class="box-shopping-cart-empty">' . $lC_Language->get('box_shopping_cart_empty') . '</li>'; } }
function execute() { global $lC_Session, $lC_ShoppingCart, $lC_Product, $lC_Language, $lC_Customer; if (!isset($lC_Product)) { $id = false; foreach ($_GET as $key => $value) { if ((is_numeric($key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) { $id = $key; } break; } if ($id !== false && lC_Product::checkEntry($id)) { $lC_Product = new lC_Product($id); } } if (isset($lC_Product)) { // VQMOD-hookpoint; DO NOT MODIFY OR REMOVE THE LINE BELOW $quantity = isset($_POST['quantity']) && !empty($_POST['quantity']) ? (int) $_POST['quantity'] : 1; if ($lC_Product->hasVariants()) { if (isset($_POST['variants']) && is_array($_POST['variants']) && !empty($_POST['variants'])) { if ($lC_Product->variantExists($_POST['variants'])) { $lC_ShoppingCart->add($lC_Product->getProductVariantID($_POST['variants']), $quantity); } else { lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword() . '&error=' . urlencode($lC_Language->get('variant_combo_not_available')))); return false; } } else { lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword())); return false; } } else { if (isset($_GET['info']) && $_GET['info'] == '1') { } else { if ($lC_Product->hasSubProducts($lC_Product->getID()) || $lC_Product->hasSimpleOptions()) { lc_redirect(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword())); } } if (isset($_POST['quantity']) && is_array($_POST['quantity'])) { foreach ($_POST['quantity'] as $product_id => $quantity) { $lC_ShoppingCart->add((int) $product_id, (int) $quantity); } } else { $lC_ShoppingCart->add($lC_Product->getID(), $quantity); } } } lc_redirect(lc_href_link(FILENAME_CHECKOUT)); }
function execute() { global $lC_Database, $lC_Session, $lC_NavigationHistory, $lC_Customer; if (!$lC_Customer->isLoggedOn()) { $lC_NavigationHistory->setSnapshot(); lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login', 'SSL')); return false; } $notifications = array(); if (isset($_GET['products']) && !empty($_GET['products'])) { $products_array = explode(';', $_GET['products']); foreach ($products_array as $product_id) { if (is_numeric($product_id) && !in_array($product_id, $notifications)) { $notifications[] = $product_id; } } } else { $id = false; foreach ($_GET as $key => $value) { if ((preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $key) || preg_match('/^[a-zA-Z0-9 -_]*$/', $key)) && $key != $lC_Session->getName()) { $id = $key; } break; } if ($id !== false && lC_Product::checkEntry($id)) { $lC_Product = new lC_Product($id); $notifications[] = $lC_Product->getID(); } } if (!empty($notifications)) { foreach ($notifications as $product_id) { $Qcheck = $lC_Database->query('select products_id from :table_products_notifications where customers_id = :customers_id and products_id = :products_id limit 1'); $Qcheck->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qcheck->bindInt(':customers_id', $lC_Customer->getID()); $Qcheck->bindInt(':products_id', $product_id); $Qcheck->execute(); if ($Qcheck->numberOfRows() < 1) { $Qn = $lC_Database->query('insert into :table_products_notifications (products_id, customers_id, date_added) values (:products_id, :customers_id, :date_added)'); $Qn->bindTable(':table_products_notifications', TABLE_PRODUCTS_NOTIFICATIONS); $Qn->bindInt(':products_id', $product_id); $Qn->bindInt(':customers_id', $lC_Customer->getID()); $Qn->bindRaw(':date_added', 'now()'); $Qn->execute(); } } } lc_redirect(lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), lc_get_all_get_params(array('action')))); }
function _process() { $notify_string = ''; $products_array = isset($_POST['notify']) ? $_POST['notify'] : array(); if (!is_array($products_array)) { $products_array = array($products_array); } $notifications = array(); foreach ($products_array as $product_id) { if (is_numeric($product_id) && !in_array($product_id, $notifications)) { $notifications[] = $product_id; } } if (!empty($notifications)) { $notify_string = 'action=notify_add&products=' . implode(';', $notifications); } lc_redirect(lc_href_link(FILENAME_DEFAULT, $notify_string, 'AUTO')); }
public function lC_Search_Search() { global $lC_Services, $lC_Language, $lC_Breadcrumb, $lC_Search, $lC_Vqmod; require_once $lC_Vqmod->modCheck('includes/classes/search.php'); $this->_page_title = $lC_Language->get('search_heading'); $lC_Search = new lC_Search(); $this->addJavascriptPhpFilename('templates/' . $this->getCode() . '/javascript/form_check.js.php'); if (isset($_GET['keywords'])) { $this->_page_title = $lC_Language->get('search_results_heading'); $this->_page_contents = 'results.php'; if ($lC_Services->isStarted('breadcrumb')) { $lC_Breadcrumb->add($lC_Language->get('breadcrumb_search_results'), lc_href_link(FILENAME_SEARCH, lc_get_all_get_params())); } $this->_process(); } else { // nothing to do } }
/** * Adds an entry to the breadcrumb navigation path * * @param string $title The title of the breadcrumb navigation entry * @param string $link The link of the breadcrumb navigation entry * @param string $cPath The cPath used to prefix the breadcrumb * @access public */ public function add($title, $link = null, $cPath = null) { global $lC_Category; if ($cPath != null) { $cPathArr = explode('_', $cPath); $cp = ''; foreach ($cPathArr as $id) { $lC_Category = new lC_Category($id); $this->_path[] = lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $cp . $id), $lC_Category->getTitle($id)); $cp .= $id . '_'; } } if (!empty($link)) { $title = lc_link_object($link, $title); } if (!empty($title)) { $this->_path[] = $title; } }
public function getListingOutput() { global $lC_Database, $lC_Language, $lC_Currencies, $lC_Image, $lC_Featured_products; $Qf = $lC_Database->query('select products_id from :table_featured_products where (str_to_date(expires_date, "%Y-%m-%d") >= str_to_date(now(), "%Y-%m-%d") or expires_date = "0000-00-00 00:00:00") and status = 1 order by expires_date desc'); $Qf->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS); $Qf->execute(); while ($Qf->next()) { $Qfresults[] = $Qf->valueInt('products_id'); } $output = ''; if ($Qf->numberOfRows() > 0) { foreach ($Qfresults as $featured) { $Qfeatured = $lC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_quantity, pd.products_name, pd.products_keyword, pd.products_description, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id'); $Qfeatured->bindTable(':table_products', TABLE_PRODUCTS); $Qfeatured->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES); $Qfeatured->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION); $Qfeatured->bindInt(':products_id', $featured); $Qfeatured->bindInt(':default_flag', 1); $Qfeatured->bindInt(':language_id', $lC_Language->getID()); $Qfeatured->execute(); while ($Qfeatured->next()) { $output .= '<div class="content-featured-products-listing-container">'; $output .= ' <div class="content-featured-products-listing-name">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qfeatured->value('products_keyword')), $Qfeatured->value('products_name')) . '</div>' . "\n"; $output .= ' <div class="content-featured-products-listing-description">' . (strlen(lc_clean_html($Qfeatured->value('products_description'))) > 65 ? substr(lc_clean_html($Qfeatured->value('products_description')), 0, 62) . '...' : lc_clean_html($Qfeatured->value('products_description'))) . '</div>' . "\n"; $output .= ' <div class="content-featured-products-listing-price">' . $lC_Currencies->displayPrice($Qfeatured->value('products_price'), $Qfeatured->valueInt('products_tax_class_id')) . '</div>' . "\n"; $output .= ' <div class="content-featured-products-listing-image">' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $Qfeatured->value('products_keyword')), $lC_Image->show($Qfeatured->value('image'), $Qfeatured->value('products_name'))) . '</div>' . "\n"; if (DISABLE_ADD_TO_CART == 1 && $Qfeatured->valueInt('products_quantity') < 1) { $output .= ' <div class="content-featured-products-listing-buy-now"><button type="button" class="content-featured-products-listing-buy-now-button" disabled>' . $lC_Language->get('out_of_stock') . '</button></div>' . "\n"; } else { $output .= ' <div class="content-featured-products-listing-buy-now"><button type="button" onclick="document.location.href=\'' . lc_href_link(basename($_SERVER['SCRIPT_FILENAME']), $Qfeatured->value('products_keyword') . '&' . lc_get_all_get_params(array('action', 'new')) . '&action=cart_add') . '\'" class="content-featured-products-listing-buy-now-button">' . $lC_Language->get('button_buy_now') . '</button></div>' . "\n"; } $output .= '</div>' . "\n"; } } } else { $output .= '<div class="content-specials-listing-name">' . $lC_Language->get('text_no_featured_products') . '</div>'; } return $output; }