Forums / General Questions / Merlin's Purchase Order Module

Merlin's Purchase Order Module

Locked

Started by slabadoo on 3 Apr 2007, 9:15 PM · Views: 6,453

Results 1 to 20 of 34
This thread is locked. New replies are disabled.
3 Apr 2007, 9:15 PM
#1
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Merlin's Purchase Order Module

Having a slight problem with the Purchase Module. Found one post that showed a fix but it was for an earlier version. The confirmation email and the email that goes to the admin are missing the Purchase Order information i.e.
Account Name:

Account Number:

Purchase Order No:

any ideas?
Slabadoo

Slabadoo

4 Apr 2007, 5:43 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Merlin's Purchase Order Module

.
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.

4 Apr 2007, 8:19 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Merlin's Purchase Order Module

slabadoo:

Having a slight problem with the Purchase Module. Found one post that showed a fix but it was for an earlier version. The confirmation email and the email that goes to the admin are missing the Purchase Order information i.e.
Account Name:

Account Number:

Purchase Order No:

any ideas?
Slabadoo

I experience the same problem... Looks like Dr Byte's suggestion may be the issue here.

I'll check that line in the relevant Purchase Order files too.

20 years a Zencart User

4 Apr 2007, 1:31 PM
#4
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Well, it looked promising but the code that is referenced in his bug fix is not in the orders.php file. Part of it is but it is different that mine

When i installed his PO MOD, orders.php was one of the files that was required be updated, so I used his orders.php in place of the original. at least that is what the directions said to do. I am using 1.3.7 and here is the line of code in my orders.php that is refererenced in the link that was provided above:

    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->email_footer : '');

And the code on the link above which I thought would be the fix is:

$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : $this->info['cc_type'];

Turns out, the two pieces of code are a little more different that I thought they would be. what do you recomend I do?

Thanks,
Slabadoo

Slabadoo

4 Apr 2007, 2:52 PM
#5
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Merlin's Purchase Order Module

there have been some changes to the core code,
the PO Module dosnt work with 1.3.7
and I dont know when I will get a chance to fix it

Zen cart PCI compliant Hosting

4 Apr 2007, 3:55 PM
#6
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

:huh: <Heart Attackkk> Going live with this site in a few days. Client needs the PO MOD. Any thoughts on a way around my delima? Seems the only thing that isn't working correctly is the email is not showing the PO info.

Mommy????:cry:
Slabadoo

Slabadoo

5 Apr 2007, 1:48 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Merlin's Purchase Order Module

There's a purchase order mod in the Super Orders contribution. Not sure how different it is in functionality.

.
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.

5 Apr 2007, 1:52 PM
#8
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Yep, I am in the process of installing it right now. I will post my outcome. Pray for me...

Slabadoo

5 Apr 2007, 2:34 PM
#9
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Wel, the Purchase Order in super orders was not what I was looking for.

text form fields to simply type in the PO info like the way Merlin did it. Hmm? ANy other ideas ona way to get it po to work with a user filled form filed at the payment step?

Thanks,
Slabadoo

Slabadoo

5 Apr 2007, 2:48 PM
#10
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

From what I can see, the only thing the Mod is not doing for me is providing the PO info in the emails sent to the customer and admin. Do you know if there would be a way to rig it to send the info along. It does show in the customer order info in admin?

I understand you are probably tied to 100's of other questions that are looking for solutions. No sweat if you can't get to it. I did however try to use the super orders MOD but The solution you offered by having the Form Filed in the apyment area was definatly the way I need to go. No recieving PO Faxes for me. Anyway, any help appreciated and thanks for listening.
Slabadoo

Slabadoo

5 Apr 2007, 4:10 PM
#11
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Well, I was able to get the HTML portion to work in 1.3.7 see code below which partially came from a different post but I had to manually insert the Titles:.

$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']] && $GLOBALS[$payment_class]->email_footer != '') ? $GLOBALS[$payment_class]->email_footer : $this->info['cc_type'] . "Account Name: " . $this->info['account_name'] . "<br>Account Number: " . $this->info['account_number'] . "<br>PO Number: " . $this->info['po_number'] ); 

But I was not able to get it to work with the text formatted email that I would prefer to send to the customer.

Still working on it. If anyone has any :unsure: advise:unsure: , please feel free to post.

Thanks,
Slabadoo

Slabadoo

5 Apr 2007, 7:40 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: Merlin's Purchase Order Module

Going STRICTLY from your last post, in your purchase order payment module, if you want the info to be passed on in the email, you need to set this:

$this->email_footer = "Account Name: " . $this->info['account_name'] . "<br>Account Number: " . $this->info['account_number'] . "<br>PO Number: " . $this->info['po_number'];

You might need to adjust it somewhat to deal with line breaks more effectively.

.
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.

5 Apr 2007, 8:19 PM
#13
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Any idea where about's that line of code would be placed?

Thanks,
Slabadoo

Slabadoo

5 Apr 2007, 8:38 PM
#14
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

Actually, I see where I am supposed to put it. I slapped it in there and did a test. Now I do get the three titles but the info from the forms are not in the text email. Like I was saying, I do have it working for html, strugleing with the test email. Any other recomendations, Am I still missing a key piece, Very possible...

Thanks,
Slabadoo

Slabadoo

5 Apr 2007, 9:18 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: Merlin's Purchase Order Module

This line in order.php does the text emails:$email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" : '';This line does the HTML emails:```
$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']] && $GLOBALS[$payment_class]->email_footer != '') ? $GLOBALS[$payment_class]->email_footer : $this->info['cc_type'] );

.
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.

6 Apr 2007, 9:14 AM
#16
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Merlin's Purchase Order Module

I'd suggest checking the order table in your database to see whether you have any values for account_name, account_number and po_number stored in the order data. i.e. whether anything is getting passed out from the payment module when the data is entered.

6 Apr 2007, 1:20 PM
#17
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

This reply is for both Chuckl & DrByte:

Chuckl, Yes, the data is getting passed to the db & I have no problem recieving the correct info througn html email. My delima is the text email is not sending the three PO values. I can get it to show the titles i.e. Account Name:
Account Number:
PO Number:
but no data form the db is getting put in it.

DrByte, The code you provided is different then the code I have in my orders.php. The only code that is close to your suggestion is this:

      
      $email_order .= $GLOBALS[$payment_class]->title . "\n\n";
      if ($GLOBALS[$payment_class]->email_footer) {
       $email_order .= $GLOBALS[$payment_class]->email_footer . "\n\n";

Which is not a one liner!

Like i was saying ealier, I am using 1.3.7. So, my goal is to get them both working. Any More Suggestion:mellow:

Once again....Thanks,
Slabadoo

Slabadoo

6 Apr 2007, 1:52 PM
#18
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Merlin's Purchase Order Module

I suspect your email footer contains only the text 'With the following information'.

If so, try changing

$email_order .= $GLOBALS[$payment_class]->email_footer . "\n\n";

to

$email_order .= $GLOBALS[$payment_class]->email_footer . "\n\n". "Account Name: " . $this->info['account_name'] . "\nAccount Number: " . $this->info['account_number'] . "\nPO Number: " . $this->info['po_number'] ;

or similar.

6 Apr 2007, 2:27 PM
#19
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

That worked for text email but now the html doesn't show values or titles? I am able to get the titles into the html then it duplicates in the text email. Here is what I had to put into line 25 in my po.php to get the html to work in the forst place:

   $this->email_footer = (is_object($GLOBALS[$_SESSION['payment']] && $GLOBALS[$payment_class]->email_footer != '') ? $GLOBALS[$payment_class]->email_footer : $this->info['cc_type'] . "Account Name: " . $this->info['account_name'] . "<br>Account Number: " . $this->info['account_number'] . "<br>PO Number: " . $this->info['po_number'] ); 

Like I was saying, the result html with this in po.php is titles but no data & for text email it comes to me like this:

Payment Method

Purchase Order
Account Name: Account Number: PO Number:
Account Name: Account Number: PO Number:
Account Name: 44
Account Number: 44
PO Number: 44

Got any magic left?
Slabadoo

Slabadoo

6 Apr 2007, 2:48 PM
#20
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Merlin's Purchase Order Module

OK, now I have it working in both html and text! The only think I need to do now is remove the redundancy:

Payment Method

Purchase Order
Account Name: Account Number: PO Number:
Account Name: Account Number: PO Number:
Account Name: 222
Account Number: 333
PO Number: 444

Perhaps it's is the po.php code???

Slabadoo