Results 1 to 10 of 46

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    Rockford, IL
    Posts
    59
    Plugin Contributions
    1

    Default Re: Purchase order module

    The best way I have found to prevent modules from overridding other modules that I have installed is to check the files themselves.

    If...

    /thisfolder/thatfolder/blahblah.php

    is a file that is used in both modules then I look at the one that is not currently installed and check to see what it changes in comparison to:
    1. the orginal zen-cart file of that name and location and,
    2. the currently used zen-cart file of that name and location.

    I have generally found that payment option modules rarely upset other payment modules, however, most modules are written to be an improvement over the base zencart install. Hence, they do not, nor can they really, take into consideration every single different module out there, past, present and future.

    Most importantly....BACKUP BACKUP BACKUP....Oh and did I mention BACKUP!

    Backup your files and your database prior to installing any new modules! I have had to kick myself in the before, for not doing that.

  2. #2
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Purchase order module

    Everything worked out very well - Thanks.
    My one issue (my wife might beg to differ) is that the Purchase Order add-on includes an account number field and I don't use them. Anyone know how to remove the field from the form?

  3. #3
    Join Date
    Nov 2010
    Posts
    44
    Plugin Contributions
    0

    Default Re: Purchase order module

    Hi, I have Purchase Order module 3.12 and Zen Cart 1.3.9h

    I am struggling for a way to add total order weight and total order value to the .pdf P.O. that this mod can send by email. And I would really appreciate some help with this. The data for these two things cannot be far away from the product model and quantity data that this .pdf already contains concerning a single Purchase order.

    Please, Stuart, Linda anyone who knows?

  4. #4
    Join Date
    Feb 2011
    Posts
    2
    Plugin Contributions
    1

    Idea or Suggestion Re: Purchase order module

    First off, thanks to those who have posted code changes (HTML_POST_VARS to _POST, flakrats suggestion for changing the Order.php email section). I just spent 6 hours with these two old modules on a Zencart v1.3.9d install.

    They are both too old to try and install right onto a newer version of Zencart - replacing core files may seem to work at first, but you may find that they will not show the Account Name, Account Number, or PO Number - they won't even save in the database. Just don't bother.

    If you have a good text file comparison tool like Beyond Compare, you can quickly look at what this module is trying to do compared to the new way that Zencart works. You will also see that replacing core files will not work. From here you must edit the NEWER zencart files so that they will perform as desired, only copying that which is necessary for the Purchase Order Module. All of the other non-core files may simply be copied over.

    I'm not a real good PHP programmer, but I'll go ahead and post the file changes under Knuckle's version - it may be a starting point for some of you, at the very least the three bits of data, Account Name, Account Number, and PO Number save and the emails work so it is still useful.

  5. #5
    Join Date
    Mar 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Purchase order module

    Quote Originally Posted by WaterSlide View Post
    First off, thanks to those who have posted code changes (HTML_POST_VARS to _POST, flakrats suggestion for changing the Order.php email section). I just spent 6 hours with these two old modules on a Zencart v1.3.9d install.

    They are both too old to try and install right onto a newer version of Zencart - replacing core files may seem to work at first, but you may find that they will not show the Account Name, Account Number, or PO Number - they won't even save in the database. Just don't bother.

    If you have a good text file comparison tool like Beyond Compare, you can quickly look at what this module is trying to do compared to the new way that Zencart works. You will also see that replacing core files will not work. From here you must edit the NEWER zencart files so that they will perform as desired, only copying that which is necessary for the Purchase Order Module. All of the other non-core files may simply be copied over.

    I'm not a real good PHP programmer, but I'll go ahead and post the file changes under Knuckle's version - it may be a starting point for some of you, at the very least the three bits of data, Account Name, Account Number, and PO Number save and the emails work so it is still useful.
    I just installed the latest Purchase Order Module and it works well....

    .... however if you use a PO longer than 12 Characters the SQL has a fit and errors out. The easy fix was to increase the size of the po_number field in the orders table (via MySqlAdmin) but you may want to edit the SQL patch to match whatever the code says is acceptable in terms of field length :-)

  6. #6
    Join Date
    Mar 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Purchase order module

    Quote Originally Posted by otaraia View Post
    I just installed the latest Purchase Order Module and it works well....

    .... however if you use a PO longer than 12 Characters the SQL has a fit and errors out. The easy fix was to increase the size of the po_number field in the orders table (via MySqlAdmin) but you may want to edit the SQL patch to match whatever the code says is acceptable in terms of field length :-)
    I just made the following change to the po.php located in includes.modules.payment to limit the max PO Size to 14 Characters and not to check for an Account Number :-

    // class methods
    function javascript_validation() {
    $validation_string = 'if (payment_value == "' . $this->code . '") {' . "\n" .
    ' var account_name = document.checkout_payment.account_name.value;' . "\n" .
    ' var account_number = document.checkout_payment.account_number.value;' . "\n" .
    ' var po_number = document.checkout_payment.po_number.value;' . "\n" .
    ' if (account_name.length == 0) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_ACC_NAME . ' ";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    ' if (po_number.length == 0) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER . '";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    ' if (po_number.length >= 15) {' . "\n" .
    ' error_message = error_message + "' . MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER_MAX . '";' . "\n" .
    ' error = 1;' . "\n" .
    ' }' . "\n" .
    '}' . "\n";
    return $validation_string;
    }

    And then in includes.languages.english.modules.payment po.php I added a new line to describe the "Exceeds 14 Characters"

    /*
    $Id: po.php,v 1.2 2002/11/27 12:00:00 olby Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2002 osCommerce

    Released under the GNU General Public License
    */

    define('MODULE_PAYMENT_PO_TEXT_TITLE', 'Purchase Order');
    define('MODULE_PAYMENT_PO_TEXT_DESCRIPTION', 'Will you accept Purchase Order?');
    define('MODULE_PAYMENT_PO_TEXT_ACCOUNT_NAME', 'Account name:');
    define('MODULE_PAYMENT_PO_TEXT_ACCOUNT_NUMBER', 'Account number:');
    define('MODULE_PAYMENT_PO_TEXT_PO_NUMBER', 'Purchase Order Nr:');
    define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER', 'with the following information:');
    define('MODULE_PAYMENT_PO_TEXT_JS_ACC_NAME', 'You forgot to enter the account name (Company).');
    define('MODULE_PAYMENT_PO_TEXT_JS_ACC_NUMBER', 'You forgot to enter the your Account Number.');
    define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER', 'You forgot to enter your Purchase Order number.');
    define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER_MAX', 'Your PO Number Exceeds 14 Characters.');
    ?>
    Last edited by otaraia; 17 Aug 2011 at 06:15 AM. Reason: more detail

  7. #7
    Join Date
    Jul 2011
    Posts
    23
    Plugin Contributions
    0

    Default Re: Purchase order module

    I just installed this module to give it a shot and it works perfectly. My only issue is that when the email is sent through it doesn't include the Account Number and I actually do need that.

    I've searched through the code and it all seems fine and I can't figure out why it doesn't populate it in the email. I haven't changed anything from the files that were included with the module.

    Any hints or ideas of where I should look next are very appreciated

    EDIT: actually the only thing I've changed is add an ID to the input fields to add css styling. Other than that nothing has been changed.

    Code:
    function selection() {
    
          $selection = array('id' => $this->code,
                             'module' => $this->title,
                             'fields' => array(array('title' => MODULE_PAYMENT_PO_TEXT_ACCOUNT_NAME,
                                                     'field' => zen_draw_input_field('account_name' , '' , 'id="poCompanyName"')),
                                               array('title' => MODULE_PAYMENT_PO_TEXT_ACCOUNT_NUMBER,
                                                     'field' => zen_draw_input_field('account_number' , '' , 'id="poAccountNumber"')),
                                               array('title' => MODULE_PAYMENT_PO_TEXT_PO_NUMBER,
                                                     'field' => zen_draw_input_field('po_number' , '' , 'id="poPurchaseOrderNumber"'))));

  8. #8
    Join Date
    Jul 2011
    Posts
    23
    Plugin Contributions
    0

    Default Re: Purchase order module

    Nevermind guys I found the issue. Under the order.php file (\includes\classes\order.php) the account number was nixed for some reason.

    Original Code
    PHP Code:
    $email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer "\n" "Account: " $this->info['account_name'] . "\n"  "PO #: " $this->info['po_number'] . "\n\n" ''
    PHP Code:
    if ($GLOBALS[$payment_class]->title == 'Purchase Order') {
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->email_footer "<br>" "Account: " $this->info['account_name'] . "<br>" "PO #: " $this->info['po_number'] : ''); 
    My code
    PHP Code:
    $email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer "\n" "Company Name: " $this->info['account_name'] . "\n" "Account Number: " $this->info['account_number'] . "\n" "PO #: " $this->info['po_number'] . "\n\n" ''
    PHP Code:
    if ($GLOBALS[$payment_class]->title == 'Purchase Order') {
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->email_footer "<br>" "Company Name: " $this->info['account_name'] . "<br>" "Account Number: "$this->info['account_number'] . "<br>" "PO #: " $this->info['po_number'] : ''); 
    I changed the "Account:" to "Company Name:" because it makes more sense for me. I also changed it under the defining PHP files so it would make more sense for our clients.

    I can't believe I didn't see it two hours ago when I went over the damn code. Thanks anyway guys!

  9. #9
    Join Date
    Jan 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Purchase order module

    any word if someone is rewriting this for 1.5? I think there are a lot of folks left hanging...

 

 

Similar Threads

  1. Purchase Module - Purchase Order Payment Module Problem
    By keewong in forum Addon Payment Modules
    Replies: 15
    Last Post: 14 Dec 2010, 12:19 AM
  2. Replies: 0
    Last Post: 23 Jan 2009, 09:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg