F
F
filippokk2016-01-16 15:43:18
PHP
filippokk, 2016-01-16 15:43:18

How to merge fields in checkout?

Good evening, Opencart 2, I decided to simplify the checkout form, and there was a problem, I want to combine the "Payment method" tab with the "Payment information" tab, i.e. transfer information from the payment method to payment information, there were no problems with transferring theme files, but when I insert them in the right place, errors start to pour in, while all the fields are displayed:

Notice: Undefined variable: error_warning in /Applications/XAMPP/xamppfiles/htdocs/oc/catalog/view/theme/default/template/checkout/guest.tpl on line 306Notice: Undefined variable: payment_methods in /Applications/XAMPP/xamppfiles/htdocs/oc/catalog/view/theme/default/template/checkout/guest.tpl on line 309

Notice: Undefined variable: text_comments in /Applications/XAMPP/xamppfiles/htdocs/oc/catalog/view/theme/default/template/checkout/guest.tpl on line 328

I thought, I need to merge the controller files, I copied the payment method controller code into the guest.php controller code, but nothing happens, then it doesn’t output anything at all, but writes an error
Parse error: syntax error, unexpected '$data' (T_VARIABLE), expecting function (T_FUNCTION) in /Applications/XAMPP/xamppfiles/htdocs/oc/catalog/controller/checkout/guest.php on line 133

Can you please tell me how to combine controllers correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Makarov, 2016-01-17
@filippokk

The direction is right - the approach is wrong. You can't just copy a controller to another.
Either understand, or you can try to copy only a piece of code from

error_warning, text_comments
with dependencies.

X
xmoonlight, 2016-01-16
@xmoonlight

Understand payment_methods - what is missing from initialization and all dependencies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question