Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] osC-PrintOrder with Store Logo v1.0


Guest

Recommended Posts

This contribution will add a Print Order Button to the Checkout Success page, as well as the Acccount History Info page, so your customers can have the option of Printing a copy of their order(s).

 

When the Print Order button is clicked, a JavaScript PopUp Window will be displayed with the customers Order Information. From this window, the customer can easily click on the Print Button to print a copy of the Order

 

It also adds this same functionality to osCAdmin for the Store Administrator in both the Customers and Orders sections for printing Order Invoices and Packing Slips. It makes the Invoices and Packing Slips MUCH MORE presentable!

 

I have also included the My Store Logo v1.1 contribution, which places a new configuration option in osCAdmin --> My Store, and will allow you to easily control the Store Logo Image which is displayed in both the Catalog and in osCAdmin from a single location.

 

Currently, if you want to change the Store Logo in the Catalog, you have to edit the header file in the "includes" directory. If you want to display the

Store Logo in osCAdmin, you have to edit at least four other files.

 

I hope you like this contribution!

 

If you have any questions or issues, please post them in this thread.

 

Good Luck!

 

-R

Link to comment
Share on other sites

  • Replies 165
  • Created
  • Last Reply

Top Posters In This Topic

I installed thsi contribution however i have 2 problems

 

Problem 1:

In the admin section, when i go to an order it shows the following on the top

$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '');

 

Problem 2

the order printable button in checkout has no image, and also when i click on it, the pop up window says file not found.

 

All jhelp will be appreciated

Link to comment
Share on other sites

Opps... sorry... :oops:

 

Looks like I missed something in the readme installation instructions...

 

In admin/orders.php, the replacement line of code should be this...

 

        <td colspan="2" align="right"><?php echo '<a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

As for your Checkout Print Order issue...

 

Make sure that you have updated the catalog/includes/FILENAMES.PHP or APPLICATION_TOP.PHP (this depends on your snapshot version) with the FILENAME defines in the instructions. It sounds like that part was missed.

 

I didn't include a Print Order button because, personally, my buttons look a bit different, and because there are so many button sets now available, thanks to "El Bavaro", its easy enough to open the button template file and create your own.

 

I hope that answers your questions.

 

Let me know if you have any further questions or issues.

 

-R

Link to comment
Share on other sites

I replaced the above lines, however now i get a pass error

 

I replaced

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

 

with

 

<td colspan="2" align="right"><?php echo '<a href="java script:popupWindow('' . (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="java script:popupWindow('' . (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

Link to comment
Share on other sites

I think you have something confused...

 

This is the way the installation should read orders in admin/orders.php...

 

Locate the following line of code - (unmodified version of file - Line#312)

        <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

And replace with this...

        <td colspan="2" align="right"><?php echo '<a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

**********

 

Locate the following line of code near the end of the file - (unmodified version of file - Line#402)

        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

And replace with this...

        $contents[] = array('align' => 'center', 'text' => '<a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

Let me know.

 

-R

Link to comment
Share on other sites

okay... try this...

       <td colspan="2" align="right"><?php echo '<a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . ($oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

Let me know.

 

-R

Link to comment
Share on other sites

Did that and it brought the following error

 

Parse error: parse error in /homepages/37/d71334475/htdocs/catalog/admin/orders.php on line 319

 

 

This is the code, plus the before and after code, just incase i accidently deleted a letter or something

 

</tr>

</table></td>

</form></tr>

<tr>

<td colspan="2" align="right"><?php echo '<a href="java script:popupWindow('' . (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERs_INVOICE) . '</a><a href="java script:popupWindow('' . (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . ($oInfo->orders_id) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERs_PACKINGSLIP) . '</a>');

</tr>

<?php

} else {

Link to comment
Share on other sites

okay... I found the syntax error... try this one...

        <td colspan="2" align="right"><?php echo '<a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_INVOICE) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '')">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a><a href="javascript:popupWindow('' .  (HTTP_SERVER . DIR_WS_ADMIN . FILENAME_ORDERS_PACKINGSLIP) . '?' . (tep_get_all_get_params(array('oID')) . 'oID=' . $HTTP_GET_VARS['oID']) . '')">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a><a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

That should do it for you.

 

Let me know so I can update and re-upload the contribution files.

 

Thanks.

 

-R

Link to comment
Share on other sites

I have uploaded a new version with the corrections...

 

osC-PrintOrder with Store Logo v1.1

http://www.oscommerce.com/community/contributions,1285

 

Fixed a few minor syntax errors in the installation instructions of the README during the file modifications of both admin/orders.php and catalog/checkout_comfirmation.php files.

 

Please note...

 

I HAVE NOT included a Print Order Button in this contribution because there are so many different button sets that are now available. You can easily create the Print Order Button using the Button Template file that comes with osC in the EXTRAS directory. Just open the .PSD file in PhotoShop.

 

If you happen to be using an osC Button Set created by "El Bavaro", open the button_empty_template_medium.gif file and add the text "Print Order" to the image.

 

Save the image as button_printorder.gif and place it in the

catalog/includes/languages/english/images/buttons directory

 

BUTTON FONT NAME - IMPACT

BUTTON FONT SIZE - 14 or 15

Link to comment
Share on other sites

Go back and check the changes that you made to catalog/checkout_success.php.

 

Also, could you please post what lines code you have on LINES 110 - 120 of your checkout_success.php?

 

-R

Link to comment
Share on other sites

When I use this code I get this error

 

<tr>

<td align="left" class="main"><?php echo '<a href="java script:popupWindow('' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_ORDERS_PRINTABLE) . '?' . (tep_get_all_get_params(array('order_id')) . 'order_id=' . $HTTP_GET_VARS['order_id']) . '')">' . tep_image_button('button_printorder.gif', IMAGE_BUTTON_PRINT_ORDER) . '</a>'; ?></td>

<td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

</td>

 

Parse error: parse error, unexpected $ in /home/mrsfield/public_html/checkout_success.php on line 173

 

If I delete the $ I get this..

 

Parse error: parse error, unexpected '[' in /home/mrsfield/public_html/checkout_success.php on line 118

Link to comment
Share on other sites

I just tested with the code you posted and it works fine for me.

 

Maybe you could email me your checkout_succes.php file and I could take a look at it.

 

-R

Link to comment
Share on other sites

ok randy here is a copy of my last email :o

 

1.well for the "os commerce" in the title i had to define the title in the language file adminincludeslanguagesenglishpackingslip.php

and also

define('TITLE_PRINT_ORDER', 'Impression du Bon de Commande')

 

I think u should add it to the install.txt since my problem was not of the php code but the defining of the variable

 

2.An advice because the "order#" was hard coded in your php file and don't let people make their own translation:

 

in adminincludespackingslip.php

replaced

<td colspan="2" align="center" class="titleHeading"><b><?php echo 'Order#' . $HTTP_GET_VARS['oID']; ?></b></td>

 

by

<td colspan="2" align="center" class="titleHeading"><b><?php echo ORDER_NAME . $HTTP_GET_VARS['oID']; ?></b></td>

 

and define in the language file : adminincludeslanguagesenglishpackingslip.php

 

define('ORDER_NAME', 'Order # ');

 

3. same for adminincludesinvoice.php

 

<title><?php echo TITLE . ' - ' . TITLE_PRINT_ORDER . ' #' . $HTTP_GET_VARS['order_id']; ?></title>

by

<title><?php echo TITLE . ' - ' . TITLE_PRINT_ORDER . $HTTP_GET_VARS['oID']; ?></title>

 

and as you see the $HTTP_GET_VARS['oID'] works while the $HTTP_GET_VARS['order_id'] doesnt why ?

 

By the way this contribution is exciting , i spent 5 hours on it ... so that means it very interesting :wink:

[/code]

MS2

Link to comment
Share on other sites

randy , 2 requests :

 

1. being able to set in the admin the 3 images : the header, the admin and the invoince if we want them to be different

 

2. could u send me the close_window.jpg file , i didnt find it ly shopor even in the zip file ?

MS2

Link to comment
Share on other sites

you can put the variable in session if you prefer (don't forget to delete it after in the process) but i don't think it's a security issue, you can only see YOURS order... try to put a order number you're not agree to see... you will get only your account history :P

 

;)

Link to comment
Share on other sites

but i ask one more time why this contribution has been post as a original one... it's only a making with two originals contributions existing.

 

Is it only to propose a paypal donation?? :?

 

Can a moderator explain us if it's a normal practice :?

Link to comment
Share on other sites

Normal practice is, like mentioned on the Contribution section, to upload your improved version to the existing "thread".

All original credits must be honoured and you can add yours.

 

Hope this helps,

 

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

The following error appears in my browser after clicking on the print button:

 

Warning: main(includes/languages/english/printorder.php): failed to open stream: No such file or directory in /home/pinegard/public_html/oscommerce/printorder.php on line 31

 

Fatal error: main(): Failed opening required 'includes/languages/english/printorder.php' (include_path='') in /home/pinegard/public_html/oscommerce/printorder.php on line 31

 

I am running 2.2 ms1

I am also running CVV Credit Mod 1.23a and header tags v2 with the admin controller.

 

What causes this error.

 

Thanks

 

Jeff :?:

Link to comment
Share on other sites

The error seems to be calling a function call "main()" from the printorder.php language file on line 31. Looking at my original, there isn't a line 31 in that file. Have you modified the language file in any way? Check your syntax.

 

Good Luck.

 

-R

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