10010110 Posted August 8, 2011 Share Posted August 8, 2011 I seem to remember that I had a body ID of “payment” on the specific payment pages like Cash on Delivery, Cheque payment, Paypal payment, etc (not the overview page but the pages but the confirmation/summary pages that are served by the modules) but since I updated to the latest version (which was a really painful process) this body class has disappeared. I don’t know if that was something that got officially removed or if it was something I added and don’t remember where but is there any way to define the page name for all these payment type pages without going into the module files? In which default page template are these module contents integrated anyway? All standard pages are displaying the “$page_name” variable as body ID, just not these payment method pages. :-( Link to comment Share on other sites More sharing options...
10010110 Posted August 8, 2011 Author Share Posted August 8, 2011 OK, I’ve found the place where the new version differs from the old one. In version 1.4.4.0 in /classes/FrontController on line 207 we find: $page_name = (isset($this->php_self) ? preg_replace('/\.php$/', '', $this->php_self) : ''); while in version 1.4.0.14 (the last previous one I had) we have the similar (but different) functionality on lines 183–185: $pathinfo = pathinfo(__FILE__); $page_name = basename($_SERVER['PHP_SELF'], '.'.$pathinfo['extension']); $page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name; It looks like I am able to replace the new code with the old one without breaking anything but I’d be happy if someone could tell me how to enable the functionality of the old code in the new one for possible forward compatibility (although I think I’m not going to upgrade anytime soon as much of a pain this is). Link to comment Share on other sites More sharing options...
justinl Posted November 11, 2011 Share Posted November 11, 2011 I think you could probably write it like this: $pathinfo = pathinfo(__FILE__); $page_name_old_method = basename($_SERVER['PHP_SELF'], '.'.$pathinfo['extension']); $page_name_old_method = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name; $page_name = (isset($this->php_self) ? preg_replace('/\.php$/', '', $this->php_self) : $page_name_old_method); And if you really want to do it right, you should make those changes in the class override directory Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now