Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Controller v1.0


{CT}Rodent

Recommended Posts

Order Controller v1.0

 

This contribution allows you to:


  • Batch Print Invoices
    Utilising your current 'invoice.php' file (as you may have edited it with logo and other information) for each invoice. This contribution uses CSS page breaks to create seperate pages for printing.

  • Batch Print Packing Slips
    Utilising your current 'packingslip.php' file for each.

  • Batch Deleting Orders

  • Batch Status Change
    Including the ability to notify the customer.

  • Default Status Comments
    Include default comments per status added via the admin 'Order Status' menu.

  • Comments / Order Details Merge
    Allows you to include certain order details in a comment automatically. e.g. "Your order number is: <OC:orders_id:OC>." will be "Your order number is: 407". This can include any field within the 'orders' table. This links with both the Default Status Comments and the Batch Status Change.

This contribution is partially based on the Batch Printing Without Frames, last edited by web-junkies, but is largely enhanced and modified.

Link to comment
Share on other sites

  • 2 weeks later...

hi

 

i install this in a clean copy of osCommerce Online Merchant v2.2 Release Candidate 2a and i'm getting these error messages when i try to:-

 

batch inivice

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_invoice.php on line 4

 

batch packing slip

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_packingslip.php on line 4

 

batch delete

Forbidden

You don't have permission to access /oscommerce-2.2rc2a/oscommerce-2.2rc2a/catalog/admin/< on this server.

 

 

Change Status:

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_status_change.php on line 35

 

can you please help. thanks

Link to comment
Share on other sites

hi

 

i install this in a clean copy of osCommerce Online Merchant v2.2 Release Candidate 2a and i'm getting these error messages when i try to:-

 

batch inivice

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_invoice.php on line 4

 

batch packing slip

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_packingslip.php on line 4

 

batch delete

Forbidden

You don't have permission to access /oscommerce-2.2rc2a/oscommerce-2.2rc2a/catalog/admin/< on this server.

Change Status:

Warning: Invalid argument supplied for foreach() in D:\wamp\www\oscommerce-2.2rc2a\oscommerce-2.2rc2a\catalog\admin\oc_batch_status_change.php on line 35

 

can you please help. thanks

 

In oc_batch_process.php on Lines 5 and 7 change $batch_order_nums to $batch_order_numbers.

 

I'm not really sure how this ever worked in the first place but the contribution does not allow others to post fixes, so there it is.

Link to comment
Share on other sites

  • 1 month later...

Installed this superb contribution on a pretty clean version of RC2a and after a bit of tweeking everything's working great except the batch delete function, to be honest I doubt very much if I'll ever us this feature but would like to get it working just incase.

 

The following is the error generated on oc_batch_process.php when I try to delete.

 

Warning: Invalid argument supplied for foreach() in /home/*****/public_html/****/admin/oc_batch_delete_confirm.php on line 35

 

any help much appreciated.

 

Just one other little note I had to disable the admin login routine to get the automatic comments to work when updating an order, this wasn't really a problem though as I found several admin side modules wouldn't work with the login feature enabled and I have just protected the admin in .htaccess as before.

 

Nigel

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Great contri, installing was even for me not so difficicult.

Only have one problem now: in email status change, the orderdate is not shown anymore. Code seems fine, but probably isn't. Anyone an idea how this might come?

Edited by irvi
Link to comment
Share on other sites

  • 2 weeks later...
There's a problem with coments that have accents in it.

For example if the comment is "Comentário", when I update the status in the detail view the comment text will be "Coment?o". The "ári" part is missing and has a ? instead...

 

Can someone fix this problem?

 

After updating with the comment wrong, the next time i enter the detailed view the text in the comment box is correct, but is wrong in the order history box.

 

I guess the problem is on the function displayDefaultComments in general.js.

 

I'm no expert in Javascript, can someone help?

Link to comment
Share on other sites

  • 3 weeks later...

The issue above relates to PHP short_tags. Now fixed and new package uploaded, however only 1 file needed changing.

 

OPEN

/catalog/admin/oc_batch_delete_confirm.php

 

FIND

<form name="delete" action="<?=$_SERVER['PHP_SELF']?>" method="post">

 

REPLACE WITH

<form name="delete" action="<?php echo $_SERVER['PHP_SELF']?>" method="post">

 

 

Accentuations! This problem also now solved and 1 file to change.

 

OPEN

/catalog/admin/oc_status_default_comments.php

 

FIND

echo $result['orders_status_default_comments'];

 

ADD BEFORE

header("Content-Type: text/html; charset=iso-8859-1");

Link to comment
Share on other sites

Hi,

 

thanks for your help. Accentuation is now fixed! But the batch delete still doesn't work, but now with a different behaviour. After the confirmation to delete those orders, it says that they were deleted but when I go back to the Orders page they are still there, even after refrenshing the page. I have Register Globals disabled, don't know if it's related...

 

Br

Pedro

Link to comment
Share on other sites

Thanks for this great contrib, I waited years for something like this! Very time-saving contribution!!

 

But is it possible to open the oc_batch_status_change.php instead of in a new window, to open it in a popup window?

 

It gets a little bit annoying me when it opens always a new window, a popup would be much better. I tried several things, the popup also gets opened, but there are no data redirected from the order.php, so nothing happens in the popup.

 

<script type="text/javascript">

 var attribWithoutAll="location=no,menubar=no,toolbar=no,status=no";
 attribWithoutAll+=",resizable=no,scrollbars=no,width=450,height=200";
 var subwindow=0;


 function box()
 {
 subwindow=window.open("oc_batch_process.php","popup",attribWithoutAll);
 subwindow.moveTo(10,50);

 }
 </script>


<?php echo tep_draw_form('batch_orders', 'oc_batch_process.php', '', 'post', 'onsubmit="box();"'). "\n"; ?>

 

Here is my ineffective attemp, does someone know how this can be realised that it works?

 

Thx a lot,

Luke

Link to comment
Share on other sites

  • 2 weeks later...
Hi,

 

thanks for your help. Accentuation is now fixed! But the batch delete still doesn't work, but now with a different behaviour. After the confirmation to delete those orders, it says that they were deleted but when I go back to the Orders page they are still there, even after refrenshing the page. I have Register Globals disabled, don't know if it's related...

 

Br

Pedro

 

I finnaly found the problem!! For people that don't use short tags must also change another line in oc_batch_delete_confirm.php:

 

find:

<td class="dataTableContent"><input type="hidden" name="order_nums[]" value="<?=$oID?>"><?php echo $oID; ?></td>

 

replace with:

<td class="dataTableContent"><input type="hidden" name="order_nums[]" value="<?php echo $oID ?>"><?php echo $oID; ?></td>

 

Regards

Link to comment
Share on other sites

Thanks for this great contrib, I waited years for something like this! Very time-saving contribution!!

 

But is it possible to open the oc_batch_status_change.php instead of in a new window, to open it in a popup window?

 

It gets a little bit annoying me when it opens always a new window, a popup would be much better. I tried several things, the popup also gets opened, but there are no data redirected from the order.php, so nothing happens in the popup.

 

<script type="text/javascript">

 var attribWithoutAll="location=no,menubar=no,toolbar=no,status=no";
 attribWithoutAll+=",resizable=no,scrollbars=no,width=450,height=200";
 var subwindow=0;


 function box()
 {
 subwindow=window.open("oc_batch_process.php","popup",attribWithoutAll);
 subwindow.moveTo(10,50);

 }
 </script>


<?php echo tep_draw_form('batch_orders', 'oc_batch_process.php', '', 'post', 'onsubmit="box();"'). "\n"; ?>

 

Here is my ineffective attemp, does someone know how this can be realised that it works?

 

Thx a lot,

Luke

 

Hi Luke,

 

I'm not an expert on PHP and HTML, but have you tried to do the popup window like the one from the products image?

 

Insert in the header:

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=100, height=100, screenX=150, screenY=150, top=150, left=150')
}
//--></script>

 

And then where you want to open the popup:

<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' TYPE THE LINK TO THE WINDOW HERE ">' . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' TYPE THE LINK TO THE WINDOW HERE '" target="_blank">' . '</a>'; ?>
</noscript>

 

It's just an idea, don't know if it works...

 

Regards.

Link to comment
Share on other sites

  • 3 months later...

Thanx for this nice contribution.

 

There's only one problem, while i edit an order and changing the orderstatus, the commenttext disappears.

If i change status first and then type some comments then the comments doesn't disappear.

 

Is there a simple way to fix this.

 

Greetz.

Quickfoxz

Link to comment
Share on other sites

  • 5 months later...

Thanks for your wonderful contribution!

I currently can not use it myself because I am printing every invoice/slip 4 pages per sheet on a duplex printer (ie. 4 pages per side of the paper x 2 sides = 8 pages per sheet) so it prints several customers' orders on each sheet (if the orders are small). Is there any way to make it force sheet break (so it will print a new sheet at the end of each invoice), rather than a page break? or is there any other solution? I really would love to use this contribution if it works for me, any help would be most appreciated!

 

Thanks in advance!

Link to comment
Share on other sites

  • 4 months later...

Great contribution, that worked without any adjustments, I only found one problem that I cant solve.

 

When batch printing invoices the first one looks great, with full width on the page, the second page hasn´t the same width as the first and so on, so once printing five or more pages the last ones are quite small and narrow.

 

Anyone who has a solution to the problem?

Link to comment
Share on other sites

  • 3 months later...

Hi there, this looks to be the perfect contribution for me. I've managed to get almost everything working however when I run the packing slips. It almost finishes the first one and then gives me the following message

 

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /tmp) in /home/site/public_html/admin/includes/functions/sessions.php on line 100

 

I am including a separate file onto the packing slip showing our latest special offers.

Link to comment
Share on other sites

  • 1 year later...

i installed this on a 2.3.1 site and it's working fine so far. i had to make one change to get the CSS page breaks to work, at least with Chrome on a Mac - i changed the BR tag to an empty DIV:

 

oc_batch_invoice.php: echo '<div style="page-break-before:always;" clear="all"></div>';

oc_batch_packingslip.php: echo '<div style="page-break-before:always;" clear="all"></div>';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...