Post by jumblez » Thu Jun 28, 2018 9:02 pm

I would greatly appreciate some help. I was trying to get rid of comments box and change text add comments here on the payment method page.
I was able to get rid of text box and change "add comments here" to "thank you for your order". I am running Opencart 3.0.2.

However now I get an error message. I attached a picture of the error. Its happens when you click the continue button on the payment methods page.
The only two files I have been in is the payment methods twig file and the check out php file. So does anyone know what happened here?
I did cleared cache and tried a different browser. Still get same message. Below is the php checkout file code, and the payment method twig, plus the error message.
Thanks!!

<?php
// Heading
$_['heading_title'] = 'Checkout';

// Text
$_['text_cart'] = 'Shopping Cart';
$_['text_checkout_option'] = 'Step %s: Checkout Options';
$_['text_checkout_account'] = 'Step %s: Account &amp; Billing Details';
$_['text_checkout_payment_address'] = 'Step %s: Billing Details';
$_['text_checkout_shipping_address'] = 'Step %s: Delivery Details';
$_['text_checkout_shipping_method'] = 'Step %s: Delivery Method';
$_['text_checkout_payment_method'] = 'Step %s: Payment Method';
$_['text_checkout_confirm'] = 'Step %s: Confirm Order';
$_['text_modify'] = 'Modify &raquo;';
$_['text_new_customer'] = 'New Customer';
$_['text_returning_customer'] = 'Returning Customer';
$_['text_checkout'] = 'Checkout Options:';
$_['text_i_am_returning_customer'] = 'I am a returning customer';
$_['text_register'] = 'Register Account';
$_['text_guest'] = 'Guest Checkout';
$_['text_register_account'] = 'By creating an account you will be able to shop faster, be up to date on an order\'s status, and keep track of the orders you have previously made.';
$_['text_forgotten'] = 'Forgotten Password';
$_['text_your_details'] = 'Your Personal Details';
$_['text_your_address'] = 'Your Address';
$_['text_your_password'] = 'Your Password';
$_['text_agree'] = 'I have read and agree to the <a href="%s" class="agree"><b>%s</b></a>';
$_['text_address_new'] = 'I want to use a new address';
$_['text_address_existing'] = 'I want to use an existing address';
$_['text_shipping_method'] = 'Please select the preferred shipping method to use on this order.';
$_['text_payment_method'] = 'Please select the preferred payment method to use on this order.';
$_['text_comments'] = 'Thank you for your order';
$_['text_recurring_item'] = 'Recurring Item';
$_['text_payment_recurring'] = 'Payment Profile';
$_['text_trial_description'] = '%s every %d %s(s) for %d payment(s) then';
$_['text_payment_description'] = '%s every %d %s(s) for %d payment(s)';
$_['text_payment_cancel'] = '%s every %d %s(s) until canceled';
$_['text_day'] = 'day';
$_['text_week'] = 'week';
$_['text_semi_month'] = 'half-month';
$_['text_month'] = 'month';
$_['text_year'] = 'year';

// Column
$_['column_name'] = 'Product Name';
$_['column_model'] = 'Model';
$_['column_quantity'] = 'Quantity';
$_['column_price'] = 'Unit Price';
$_['column_total'] = 'Total';

// Entry
$_['entry_email_address'] = 'E-Mail Address';
$_['entry_email'] = 'E-Mail';
$_['entry_password'] = 'Password';
$_['entry_confirm'] = 'Password Confirm';
$_['entry_firstname'] = 'First Name';
$_['entry_lastname'] = 'Last Name';
$_['entry_telephone'] = 'Telephone';
$_['entry_address'] = 'Choose Address';
$_['entry_company'] = 'Company';
$_['entry_customer_group'] = 'Customer Group';
$_['entry_address_1'] = 'Address 1';
$_['entry_address_2'] = 'Address 2';
$_['entry_postcode'] = 'Post Code';
$_['entry_city'] = 'City';
$_['entry_country'] = 'Country';
$_['entry_zone'] = 'Region / State';
$_['entry_newsletter'] = 'I wish to subscribe to the %s newsletter.';
$_['entry_shipping'] = 'My delivery and billing addresses are the same.';

// Error
$_['error_warning'] = 'There was a problem while trying to process your order! If the problem persists please try selecting a different payment method or you can contact the store owner by <a href="%s">clicking here</a>.';
$_['error_login'] = 'Warning: No match for E-Mail Address and/or Password.';
$_['error_attempts'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';
$_['error_approved'] = 'Warning: Your account requires approval before you can login.';
$_['error_exists'] = 'Warning: E-Mail Address is already registered!';
$_['error_firstname'] = 'First Name must be between 1 and 32 characters!';
$_['error_lastname'] = 'Last Name must be between 1 and 32 characters!';
$_['error_email'] = 'E-Mail address does not appear to be valid!';
$_['error_telephone'] = 'Telephone must be between 3 and 32 characters!';
$_['error_password'] = 'Password must be between 4 and 20 characters!';
$_['error_confirm'] = 'Password confirmation does not match password!';
$_['error_address_1'] = 'Address 1 must be between 3 and 128 characters!';
$_['error_city'] = 'City must be between 2 and 128 characters!';
$_['error_postcode'] = 'Postcode must be between 2 and 10 characters!';
$_['error_country'] = 'Please select a country!';
$_['error_zone'] = 'Please select a region / state!';
$_['error_agree'] = 'Warning: You must agree to the %s!';
$_['error_address'] = 'Warning: You must select address!';
$_['error_shipping'] = 'Warning: Shipping method required!';
$_['error_no_shipping'] = 'Warning: No Shipping options are available. Please <a href="%s">contact us</a> for assistance!';
$_['error_payment'] = 'Warning: Payment method required!';
$_['error_no_payment'] = 'Warning: No Payment options are available. Please <a href="%s">contact us</a> for assistance!';
$_['error_custom_field'] = '%s required!';

Payment method TWIG FILE
{% if error_warning %}
<div class="alert alert-warning alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
{% endif %}
{% if payment_methods %}
<p>{{ text_payment_method }}</p>
{% for payment_method in payment_methods %}
<div class="radio">
<label>{% if payment_method.code == code or not code %}
{% set code = payment_method.code %}
<input type="radio" name="payment_method" value="{{ payment_method.code }}" checked="checked" />
{% else %}
<input type="radio" name="payment_method" value="{{ payment_method.code }}" />
{% endif %}
{{ payment_method.title }}
{% if payment_method.terms %}
({{ payment_method.terms }})
{% endif %} </label>
</div>
{% endfor %}
{% endif %}
<p><strong>{{ text_comments }}</strong></p>
<p>
<textarea name="comment" cols="10 rows="8">.....</textarea>
</p>
{% if text_agree %}
<div class="buttons">
<div class="pull-right">{{ text_agree }}
{% if agree %}
<input type="checkbox" name="agree" value="1" checked="checked" />
{% else %}
<input type="checkbox" name="agree" value="1" />
{% endif %}
&nbsp;
<input type="button" value="{{ button_continue }}" id="button-payment-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
</div>
</div>
{% else %}
<div class="buttons">
<div class="pull-right">
<input type="button" value="{{ button_continue }}" id="button-payment-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
</div>
</div>
{% endif %}

Attachments

error opencart.jpg

error opencart.jpg (21.93 KiB) Viewed 5392 times


Newbie

Posts

Joined
Wed May 09, 2018 8:02 pm

Post by straightlight » Thu Jun 28, 2018 9:11 pm

Long time reported issue. In catalog/controller/checkout/payment_method.php and catalog/controller/checkout/shipping_method.php file,

find:

Code: Select all

$this->session->data['comment'] = strip_tags($this->request->post['comment']);
replace with:

Code: Select all

if (isset($this->request->post['comment'])) {
    $this->session->data['comment'] = strip_tags($this->request->post['comment']);

} else {
    $this->session->data['comment'] = '';
}
Then, ensure to apply these steps: viewtopic.php?f=176&p=727490#p718325

This should resolved the issue. In addition, you do not need to post the entire files to rectify one problem.
Last edited by straightlight on Thu Jun 28, 2018 10:52 pm, edited 1 time in total.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jumblez » Thu Jun 28, 2018 10:27 pm

I believe I did what you instructed. Now I have an internal server error. I also cleared cache and refreshed as directed.
Any thoughts?

I attached a picture of the code from the last part of the file with the changes starting with line 353.
I must have some out of place . Thank-you as well.

Attachments

cart file.jpg

cart file.jpg (85.42 KiB) Viewed 5374 times


Newbie

Posts

Joined
Wed May 09, 2018 8:02 pm

Post by straightlight » Thu Jun 28, 2018 10:53 pm

For unknown reasons, the last closing bracket did not appeared since the last time I submitted the post. Try again, it should work now.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jumblez » Fri Jun 29, 2018 8:27 am

Thank-you. We are getting closer. The cart functions fine however when you click on continue on the payment methods page it goes back to first check out page.
I attached the file image, just in case I misses something. Any thoughts?

Attachments

279.jpg

279.jpg (99.07 KiB) Viewed 5339 times


Newbie

Posts

Joined
Wed May 09, 2018 8:02 pm

Post by jumblez » Fri Jun 29, 2018 6:05 pm

Ok, problem solved! All my problems started with removing comments box on the payment page of check out. Opencart support suggested that I just remove that code to remove the comments box. However, that apparently created my problem. I reached out to Opencart support again and was told to restore my comment box, but add ​style="display: none"​to hide it because the controller expects it. Then I restored the catalog/controller/checkout/payment_method.php file to its original code. After that everything worked just fine.

I wanted to publicly thank straightlight for his help. Thanks!!

Newbie

Posts

Joined
Wed May 09, 2018 8:02 pm
Who is online

Users browsing this forum: No registered users and 117 guests