
Originally Posted by
dealbyethan.com
Hi,
Thanks for your suggestion. I followed your instructions. But it didn't work. The email subject becomes Order # (wrong number) for (without customer's name). Don't we also have to also set the PO-subject in admin > configuration > my store to something? At the moment it's set to Order # {order_number}.
I want to put supplier's name in the email right at the top where I say "Hi (supplier name)". Where do I put the code $subcontractor['email_address']; ?
I tried your send_pos.php and confirm_track_sub.php file. However it doesn't work. When I clicked on the link in the email, I get the following error. Did I do something wrong? Please advise. Thank you.
Warning: main(includes/database_tables.php) [function.main]: failed to open stream: No such file or directory in /home/dealbyet/public_html/admin/confirm_track_sub.php on line 39
Warning: main(includes/database_tables.php) [function.main]: failed to open stream: No such file or directory in /home/dealbyet/public_html/admin/confirm_track_sub.php on line 39
Warning: main(includes/database_tables.php) [function.main]: failed to open stream: No such file or directory in /home/dealbyet/public_html/admin/confirm_track_sub.php on line 39
Fatal error: main() [function.require]: Failed opening required 'includes/database_tables.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dealbyet/public_html/admin/confirm_track_sub.php on line 39
Hmm.. This kind of thing is always hard to debug with other people. I really need a lot of specific details to know how to debug it with you.
1.) What number should the order# be, and what did it put in the email?
2.) You don't have to set the PO-NUMBER with the way I showed you. The code I gave you just bypasses the need for using that.
3.) You need to debug those errors you are getting. Did you edit the files I gave you? There are specific lines given in both files that you need to edit. Make sure they are in the correct location as well. send_pos.php is supposed to be in the /admin/ directory of the store - and confirm_track_send.php is supposed to be in the root directory of the store.
Adding the name to your email:
In the admin directory - find and edit email_header.txt. Add whatever text you want to add - adding {subcontractor_name} where you want the name to show up.
Then in your send_pos.php file, search for this line:
Code:
$zawartosc2[$i]=str_replace("{customers_name}",$row4[5],$zawartosc);
Underneath that - add this:
Code:
$subcontractor_id = $subk[$i];
$subcontractor_query = mysql_query("SELECT * FROM subcontractors WHERE subcontractors_id = $subcontractor_id");
$subcontractor = mysql_fetch_assoc($subcontractor_query); $zawartosc2[$i]=str_replace("{subcontractor_name}",$subcontractor['full_name'],"$zawartosc2[$i]");
And if you used my mod - find this code:
Code:
$header = str_replace("{customers_name}",$orders['customers_name'],$header);
And underneath that - add this code:
Code:
$header = str_replace("{subcontractor_name}",$subcontractor['fullname'],$header);
After trying all of what I wrote - let me know if you are still running into any problems.
Bookmarks