Forums / Addon Payment Modules / Purchase Order Basic

Purchase Order Basic

Views: 12,939

Results 1 to 20 of 47
18 Jan 2012, 12:50 AM
#1
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Purchase Order Basic

After upgrading to Zen-Cart1.5, my PO program stopped working, Since I couldnt find one that worked for ZC 1.5 I created one as my client had to have one. Therefore I have just finished creating a working Purchase Order Basic Module for Zen-Cart 1.5.x.
This module allows the customer to select Purchase Order as an option for payment and then requires a PO Number be added.

Works in 1.5.x. Has not been tested in 1.3.9 but should work.

For questions comments please leave them here.

The module can be downloaded from the Free Software Addons section of Zen-Cart

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=2058

My modules: Purchase Order Basic
Mike

18 Jan 2012, 10:23 AM
#2
ray_the_otter avatar

ray_the_otter

Zen Follower

Join Date:
Jul 2010
Posts:
278
Plugin Contributions:
0

Re: Purchase Order Basic

Hi,

This looks great and something I need, but I could not find it in the downloads section.

Is there a feature to this mod like That Software Guys' 'Invoice' add-on. As I need to select which customers can pay by PO/Invoice and restrict some customers (slow bad payers) to not have this checkout option available.

Thanks
Ray

I am unable to answer any private messages for any of the add-on's I am associated with. I have migrated to other cart systems so sadly cannot offer any assistance, all the best and I hope you get your query fixed soon!

18 Jan 2012, 11:26 AM
#3
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Purchase Order Basic

sounds like a great mod, but couldn't find it either, is it awaiting approval from the zen cart team?

18 Jan 2012, 2:23 PM
#4
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: Purchase Order Basic

I just realized that it takes a bit longer than I thought once you upload it to zencart for approval.
They tell me it could take up to a week. I will make it available through another means here shortly.

I was just looking at that option about adding the ability of choosing which customers can pay with purchase orders. So that is something I will be working on shortly.

Thanks for the suggestion, please keep them coming, I will look to incorporate them.
Mike

My modules: Purchase Order Basic
Mike

18 Jan 2012, 6:07 PM
#5
tbone542 avatar

tbone542

New Zenner

Join Date:
Jan 2012
Posts:
1
Plugin Contributions:
0

Re: Purchase Order Basic

Hi Mike,

How can I get a copy of your po module?

I am new to zen cart and tried to modify the moneyorder module, however it doesn't have any input field, and I haven't yet figured out how to add it to the module and save it to the order details.

Thanks,
Tbone

18 Jan 2012, 10:50 PM
#6
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: Purchase Order Basic

I just received some great feedback from Dr. Byte.
I will need to make some quick changes to the code based on his recommendations and this should eliminate any edits and make the module better.
Please bear with me this will take about a day and I will have this online. I apologize for any delay. Working to make this right for all of us.
Mike

My modules: Purchase Order Basic
Mike

19 Jan 2012, 5:01 AM
#7
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: Purchase Order Basic

OK,
Here it is...

I have made the changes and works beautifully. I have resubmitted to Free Software Addons on ZenCart.com and it is awaiting approval.
With Dr. Bytes suggestions, this module now makes no changes to the database and no files are changed in any way.

Installation is a snap!

The module is here:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=2058

Please leave feedback and support questions in this thread.
If you are using this module and you find it helpful... please drop me a line and let me know.

Thanks
Mike

My modules: Purchase Order Basic
Mike

19 Jan 2012, 4:46 PM
#8
ray_the_otter avatar

ray_the_otter

Zen Follower

Join Date:
Jul 2010
Posts:
278
Plugin Contributions:
0

Re: Purchase Order Basic

l3ackdraft:

I just received some great feedback from Dr. Byte.
I will need to make some quick changes to the code based on his recommendations and this should eliminate any edits and make the module better.
Please bear with me this will take about a day and I will have this online. I apologize for any delay. Working to make this right for all of us.
Mike

no worries fella, no hurry. We all appreciate the effort and complexities of your tasks. I for one am just greatful the simple folk like me have the smart chaps like you leading the way!

I am unable to answer any private messages for any of the add-on's I am associated with. I have migrated to other cart systems so sadly cannot offer any assistance, all the best and I hope you get your query fixed soon!

23 Jan 2012, 11:12 PM
#10
mattee77 avatar

mattee77

New Zenner

Join Date:
Sep 2011
Posts:
52
Plugin Contributions:
0

Re: Purchase Order Basic

This works a Dream, How/where would i include some additional instructions to the customer asking to Fax/Email a copy of the purchase order. Ideally after the selection has been on made on step 3 of the checkout before the order is confirmed and sent to pending

24 Jan 2012, 12:26 AM
#11
drbyte avatar

drbyte

Sensei

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

Re: Purchase Order Basic

An easy way to do that would be by customizing the code to emulate the check/moneyorder module's field that lets the admin indicate where to send the check. And stuff that value into the $this->email_footer variable.

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

24 Jan 2012, 10:10 PM
#12
mattee77 avatar

mattee77

New Zenner

Join Date:
Sep 2011
Posts:
52
Plugin Contributions:
0

Re: Purchase Order Basic

There is a problem with the following code which shows error box if no order number is entered. It should read

define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER', 'You must enter your Purchase Order number.');
?>

24 Jan 2012, 10:14 PM
#13
mattee77 avatar

mattee77

New Zenner

Join Date:
Sep 2011
Posts:
52
Plugin Contributions:
0

Re: Purchase Order Basic

Also i require the description text below to show on confirmation (step 3), all i am getting is the title text twice (purchase order)

define('MODULE_PAYMENT_PURCHASEORDER_TEXT_DESCRIPTION', 'We Verify All Purchase Orders Prior to Shipment!.');

what is the correct code so this shows?

would it go here somewhere?

function confirmation() {

  $confirmation = array('title' => $this->title,
                        'fields' => array(array('title' => MODULE_PAYMENT_PURCHASEORDER_TEXT_PURCHASEORDER_NUMBER,
                                                'field' => $_POST['po_number'])));

  return $confirmation;
24 Jan 2012, 10:27 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: Purchase Order Basic

mattee77:

There is a problem with the following code which shows error box if no order number is entered. It should read

define('MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER', 'You must enter your Purchase Order number.');
?>

No, quite the opposite. Don't change the language file. The module itself should refer to MODULE_PAYMENT_PURCHASEORDER_TEXT_JS_PURCHASEORDER_NUMBER instead of MODULE_PAYMENT_PO_TEXT_JS_PO_NUMBER on line 66

I already reported this to Mike, but he hasn't updated the addon yet.

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

24 Jan 2012, 10:42 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: Purchase Order Basic

mattee77:

Also i require the description text below to show on confirmation (step 3), all i am getting is the title text twice (purchase order)

define('MODULE_PAYMENT_PURCHASEORDER_TEXT_DESCRIPTION', 'We Verify All Purchase Orders Prior to Shipment!.');

what is the correct code so this shows?
Try this:```
function confirmation() {
$confirmation = array('title' => $this->title,
'fields' => array(array('title' => MODULE_PAYMENT_PURCHASEORDER_TEXT_PURCHASEORDER_NUMBER,
'field' => $_POST['po_number'])[B],
array('title' => '',
'field' => MODULE_PAYMENT_PURCHASEORDER_TEXT_EMAIL_FOOTER)[/B]
));

  return $confirmation;
}

and
function before_process() {
global $order;
$order->info['payment_method'] .= ': ' . $_POST['po_number'];
[B] $this->email_footer = MODULE_PAYMENT_PURCHASEORDER_TEXT_PURCHASEORDER_NUMBER . " " . $_POST['po_number'] . "\n" . MODULE_PAYMENT_PURCHASEORDER_TEXT_EMAIL_FOOTER;[/B]
}

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

24 Jan 2012, 11:06 PM
#16
mattee77 avatar

mattee77

New Zenner

Join Date:
Sep 2011
Posts:
52
Plugin Contributions:
0

Re: Purchase Order Basic

Brilliant, thanks for that. I spent half the day trying to figure it out. It works perfecly now :clap:

6 Feb 2012, 8:43 PM
#17
blarney avatar

blarney

New Zenner

Join Date:
Oct 2005
Location:
Connectiuct
Posts:
69
Plugin Contributions:
1

Re: Purchase Order Basic

Does this module allow the client to select which customers will see that option? She understandably doesn't want all of her customers to know that is an option for certain customers.

9 Feb 2012, 6:49 PM
#18
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: Purchase Order Basic

No this module does not do that. I have received a couple of requests for such and will look into making this option available. Right now there is no completion date proposed.

My modules: Purchase Order Basic
Mike

9 Feb 2012, 8:31 PM
#19
l3ackdraft avatar

l3ackdraft

New Zenner

Join Date:
May 2005
Location:
Pennsylvania
Posts:
30
Plugin Contributions:
0

Re: Purchase Order Basic

I thought about it, and as I have received a number of requests for this same addon, I have decided I will write the changes tonight and hopefully upload tonight or tomorrow.
So stay tuned and this will be available shortly.

With this module my intent is to not have the end user modify any core files.

I will keep you posted.

Thanks
Mike

My modules: Purchase Order Basic
Mike

10 Feb 2012, 3:10 AM
#20
drbyte avatar

drbyte

Sensei

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

Re: Purchase Order Basic

Summary of what to change:

  • in the install() section add a new settings field, for which customer groups should be allowed to use it
  • in the update_status() section check whether the current customer is in one of the allowed groups, and if not then set $this->enabled = false;

Then the storeowner can manually add the appropriate customers to the appropriate group. (The group should can be set to give 0% discount if needed.)
And in the p/o module can specify that group-number as the allowed group.

Maybe consider a comma-separated list of multiple groups in the module's group field in case that's needed.
ie: if (!in_array($customer_group, explode(',', DEFINED_CONSTANT_HERE))) $this->enabled = false;

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