Zen Cart Logo
Forums / Bug Reports / [Fixed 1.6.0] template_filename not selecting in functions_email.php

[Fixed 1.6.0] template_filename not selecting in functions_email.php

Views: 896

Results 1 to 8 of 8
10 Oct 2012, 12:46 AM
#1
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

[Fixed 1.6.0] template_filename not selecting in functions_email.php

In functions_email.php, the function zen_build_html_email_from_template() refers to a $current_page_base. In dubugging, this was always null. I changed line 427 to use $module instead of $current_page_base:

    $template_filename = DIR_FS_EMAIL_TEMPLATES . $langfolder . "email_template_" . $module . ".html";
10 Oct 2012, 12:52 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

carlvt88:

$current_page_base. In dubugging, this was always null.
Not sure what exactly you're debugging.

$current_page_base is not null. In fact it's used 267 times.

10 Oct 2012, 2:32 AM
#3
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

(sorry if this is a resend)

In testing, I wasn't seeing the order_status email template used. Status changes always sent the default template.

This is on my development system, Win7 / xampp 3.0.12 / netbeans 7.2.

I set a breakpoint in functions_email.php line 427. This is where the template_filename is constructed from, among other things, $current_page_base. When I single stepped to this point, $current_page_base was null, so I used $module instead which evaluated to "order_status" - constructing the correct $template_filename.

10 Oct 2012, 2:44 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

Oh. This is on the admin side?

10 Oct 2012, 2:54 AM
#5
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

correct

10 Oct 2012, 3:06 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

Aha. Okay, try this change instead. Add the line to the top of the function, as shown:```
global $messageStack, $current_page_base;
[B] if (NULL == $current_page_base) $current_page_base = $module;[/B]

10 Oct 2012, 3:07 AM
#7
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

Re: [Fixed 1.6.0] template_filename not selecting in functions_email.php

OK - Thanks!