PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@ -0,0 +1,69 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: best_sellers.php,v 1.20 2003/02/10 22:30:57 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
if (!is_numeric(MAX_DISPLAY_BESTSELLERS)) return FALSE;
$best_sellers_block = FALSE;
if (isset($nCurrentCategoryID) && ($nCurrentCategoryID > 0)) {
$productstable = $oostable['products'];
$products_descriptiontable = $oostable['products_description'];
$products_to_categoriestable = $oostable['products_to_categories'];
$categoriestable = $oostable['categories'];
$query = "SELECT DISTINCT p.products_id, p.products_image, pd.products_name, pd.products_short_description
FROM $productstable p,
$products_descriptiontable pd,
$products_to_categoriestable p2c,
$categoriestable c
WHERE p.products_setting = '2'
AND p.products_ordered > 0
AND p.products_id = pd.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id
AND '" . intval($nCurrentCategoryID) . "' IN (c.categories_id, c.parent_id)
ORDER BY p.products_ordered DESC, pd.products_name";
} else {
$productstable = $oostable['products'];
$products_descriptiontable = $oostable['products_description'];
$query = "SELECT DISTINCT p.products_id, p.products_image, pd.products_name,
pd.products_short_description
FROM $productstable p,
$products_descriptiontable pd
WHERE p.products_setting = '2'
AND p.products_ordered > 0
AND p.products_id = pd.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'
ORDER BY p.products_ordered DESC, pd.products_name";
}
$best_sellers_result = $dbconn->SelectLimit($query, MAX_DISPLAY_BESTSELLERS);
if ($best_sellers_result->RecordCount() >= MIN_DISPLAY_BESTSELLERS) {
$best_sellers_block = TRUE;
$smarty->assign('best_sellers_list', $best_sellers_result->GetArray());
$smarty->assign('block_heading_best_sellers', $block_heading);
}
$smarty->assign('best_sellers_block', $best_sellers_block);

View File

@ -0,0 +1,289 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: categories.php,v 1.23 2002/11/12 14:09:30 dgw_
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
/**
* Return the number of products in a category
*
* @param $category_id
* @param $include_inactive
* @return string
*/
function oos_count_products_in_category($category_id, $include_inactive = FALSE) {
$products_count = 0;
$dbconn =& oosDBGetConn();
$oostable =& oosDBGetTables();
$productstable = $oostable['products'];
$products_to_categoriestable = $oostable['products_to_categories'];
if ($include_inactive == TRUE) {
$products = $dbconn->Execute("SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p2c.categories_id = '" . intval($category_id) . "'");
} else {
$products = $dbconn->Execute("SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_setting = '2' AND p2c.categories_id = '" . intval($category_id) . "'");
}
$products_count += $products->fields['total'];
$categoriestable = $oostable['categories'];
$child_categories_result = $dbconn->Execute("SELECT categories_id FROM $categoriestable WHERE parent_id = '" . intval($category_id) . "'");
if ($child_categories_result->RecordCount()) {
while ($child_categories = $child_categories_result->fields) {
$products_count += oos_count_products_in_category($child_categories['categories_id'], $include_inactive);
// Move that ADOdb pointer!
$child_categories_result->MoveNext();
}
}
return $products_count;
}
/**
* Return true if the category has subcategories
*
* @param $category_id
* @return boolean
*/
function oos_has_category_subcategories($category_id) {
$dbconn =& oosDBGetConn();
$oostable =& oosDBGetTables();
$categoriestable = $oostable['categories'];
$query = "SELECT COUNT(*) AS total
FROM $categoriestable
WHERE parent_id = '" . intval($category_id) . "'";
$child_category = $dbconn->Execute($query);
if ($child_category->fields['total'] > 0) {
return TRUE;
} else {
return FALSE;
}
}
/**
* Return Show Category
*
* @param $nCounter
* @return string
*/
function oos_show_category($nCounter) {
global $nPrevID, $aFoo, $aCategories, $sCategory_new, $id, $parent_child, $nCurrentCategoryID;
$aCategory = array('counter' => $nCounter);
if ( (isset($id)) && (in_array($nCounter, $id)) ) {
$aCategory['isSelected'] = 1;
} else {
$aCategory['isSelected'] = 0;
}
if ($nCounter == $nCurrentCategoryID) {
$aCategory['isActive'] = 1;
} else {
$aCategory['isActive'] = 0;
}
if ( (isset($parent_child)) && (is_array($parent_child)) ) {
foreach ($parent_child as $index_of => $sub_parent_child) {
if ($nCounter == $sub_parent_child['parent_id']) {
$aCategory['isHasSubCategories'] = 1;
break;
} else {
$aCategory['isHasSubCategories'] = 0;
}
}
}
if (SHOW_COUNTS == 'true') {
$products_in_category = oos_count_products_in_category($nCounter);
$aCategory['countProductsInCategory'] = $products_in_category;
}
if ( (isset($aFoo)) && (is_array($aFoo)) ) {
if (!isset($nPrevID)) {
$nPrevID = $nCounter;
}
if ($aFoo[$nPrevID]['level'] < $aFoo[$nCounter]['level']) {
$aCategory['isGroupStart'] = 1;
$nPrevID = $nCounter;
} else {
$aCategory['isGroupStart'] = 0;
}
if ($aFoo[$nCounter]['next_id']) {
$nNextID = $aFoo[$nCounter]['next_id'];
if ($aFoo[$nCounter]['level'] < $aFoo[$nNextID]['level']) {
$aCategory['isHasSubElements'] = 1;
} else {
$aCategory['isHasSubElements'] = 0;
}
if ($aFoo[$nNextID]['level'] < $aFoo[$nCounter]['level'] ) {
$nElem = $aFoo[$nCounter]['level'] - $aFoo[$nNextID]['level'] ;
$aCategory['nElements'] = $nElem;
} else {
$aCategory['nElements'] = 0;
}
}
if ($aFoo[$nNextID]['level'] < $aFoo[$nCounter]['level'] ) {
$aCategory['isGroupEnd'] = 1;
} else {
$aCategory['isGroupEnd'] = 0;
}
$aCategory = array_merge($aCategory, $aFoo[$nCounter]);
}
$aCategories[] = $aCategory;
if ($aFoo[$nCounter]['next_id']) {
oos_show_category($aFoo[$nCounter]['next_id']);
}
}
$categoriestable = $oostable['categories'];
$categories_descriptiontable = $oostable['categories_description'];
$query = "SELECT c.categories_id, cd.categories_name, c.parent_id, c.categories_status
FROM $categoriestable c,
$categories_descriptiontable cd
WHERE c.categories_status = '2'
AND c.parent_id = '0'
AND c.categories_id = cd.categories_id
AND cd.categories_languages_id = '" . intval($nLanguageID) . "'
ORDER BY c.sort_order, cd.categories_name";
$categories_result = $dbconn->Execute($query);
while ($categories = $categories_result->fields) {
$list_of_categories_ids[] = intval($categories['categories_id']);
$aFoo[$categories['categories_id']] = array('name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => FALSE);
if (isset($prev_id)) {
$aFoo[$prev_id]['next_id'] = $categories['categories_id'];
}
$prev_id = $categories['categories_id'];
if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}
// Move that ADOdb pointer!
$categories_result->MoveNext();
}
if (!empty($sCategory)) {
$new_path = '';
$id = explode('_', $sCategory);
reset($id);
foreach($id as $key => $value) {
unset($prev_id);
unset($first_id);
$categoriestable = $oostable['categories'];
$categories_descriptiontable = $oostable['categories_description'];
$query = "SELECT c.categories_id, cd.categories_name, c.parent_id, c.categories_status
FROM $categoriestable c,
$categories_descriptiontable cd
WHERE c.categories_status = '2'
AND c.parent_id = '" . intval($value) . "'
AND c.categories_id = cd.categories_id
AND cd.categories_languages_id = '" . intval($nLanguageID) . "'
ORDER BY c.sort_order, cd.categories_name";
$categories_result = $dbconn->Execute($query);
$category_check = $categories_result->RecordCount();
if ($category_check > 0) {
$new_path .= $value;
while ($row = $categories_result->fields) {
$list_of_categories_ids[] = intval($row['categories_id']);
$aFoo[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);
if (isset($prev_id)) {
$aFoo[$prev_id]['next_id'] = $row['categories_id'];
}
$prev_id = $row['categories_id'];
if (!isset($first_id)) {
$first_id = $row['categories_id'];
}
$last_id = $row['categories_id'];
// Move that ADOdb pointer!
$categories_result->MoveNext();
}
$aFoo[$last_id]['next_id'] = $aFoo[$value]['next_id'];
$aFoo[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
if (sizeof($list_of_categories_ids) > 0 ) {
$select_list_of_cat_ids = implode(",", $list_of_categories_ids);
$categoriestable = $oostable['categories'];
$query = "SELECT categories_id, parent_id
FROM $categoriestable
WHERE parent_id in (" . $select_list_of_cat_ids . ")";
$parent_child_result = $dbconn->Execute($query);
while ($_parent_child = $parent_child_result->fields) {
$parent_child[] = $_parent_child;
// Move that ADOdb pointer!
$parent_child_result->MoveNext();
}
}
if (isset($first_element)) {
oos_show_category($first_element);
}
$smarty->assign(
array(
'block_heading_categories' => $block_heading,
'categories' => $aCategories
)
);

View File

@ -0,0 +1,53 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
$currency_block = FALSE;
if (isset($oCurrencies) && is_object($oCurrencies)) {
reset($oCurrencies->currencies);
$aCurrencies = array();
foreach($oCurrencies->currencies as $sKey => $value) {
$aCurrencies[] = array('id' => $sKey, 'text' => $value['title']);
}
if (count($aCurrencies) >= 2) {
$currency_block = TRUE;
$currency_get_parameters = oos_get_all_get_parameters(array('language', 'currency'));
$currency_all_get_parameters = oos_remove_trailing($currency_get_parameters);
$smarty->assign('currencies_contents', $aCurrencies);
$smarty->assign('currency_get_parameters', $currency_all_get_parameters);
} else {
$blockstable = $oostable['block'];
$dbconn->Execute("UPDATE " . $blockstable . "
SET block_status = 0
WHERE block_file = 'currencies'");
}
}
$smarty->assign('currency_block', $currency_block);

View File

@ -0,0 +1,38 @@
<?php
/* ----------------------------------------------------------------------
$Id: block_information.php 412 2013-06-13 18:12:58Z r23 $
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: information.php,v 1.1.2.1 2003/04/18 17:42:37 wilt
orig: information.php,v 1.6 2003/02/10 22:31:00 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
$informationtable = $oostable['information'];
$information_descriptiontable = $oostable['information_description'];
$sql = "SELECT id.information_id, id.information_name, i.sort_order
FROM $informationtable i,
$information_descriptiontable id
WHERE id.information_id = i.information_id AND
i.status = '1' AND
id.information_languages_id = '" . intval($nLanguageID) . "'
ORDER BY i.sort_order DESC";
$smarty->assign('information', $dbconn->GetAll($sql));
$smarty->assign('block_heading_information', $block_heading);

View File

@ -0,0 +1,54 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: languages.php,v 1.14 2003/02/12 20:27:31 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
$languages_block = FALSE;
$languagestable = $oostable['languages'];
$query = "SELECT name, iso_639_2, iso_639_1
FROM $languagestable
WHERE status = '1'
ORDER BY sort_order";
if (USE_CACHE == 'true') {
$languages_result = $dbconn->CacheExecute(3600, $query);
} else {
$languages_result = $dbconn->Execute($query);
}
if ($languages_result->RecordCount() >= 2) {
$languages_block = TRUE;
$lang_get_parameters = oos_get_all_get_parameters(array('language', 'currency'));
$lang_all_get_parameters = oos_remove_trailing($lang_get_parameters);
$smarty->assign('languages_contents', $languages_result->GetArray());
$smarty->assign('lang_get_parameters', $lang_all_get_parameters);
} else {
$blockstable = $oostable['block'];
$dbconn->Execute("UPDATE " . $blockstable . "
SET block_status = 0
WHERE block_file = 'languages'");
}
$smarty->assign('languages_block', $languages_block);

View File

@ -0,0 +1,97 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: manufacturers.php,v 1.18 2003/02/10 22:31:01 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
if (!$oEvent->installed_plugin('manufacturers')) return FALSE;
$manufacturers_block = FALSE;
$display_a_list = FALSE;
$manufacturerstable = $oostable['manufacturers'];
$query = "SELECT manufacturers_id, manufacturers_name
FROM $manufacturerstable
ORDER BY manufacturers_name";
$manufacturers_result = $dbconn->Execute($query);
$nManufacturersRecordCount = $manufacturers_result->RecordCount();
if ($nManufacturersRecordCount < 1) {
$manufacturers_block = FALSE;
} elseif ($nManufacturersRecordCount <= 9) {
// Display a list
$display_a_list = TRUE;
$manufacturers_block = TRUE;
$manufacturers_list = array();
while ($manufacturers = $manufacturers_result->fields) {
$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
if (isset($_GET['manufacturers_id']) && ($_GET['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<strong>' . $manufacturers_name .'</strong>';
$manufacturer_info = array('id' => $manufacturers['manufacturers_id'], 'name' => $manufacturers_name);
$manufacturers_list[] = $manufacturer_info;
// Move that ADOdb pointer!
$manufacturers_result->MoveNext();
}
$smarty->assign('manufacturers_list', $manufacturers_list);
} else {
// Display a drop-down
$manufacturers_block = TRUE;
$manufacturers_names = array();
$manufacturers_values = array();
if (MAX_MANUFACTURERS_LIST < 2) {
$manufacturers_values[] = '';
$manufacturers_names[] = $aLang['pull_down_default'];
}
while ($manufacturers = $manufacturers_result->fields) {
$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
$manufacturers_values[] = $manufacturers['manufacturers_id'];
$manufacturers_names[] = $manufacturers_name;
// Move that ADOdb pointer!
$manufacturers_result->MoveNext();
}
$smarty->assign(
array(
'manufacturers_values' => $manufacturers_values,
'manufacturers_names' => $manufacturers_names
)
);
if (isset($_GET['manufacturers_id'])) {
$smarty->assign('select_manufacturers', intval($_GET['manufacturers_id']));
}
}
$smarty->assign(
array(
'block_heading_manufacturers' => $block_heading,
'manufacturers_block' => $manufacturers_block,
'display_a_list' => $display_a_list
)
);

View File

@ -0,0 +1,39 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
$products_history_block = FALSE;
if (isset($_SESSION)) {
if ($_SESSION['products_history']->count_history() > 0) {
$products_history_block = TRUE;
$product_ids = $_SESSION['products_history']->get_product_id_list();
$productstable = $oostable['products'];
$products_descriptiontable = $oostable['products_description'];
$products_sql = "SELECT p.products_id, p.products_image, pd.products_name, pd.products_short_description
FROM $productstable p,
$products_descriptiontable pd
WHERE p.products_id IN (" . $product_ids . ")
AND p.products_id = pd.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'
ORDER BY products_name";
$smarty->assign('customer_products_history', $dbconn->GetAll($products_sql));
$smarty->assign('block_heading_products_history', $block_heading);
}
}
$smarty->assign('products_history_block', $products_history_block);

View File

@ -0,0 +1,60 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: reviews.php,v 1.36 2003/02/12 20:27:32 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
if (!$oEvent->installed_plugin('reviews')) return FALSE;
if ($sContent != $aContents['product_reviews_write']) {
$reviewstable = $oostable['reviews'];
$productstable = $oostable['products'];
$reviews_descriptiontable = $oostable['reviews_description'];
$products_descriptiontable = $oostable['products_description'];
$random_select = "SELECT r.reviews_id, r.reviews_rating,
substring(rd.reviews_text, 1, 60) AS reviews_text,
p.products_id, p.products_image, pd.products_name
FROM $reviewstable r,
$reviews_descriptiontable rd,
$productstable p,
$products_descriptiontable pd
WHERE p.products_setting = '2'
AND p.products_id = r.products_id
AND r.reviews_id = rd.reviews_id
AND rd.reviews_languages_id = '" . intval($nLanguageID) . "'
AND p.products_id = pd.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'";
if (isset($_GET['products_id'])) {
if (!isset($nProductsID)) $nProductsID = oos_get_product_id($_GET['products_id']);
$random_select .= " AND p.products_id = '" . intval($nProductsID) . "'";
}
$random_select .= " ORDER BY r.reviews_id DESC";
$random_product = oos_random_select($random_select, MAX_RANDOM_SELECT_REVIEWS);
$smarty->assign(
array(
'block_heading_reviews' => $block_heading,
'random_product' => $random_product
)
);
}

View File

@ -0,0 +1,79 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: specials.php,v 1.30 2003/02/10 22:31:07 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
if (!$oEvent->installed_plugin('spezials')) return FALSE;
if (!is_numeric(MAX_DISPLAY_NEW_SPEZILAS)) return FALSE;
$specials_block = FALSE;
if ($sContent != $aContents['specials']) {
$productstable = $oostable['products'];
$products_descriptiontable = $oostable['products_description'];
$specialstable = $oostable['specials'];
$query = "SELECT p.products_id, pd.products_name, p.products_price, p.products_base_price,
p.products_base_unit, p.products_tax_class_id, p.products_units_id,
p.products_quantity_order_min, p.products_quantity_order_max,
p.products_product_quantity, p.products_image, s.specials_new_products_price
FROM $productstable p,
$products_descriptiontable pd,
$specialstable s
WHERE p.products_setting = '2'
AND p.products_id = s.products_id
AND pd.products_id = s.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'
AND s.status = '1'
ORDER BY s.specials_date_added DESC";
if ($specials_random_product = oos_random_select($query, MAX_RANDOM_SELECT_SPECIALS)) {
$specials_block = TRUE;
$specials_random_product_price = NULL;
$specials_random_product_special_price = NULL;
$specials_random_base_product_price = NULL;
$specials_random_base_product_special_price = NULL;
if ($aUser['show_price'] == 1 ) {
$specials_random_product_price = $oCurrencies->display_price($specials_random_product['products_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id']));
$specials_random_product_special_price = $oCurrencies->display_price($specials_random_product['specials_new_products_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id']));
if ($specials_random_product['products_base_price'] != 1) {
$specials_random_base_product_special_price = $oCurrencies->display_price($specials_random_product['specials_new_products_price'] * $specials_random_product['products_base_price'], oos_get_tax_rate($specials_random_product['products_tax_class_id']));
}
}
$smarty->assign(
array(
'specials_random_product' => $specials_random_product,
'specials_random_product_price' => $specials_random_product_price,
'specials_random_product_special_price' => $specials_random_product_special_price,
'specials_random_base_product_price' => $specials_random_base_product_price,
'specials_random_base_product_special_price' => $specials_random_base_product_special_price
)
);
$smarty->assign(array('block_heading_specials' => $block_heading));
}
}
$smarty->assign('specials_block', $specials_block);

View File

@ -0,0 +1,74 @@
<?php
/* ----------------------------------------------------------------------
MyOOS [Shopsystem]
https://www.oos-shop.de
Copyright (c) 2003 - 2019 by the MyOOS Development Team.
----------------------------------------------------------------------
Based on:
File: whats_new.php,v 1.2 2003/01/09 09:40:07 elarifr
orig: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */
/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) OR die( 'Direct Access to this location is not allowed.' );
$whats_new_block = FALSE;
$productstable = $oostable['products'];
$query = "SELECT products_id, products_image, products_tax_class_id, products_units_id, products_price,
products_base_price, products_base_unit, products_product_quantity
FROM $productstable
WHERE products_setting = '2'
ORDER BY products_date_added DESC";
if ($random_product = oos_random_select($query, MAX_RANDOM_SELECT_NEW)) {
$whats_new_block = TRUE;
$random_product['products_name'] = oos_get_products_name($random_product['products_id']);
$whats_new_product_price = NULL;
$whats_new_product_special_price = NULL;
$whats_new_product_discount_price = NULL;
$whats_new_base_product_price = NULL;
$whats_new_special_price = NULL;
$base_product_price = $random_product['products_price'];
if ($aUser['show_price'] == 1 ) {
$whats_new_special_price = oos_get_products_special_price($random_product['products_id']);
$whats_new_product_price = $oCurrencies->display_price($random_product['products_price'], oos_get_tax_rate($random_product['products_tax_class_id']));
if (oos_is_not_null($whats_new_special_price)) {
$base_product_price = $whats_new_special_price;
$whats_new_product_special_price = $oCurrencies->display_price($whats_new_special_price, oos_get_tax_rate($random_product['products_tax_class_id']));
}
if ($random_product['products_base_price'] != 1) {
$whats_new_base_product_price = $oCurrencies->display_price($base_product_price * $random_product['products_base_price'], oos_get_tax_rate($random_product['products_tax_class_id']));
}
}
$smarty->assign(
array(
'whats_new_product_special_price' => $whats_new_product_special_price,
'whats_new_product_discount_price' => $whats_new_product_discount_price,
'whats_new_base_product_price' => $whats_new_base_product_price,
'whats_new_special_price' => $whats_new_special_price,
'whats_new_product_price' => $whats_new_product_price,
'random_product' => $random_product,
'block_heading_whats_new' => $block_heading
)
);
}
$smarty->assign('whats_new_block', $whats_new_block);