• Portada
    • Recientes
    • Usuarios
    • Registrarse
    • Conectarse

    Ayuda con oscommerce

    Programado Fijo Cerrado Movido
    Software
    3
    5
    3.1k
    Cargando más mensajes
    • Más antiguo a más nuevo
    • Más nuevo a más antiguo
    • Mayor número de Votos
    Responder
    • Responder como tema
    Accede para responder
    Este tema ha sido borrado. Solo los usuarios que tengan privilegios de administración de temas pueden verlo.
    • HitsH
      Hits
      Última edición por

      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/13

      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com

      Copyright © 2003 osCommerce

      Released 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.com

      Copyright © 2003 osCommerce

      Released 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:

      1 Respuesta Última respuesta Responder Citar 0
      • marcaljM
        marcalj
        Última edición por

        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!
        1 Respuesta Última respuesta Responder Citar 0
        • HitsH
          Hits
          Última edición por

          vaya q si 😄 😄 😄 era eso 🙂 asias marcalj

          1 Respuesta Última respuesta Responder Citar 0
          • marble_fxM
            marble_fx
            Última edición por

            ^_^U

            Puedes modificar esos valores desde el panel de control. Esta en Maximos y Minimos Values 😜

            1 Respuesta Última respuesta Responder Citar 0
            • HitsH
              Hits
              Última edición por

              lol, q fallo :risitas: :risitas:

              1 Respuesta Última respuesta Responder Citar 0
              • 1 / 1
              • First post
                Last post

              Foreros conectados [Conectados hoy]

              1 usuarios activos (0 miembros e 1 invitados).
              febesin, pAtO,

              Estadísticas de Hardlimit

              Los hardlimitianos han creado un total de 543.3k posts en 62.8k hilos.
              Somos un total de 34.8k miembros registrados.
              Mia ha sido nuestro último fichaje.