} else {
                $order_min = number_format($listing['products_quantity_order_min']);
            }
            if (PRODUCT_LISTING_WITH_QTY == '1') {
                $sProductListBuyNow = '<form name="buy_now" action="' . OOS_HTTP_SERVER . OOS_SHOP . 'index.php" method="post">';
                $sProductListBuyNow .= '<input type="hidden" name="action" value="buy_now">';
                $sProductListBuyNow .= '<input type="hidden" name="products_id" value="' . $listing['products_id'] . '">';
                $sProductListBuyNow .= '<input type="hidden" name="page" value="' . $sPage . '">';
                $sProductListBuyNow .= '<input type="hidden" name="categories" value="' . $categories . '">';
                $sProductListBuyNow .= '<input type="hidden" name="formid" value="' . $sFormid . '">';
                $sProductListBuyNow .= oos_hide_session_id();
                // todo remove oos_get_all_as_hidden_field
                $sProductListBuyNow .= oos_get_all_as_hidden_field(array('action'));
                $sProductListBuyNow .= '<input type="hidden" name="nv" value="' . $nCurrentPageNumber . '">';
                $sProductListBuyNow .= $aLang['products_order_qty_text'];
                $sProductListBuyNow .= ' <input type="text" name="cart_quantity" value="' . $order_min . '" size="3" /><br />';
                $sProductListBuyNow .= oos_image_submit('buy_now.gif', $aLang['text_buy'] . $listing['products_name'] . $aLang['text_now']);
                $sProductListBuyNow .= '</form>';
            } else {
                $sProductListBuyNow = '<a href="' . oos_href_link($sPage, $all_get_listing . 'action=buy_now&amp;products_id=' . $listing['products_id'] . '&amp;cart_quantity=' . $order_min) . '">' . oos_image_button('buy_now.gif', $aLang['text_buy'] . $listing['products_name'] . $aLang['text_now']) . '</a>&nbsp;';
            }
        } else {
            $sProductListBuyNow = '&nbsp;';
        }
        $aProductListing[] = array('products_id' => $listing['products_id'], 'products_model' => $listing['products_model'], 'products_image' => $listing['products_image'], 'products_name' => $listing['products_name'], 'manufacturers_id' => $listing['manufacturers_id'], 'manufacturers_name' => $listing['manufacturers_name'], 'products_quantity' => $listing['products_quantity'], 'products_weight' => $listing['products_weight'], 'product_list_sort_order' => $listing['products_sort_order'], 'product_list_link' => $sProductListLink, 'products_description' => oos_remove_tags($listing['products_description']), 'product_list_uvp' => $sProductListUVP, 'product_list_price' => $sProductListPrice, 'product_list_buy_now' => $sProductListBuyNow);
        // Move that ADOdb pointer!
        $listing_result->MoveNext();
    }
}
$oSmarty->assign(array('oos_page_split' => $listing_split->display_count($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, $nCurrentPageNumber, $aLang['text_display_number_of_products']), 'oos_display_links' => $listing_split->display_links($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $nCurrentPageNumber, oos_get_all_get_parameters(array('nv', 'info'))), 'oos_page_numrows' => $listing_numrows));
$oSmarty->assign('list_box_contents', $aProductListing);
            }

        }

        $aProductListing[] = array(
                                'products_id' => $listing['products_id'],
                                'products_model' => $listing['products_model'],
                                'products_image' => $listing['products_image'],
                                'products_name' => $listing['products_name'],
                                'manufacturers_id' => $listing['manufacturers_id'],
                                'manufacturers_name' => $listing['manufacturers_name'],
                                'products_quantity' => $listing['products_quantity'],
                                'products_weight' => $listing['products_weight'],
                                'product_list_sort_order' => $listing['products_sort_order'],
                                'product_list_link' => $sProductListLink,
                                'products_description' => oos_remove_tags($listing['products_description']),
                                'product_list_uvp' => $sProductListUVP,
                                'product_list_price' =>  $sProductListPrice,
                                'product_list_buy_now' => $sProductListBuyNow
                              );

        // Move that ADOdb pointer!
        $listing_result->MoveNext();
    }



    $oSmarty->assign(array('oos_page_split' => $listing_split->display_count($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, $nCurrentPageNumber, $aLang['text_display_number_of_products']),
                           'oos_display_links' => $listing_split->display_links($listing_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $nCurrentPageNumber, oos_get_all_get_parameters(array('nv', 'info'))),
                           'oos_page_numrows' => $listing_numrows));
Example #3
0
                $featured_product_discount_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id']));
            }
        }

        if ($featured['products_base_price'] != 1) {
            $featured_base_product_price = $oCurrencies->display_price($featured['products_price'] * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));

            if ($featured_special_price != '') {
                $featured_base_product_special_price = $oCurrencies->display_price($featured_special_price * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));
            }
        }

        $aFeatured[] = array('products_id' => $featured['products_id'],
                             'products_image' => $featured['products_image'],
                             'products_name' => $featured['products_name'],
                             'products_description' => oos_remove_tags($featured['products_description']),
                             'products_base_price' => $featured['products_base_price'],
                             'products_base_unit' => $featured['products_base_unit'],
                             'products_units' => $featured_units,
                             'featured_product_price' => $featured_product_price,
                             'featured_product_special_price' => $featured_product_special_price,
                             'featured_max_product_discount' => $featured_max_product_discount,
                             'featured_product_discount_price' => $featured_product_discount_price,
                             'featured_base_product_price' => $featured_base_product_price,
                             'featured_base_product_special_price' => $featured_base_product_special_price,
                             'featured_special_price' => $featured_special_price);
        // Move that ADOdb pointer!
        $featured_result->MoveNext();
    }

    $oSmarty->assign('featured_array', $aFeatured);
        $new_spezials_base_product_special_price = '';

        $new_spezials_units = UNITS_DELIMITER . $products_units[$new_spezials['products_units_id']];

        $new_spezials_product_price = $oCurrencies->display_price($new_spezials['products_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
        $new_spezials_product_special_price = $oCurrencies->display_price($new_spezials['specials_new_products_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));

        if ($new_spezials['products_base_price'] != 1) {
            $new_spezials_base_product_price = $oCurrencies->display_price($new_spezials['products_price'] * $new_spezials['products_base_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
            $new_spezials_base_product_special_price = $oCurrencies->display_price($new_spezials['specials_new_products_price'] * $new_spezials['products_base_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
        }

        $new_spezials_array[] = array('products_id' => $new_spezials['products_id'],
                                      'products_image' => $new_spezials['products_image'],
                                      'products_name' => $new_spezials['products_name'],
                                      'products_description' => oos_remove_tags($new_spezials['products_description']),
                                      'products_base_unit' => $new_spezials['products_base_unit'],
                                      'products_base_price' => $new_spezials['products_base_price'],
                                      'products_units' => $new_spezials_units,
                                      'products_price' => $new_spezials_product_price,
                                      'products_special_price' => $new_spezials_product_special_price,
                                      'base_product_price' => $new_spezials_base_product_price,
                                      'base_product_special_price' => $new_spezials_base_product_special_price);

        // Move that ADOdb pointer!
        $new_spezials_result->MoveNext();
    }

    $oSmarty->assign('new_spezials_array', $new_spezials_array);
}
    $new_product_price = '';
    $new_product_special_price = '';
    $new_max_product_discount = 0;
    $new_product_discount_price = '';
    $new_base_product_price = '';
    $new_base_product_special_price = '';
    $new_special_price = '';
    $new_product_units = UNITS_DELIMITER . $products_units[$new_products['products_units_id']];
    $new_product_price = $oCurrencies->display_price($new_products['products_price'], oos_get_tax_rate($new_products['products_tax_class_id']));
    $new_special_price = $new_products['specials_new_products_price'];
    if (!empty($new_special_price)) {
        $new_product_special_price = $oCurrencies->display_price($new_special_price, oos_get_tax_rate($new_products['products_tax_class_id']));
    } else {
        $new_max_product_discount = min($new_products['products_discount_allowed'], $_SESSION['member']->group['discount']);
        if ($new_max_product_discount != 0) {
            $new_special_price = $new_products['products_price'] * (100 - $new_max_product_discount) / 100;
            $new_product_discount_price = $oCurrencies->display_price($new_special_price, oos_get_tax_rate($new_products['products_tax_class_id']));
        }
    }
    if ($new_products['products_base_price'] != 1) {
        $new_base_product_price = $oCurrencies->display_price($new_products['products_price'] * $new_products['products_base_price'], oos_get_tax_rate($new_products['products_tax_class_id']));
        if ($new_special_price != '') {
            $new_base_product_special_price = $oCurrencies->display_price($new_special_price * $new_products['products_base_price'], oos_get_tax_rate($new_products['products_tax_class_id']));
        }
    }
    $new_products_array[] = array('products_id' => $new_products['products_id'], 'products_image' => $new_products['products_image'], 'products_name' => $new_products['products_name'], 'products_description' => oos_remove_tags($new_products['products_description']), 'products_base_price' => $new_products['products_base_price'], 'products_base_unit' => $new_products['products_base_unit'], 'new_product_units' => $new_product_units, 'new_product_price' => $new_product_price, 'new_product_special_price' => $new_product_special_price, 'new_max_product_discount' => $new_max_product_discount, 'new_product_discount_price' => $new_product_discount_price, 'new_base_product_price' => $new_base_product_price, 'new_base_product_special_price' => $new_base_product_special_price, 'new_special_price' => $new_special_price);
    // Move that ADOdb pointer!
    $new_products_result->MoveNext();
}
// assign Smarty variables;
$oSmarty->assign(array('block_heading_new_products' => sprintf($aLang['table_heading_new_products'], strftime('%B')), 'new_products_array' => $new_products_array));
Example #6
0
        $featured_product_price = '';
        $featured_product_special_price = '';
        $featured_max_product_discount = 0;
        $featured_product_discount_price = '';
        $featured_base_product_price = '';
        $featured_base_product_special_price = '';
        $featured_special_price = '';
        $featured_units = UNITS_DELIMITER . $products_units[$featured['products_units_id']];
        $featured_product_price = $oCurrencies->display_price($featured['products_price'], oos_get_tax_rate($featured['products_tax_class_id']));
        $featured_special_price = oos_get_products_special_price($featured['products_id']);
        if (oos_is_not_null($featured_special_price)) {
            $featured_product_special_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id']));
        } else {
            $featured_max_product_discount = min($featured['products_discount_allowed'], $_SESSION['member']->group['discount']);
            if ($featured_max_product_discount != 0) {
                $featured_special_price = $featured['products_price'] * (100 - $featured_max_product_discount) / 100;
                $featured_product_discount_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id']));
            }
        }
        if ($featured['products_base_price'] != 1) {
            $featured_base_product_price = $oCurrencies->display_price($featured['products_price'] * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));
            if ($featured_special_price != '') {
                $featured_base_product_special_price = $oCurrencies->display_price($featured_special_price * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));
            }
        }
        $aFeatured[] = array('products_id' => $featured['products_id'], 'products_image' => $featured['products_image'], 'products_name' => $featured['products_name'], 'products_description' => oos_remove_tags($featured['products_description']), 'products_base_price' => $featured['products_base_price'], 'products_base_unit' => $featured['products_base_unit'], 'products_units' => $featured_units, 'featured_product_price' => $featured_product_price, 'featured_product_special_price' => $featured_product_special_price, 'featured_max_product_discount' => $featured_max_product_discount, 'featured_product_discount_price' => $featured_product_discount_price, 'featured_base_product_price' => $featured_base_product_price, 'featured_base_product_special_price' => $featured_base_product_special_price, 'featured_special_price' => $featured_special_price);
        // Move that ADOdb pointer!
        $featured_result->MoveNext();
    }
    $oSmarty->assign('featured_array', $aFeatured);
}
/** 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;
}
$productstable = $oostable['products'];
$products_descriptiontable = $oostable['products_description'];
$specialstable = $oostable['specials'];
$sql = "SELECT p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_units_id,\n               substring(pd.products_description, 1, 150) AS products_description,\n               p.products_image, p.products_base_price, p.products_base_unit, s.specials_new_products_price\n        FROM {$productstable} p,\n             {$products_descriptiontable} pd,\n             {$specialstable} s\n        WHERE p.products_status >= '1'\n          AND (p.products_access = '0' OR p.products_access = '" . intval($nGroupID) . "')\n          AND s.products_id = p.products_id\n          AND p.products_id = pd.products_id\n          AND pd.products_languages_id = '" . intval($nLanguageID) . "'\n          AND s.status = '1'\n        ORDER BY s.specials_date_added DESC";
$new_spezials_result = $dbconn->SelectLimit($sql, MAX_DISPLAY_NEW_SPEZILAS);
if ($new_spezials_result->RecordCount() >= MIN_DISPLAY_NEW_SPEZILAS) {
    $new_spezials_array = array();
    while ($new_spezials = $new_spezials_result->fields) {
        $new_spezials_base_product_price = '';
        $new_spezials_base_product_special_price = '';
        $new_spezials_units = UNITS_DELIMITER . $products_units[$new_spezials['products_units_id']];
        $new_spezials_product_price = $oCurrencies->display_price($new_spezials['products_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
        $new_spezials_product_special_price = $oCurrencies->display_price($new_spezials['specials_new_products_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
        if ($new_spezials['products_base_price'] != 1) {
            $new_spezials_base_product_price = $oCurrencies->display_price($new_spezials['products_price'] * $new_spezials['products_base_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
            $new_spezials_base_product_special_price = $oCurrencies->display_price($new_spezials['specials_new_products_price'] * $new_spezials['products_base_price'], oos_get_tax_rate($new_spezials['products_tax_class_id']));
        }
        $new_spezials_array[] = array('products_id' => $new_spezials['products_id'], 'products_image' => $new_spezials['products_image'], 'products_name' => $new_spezials['products_name'], 'products_description' => oos_remove_tags($new_spezials['products_description']), 'products_base_unit' => $new_spezials['products_base_unit'], 'products_base_price' => $new_spezials['products_base_price'], 'products_units' => $new_spezials_units, 'products_price' => $new_spezials_product_price, 'products_special_price' => $new_spezials_product_special_price, 'base_product_price' => $new_spezials_base_product_price, 'base_product_special_price' => $new_spezials_base_product_special_price);
        // Move that ADOdb pointer!
        $new_spezials_result->MoveNext();
    }
    $oSmarty->assign('new_spezials_array', $new_spezials_array);
}