Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Gratuity


16 replies to this topic

#1 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 29 March 2009, 18:28

This is the support thread for the Gratuity contribution, which provides an option on the checkout payment page where the customer can enter an amount they would like to add to the total of the order as a tip.

Jack

Edited by Jack_mcs, 29 March 2009, 18:30.


#2 kbking

  • Community Member
  • 266 posts
  • Real Name:Chris

Posted 30 March 2009, 00:06

Hi!
Let me be the first one to say thanks!

This contribution really made my day, what a good idea! :D

#3 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 31 March 2009, 03:07

Thanks for letting me know. I wasn't sure if it would be useful to anyone but I'm pleased to know it is.

Jack

#4 lwlarsen

  • Community Member
  • 6 posts
  • Real Name:Lawrence Larsen
  • Location:Naperville

Posted 06 April 2009, 02:27

I have installed the add-on and it works great in the checkout_payment.php but how can I work with the data in the checkout_process.php

I would like to know if this add-on can be used to send the tip amount to the user in the Purchase Email and what code will be needed to do this

It would also be nice if the data was added in the user order information

Thank you for any help with this project

:blink:

#5 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 06 April 2009, 03:29

The gratuity amount shows in the order and email here. Perhaps you didn't set the sort order correctly?

Jack

#6 lwlarsen

  • Community Member
  • 6 posts
  • Real Name:Lawrence Larsen
  • Location:Naperville

Posted 06 April 2009, 13:30

View PostJack_mcs, on Apr 5 2009, 10:29 PM, said:

The gratuity amount shows in the order and email here. Perhaps you didn't set the sort order correctly?

Jack
Sort order

Gratuity 5
Low Order Fee 4
Shipping 2
Sub-Total 1
Tax 3
Total 6

On screen
Billing Information

Billing Address (Edit)
Lawrence Larsen
28W166 Plainview Drive
Naperville, 60564
United States
Payment Method (Edit)
Credit Card
Sub-Total: $8.95
Delivery Rate (Local): $3.00
Sales Tax: $0.96
Gratuity: $12.00
Total: $24.91


Email

Products
------------------------------------------------------
1 x 201 Sweet & Sour Chicken () = $8.95

------------------------------------------------------
Sub-Total: $8.95
Delivery Rate (Local): $3.00
Sales Tax: $0.96
Total: $12.91

Delivery Address


Is the sort order OK I will try setting it to your 3,4,5 like in your readme

Thanks for any help
Lawrence

#7 lwlarsen

  • Community Member
  • 6 posts
  • Real Name:Lawrence Larsen
  • Location:Naperville

Posted 06 April 2009, 14:40

Hi Jack

I just setup a test system no other add-on or mods and I still get the same

order:
Gratuity 4
Shipping 2
Sub-Total 1
Tax 3
Total 6

Is this OK?

shows on screen as a $5.00 tip

and the email:

osCommerce
------------------------------------------------------
Order Number: 1
Detailed Invoice: http://oscommerce.irdelivery.com/test/cata....php?order_id=1

Date Ordered: Monday 06 April, 2009


Products
------------------------------------------------------
1 x SWAT 3: Close Quarters Battle (PC-SWAT3) = $79.99
------------------------------------------------------
Sub-Total: $79.99
Flat Rate (Best Way): $5.00
Total: $84.99


Delivery Address

What am I doing? to make it not work?

Thanks
Lawrence

#8 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 06 April 2009, 16:25

I don't know. The code in the contribution doesn't handle adding anything to the email. That is handled by the stock code. If it is working everywhere but the email and the email works for everything else, then it seems it would have to be the sort orde. But the sort order you show should work so I don't have an answer for you. It must be something related to your shop and/or your server setup though since it works here and in other shops I've installed it into.

Jack

#9 lwlarsen

  • Community Member
  • 6 posts
  • Real Name:Lawrence Larsen
  • Location:Naperville

Posted 21 April 2009, 13:39

Hi Jack

I have signed up on your server with your install of oscommerce and installed your add-on and it sitll does not work

I hope you can help
Lawrence Larsen

#10 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 21 April 2009, 16:36

That elimiates the server as a problem. It would seem you are making some mistake in the installation or setup but I can't guess as to what that is.

Jack

#11 lwlarsen

  • Community Member
  • 6 posts
  • Real Name:Lawrence Larsen
  • Location:Naperville

Posted 21 April 2009, 16:56

I used the readme.txt and checked it three times. Is this going to turn in to a pissing match or are you going to fix the problem. It looks like it only works on the sites you install it!

I worked with IBM mainframes for 22 years and have been in this position more then once. It is easy to blame the other person and let them fix your problems

Edited by lwlarsen, 21 April 2009, 16:59.


#12 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 21 April 2009, 17:26

If a problem exists, I might fix it. Pobably will given enough time. But I'm not convinced one exists in this case and since I don't work for free, no matter how nicely asked, I'm not going to troubleshoot it for you. If you find yourself in this position so many times, maybe that indicates where the problem might be?

Jack

#13 ecomeal

  • Community Member
  • 12 posts
  • Real Name:Vitaliy Vaserman
  • Gender:Male
  • Location:New York City, USA

Posted 19 May 2009, 21:17

Thanks for a good contribution.

However, I am having the same problem. Gratuity is displayed in checkout_confirmation.php, but not on the invoice.

May be it is not passed to checkout_process.php ??

Have you also modified anything else for this contribution? application_top, checkout_proocess, may be something else?

Thank you,


V

Edited by ecomeal, 19 May 2009, 21:18.


#14 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 20 May 2009, 00:28

It's written as a module which means adding its results to the order is handled by the oscommerce code. The only thing i can think of that would cause that would be the sort order.

Jack

#15 burt

  • Community Member
  • 6,765 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEVon/NULL -> get it, hardeharhar.

Posted 20 May 2009, 08:33

Jack - this also did not work for me on a clean RC2a. Didn't bug hunt as I didn't have time, sorry.
Me page.

#16 Jack_mcs

  • Community Member
  • 24,075 posts
  • Real Name:Jack
  • Gender:Male

Posted 20 May 2009, 11:49

Thanks for checking. Somehow one of the changes didn't make it into the instructions so there is a problem with it. I have uploaded a new version. The difference is in the checkout_confirmation.php file. To apply the fix, find
// load the selected payment module
and add this above it
  if (!tep_session_is_registered('gratuity')) tep_session_register('gratuity');
  if (tep_not_null($HTTP_POST_VARS['gratuity'])) {
	$gratuity = tep_db_prepare_input($HTTP_POST_VARS['gratuity']);
  }

I apologize to eveyone for the confusion I caused with this mistake.

Jack

#17 CentralMass

  • Community Member
  • 185 posts
  • Real Name:Matt Ward
  • Location:Gardner, Mass

Posted 18 November 2009, 23:59

Jack,
Just wanted to drop a note and say nice addon - I actually used it with a bit of modification to allow a candy seller to have clients be able to check a box to include an ice pack when they ship to warmer climates! With just a few changes to the text definitions in checkout_payment.php and ot_gratuity.php and this one change to make the text box a check box I was good to go!

In case anyone wants to do something similar, to make the text box into a check box change checkout_payment.php.

Change:

echo tep_draw_input_field('gratuity', tep_not_null($gratuity) ? $gratuity : '', 'maxlength="255"', false);

To:
echo tep_draw_checkbox_field('gratuity', '4', false,'');

This will make an un-checked box that will add $4 to your total (to make it checked by default, you can change the false to true).
Need Hosting? Just ask!