|
ECB SEO SHOP SOFTWARE - IMEDES SOFTWARE DOWNLOADS
Thema: Optionen müssen gewählt werden
--------------------------------------
Datenbankmanipulation mittels Phpmyadmin
--------------------------------------
ALTER TABLE `products_options_values` ADD `products_options_default` CHAR( 1 ) NOT NULL DEFAULT 'n';
--------------------------------------
--------------------------------------
--------------------------------------
/lang/english/admin/products_attributes.php
--------------------------------------
finde
?>
davor einfügen:
define('TEXT_OPTION_EMPTY_DEFAULT', 'make this field the empty default');
--------------------------------------
--------------------------------------
--------------------------------------
/lang/german/admin/products_attributes.php
--------------------------------------
finde
?>
davor einfügen:
define('TEXT_OPTION_EMPTY_DEFAULT', 'Dieses Feld als Standardfeld definieren');
--------------------------------------
--------------------------------------
--------------------------------------
/admin/includes/application_top.php
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
// include needed functions
require_once(DIR_FS_INC . 'xtc_db_connect.inc.php');
require_once(DIR_FS_INC . 'xtc_db_close.inc.php');
require_once(DIR_FS_INC . 'xtc_db_error.inc.php');
require_once(DIR_FS_INC . 'xtc_db_query.inc.php');
require_once(DIR_FS_INC . 'xtc_db_queryCached.inc.php');
require_once(DIR_FS_INC . 'xtc_db_perform.inc.php');
require_once(DIR_FS_INC . 'xtc_db_fetch_array.inc.php');
require_once(DIR_FS_INC . 'xtc_db_num_rows.inc.php');
require_once(DIR_FS_INC . 'xtc_db_data_seek.inc.php');
require_once(DIR_FS_INC . 'xtc_db_insert_id.inc.php');
require_once(DIR_FS_INC . 'xtc_db_free_result.inc.php');
require_once(DIR_FS_INC . 'xtc_db_fetch_fields.inc.php');
require_once(DIR_FS_INC . 'xtc_db_output.inc.php');
require_once(DIR_FS_INC . 'xtc_db_input.inc.php');
require_once(DIR_FS_INC . 'xtc_db_prepare_input.inc.php');
require_once(DIR_FS_INC . 'xtc_get_ip_address.inc.php');
require_once(DIR_FS_INC . 'xtc_setcookie.inc.php');
require_once(DIR_FS_INC . 'xtc_validate_email.inc.php');
require_once(DIR_FS_INC . 'xtc_not_null.inc.php');
require_once(DIR_FS_INC . 'xtc_add_tax.inc.php');
require_once(DIR_FS_INC . 'xtc_get_tax_rate.inc.php');
require_once(DIR_FS_INC . 'xtc_get_qty.inc.php');
require_once(DIR_FS_INC . 'xtc_product_link.inc.php');
require_once(DIR_FS_INC . 'xtc_cleanName.inc.php');
und ersetze es mit:
// include needed functions
require_once('../'.DIR_WS_FUNCTIONS.'database.php');
//require_once(DIR_FS_INC . 'xtc_db_connect.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_close.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_error.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_query.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_queryCached.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_perform.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_fetch_array.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_num_rows.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_data_seek.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_insert_id.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_free_result.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_fetch_fields.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_output.inc.php');
//require_once(DIR_FS_INC . 'xtc_db_input.inc.php');
require_once(DIR_FS_INC . 'xtc_db_prepare_input.inc.php');
require_once(DIR_FS_INC . 'xtc_get_ip_address.inc.php');
require_once(DIR_FS_INC . 'xtc_setcookie.inc.php');
require_once(DIR_FS_INC . 'xtc_validate_email.inc.php');
require_once(DIR_FS_INC . 'xtc_not_null.inc.php');
require_once(DIR_FS_INC . 'xtc_add_tax.inc.php');
require_once(DIR_FS_INC . 'xtc_get_tax_rate.inc.php');
require_once(DIR_FS_INC . 'xtc_get_qty.inc.php');
require_once(DIR_FS_INC . 'xtc_product_link.inc.php');
require_once(DIR_FS_INC . 'xtc_cleanName.inc.php');
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
// make a connection to the database... now
xtc_db_connect() or die('Unable to connect to database server!');
und ersetze es mit:
// make a connection to the database... now
require_once (DIR_FS_CATALOG.'imedes_library/db_connect_alt_admin.php');
db_connect_alt() or die('Unable to connect to database server!');
global $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE=ADODB_FETCH_ASSOC;
---------------------------------
---------------------------------
---------------------------------
/admin/includes/functions/sessions.php
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
function _sess_write($key, $val) {
global $SESS_LIFE;
und ersetze es mit:
function _sess_write($key, $val) {
global $SESS_LIFE;
if(!is_object($db)){// Vermutlich wird das $db objekt gelöscht, bevor die Session geschrieben wird
global$db;
require_once (DIR_FS_CATALOG.'imedes_library/db_connect_alt_admin.php');
db_connect_alt() or die('Unable to connect to database server!');
$db->Execute("SET NAMES 'latin1'");
$db->Execute("SET CHARACTER_SET_CLIENT=latin1");
$db->Execute("SET CHARACTER_SET_RESULTS=latin1");
}
---------------------------------
---------------------------------
---------------------------------
admin/products_attributes.php
--------------------------------------
finde folgendes:
</select> </td>
<td class="smallText"><?php echo $inputs; ?></td>
und damit ersetzen:
</select> </td>
<td class="smallText"><table border="0" width="100%"><tr><td class="smallText"><?php echo $inputs; ?></td><td class="smallText"><?php echo TEXT_OPTION_EMPTY_DEFAULT; ?><input type="checkbox" name="empty_default" value="y" <?php if($value_name['products_options_default']=="y") echo ' checked="checked"';?> /></td></tr></table></td>
--------------------------------------
finde folgendes:
xtc_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . $value_name[$languages[$i]['id']] . "' where products_options_values_id = '" . $_POST['value_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
und mit folgendem ersetzen:
xtc_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . $value_name[$languages[$i]['id']] . "',products_options_default = '" . $_POST["empty_default"] . "' where products_options_values_id = '" . $_POST['value_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
--------------------------------------
finde folgendes:
$value_name = xtc_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $values_values['products_options_values_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
und mit folgendem ersetzen:
$value_name = xtc_db_query("select products_options_values_name,products_options_default from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $values_values['products_options_values_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");
--------------------------------------
finde folgendes:
xtc_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . $_POST['value_id'] . "', '" . $languages[$i]['id'] . "', '" . $value_name[$languages[$i]['id']] . "')");
und mit folgendem ersetzen:
xtc_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name,products_options_default) values ('" . $_POST['value_id'] . "', '" . $languages[$i]['id'] . "', '" . $value_name[$languages[$i]['id']] . "','".$_POST["empty_default"]."')");
--------------------------------------
finde folgendes:
<td class="smallText"><input type="hidden" name="value_id" value="<?php echo $next_id; ?>"><?php echo $inputs; ?></td>
und damit ersetzen:
<td class="smallText"><table border="0" width="100%"><tr><td class="smallText"><input type="hidden" name="value_id" value="<?php echo $next_id; ?>"><?php echo $inputs; ?></td><td class="smallText"><?php echo TEXT_OPTION_EMPTY_DEFAULT; ?><input type="checkbox" name="empty_default" value="y" /></td></tr></table></td>
--------------------------------------
--------------------------------------
--------------------------------------
/includes/application_top.php
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
// Database
require_once (DIR_FS_INC.'xtc_db_connect.inc.php');
require_once (DIR_FS_INC.'xtc_db_close.inc.php');
require_once (DIR_FS_INC.'xtc_db_error.inc.php');
require_once (DIR_FS_INC.'xtc_db_perform.inc.php');
require_once (DIR_FS_INC.'xtc_db_query.inc.php');
require_once (DIR_FS_INC.'xtc_db_queryCached.inc.php');
require_once (DIR_FS_INC.'xtc_db_fetch_array.inc.php');
require_once (DIR_FS_INC.'xtc_db_num_rows.inc.php');
require_once (DIR_FS_INC.'xtc_db_data_seek.inc.php');
require_once (DIR_FS_INC.'xtc_db_insert_id.inc.php');
require_once (DIR_FS_INC.'xtc_db_free_result.inc.php');
require_once (DIR_FS_INC.'xtc_db_fetch_fields.inc.php');
require_once (DIR_FS_INC.'xtc_db_output.inc.php');
require_once (DIR_FS_INC.'xtc_db_input.inc.php');
require_once (DIR_FS_INC.'xtc_db_prepare_input.inc.php');
require_once (DIR_FS_INC.'xtc_get_top_level_domain.inc.php');
und ersetze es mit:
// Database
require_once(DIR_WS_FUNCTIONS.'database.php');
// require_once (DIR_FS_INC.'xtc_db_connect.inc.php');
// require_once (DIR_FS_INC.'xtc_db_close.inc.php');
// require_once (DIR_FS_INC.'xtc_db_error.inc.php');
// require_once (DIR_FS_INC.'xtc_db_perform.inc.php');
// require_once (DIR_FS_INC.'xtc_db_query.inc.php');
// require_once (DIR_FS_INC.'xtc_db_queryCached.inc.php');
// require_once (DIR_FS_INC.'xtc_db_fetch_array.inc.php');
// require_once (DIR_FS_INC.'xtc_db_num_rows.inc.php');
// require_once (DIR_FS_INC.'xtc_db_data_seek.inc.php');
// require_once (DIR_FS_INC.'xtc_db_insert_id.inc.php');
// require_once (DIR_FS_INC.'xtc_db_free_result.inc.php');
// require_once (DIR_FS_INC.'xtc_db_fetch_fields.inc.php');
// require_once (DIR_FS_INC.'xtc_db_output.inc.php');
// require_once (DIR_FS_INC.'xtc_db_input.inc.php');
require_once (DIR_FS_INC.'xtc_db_prepare_input.inc.php');
require_once (DIR_FS_INC.'xtc_get_top_level_domain.inc.php');
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
// make a connection to the database... now
xtc_db_connect() or die('Unable to connect to database server!');
und ersetze es mit:
// make a connection to the database... now
require_once (DIR_FS_CATALOG.'imedes_library/db_connect_alt.php');
db_connect_alt() or die('Unable to connect to database server!');
global $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE=ADODB_FETCH_ASSOC;
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
// include the language translations
require (DIR_WS_LANGUAGES.$_SESSION['language'].'/'.$_SESSION['language'].'.php');
und ersetze es mit:
// include the language translations
require (DIR_WS_LANGUAGES.$_SESSION['language'].'/'.$_SESSION['language'].'.php');
$db->Execute("SET NAMES 'latin1'");
$db->Execute("SET CHARACTER_SET_CLIENT=latin1");
$db->Execute("SET CHARACTER_SET_RESULTS=latin1");
---------------------------------
---------------------------------
---------------------------------
/includes/functions/sessions.php
---------------------------------
Achtung!!!! Diese folgende Änderung ist nur notwendig, wenn Sie bisher noch KEINE Bibliothek von Imedes
erworben haben, welches unter einer Bezahllizenz steht. Falls Sie nicht sicher sind, dann schauen Sie
einfach in den Quellcode der entsprechenden Datei oder sprechen uns einfach an
finde folgendes:
function _sess_write($key, $val) {
global $SESS_LIFE;
und ersetze es mit:
function _sess_write($key, $val) {
global $SESS_LIFE;
if(!is_object($db)){// Vermutlich wird das $db objekt gelöscht, bevor die Session geschrieben wird
global$db;
require_once (DIR_FS_CATALOG.'imedes_library/db_connect_alt.php');
db_connect_alt() or die('Unable to connect to database server!');
$db->Execute("SET NAMES 'latin1'");
$db->Execute("SET CHARACTER_SET_CLIENT=latin1");
$db->Execute("SET CHARACTER_SET_RESULTS=latin1");
}
---------------------------------
---------------------------------
---------------------------------
/includes/modules/product_attributes.php around line 41 find:
--------------------------------------
finde folgendes:
$products_options_query = xtDBquery("select pov.products_options_values_id,
pov.products_options_values_name,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."'
order by pa.sortorder,pov.products_options_values_name ");
damit ersetzen:
$products_options_query = xtDBquery("select pov.products_options_values_id,
pov.products_options_values_name,
pov.products_options_default,
pa.attributes_model,
pa.options_values_price,
pa.price_prefix,
pa.attributes_stock,
pa.attributes_model
from ".TABLE_PRODUCTS_ATTRIBUTES." pa,
".TABLE_PRODUCTS_OPTIONS_VALUES." pov
where pa.products_id = '".$product->data['products_id']."'
and pa.options_id = '".$products_options_name['products_options_id']."'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '".(int) $_SESSION['languages_id']."' order by pa.sortorder,pov.products_options_values_name ");
--------------------------------------
finde folgendes:
while ($products_options_name = xtc_db_fetch_array($products_options_name_query,true)) {
folgendes davor einsetzen:
$defaultArr=array();
--------------------------------------
finde folgendes:
$products_options_data[$row]['DATA'][$col] = array ('ID' => $products_options['products_options_values_id'], 'TEXT' => $products_options['products_options_values_name'], 'MODEL' => $products_options['attributes_model'], 'PRICE' => '', 'FULL_PRICE' => '', 'PREFIX' => $products_options['price_prefix']);
danach einfügen:
if($products_options['products_options_default']=="y")
$defaultArr[$row][]=$products_options['products_options_values_id'];
--------------------------------------
finde folgendes:
$products_options_data[$row]['DATA'][$col] = array ('ID' => $products_options['products_options_values_id'], 'TEXT' => $products_options['products_options_values_name'], 'MODEL' => $products_options['attributes_model'], 'PRICE' => $xtPrice->xtcFormat($price, true), 'FULL_PRICE' => $xtPrice->xtcFormat($full, true), 'PREFIX' => $products_options['price_prefix']);
danach einfügen:
if($products_options['products_options_default']=="y")
$defaultArr[$row][]=$products_options['products_options_values_id'];
--------------------------------------
finde folgendes:
$module_smarty->assign('language', $_SESSION['language']);
danach einfügen:
$module_smarty->assign('defaultArr', $defaultArr);
--------------------------------------
--------------------------------------
--------------------------------------
12. in templates/xtc4/module/product_options/product_options_dropdown.html find
--------------------------------------
finde folgendes:
{foreach name=outer item=options_data from=$options}
damit ersetzen:
{foreach name=outer item=options_data from=$options key=key}
--------------------------------------
finde folgendes:
{/foreach}
</select>
danach einsetzen:
{foreach key=key2 item=value2 from=$defaultArr[$key] name=defaults}
<input type="hidden" value="1" id="default_{$value2}" name="default_{$value2}">
{/foreach}
--------------------------------------
--------------------------------------
--------------------------------------
14. in templates/xtc4/javascript/general.js.php AT THE END
--------------------------------------
folgendes einfügen:
function checkformular(form)
{
var flag = 0;
var flag_select_one = 0;
for (var i = 0; i < form.length; ++i) {
if(form.elements[i].type == 'select-one') {
flag_select_one = 1;
if (document.getElementById('default_'+form.elements[form.elements[i].name].value)) {
if (document.getElementById('default_'+form.elements[form.elements[i].name].value).value != '1')
flag = 1;
else {
var name = "<?php echo OPTIONS_WARNING; ?>";
alert(name);
return false;
}
} else{
flag = 1;
}
}
}
if (flag_select_one ==0){
return true;
}
if (flag ==1){
return true;
}
return false;
}
------------------------
------------------------
------------------------
includes/modules/product_info.php
------------------------
finde:
$info_smarty->assign('FORM_ACTION', xtc_draw_form('cart_quantity', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array ('action')).'action=add_product')));
und ersetzen mit:
$info_smarty->assign('FORM_ACTION', xtc_draw_form('cart_quantity', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array ('action')).'action=add_product'),'POST','onsubmit="return checkformular(this);"'));
------------------------
------------------------
------------------------
/lang/german/german.php
------------------------
finde folgendes:
?>
und füge davor ein:
define('OPTIONS_WARNING','Bitte Option auswählen.');
------------------------
------------------------
------------------------
/lang/english/english.php
------------------------
finde folgendes:
?>
und füge davor ein:
define('OPTIONS_WARNING','Please select a product option.');
------------------------
------------------------
------------------------
Kurze Anleitung:
--------------------------------------
Wenn die Optionen definiert werden, z.b. die Farben blau, grün und gelb, muß ein Standardwert definiert werden.
In diesem Beispiel muß eine weitere Option definiert werden mit dem Text: "Bitte Farbe wählen". Für diese Option
muß dann das Häckchen für den Standardwert gesetzt werden.
Wenn man dann die optionen für einen Artikel festlegt muß die Sortierung immer so eingetellt werden, das der
Standardwert den kleinsten Sortierungswert erhält.
|