Pagina 1 di 1

come visualizzare il produttore nei prodotti in vetrina?

Inviato: 05/01/2006, 19:02
da chrisbat
salve, ho un piccolo problemino...
come faccio a visualizzare il produttore nei prodotti in vetrina? e nella descrizione dell'oggetto?
grazie

Inviato: 10/01/2006, 18:10
da tacconif
In OSC non ho trovato una funzione che recupera il nome del produttore passandogli l'id, tipo come quella che recupera il nome del prodotto in base all'id del prodotto.
Comunque e' facile da realizzare:

Codice: Seleziona tutto

  function tep_get_manufacturer_name($manufacturers_id) {

    $manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
    $manufacturers = tep_db_fetch_array($manufacturer_query);

    return $manufacturers['manufacturers_name'];
  }


Io l'ho messa in includes/functions/general.php,
poi modifichi a pagina /includes/modules/new_products.php cambiando la riga

Codice: Seleziona tutto

    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));
con

Codice: Seleziona tutto

    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . tep_get_manufacturer_name($new_products['manufacturers_id']) . '<br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));