Pagina 1 di 1

O S W A I I - per maury2ma - CONTENUTO PAGINE

Inviato: 07/06/2007, 11:30
da pippo101010
Buongiorno a tutti. Sono Nuovo.

Dietro invito di maury2ma (maurizio di OSWAII) apro queta discussione riguardante l'assetto delle pagine in oswaii, e precisamente, come fare a fare comparire nella home page, e in generale in tutte le pagine, alcuni moduli. Mi spiego meglio:

Io, in particolare, vorrei far comparire in alto e in orizzontale, prima dei nuovi prodotti, i prodotti in offerta (cioè, il contenuto della pagina che normalmente compare cliccando sull'iconcina in alto a destra del box delle offerte, il quale, come ben sappiamo, funziona solo con un prodotto casuale alla volta).

Se poi potessi sapere come fare, in generale, a modificare il contenuto delle pagine, inserendo i moduli che più mi aggradano, sarei l'uomo più felice del mondo!

Approfitto dell'occasione concessami da Maurizio per chiedergli anche riguardo al come procedere sulla gestione dei template e se esistono in giro template BTS da scaricare.

Grazie Maurizio, aspetto con ansia la tua risposta.

Ciao

Inviato: 07/06/2007, 14:29
da maury2ma
prima la risposta brutta, esistono pochi template bts in giro e li trovi sul sito americano di oscommerce nella sezione template.

poi la risposta buona.

nella cartella templater/fallback/content/
trovi tutti i file che vengono visualizzati.
ex :
specials.tpl.php
contiene la parte visualizzata della pagina specials.php

quindi se apriamo il file index_default.tpl.php cioe' la home
ed modifichiamo il file cosi' :

Codice: Seleziona tutto

<h1 class="pageHeading">
  <?php echo tep_image_2ma_template(bts_select(images, 'table_background_default.png'), HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>
  <?php echo HEADING_TITLE; ?> 
</h1><br />
<div class="AlignLeft">
<?php echo tep_customer_greeting(); ?>
<?php echo TEXT_MAIN; ?><br /><?php echo $pagetext; ?><br />
</div>
<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

<?php include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?>

<h1 class="pageHeading">
  <?php echo tep_image_2ma_template(bts_select(images, 'table_background_specials.png'), HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>
  <?php echo HEADING_TITLE; ?>
</h1> <br />
<?php
// ####################### Added Categories Enable / Disable ###############
  //$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";
  //TotalB2B start
  if (!isset($customer_id)) $customer_id = 0;
    $customer_group = tep_get_customers_groups_id();
//  $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, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1'                                                                                                                                                                                                                           order by s.specials_date_added DESC";
    $specials_query_raw = "select DISTINCT 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, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_status='1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and ((s.customers_id = '" . $customer_id . "' and s.customers_groups_id = '0') or (s.customers_id = '0' and s.customers_groups_id = '" . $customer_group . "') or (s.customers_id = '0' and s.customers_groups_id = '0')) order by s.specials_date_added DESC";
  //TotalB2B end
// ####################### End Categories Enable / Disable ###############

  $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'))) {
?>
  <?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?> - <?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> <br />
<?php
  }
?>
<div>
<?php
    $row = 0;
    $specials_query = tep_db_query($specials_split->sql_query);
    while ($specials = tep_db_fetch_array($specials_query)) {
      $row++;

	  //TotalB2B start
      $specials['products_price'] = tep_xppp_getproductprice($specials['products_id']);
      //TotalB2B end

      //TotalB2B start
	  $specials['specials_new_products_price'] = tep_get_products_special_price($specials['products_id']);
	  $query_special_prices_hide = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'SPECIAL_PRICES_HIDE'");
      $query_special_prices_hide_result = tep_db_fetch_array($query_special_prices_hide); 
      if ($query_special_prices_hide_result['configuration_value'] == 'true') {
        echo '  <div class="TrentaTre"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br /><span class="ColorRed">' . $currencies->display_price_nodiscount($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></div>' . "\n";
	  } else {
        echo '  <div class="TrentaTre"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br /><span class="s">' . $currencies->display_price($specials['products_id'], $specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span><br /><span class="ColorRed">' . $currencies->display_price_nodiscount($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></div>' . "\n";
	  }
      //TotalB2B end

      if ((($row / 3) == floor($row / 3))) {
?>
      </div><div class="Table_templateClear"> <br /> </div><div>
<?php
      }
    }
?>
   </div><div class="Table_templateClear"> <br /> </div>
<?php
  if (($specials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<br /> 
    <?php echo $specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?> - <?php echo TEXT_RESULT_PAGE . ' ' . $specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> <br />
<?php
  }
?>
cioe' copiando il contenuto di un file dentro l'altro
otterremo le offerte in homepage.
naturalmente dobbiamo poi modificare la grafica a nostro piacimento.

Inviato: 07/06/2007, 14:31
da maury2ma
ti ho fatto iscrivere a questo forum anche per tre motivi semplicissimi:
primo le e-mail le cancello spesso involontariamente (troppa spam) quindi se mi sbaglio non le leggo
secondo quello che scrivo a te tutti possono leggerlo e magari gli torna utile
terzo.... io sono solo un appassionato quindi molte cose non le so. :(

GRAAAANDE!!!!!

Inviato: 07/06/2007, 16:06
da pippo101010
OK sono riuscito a modificare la pagina.

Maurizio, sei Mitico!

Non sai quale aiuto sei riuscito a darmi.

GRAZIE MILLE!!!!