-
This post is being processed/translated. The original version will be shown:
Buenas, tengo una duda q mas de oscommerce es de programacion:
he puesto una contribucion q hace q me muestra las ofertas de la tienda, en laportada, pero solo me muestra 9 productos (3 filas, 3 columnas) y no encuentro por ningun sitio donde modificar esto.
Para mi el fallo está en el archivo ofertas original (specials.php) ya que si vas a este archivo, te muestra en la primera pagaina 9 productos, y genera una segunda con las ofertas restantes, pero yo lo quiero todo en la primera, sean los q sean.
Os pego el default_specials.php (contribucion q hace q muestre el specials.php en portada).
/*
$Id: default_specials.php,v 2.0 2003/06/13osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.comCopyright
2003 osCommerceReleased under the GNU General Public License
*/
?>$info_box_contents = array();
$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
new infoBoxHeading($info_box_contents, true, true, tep_href_link(FILENAME_SPECIALS));$new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);
$info_box_contents = array();
$row = 0;
$col = 0;
while ($default_specials = tep_db_fetch_array($new)) {
$default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
'params' => 'class="smallText" width="33%" valign="top"',
'text' => '[' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '](' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials[)
[' . $default_specials['products_name'] . '](' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . ')
' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '
' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '');
$col ++;
if ($col > 2) {
$col = 0;
$row ++;
}
}
new contentBox($info_box_contents);
?>Y ahora el specials.php. (ofertas)
/*
$Id: specials.php,v 1.49 2003/06/09 22:35:33 hpdl Exp $osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.comCopyright
2003 osCommerceReleased under the GNU General Public License
*/require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SPECIALS);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SPECIALS));
?><title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">$specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added DESC";
$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>}
?>if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>}
?>|
| display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?> | display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> |
$row = 0;
$specials_query = tep_db_query($specials_split->sql_query);
while ($specials = tep_db_fetch_array($specials_query)) {
$row++;echo ' ' . "\n";
if ((($row / 3) == floor($row / 3))) {
?>}
}
?>| [' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '](' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . ')
[' . $specials['products_name'] . '](' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . ')
' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '
' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . ' || display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?> | display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> |
|
|
Si alguien sabe donde está el fallo q me lo diga please, q estoy dandole vueltas ya 2 noches y nada.... :rabieta:
-
This post is being processed/translated. The original version will be shown:
Buenas Hits, como va eso?
Mira, creo que ya lo tengo.
En el primer archivo, la query que hace tiene limitado los resultados por la variable "MAX_DISPLAY_SPECIAL_PRODUCTS". Fijate en la query:
$new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);Creo que dejando la query asi, se te solucionaria el problema, mostrandote todas las ofertas disponibles:```
$new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' order by s.specials_date_added DESC");A ver que tal va eso. No se si sabes como va una sentencia SQL, si quieres ya que tamos te lo comento :p Salu2! -
This post is being processed/translated. The original version will be shown:
vaya q si
era eso
asias marcalj -
This post is being processed/translated. The original version will be shown:
^_^U
Puedes modificar esos valores desde el panel de control. Esta en Maximos y Minimos Values

-
This post is being processed/translated. The original version will be shown:
lol, q fallo :risitas: :risitas:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Registrarse Conectarse