Post by mfadel » Thu Nov 16, 2017 9:22 pm

Hello everyone,
I am trying to inculde guest customer's data in Terms and condition page make it as a contract in Check out page,
my controller
contract.php

Code: Select all

		if (isset($this->session->data['guest']['firstname'])) {
				$data['firstname'] = $this->session->data['payment_address']['firstname'];
			} else {
				$data['firstname'] = '';
			}
                 }
my view: contract.twig

Code: Select all

            <strong> {{ firstname }}  </strong><br>
but it doesn't show anything? What did I miss?

Newbie

Posts

Joined
Tue Oct 28, 2014 11:39 pm

Post by straightlight » Thu Nov 16, 2017 10:05 pm

Your posted enquiry and codes above are incomplete. It does not indicate with OC version you're using nor at which moment during checkout you are wanting to implement your contract controller file. However, the way you describe the problem above is that you should rather use a return statement with your controller in order for a core checkout controller to obtain that first name by using something like:

Code: Select all

$data['contract_firstname'] = $this->load->controller('checkout/contract');
Then, somewhere in the checkout TWIG file where, again, the enquiry above does not mention where during checkout you'd like to implement your contract, you could use:

Code: Select all

{% if contract_firstname %}
{{ contract_firstname }}
{% endif %}

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
Who is online

Users browsing this forum: No registered users and 344 guests