If this is your first visit, check our documentation. To post, register or login.
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

Started by carlvt88 on 10 Oct 2012, 12:46 AM · Views: 904

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,512
Plugin Contributions:
176

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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,512
Plugin Contributions:
176

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

Oh. This is on the admin side?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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,512
Plugin Contributions:
176

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]

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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!

11 Oct 2012, 6:50 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

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

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.