Hallo zusammen,
ich experimentiere immer noch mit OC und bin nun beim Checkout angelangt.
Bei Schritt 5 (Zahlungsart) sieht OC eine Checkbox vor, mit welcher man den AGB's zustimmen muss, bevor man weiter zu Schritt 6 (Auftrag bestätigen) kommt.
Meiner Meinung nach ist es üblicher wenn man den AGB's im Rahmen der Zusammenfassung (Schritt 6 - Auftrag bestätigen) zustimmen muss.
Daher möchte ich gerne die Checkbox samt zugehörigen Text und Überprüfung von Schritt 5 zu Schritt 6 "umziehen".
Meine bisherigen Versuche sind leider gescheitert.
Die Checkbox sowie die Textanzeige bekommen ich beim Schritt 6 angezeigt, jedoch gelingt die Überprüfung nicht.
Kann mir jemand helfen? Vielleicht hat der Eine oder Andere auch das gleiche Problem?
Gruß
Andreas
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Im Prinzip inab-oc wrote:Hallo Osworx,
kannst Du mir sagen, welche Teile des Quellcodes genau?
In confirm.tpl muss ich ja die entsprechenden Passagen auch einfügen. Auch hier steh ich etwas auf dem Schlauch...
Danke schonmal...
Gruß
Andreas
Code: Select all
../catalog/controller/checkout/payment_method.php
Code: Select all
if ($this->config->get('config_checkout_id')) {
$this->load->model('catalog/information');
$information_info = $this->model_catalog_information->getInformation($this->config->get('config_checkout_id'));
if ($information_info && !isset($this->request->post['agree'])) {
$json['error']['warning'] = sprintf($this->language->get('error_agree'), $information_info['title']);
}
}
Code: Select all
../catalog/controller/checkout/confirm.php
Code: Select all
../catalog/view/theme/TEMPLATENAME/template/checkout/payment_method.tpl
Code: Select all
<?php if ($text_agree) { ?>
<div class="buttons">
<div class="right"><?php echo $text_agree; ?>
<?php if ($agree) { ?>
<input type="checkbox" name="agree" value="1" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="agree" value="1" />
<?php } ?>
<input type="button" value="<?php echo $button_continue; ?>" id="button-payment-method" class="button" />
</div>
</div>
<?php } else { ?>
<div class="buttons">
<div class="right">
<input type="button" value="<?php echo $button_continue; ?>" id="button-payment-method" class="button" />
</div>
</div>
<?php } ?>
<script type="text/javascript"><!--
$('.colorbox').colorbox({
width: 640,
height: 480
});
//--></script>
Code: Select all
../catalog/view/theme/TEMPLATENAME/template/checkout/confirm.tpl
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
hab die Verschiebungen gemacht, und nach diversen Kleinigkeiten, die noch zusätzlich notwendig waren, folgender Stand:
Code: Select all
confirm.php
Code: Select all
$json = array();
Code: Select all
// ANFANG - Anzeige T&C inkl. Checkbox
$this->data['button_continue'] = $this->language->get('button_continue');
if (!$json) {
if ($this->config->get('config_checkout_id')) {
$this->load->model('catalog/information');
$information_info = $this->model_catalog_information->getInformation($this->config->get('config_checkout_id'));
if ($information_info) {
$this->data['text_agree'] = sprintf($this->language->get('text_agree'), $this->url->link('information/information/info', 'information_id=' . $this->config->get('config_checkout_id'), 'SSL'), $information_info['title'], $information_info['title']);
} else {
$this->data['text_agree'] = '';
}
} else {
$this->data['text_agree'] = '';
}
if (isset($this->session->data['agree'])) {
$this->data['agree'] = $this->session->data['agree'];
} else {
$this->data['agree'] = '';
}
}
$this->response->setOutput(json_encode($json));
// ENDE - Anzeige T&C inkl. Checkbox
Code: Select all
config.tpl
Code: Select all
<?php if ($text_agree) { ?>
<div class="buttons">
<div class="right"><?php echo $text_agree; ?>
<?php if ($agree) { ?>
<input type="checkbox" name="agree" value="1" checked="checked" style="float:none;" />
<?php } else { ?>
<input type="checkbox" name="agree" value="1" style="float:none;" />
<?php } ?>
<input type="button" value="<?php echo $button_continue; ?>" id="button-payment-method" class="button colorButton remove-bottom" />
</div>
</div>
<?php } else { ?>
<?php } ?>
<script type="text/javascript"><!--
$('.colorbox').fancybox({
width:560,
height:560,
autoDimensions: false
});
//--></script>
Die Terms & Conditions habe ich gelesen und bin einverstanden. [ ] "Weiter"
Also gewünschter Text, Checkbox und Button. Soweit so gut. Jetzt scheitere ich an der Überprüfung.
Im Schritt 5 wird ja eine Warnmeldung ausgegeben, wenn die Checkbox nicht angehakt wurde. Bei mir im Schritt 6 funktioniert dies noch nicht. Ich kann die Checkbox anhaken und auf den Button "Weiter", dann wird der Haken in der Checkbox lediglich gelöscht, keine Warnmeldung...
Was muss ich in config.php und ggf. in config.tpl noch ändern / ergänzen, damit die Prüfung funktioniert und der "Weiter"-Button den "Kaufen"-Button ersetzt?
Gruß
Andreas
P.S.: Ist vielleicht auch für Dein Modul "Legal" interessant...
In config.php nichts und in config.tpl gibt es garnicht!ab-oc wrote: Also gewünschter Text, Checkbox und Button. Soweit so gut. Jetzt scheitere ich an der Überprüfung.
Im Schritt 5 wird ja eine Warnmeldung ausgegeben, wenn die Checkbox nicht angehakt wurde. Bei mir im Schritt 6 funktioniert dies noch nicht. Ich kann die Checkbox anhaken und auf den Button "Weiter", dann wird der Haken in der Checkbox lediglich gelöscht, keine Warnmeldung...
Was muss ich in config.php und ggf. in config.tpl noch ändern / ergänzen, damit die Prüfung funktioniert
Meinst wahrscheinlich confirm.*
Verstehe ich noch weniger!ab-oc wrote:.. und der "Weiter"-Button den "Kaufen"-Button ersetzt?
Welcher Button 'Kaufen' soll wo durch was ersetzt werden???
Wenn keine Überprüfung gemacht wird, dann fehlt halt noch ein wenig Code in beiden.
Wahrscheinlich das validate()
Versteht ich jetzt nicht ganz, denn dort wird AGB sowie Widerruf sowieso abgefragt - eine Checkbox dort ist rechtlich nicht notwendig (wurde von mehreren unabhängigen Rechtsanwälten bestätigt).ab-oc wrote:... ist vielleicht auch für Dein Modul "Legal" interessant...
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Stimmt...OSWorX wrote:ab-oc wrote:
Also gewünschter Text, Checkbox und Button. Soweit so gut. Jetzt scheitere ich an der Überprüfung.
Im Schritt 5 wird ja eine Warnmeldung ausgegeben, wenn die Checkbox nicht angehakt wurde. Bei mir im Schritt 6 funktioniert dies noch nicht. Ich kann die Checkbox anhaken und auf den Button "Weiter", dann wird der Haken in der Checkbox lediglich gelöscht, keine Warnmeldung...
Was muss ich in config.php und ggf. in config.tpl noch ändern / ergänzen, damit die Prüfung funktioniert
In config.php nichts und in config.tpl gibt es garnicht!
Meinst wahrscheinlich confirm.*
Ok, missverständlich formuliert. Mein jetziger Stand ist der, dass im Schritt 6 zwei Buttons existieren. Der eigentliche "Kaufen"-Button welcher original zu Schritt 6 gehört, zuzüglich des "Weiter"-Buttons, welcher aus Schritt 5 "umkopiert" wurde.OSWorX wrote:ab-oc wrote:
.. und der "Weiter"-Button den "Kaufen"-Button ersetzt?
Verstehe ich noch weniger!
Welcher Button 'Kaufen' soll wo durch was ersetzt werden???
Klar brauch ich nur einen Button zum Kaufen. Jetzt muss eben einer wieder entfernt werden, ich bin mir nur nicht sicher welcher geschickter ist, da bisher auch die Validierung bei mir nicht funktioniert. Bisher dachte ich, dass diese Validierung über den "Weiter"-Button ausgelöst wird. Oder nicht?
Bei Deinem Legal wird AGB und Widerruf auch in Schritt 5 abgefragt, oder?OSWorX wrote:ab-oc wrote:
... ist vielleicht auch für Dein Modul "Legal" interessant...
Versteht ich jetzt nicht ganz, denn dort wird AGB sowie Widerruf sowieso abgefragt - eine Checkbox dort ist rechtlich nicht notwendig (wurde von mehreren unabhängigen Rechtsanwälten bestätigt).
Kannst Du mir zu dem validate() noch ein paar mehr Hinweise geben? Du kennst Dich offensichtlich sehr gut aus, mit dem OpenCart-System...
Danke
Andreas
Netter Scherz .. oder wie soll ich das verstehen??ab-oc wrote:Du kennst Dich offensichtlich sehr gut aus, mit dem OpenCart-System...
Würde anonsten wohl kaum dermassen heikle Module wie z.B. LEGAL erstellen können - oder ?!
Ganz wie Standard - und das genügt.ab-oc wrote:Bei Deinem Legal wird AGB und Widerruf auch in Schritt 5 abgefragt, oder?
Im Modul LEGAL wird in der integrierten und verpflichtenden abschliessenden BUTTONLÖSUNG sowohl auf AGB als auch Widerruf hingewiesen.
Das genügt vollkommen - irgendwelche Checkboxen oder weitere Abfragen sind hier nicht mehr erforderlich.
Ja, aber letztendlich läuft es doch auch eine ziemliche Modifikation des Systems raus - daher zum letztenmal gratis hier ein Hinweis, mehr dann als Auftragsarbeit.ab-oc wrote:Kannst Du mir zu dem validate() noch ein paar mehr Hinweise geben?
In der checkout.tpl siehe:
Code: Select all
$('#button-payment-address').live('click', function() {
$.ajax({
url: 'index.php?route=checkout/payment_address/validate',
Code: Select all
function quickConfirm(module){
$.ajax({
url: 'index.php?route=checkout/confirm',
Code: Select all
if ($information_info && !isset($this->request->post['agree'])) {
Code: Select all
<input type="button" value="<?php echo $button_continue; ?>" id="button-payment-method" class="button colorButton remove-bottom" />
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
für alle, die an der Lösung interessiert sind:
Schritt 1:
Code: Select all
theme/*/template/checkout/payment_method.tpl
Code: Select all
<?php if ($text_agree) { ?>
<div class="buttons">
<div class="right"><?php echo $text_agree; ?>
<?php if ($agree) { ?>
<input type="checkbox" name="agree" value="1" checked="checked" style="float:none;" />
<?php } else { ?>
<input type="checkbox" name="agree" value="1" style="float:none;" />
<?php } ?>
<input type="button" value="<?php echo $button_continue; ?>" id="button-payment-method" class="button colorButton remove-bottom" />
</div>
</div>
<?php } else { ?>
Schritt 2
Code: Select all
theme/*/template/checkout/confirm.tpl
Code: Select all
<!-- ANFANG 1 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm) -->
<?php if ($text_agree) { ?>
<div class="buttons">
<div class="right"><?php echo $text_agree; ?>
<?php if ($agree) { ?>
<input type="checkbox" name="agree" value="1" checked="checked" style="float:none;" />
<?php } else { ?>
<input type="checkbox" name="agree" value="1" style="float:none;" /> <br>
<br />
<?php } ?>
<input class="button confirmButton" onclick="validateme();" type="button" value="<?php echo $button_confirm; ?>">
<div class="payment" align="right"><?php echo $payment; ?></div> <!-- TO RAVI - $_['button_confirm'] - Text for confirm button -->
</div>
</div>
<?php } else { ?>
<div class="buttons">
<div class="right">
</div>
</div>
<?php } ?>
<!-- ENDE 1 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm) -->
Code: Select all
<?php } else { ?>
<script type="text/javascript"><!--
location = '<?php echo $redirect; ?>';
//--></script>
<?php } ?>
Code: Select all
<!-- ANFANG 3 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm) -->
<style>
.payment{
display:none;
}
</style>
<script>
function validateme(){
var checkbox = $('input[name=\'agree\']')
if(checkbox.is(":checked")){
$('.payment .button').click();
}else {
var checkvalidate = '<div class="warning" style=""><?php echo $erroragree; ?></div>'; <!-- TO RAVI - $_['error_agree'] - Text for T&C warning -->
$('.checkout-product').before(checkvalidate);
/*setTimeout(function(){
$('.warning').remove();
}, 2000); */
}
}
</script>
<!-- ENDE 3 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm) -->
Code: Select all
catalog/controller/checkout/payment_method.php
Code: Select all
/* ANFANG 1 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm)
if ($information_info && !isset($this->request->post['agree'])) {
$json['error']['warning'] = sprintf($this->language->get('error_agree'), $information_info['title']);
}
ENDE 1 - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm) */
Code: Select all
catalog/controller/checkout/confirm.php
Code: Select all
// ANFANG - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm)
if ($this->config->get('config_checkout_id')) {
$this->load->model('catalog/information');
$information_info = $this->model_catalog_information->getInformation($this->config->get('config_checkout_id'));
if ($information_info) {
$this->data['text_agree'] = sprintf($this->language->get('text_agree'), $this->url->link('information/information/info', 'information_id=' . $this->config->get('config_checkout_id'), 'SSL'), $information_info['title'], $information_info['title']);
} else {
$this->data['text_agree'] = '';
}
} else {
$this->data['text_agree'] = '';
}
if (isset($this->session->data['agree'])) {
$this->data['agree'] = $this->session->data['agree'];
} else {
$this->data['agree'] = '';
}
$this->data['button_confirm'] = $this->language->get('button_confirm');
$this->data['erroragree'] = sprintf($this->language->get('error_agree'), $information_info['title']);
// ENDE - Checkbox and Terms & Conditions which moved from step 5 (payment-method) to step 6 (confirm)
Code: Select all
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/checkout/confirm.tpl')) {
$this->template = $this->config->get('config_template') . '/template/checkout/confirm.tpl';
} else {
$this->template = 'default/template/checkout/confirm.tpl';
}
This is the only place I have read someone seeking the same solution as me - moving the checkbox from step 5 to step 6.
I use version 2.0.2, and have tried using your coding as inspiration, but have failed miserably.
Anyone able to help here?
For the english friends, follow post viewtopic.php?f=190&t=172517
Probably you need to hide the checkbox, because i don't find the validator.
Working on Opencart Version 2.3.0.2
Users browsing this forum: No registered users and 144 guests