Post by nbdevelopdreece » Tue Sep 01, 2020 12:49 am

In opencart 2, I am editing the appearance/php of the header only in the "success"/"thank you" page (catalog/view/theme/*/template/common/success.tpl).

So, in catalog/view/theme/*/template/common/header.tpl I want to do something like:

Code: Select all

if( $is_thank_you_page ){
   echo "stuff";
   // bonus: I wanted to get the order email but maybe it should be a different post
}
But how can I check in the header.tpl if it is the "success"/"thank you" page?
I tried setting a variable in success.tpl before printing the header with no results.


Posts

Joined
Tue Oct 08, 2019 10:42 pm

Post by grgr » Tue Sep 01, 2020 10:54 am

By adding some code the the header.php file such as:

Code: Select all

if (isset($this->request->get['route']) && $this->request->get['route'] == 'checkout/success') {
	$data['my_message'] = 'This is my message';
} else {
	$data['my_message'] = '';
}

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK
Who is online

Users browsing this forum: No registered users and 10 guests