Re: Drop Shipping Purchase Order Module
Quote:
Originally Posted by
dealbyethan.com
Thanks for everyone's help. This module seems to work okay now. I would like to make a few changes. Please advise. Thank you.
1. How do I change the email subject line to "Order # for (customer's name)"?
2. How do I add supplier's name in the email? I have quite a lot of suppliers.
Alright - if you are using my modification, you will need to change two places. If you are not using my mod - the first change only should do it.
First Change:
I haven't tried this yet, but I imagine it will work: Find this code:
Code:
$tematk=$PO_SUBJECT;
$tematk=str_replace("{po_number}",$kod,$tematk);
Comment those both out, and then add this below it:
Code:
$tematk = 'Order #'.$kod.' for '.$row4[5];
Second Change:
This should only be done if you used my modification (written about in posts above)
Find this code:
Code:
$subject = 'PO #'.$ponumber;
Comment that out and add this below it:
Code:
$subject = 'Order #'.$ponumber.' for '.$orders['customers_name'];
Supplier's Name
As for adding the suppliers name into the email - yes, that should be easy. Just depends on where you want to add it. If you are using my modified code, the query to get the subcontractors information is already there. Simply use this variable where you want to add the name into the email:
Code:
$subcontractor['email_address'];
Hopefully that helps!
Re: Drop Shipping Purchase Order Module
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
Re: Drop Shipping Purchase Order Module
Quote:
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.
Re: Drop Shipping Purchase Order Module
Hi everyone,
this is Keepsake, the guy who wrote this back in the day. :)
I just remembered some of the stuff I did and I can't belive that little tweak got so much popularity. Really makes me proud. :)
Thank you Prattski for all your support while I wasn't around. I'd be glad to work on rolling out a new, updated version of this module for 1.3.8 since I'm going to be updating a store that uses this module.
Quote:
Originally Posted by
Prattski
Here's the things that we didn't like about it, or that didn't work:
- wouldn't send the emails (bug for 1.3.7?)
I believe so, it works for me (1.2.6)
Quote:
Originally Posted by
Prattski
- when you resent a PO, it would increment the PO number (not sure why it needed to do this... but we didn't like it)
I believe the reason for that was that when you re-send a PO you can change it (add items to it or delete them) so it's better if it is renumbered.
I have no problem with the fact that it seems it would be better if the old number was retained though.
Quote:
Originally Posted by
Prattski
- Didn't display the PO number on the already sent list
So, I modified the send_pos.php file quite a bit to fix/add these features. The main bulk of the update is that resending POs does not increment the PO number. It keeps the PO number as was originally set. Everything seems to be working flawlessly now on 1.3.7. I even cleaned up the code so that it is correctly tabbed in it's if/while/for statements for the all the code at the top portion of the page before the HTML.
I'll attach the file to this post. You will need to edit two variables near the top of the page - I have labeled them though, so you can't miss them. They are just for the From Name, and From Email address for when POs are sent out.
Have any questions, please let me know. I'll try to do my best to answer them.
Do you mind if I incoporate it into the new version of the module that I'll have replace the old one on all the download sites I'm aware of?
Thank you again, Great work!
Re: Drop Shipping Purchase Order Module
Quote:
Originally Posted by
Chuckl
Regarding whether anyone is going to pick up this mod, it is by no means clear to me that all of it is released under the GPL. No one is going to touch proprietary code, or submit it to the ZC downloads section.
Secondly, even if the code is indeed unencumbered, anyone attempting this will have to ask 'How fluent am I in Polish?'
It's GPL all right. Feel free to use it. Buy something at www.redlinegoods.com if you want to compensate me for developing it in any way. :)
I can help with translating all the bits that are in Polish.
Once I get a 1.3.8 compliant version together, how do I submit it to ZC downloads?
Re: Drop Shipping Purchase Order Module
Quote:
Originally Posted by
Keepsake
Once I get a 1.3.8 compliant version together, how do I submit it to ZC downloads?
Super easy. Just go to zen-cart.com, click on the "downloads" link near the top, then you'll see a button labeled: "submit your file".
I'm willing to help you out, Keepsake, with a new updated version. I sent you a private message.
Re: Drop Shipping Purchase Order Module
Hi,
Where can I download this module?
Regards
Zis
Re: Drop Shipping Purchase Order Module
Hi,
Where can I download this module?
Re: Drop Shipping Purchase Order Module
Unfortunately, I don't know! My boss already had it - and he sent it to me and I worked on it from there.
If you can though - be patient. The original person who did this mod is working on updating it, and will be implementing some of the modifications that I made to it. When it is ready, it will be posted in the Zen Cart downloads. Subscribe to this thread - I'm sure when it is ready for download it will be posted here.
Re: Drop Shipping Purchase Order Module
Quote:
Originally Posted by
Prattski
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.
Subcontractor name didn't appear in the email. When I did a test to send po to myself in admin. I received the following warnings
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/dealbyet/public_html/admin/send_pos.php on line 210
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/dealbyet/public_html/admin/send_pos.php on line 210
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/dealbyet/public_html/admin/send_pos.php on line 389
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/dealbyet/public_html/admin/send_pos.php on line 389
Quote:
Originally Posted by
Prattski
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.
1 & 2. The order # should be the same as my store order # which I have already achieved. At the moment the email subject appears as Order # XXX. I would like it to show up as Order # XXX for YYY (i.e. customer name). When I tried your code, the email subject becomes Order # XX (but wrong order number) for (no customer 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}.
3. I followed your instructions to change the files. There might be some slight differences but those are from the previous versions of your files. Yes send_pos.php and confirm_track_send.php are at the correct locations. I think I also have a copy of confirm_track_send.php in /admin. Should I remove it?
Thanks for your help.