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 21 to 34 of 34
This thread is locked. New replies are disabled.
6 Apr 2007, 3:10 PM
#21
chuckl avatar

chuckl

Totally Zenned

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

Merlin's Purchase Order Module

As Merlin said earlier in the thread, some reassembly required, and I think it's a combination of changed core code, the use of $HTTP_POST_VARS in po.php rather than $_POST, and who knows what other factors.
Now that you have the data in the required places, I'd remove the changes one by one and see what happens in the output. That should enable you to isolate what's causing what.

6 Apr 2007, 3:35 PM
#22
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

Fixed the issue from the last post, now I am getting this in the text email:

Payment Method

Purchase Order
with the following information:
with the following information:
Account Name: 555
Account Number: 555
PO Number: 555

I tried to just get rid of the wording 'the following information:' from
```
define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER', 'with the following information:');

in the po.php english/mod/payments/po.php but then it would not show the datain the email??? I am close, just need to get rid of the double entry. I know it is here somewhere, just a matter of finding it. Any ideas? Anyone?
 
Thanks,
Slabadoo
 
 

Slabadoo

6 Apr 2007, 3:53 PM
#23
chuckl avatar

chuckl

Totally Zenned

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

Re: Merlin's Purchase Order Module

That text is indeed from MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER, and email_footer is initialised with that at the top of po.php.

I'd guess that in order.php somewhere you have something like

email_footer .= email_footer.something_else.something_other.....

or even simpler, you have inserted the corrected line and not commented out the original one.
i.e. the original

$email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" : '';

immediately followed by

$email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" . ''."Account Name:"... etc

6 Apr 2007, 6:35 PM
#24
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

Chuckl,

You were right! That did the trick though guess what, for some reason now when I do credit card as the payment all works well in html but in text, i get this for payment method:

Payment Method

Credit Card

Is the card not supposed to show like 4111XXXXXXXXX1111?

I was able to make it show Visa but that is the extent of it. Any ideas?

Once again, Thanks,
Slabadoo "I really need to put a signatur on here"

Slabadoo

6 Apr 2007, 8:12 PM
#25
drbyte avatar

drbyte

Sensei

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

Re: Merlin's Purchase Order Module

No. The confirmation emails are never intended to show any credit card information. Just the card type (ie: visa, m/c, etc)

.
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 Apr 2007, 10:08 PM
#26
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

After carefully analizing all 4 email confirmation, It's turns out that the html PO works fine if it is the only means of payment. But I am offering CC payment also now and if I choose payment as my payment type, the html email looks like this:

Payment MethodCredit CardVisaAccount Name:
Account Number:
PO Number:

I have scratched the idea of text emails and I am focusing on trying to make just the two payment methods look correct in the confirmation email. I know there must be a way to use an if statement somehow. All I want to do is hide the PO info in the email if it's a CC order and hide the credit card info if it's a PO.

I have racked my little brain until php code started oozzing out of it. "Not Pretty" PHP code every where... Eww!

OK, I'll stop whining but if there is someone out there that has a solution to this, I would be greatfull and yes, I understand that this code has been deemed broken in1.3.7 but perhaps the miracal worker is out there, just waiting for a moment like this to shine...
Thanks,
Slabadoo

Slabadoo

10 Apr 2007, 11:08 PM
#27
merlinpa1969 avatar

merlinpa1969

Totally Zenned

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

Re: Merlin's Purchase Order Module

you need to have an ( you will need to actually get the right code this is just a rough example

if $this-order->['payment_type']== po {
add the po stuff here
}else{
regular statement
}

this will show the po information ONLY if the po is chosen

Zen cart PCI compliant Hosting

11 Apr 2007, 9:12 PM
#28
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

Merlin, using the if statement and a collection of code from my self and other posts I was able to get the po to do what I needed it to do.

I now have two payment options, Credit Card and your Purchase Order Module and they now pass all the information to me in html and text email.

Starting at line 919 of the orders.php that you supplied in your Purchase Order Module, here's what it looked like before my masacar:

    if (is_object($GLOBALS[$_SESSION['payment']])) {
      $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
      EMAIL_SEPARATOR . "\n";
      $payment_class = $_SESSION['payment'];
      $email_order .= $GLOBALS[$payment_class]->title . "\n\n";
      if ($GLOBALS[$payment_class]->email_footer) {
        $email_order .= $GLOBALS[$payment_class]->email_footer . "\n\n";
      }
    } else {
      $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
      EMAIL_SEPARATOR . "\n";
      $email_order .= PAYMENT_METHOD_GV . "\n\n";
    }
    $html_msg['PAYMENT_METHOD_TITLE']  = EMAIL_TEXT_PAYMENT_METHOD;
    $html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->email_footer : '');

And then the masacar:

 // ************************BEGIN THIS CONTROLS THE TEXT EMAIL USING CREDIT CARD AND MERLIN PURCHASE ORDER MOD FOR 1.3.7*****************  
    if (is_object($GLOBALS[$_SESSION['payment']])) {
      $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
      EMAIL_SEPARATOR . "\n";
      $payment_class = $_SESSION['payment'];
      $email_order .= $GLOBALS[$payment_class]->title . "\n\n";
   
 
   if ($this->info['cc_type']){
        $email_order .= $GLOBALS[$payment_class]->email_footer . $this->info['cc_type'] ;
  } else {
  $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'] ;
   }
 // ************************END THIS CONTROLS THE HTML EMAIL USING CREDIT CARD AND MERLIN PURCHASE ORDER MOD FOR 1.3.7*****************
        
    } else {
      $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
      EMAIL_SEPARATOR . "\n";
      $email_order .= PAYMENT_METHOD_GV . "\n\n";
    }
    $html_msg['PAYMENT_METHOD_TITLE']  = EMAIL_TEXT_PAYMENT_METHOD;
    $html_msg['PAYMENT_METHOD_DETAIL'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
 
// ************************BEGIN THIS CONTROLS THE HTML EMAIL USING CREDIT CARD AND MERLIN PURCHASE ORDER MOD FOR 1.3.7*****************
 if ($this->info['cc_type']){
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']] && $GLOBALS[$payment_class]->email_footer != '') ? $GLOBALS[$payment_class]->email_footer : $this->info['cc_type'] );
}else{ 
$html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']] && $GLOBALS[$payment_class]->email_footer != '') ? $GLOBALS[$payment_class]->email_footer : "Account Name: " . $this->info['account_name'] . "\n\n" . "<br>Account Number: " . $this->info['account_number'] . "\n\n" . "<br>PO Number: " . $this->info['po_number'] );
}
// ************************END THIS CONTROLS THE HTML EMAIL USING CREDIT CARD AND MERLIN PURCHASE ORDER MOD FOR 1.3.7*****************

I added comments to make it easier. the first few lines I kept in even though they were not edited because it will make it easier for any one to determin where to begin and end.

Thanks to all for your help on this matter.
Great job!
Slabadoo:clap:

Slabadoo

11 Apr 2007, 10:01 PM
#29
merlinpa1969 avatar

merlinpa1969

Totally Zenned

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

Re: Merlin's Purchase Order Module

zip it back up and upload it to the DL section,

Zen cart PCI compliant Hosting

12 Apr 2007, 1:42 PM
#30
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

Merlin, How do you want to brand? e.g

Title:
Author:
Your File Version:
Zen Cart Version:
Category: This one I know (Payment Module)
Description:

Let me know and I will post it...
Thanks,
Slabadoo

Slabadoo

12 Apr 2007, 2:34 PM
#31
merlinpa1969 avatar

merlinpa1969

Totally Zenned

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

Re: Merlin's Purchase Order Module

Title: PO MOD
Author: slabadoo
Your File Version: 1.3.7
Zen Cart Version: 1.3.7
Category: This one I know (Payment Module)
Description: fill in what you think

Zen cart PCI compliant Hosting

31 Oct 2007, 8:34 AM
#32
webm0nster avatar

webm0nster

New Zenner

Join Date:
Oct 2007
Posts:
3
Plugin Contributions:
0

Re: Merlin's Purchase Order Module

JFYI - To get this module to insert values into the database I had to global replace $HTTP_POST_VARS with $_POST in the file po.php on a php5/mysql5 system.

1 Nov 2007, 12:51 PM
#33
slabadoo avatar

slabadoo

Zen Follower

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

Re: Merlin's Purchase Order Module

Which version of php5 was it? 5.2.4 or earlier?

Slabadoo

1 Nov 2007, 3:40 PM
#34
webm0nster avatar

webm0nster

New Zenner

Join Date:
Oct 2007
Posts:
3
Plugin Contributions:
0

Re: Merlin's Purchase Order Module

Yes sir it was v5.2.2. Thanks for the mod this one should be a built in feature.