Eine vorweg... ich würde jederzeit dieses Modul hier vorziehen:
BETA MODUL: Erlöschen des Widerrufsrechts bei DownloadsDennoch möchte ich die Ansätze in diesem Thema hier zumindest noch vervollständigen, da hier einige Fehler enthalten waren.
Datei "/includes/classes/payment.php"
Suche:
if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
$js .= "\n" . ' if (!document.getElementById("checkout_payment").conditions.checked) {' . "\n" .
' error_message = error_message + unescape("' . xtc_js_lang(ERROR_CONDITIONS_NOT_ACCEPTED) . '");' . "\n" .
' error = 1;' . "\n" .
' }' . "\n\n";
}
Füge danach ein:
// Widerrufsrecht
if(($_SESSION['cart']->get_content_type() == 'mixed') || ($_SESSION['cart']->get_content_type() == 'virtual')) {
$js .= "\n" . ' if (!document.getElementById("checkout_payment").revocation.checked) {' . "\n" .
' error_message = error_message + unescape("' . xtc_js_lang(ERROR_REVOCATION_NOT_ACCEPTED) . '");' . "\n" .
' error = 1;' . "\n" .
' }' . "\n\n";
}
// Ende Widerrufsrecht
Datei "/lang/english/english.php"
Suche:
define('ERROR_CONDITIONS_NOT_ACCEPTED', 'Please accept our terms and conditions to proceed with your order.\n\n'); Füge danach ein:
define('ERROR_REVOCATION_NOT_ACCEPTED', 'Please accept our cancellation policy to proceed with your order.\n\n'); Datei "/lang/german/german.php"
Suche:
define('ERROR_CONDITIONS_NOT_ACCEPTED', '* Sofern Sie unsere Allgemeinen Geschäftsbedingungen nicht akzeptieren,\n können wir Ihre Bestellung bedauerlicherweise nicht entgegennehmen!\n\n'); Füge danach ein:
define('ERROR_REVOCATION_NOT_ACCEPTED', '* Sofern Sie unsere Widerrufsbelehrung nicht akzeptieren,\n können wir Ihre Bestellung bedauerlicherweise nicht entgegennehmen!\n\n'); Datei "/templates/<template-name>/module/checkout_payment.html"
Suche:
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td>{$AGB_checkbox}</td>
<td width="100%"><strong>{#text_accept_agb#}</strong></td>
</tr>
</table>
Füge danach ein:
<h2>{$REVOCATION_HEADLINE}</h2>
<div id="revocation">{$REVOCATION_CHECKBOX} {$REVOCATION_TEXT} {*$REVOCATION_LINK*}</div>
Datei "/checkout:confirmation.php"
Suche:
// if conditions are not accepted, redirect the customer to the payment method selection pageif (DISPLAY_CONDITIONS_ON_CHECKOUT
== 'true') { if ($_POST['conditions'] == false) { $error = str_replace('\n', '<br />', ERROR_CONDITIONS_NOT_ACCEPTED
); xtc_redirect
(xtc_href_link
(FILENAME_CHECKOUT_PAYMENT
, 'error_message=' . urlencode($error), 'SSL', true, false)); }} Füge danach ein:
// if revocation not accepted, redirect the customer to the payment method selection pageif(($_SESSION['cart']->get_content_type() == 'mixed') || ($_SESSION['cart']->get_content_type() == 'virtual')) { if ($_POST['revocation'] == false) { $error = str_replace('\n', '<br />', ERROR_REVOCATION_NOT_ACCEPTED
); xtc_redirect
(xtc_href_link
(FILENAME_CHECKOUT_PAYMENT
, 'error_message=' . urlencode($error), 'SSL', true, false)); }} Datei "/checkout_payment.php"
Suche:
//check if display conditions on checkout page is trueif (DISPLAY_CONDITIONS_ON_CHECKOUT
== 'true') { if (GROUP_CHECK
== 'true') { $group_check = "and group_ids LIKE '%c_" . $_SESSION['customers_status']['customers_status_id'] . "_group%'"; } $shop_content_query = xtc_db_query
("SELECT content_title,
content_heading,
content_text,
content_file
FROM " . TABLE_CONTENT_MANAGER
. "
WHERE content_group='3' " . $group_check . "
AND languages_id='" . $_SESSION['languages_id'] . "'"); $shop_content_data = xtc_db_fetch_array
($shop_content_query); if ($shop_content_data['content_file'] != '') { /* BOF - Hetfield - 2010-01-21 - Bugfix including contentfiles at SSL-Proxy */ //$conditions = '<iframe SRC="' . DIR_WS_CATALOG . 'media/content/' . $shop_content_data['content_file'] . '" width="100%" height="300">'; $conditions = '<div class="agbframe">' . file_get_contents(DIR_FS_DOCUMENT_ROOT
. 'media/content/' . $shop_content_data['content_file']) . '</div>'; /* EOF - Hetfield - 2010-01-21 - Bugfix including contentfiles at SSL-Proxy */ } else { /* BOF - Hetfield - 2010-01-20 - Remove agb-textarea from checkout_payment */ //$conditions = '<textarea name="blabla" cols="60" rows="10" readonly="readonly">' . strip_tags(str_replace('<br />', "\n", $shop_content_data['content_text'])) . '</textarea>'; $conditions = '<div class="agbframe">' . $shop_content_data['content_text'] . '</div>'; /* EOF - Hetfield - 2010-01-20 - Remove agb-textarea from checkout_payment */ } $smarty->assign('AGB', $conditions); //BOF - Hetfield - 2009-07-29 - SSL for Content-Links per getContentLink //$smarty->assign('AGB_LINK', $main->getContentLink(3, MORE_INFO)); $smarty->assign('AGB_LINK', $main->getContentLink(3, MORE_INFO
,'SSL')); //EOF - Hetfield - 2009-07-29 - SSL for Content-Links per getContentLink // BOF - Tomcraft - 2009-10-01 - AGB checkbox re-implemented if (isset ($_GET['step']) && $_GET['step'] == 'step2') { $smarty->assign('AGB_checkbox', '<input type="checkbox" value="conditions" name="conditions" checked />'); } else { $smarty->assign('AGB_checkbox', '<input type="checkbox" value="conditions" name="conditions" />'); } // EOF - Tomcraft - 2009-10-01 - AGB checkbox re-implemented} Füge danach ein:
// Widerrufsrechtif(($_SESSION['cart']->get_content_type() == 'mixed') || ($_SESSION['cart']->get_content_type() == 'virtual')) { if (GROUP_CHECK
== 'true') { $group_check = "and group_ids LIKE '%c_" . $_SESSION['customers_status']['customers_status_id'] . "_group%'"; } $shop_content_query = xtc_db_query
("SELECT content_title,
content_heading,
content_text,
content_file
FROM " . TABLE_CONTENT_MANAGER
. "
WHERE content_group='20' " . $group_check . "
AND languages_id='" . $_SESSION['languages_id'] . "'"); $shop_content_data = xtc_db_fetch_array
($shop_content_query); if ($shop_content_data['content_file'] != '') { /* BOF - Hetfield - 2010-01-21 - Bugfix including contentfiles at SSL-Proxy */ //$revocation = '<iframe SRC="' . DIR_WS_CATALOG . 'media/content/' . $shop_content_data['content_file'] . '" width="100%" height="300">'; $revocation = file_get_contents(DIR_FS_DOCUMENT_ROOT
. 'media/content/' . $shop_content_data['content_file']); /* EOF - Hetfield - 2010-01-21 - Bugfix including contentfiles at SSL-Proxy */ } else { /* BOF - Hetfield - 2010-01-20 - Remove agb-textarea from checkout_payment */ //$revocation = '<textarea name="blabla" cols="60" rows="10" readonly="readonly">' . strip_tags(str_replace('<br />', "\n", $shop_content_data['content_text'])) . '</textarea>'; $revocation = strip_tags(str_replace('<br />', "\n", $shop_content_data['content_text'])); /* EOF - Hetfield - 2010-01-20 - Remove agb-textarea from checkout_payment */ } $revocation_headline = strip_tags(str_replace('<br />', "\n", $shop_content_data['content_title'])); $smarty->assign('REVOCATION_HEADLINE', $revocation_headline); $smarty->assign('REVOCATION_TEXT', $revocation); $smarty->assign('REVOCATION_LINK', $main->getContentLink(20, MORE_INFO
,'SSL')); // Change 20 to the desired language group if (isset ($_GET['step']) && $_GET['step'] == 'step2') { $smarty->assign('REVOCATION_CHECKBOX', '<input type="checkbox" value="revocation" name="revocation" checked />'); } else { $smarty->assign('REVOCATION_CHECKBOX', '<input type="checkbox" value="revocation" name="revocation" />'); }}// Ende Widerrufsrecht Jetzt legt ihr im Content Manager je Sprache einen neuen Content an mit der Sprachgruppe 20. Der Titel und der Text dieses Contents wir auf die "checkout_payment" Seite übernommen.
Grüße
Torsten