Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: ANLEITUNG: Erlöschungsvereinbarung bei Download-Artikeln einfügen

    tiflie

    • Fördermitglied
    • Beiträge: 52
    Nochmals Hallo,

    habe noch folgendes  Problem, wenn Javascript deaktiviert ist, reicht es die Checkbox der AGB zu bestätigen, um weiter zur checkout_confirmation Seite zu kommen. Was Fehlt in dem Code? Vielen Dank für die Hilfe!

    Code: PHP  [Auswählen]
      //Widerufsrecht
                 
                    $js .= "\n" . '  if (!document.getElementById("checkout_payment").widerrufsrecht.checked) {' . "\n" .
                                    '       error_message = error_message + unescape("' . xtc_js_lang(ERROR_WIDERRUFSRECHT_NOT_ACCEPTED) . '");' . "\n" .
                                    '       error = 1;' . "\n" .
                                    '  }' . "\n\n";
                    }
                    //Ende Widerrufsrecht

    tiflie

    • Fördermitglied
    • Beiträge: 52
    Hallo,

    habe folgenden Code in der checkout_confirmation.php eingesetzt, jetzt wird auch gemeckert wenn JS ausgeschaltet ist. Aber wenn kein digitaler Artikel im Korb ist, also keine Checkbox zu aktivieren/hacken, wird auch gemeckert.
    Welche Variabel muß ich einsätzen (Kein Checkbox also Keine Meldung), if (isset) hat nichts gebracht,
    Code: PHP  [Auswählen]
    // if conditions are not accepted, redirect the customer to the payment method selection page

    if (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));
            }
    }
    //if WBR are not accepted, redirect the customer to the payment method selection page
            if ($_POST['widerrufsrecht'] == false) {
                    $error = str_replace('\n', '<br />', ERROR_WIDERRUFSRECHT_NOT_ACCEPTED);
                    xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($error), 'SSL', true, false));
            }
    Habe noch das Problem mit dem Text für die englische Version
    Code: PHP  [Auswählen]
    $smarty->assign('WDR_headline', 'Digitale Inhalte oder Software, die nicht auf einem körperlichen Datenträger geliefert werden:');

    Wie macht man eine saubere Abfrage "if languages_id= DE" dann Text in deutsch oder "if languages_id= EN" dann Text in englisch,
    please Help!

    Grüß
    Phil

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.369
    • Geschlecht:
    Eine vorweg... ich würde jederzeit dieses Modul hier vorziehen: BETA MODUL: Erlöschen des Widerrufsrechts bei Downloads
    Dennoch 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:

    Code: PHP  [Auswählen]
            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:

    Code: PHP  [Auswählen]
            // 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:

    Code: PHP  [Auswählen]
    define('ERROR_CONDITIONS_NOT_ACCEPTED', 'Please accept our terms and conditions to proceed with your order.\n\n');

    Füge danach ein:

    Code: PHP  [Auswählen]
    define('ERROR_REVOCATION_NOT_ACCEPTED', 'Please accept our cancellation policy to proceed with your order.\n\n');

    Datei "/lang/german/german.php"

    Suche:

    Code: PHP  [Auswählen]
    define('ERROR_CONDITIONS_NOT_ACCEPTED', '* Sofern Sie unsere Allgemeinen Gesch&auml;ftsbedingungen nicht akzeptieren,\n k&ouml;nnen wir Ihre Bestellung bedauerlicherweise nicht entgegennehmen!\n\n');

    Füge danach ein:

    Code: PHP  [Auswählen]
    define('ERROR_REVOCATION_NOT_ACCEPTED', '* Sofern Sie unsere Widerrufsbelehrung nicht akzeptieren,\n k&ouml;nnen wir Ihre Bestellung bedauerlicherweise nicht entgegennehmen!\n\n');

    Datei "/templates/<template-name>/module/checkout_payment.html"

    Suche:

    Code: PHP  [Auswählen]
    <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:

    Code: PHP  [Auswählen]
    <h2>{$REVOCATION_HEADLINE}</h2>
    <div id="revocation">{$REVOCATION_CHECKBOX} {$REVOCATION_TEXT} {*$REVOCATION_LINK*}</div>

    Datei "/checkout:confirmation.php"

    Suche:

    Code: PHP  [Auswählen]
    // if conditions are not accepted, redirect the customer to the payment method selection page
    if (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:

    Code: PHP  [Auswählen]
    // if revocation not accepted, redirect the customer to the payment method selection page
    if(($_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:

    Code: PHP  [Auswählen]
    //check if display conditions on checkout page is true
    if (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:

    Code: PHP  [Auswählen]
    // Widerrufsrecht
    if(($_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
    rechtstexte für onlineshop
    14 Antworten
    519 Aufrufe
    05. August 2024, 13:17:33 von Conanwulf
    5 Antworten
    2794 Aufrufe
    14. Juli 2014, 09:58:41 von ComputerHaus
    1 Antworten
    1794 Aufrufe
    12. Dezember 2012, 18:00:34 von h-h-h
    10 Antworten
    6152 Aufrufe
    25. Februar 2016, 13:17:43 von hh040
               
    anything