Categoria generale > Discussioni generali
Installare osCommerce
(1/1)
admin:
Scaricare i pacchetti compresi quelli della lingua, spostali nelle directory che preferisci e rinominala (se vuoi); quindi seguire le istruzioni.
Per cambiare directory dell' amministratore, dopo aver rinominato la directory, andare in /include/configure.php ed /admin/include/configure.php e modificare manualmente il nome della vecchia directory.
Se si usa un server https, bisogna andare in /include/configure.php ed /admin/include/configure.php e modificare manualmente il Path da http ad https
Per impostare l' Italiano come lingua bisogna (dopo aver copiato i file) abilitarla manualmente in Local->Language; i parametri sono: nome:Italiano, code:it, Directory:italiano, order:26
Impostare i permessi in questo modo:
directory 755 o 555
files 644
file di configurazione 444
Aprite il file /includes/classes/currencies.php e modificate la funzione display_price da:
--- Codice: --- return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
--- Termina codice ---
a:
--- Codice: --- if (VISUALIZZA_PREZZI == 'true') {
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}
return '';
--- Termina codice ---
e nella funzione format aggiungere come prima riga:
--- Codice: ---if (VISUALIZZA_PREZZI == 'false') {
return '';
}
--- Termina codice ---
Aprire il file includes/modules/box/bm_card_acceptance.php e sostituire la funzione execute da:
--- Codice: --- if ( (substr(basename($PHP_SELF), 0, 8) != 'checkout') && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) ) {
$output = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CARD_ACCEPTANCE_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;">';
foreach ( explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo ) {
$output .= tep_image(DIR_WS_IMAGES . 'card_acceptance/' . basename($logo));
}
$output .= ' </div>' .
'</div>';
$oscTemplate->addBlock($output, $this->group);
}
--- Termina codice ---
a:
--- Codice: --- if (VISUALIZZA_PREZZI == 'si') {
if ( (substr(basename($PHP_SELF), 0, 8) != 'checkout') && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) ) {
$output = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CARD_ACCEPTANCE_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;">';
foreach ( explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo ) {
$output .= tep_image(DIR_WS_IMAGES . 'card_acceptance/' . basename($logo));
}
$output .= ' </div>' .
'</div>';
$oscTemplate->addBlock($output, $this->group);
}
}
--- Termina codice ---
Aprite il file /includes/classes/shopping_cart.php e modificate la funzione show_total da:
--- Codice: --- $this->calculate();
return $this->total;
--- Termina codice ---
a:
--- Codice: --- if (VISUALIZZA_PREZZI > 0) {
$this->calculate();
return $this->total;
} else {
return '';
}
--- Termina codice ---
Aprite il file /includes/modules/adress_book_details.php e rimuovere il codice sotto indicato (si trova dalla riga 30):
--- Codice: --- elseif (isset($entry['entry_gender'])) {
$male = ($entry['entry_gender'] == 'm') ? true : false;
$female = !$male;
}
--- Termina codice ---
ed aggiungere dopo la riga 58
--- Codice: ---</tr>
--- Termina codice ---
la riga
--- Codice: ---<tr>
<td class="fieldKey"><?php echo ENTRY_PARTITAIVA; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('partitaIVA', (isset($entry['entry_gender']) ? $entry['entry_gender'] : '')) . ' ' . (tep_not_null(ENTRY_PARTITAIVA_TEXT) ? '<span class="inputRequirement">' . ENTRY_PARTITAIVA_TEXT . '</span>': ''); ?></td>
</tr>
--- Termina codice ---
Aprite il file /address_book_process.php ed aggiungere:
dopo la riga 41:
--- Codice: ---if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
--- Termina codice ---
il codice:
--- Codice: ---if (ACCOUNT_COMPANY == 'true') $partitaIVA = tep_db_prepare_input($HTTP_POST_VARS['partitaIVA']);
--- Termina codice ---
ed modificare la riga 136 da:
--- Codice: ---if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
--- Termina codice ---
a:
--- Codice: ---if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_gender'] = $partitaIVA;
--- Termina codice ---
Aprite il file /admin/customers.php e:
aggiungere dopo la riga 41:
--- Codice: ---$entry_company = tep_db_prepare_input($HTTP_POST_VARS['entry_company']);
--- Termina codice ---
la riga
--- Codice: ---$entry_partitaIVA = tep_db_prepare_input($HTTP_POST_VARS['entry_partitaIVA']);
--- Termina codice ---
e dopo la riga 178
--- Codice: --- if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $entry_company;
--- Termina codice ---
la riga
--- Codice: ---if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_gender'] = $entry_partitaIVA;
--- Termina codice ---
modificare la riga 226 da:
--- Codice: --- $customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
--- Termina codice ---
a:
--- Codice: --- $customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, a.entry_gender from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");
--- Termina codice ---
aggiungere dopo la riga 473
--- Codice: ---</tr>
--- Termina codice ---
la riga:
--- Codice: --- <tr>
<td class="main"><?php echo ENTRY_PARTITAIVA; ?></td>
<td class="main">
<?php
if ($error == true) {
echo $cInfo->entry_gender . tep_draw_hidden_field('entry_partitaIVA');
} else {
echo tep_draw_input_field('entry_partitaIVA', $cInfo->entry_gender, 'maxlength="16"');
}
?></td>
</tr>
--- Termina codice ---
Aprite il file /create_account.php e:
aggiungere dopo la riga 33:
--- Codice: ---f (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
--- Termina codice ---
la riga:
--- Codice: --- if (ACCOUNT_COMPANY == 'true') $partitaIVA = tep_db_prepare_input($HTTP_POST_VARS['partitaIVA']);
--- Termina codice ---
sostituire la riga 195
--- Codice: --- if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
--- Termina codice ---
con la riga
--- Codice: --- if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_gender'] = $partitaIVA;
--- Termina codice ---
aggiungere dopo la riga 336
--- Codice: ---</tr>
--- Termina codice ---
la riga
--- Codice: ---<tr>
<td class="fieldKey"><?php echo ENTRY_PARTITAIVA; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('partitaIVA') . ' ' . (tep_not_null(ENTRY_PARTITAIVA_TEXT) ? '<span class="inputRequirement">' . ENTRY_PARTITAIVA_TEXT . '</span>': ''); ?></td>
</tr>
--- Termina codice ---
Aprire il file checkout_payment_address.php e rimuovere la riga 131
--- Codice: --- if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
--- Termina codice ---
Aprire il file checkout_shipping_address.php e rimuovere la riga 144
--- Codice: --- if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
--- Termina codice ---
Aprire il file della lingua ed aggiungere
--- Codice: ---define('ENTRY_PARTITAIVA', 'Partita IVA / Codice Fiscale');
define('ENTRY_PARTITAIVA_TEXT', '');
define('ENTRY_PARTITAIVA_CORTO'), 'P.IVA/C.F.');
--- Termina codice ---
Aprire l file /includes/functions/general.php
e sostituire i righi che iniziano dal 513
[codce]if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
$address = $company . $cr . $address;
}[/code]
con i seguenti:
--- Codice: ---if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {
$address = $company . $cr . $address;
if (tep_not_null($partitaIVA)) {
$address .= $cr . ENTRY_PARTITAIVA_CORTO . ': ' . $partitaIVA;
}
}
--- Termina codice ---
sostituire il rigo 531
--- Codice: ---$address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$address_id . "'");
--- Termina codice ---
con il seguente:
--- Codice: ---$address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id, entry_gender as partitaIVA from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$address_id . "'");
--- Termina codice ---
inserire i seguenti comandi:
--- Codice: ---DELETE FROM zones;
DELETE FROM geo_zones;
INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES (1, 'Italia', 'Italia', NULL, '2016-04-24 11:26:32');
DELETE FROM zones_to_geo_zones;
INSERT INTO `zones_to_geo_zones` (`association_id`, `zone_country_id`, `zone_id`, `geo_zone_id`, `last_modified`, `date_added`) VALUES (1, 105, NULL,1, NULL, '2016-04-19 23:43:46');
DELETE FROM tax_class;
INSERT INTO `tax_class` (`tax_class_id`, `tax_class_title`, `tax_class_description`, `last_modified`, `date_added`) VALUES (1, 'Iva', 'Iva Italia', '2016-04-19 23:43:46', '2016-04-19 23:43:46'),(2, 'Conai', 'Conai Italia', '2016-04-19 23:43:46', '2016-04-19 23:43:46');
INSERT INTO `configuration` SET `configuration_title` = 'Catalogo', `configuration_key` = 'VISUALIZZA_PREZZI', `configuration_value` = 'true', `configuration_description` = 'Abilita o disabilitala visualizzazione dei prezzi', `configuration_group_id` = '1', `sort_order` = '22', `set_function` = 'tep_cfg_select_option(array(\'true\', \'false\'), ' WHERE `configuration`.`configuration_id` = 369;
ALTER TABLE `products` CHANGE `products_model` `products_model` VARCHAR(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
ALTER TABLE `address_book` CHANGE `entry_gender` `entry_gender` VARCHAR(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;
UPDATE `countries` SET `address_format_id` = '5' WHERE `countries`.`countries_id` = 105;
--- Termina codice ---
Se invece vogliamo aggiungere una tassa in base alle provincie dobbiamo aggiungere (per Napoli)
--- Codice: ---INSERT INTO `zones` (`zone_id`, `zone_country_id`, `zone_code`, `zone_name`) VALUES (1, 105, 'IT', 'NA');
INSERT INTO `zones_to_geo_zones` (`association_id`, `zone_country_id`, `zone_id`, `geo_zone_id`, `last_modified`, `date_added`) VALUES (2, 105, 1, 1, NULL, '2016-04-19 23:43:46');
--- Termina codice ---
Se le pagine risultassero bianche o mancano dei menù, dopo aver cambiato il nome alla directory di admin, verificare di aver modificato in maniera opportuna TUTTI i campi dei file configure.php
Se si è dimenticato la password id amministratore bisogna aprire il database tramite phpAdmin o shell, andare nella tabella administrators ed inserire al posto della password 6cdd7c57450225fac77427f5962bb726:40 che aquile a pass
modifica: includes/functions/general.php includes/header.php include/footer.php /shopping_cart.php
admin:
Per azzerare la password di amministratore, vai nel DB, apri la cartella Admin e modifica la password in: 6cdd7c57450225fac77427f5962bb726:40
La password diventerà: pass
Navigazione
[0] Indice dei post
Vai alla versione completa