Tips and gratuities are not common in e-commerce retail. But brick-and-mortar stores with a face-to-face environment are more complex in their client interactions by their nature. I fully realize that my shop is highly unique in its service line offerings - but it's this uniqueness that has led us to using Drupal Commerce for our e-commerce needs. The high level of options to customize the interface has been an invaluable resource.
Example Use Case:
In my shop, we sell retail products from the counter, but my shop is also a coffee-shop as well as a leather repair shop/service center all combined into one. Clients frequently leave tips for the barista, but not always. When clients drop off their leather clothing for alterations or repairs, once they pick up the completed project, they sometimes leave a tip for the leather-worker or seamstress who fixed their clothing. These tips are optional and are added to the credit card charge by the client when they are being rung up for the work or their coffee drink.
Cash tips are inconsequential - that's a bookkeeping issue that's tracked separately. What would need to be captured is the tips that clients write in or type in on credit card receipts.
I realize Commerce POS wasn't necessarily designed with the quick-serve restaurant or coffee-shop in mind, but my gut says this might actually not be too difficult. It might be something as simple as a custom "Gratuity" line-item on the order - or it might be more complicated than that. Perhaps a submodule ("POS Gratuity" or similar?).
This also might be more appropriate for a custom work request. I'm not a developer so I don't have a strong grasp of the depth of work that adding something like this might be. If I knew how to code it myself I would! But I don't have the skills. :(
Comment | File | Size | Author |
---|---|---|---|
#29 | commerce_pos_gratuity_29.png | 19.16 KB | cbildstein |
#29 | commerce_pos_gratuity_29.patch | 291.52 KB | cbildstein |
#28 | commerce_pos_gratuity_28.patch | 318.13 KB | smccabe |
#24 | commerce_pos_gratuities_final3.patch | 347.73 KB | Anonymous (not verified) |
#23 | Screenshot from 2017-05-05 11-58-30.png | 3.65 KB | smccabe |
Comments
Comment #2
TynanFox CreditAttribution: TynanFox as a volunteer commentedComment #3
TynanFox CreditAttribution: TynanFox as a volunteer commentedComment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedThis is an interesting feature request. Most POS applications are built with a specific payment gateway in mind, but Drupal Commerce supports numerous payment gateways. My point in this is gratuity is usually added on after the card has been swiped. But it seems like to do that, any gratuity module would have to have specific coding support for specific gateways which can make things more complex. For example, Authorize.net could be set up to authorize an amount for 20-25% higher than the actual sale price, then the tipped amount is captured later after they enter it.
To simplify things though, it sounds like the best way to do it is to add the tip BEFORE swiping the card / accepting cash.
I envision a UI like the ones we see at various food trucks these days, which allows the user to quickly select 5, 10, 15, 18, 20 etc as their tip percentage. This would then add a line item to the order for the tipped amount. Alternatively we could add an order total price component to house the tip. Not sure which would be easier at this point. I'll give it a swing and see what I can come up with.
Comment #5
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedI have thoughts on a few different scenarios.
Maybe finishing an order would require either the total owing to be $0 or if negative, for there to be enough total cash payments to give change back. Otherwise you'd have to resolve the difference by recording a gratuity or fixing a mistake you made in the payment amounts you entered.
Gratuities seem like they'd make a pretty simple line item type we could add to the order.
** The Paymentree module doesn't support tips but Paymentree will return that information so we could add support to commerce_pos_terminal and commerce_paymentree.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedWhat I'm leaning towards doing right now is building a submodule called Commerce POS Gratuity and have it have basically the same functionality as the Commerce POS Discount module, allowing the cashier to add an arbitrary amount to an order (in the form of a gratuity line item) and have that just get added in to the total. It would have a very similar UI and workflow to the way the Discount module works right now (a button under the Pay button to add a Gratuity).
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedI have submitted a PR with the approach I was originally envisioning: https://github.com/AcroMedia/commerce_pos/pull/29
Allows the adding of a gratuity line item to a POS transaction order.
This is the approach I was originally planning on, which adds a button under the Pay/Park/Void section to add a Gratuity. This may not be the best way, but it works at least.
I was already half-way through this when @travis-bradbury suggested we take a different approach and add a way for the commerce_pos_terminal module to add gratuities for debit/credit cards, and have an apply change button for tips if they pay in cash. This adds the tip 'after the fact' instead of before payment is requested.
I'm planning on building another branch to explore this other approach, but figured I would at least put this PR up for review as well. I anticipate that I'll be able to re-use a good portion of this code and maybe even combine the two approaches (allowing for adding a gratuity before or after payment).
Comment #8
travis-bradbury CreditAttribution: travis-bradbury at Acro Commerce commentedTo expand on that - there's two ways to pay with credit/debit. One involves the terminal submodule and a semi-integrated payment terminal. The POS and the terminal would communicate, allowing us to automatically know that a gratuity was added.
Without that sub-module you're just using payment methods from commerce_cop to say you took a credit or debit payment. That couldn't involve commerce_pos_terminal since it's probably not even installed.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedI've added a new feature to the PR that now allows you to automatically apply any Change for an order as a gratuity after payment.
https://github.com/AcroMedia/commerce_pos/pull/29
This should support the majority of use-cases. I'd still like to eventually pursue an integration with the commerce_pos_terminal module, but that will have to be a phase 2, and should probably be tracked in another issue.
Comment #10
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedGet this error if i try to pay without setting up a payment gateway, edge case i know, but shouldn't error.
Also I lose the gratuity option once I hit pay but before I hit finish, it would be really nice if I could still add it then? I dunno if that might be difficult with totals and such, but it would be really nice to add a gratuity later in the flow, since you likely won't know that until the customer pays.
Otherwise functionality seems to work just fine for me. It would be nice to have a gratuities report, but that probably warrants it's own issue.
Comment #11
jjpoole CreditAttribution: jjpoole commentedHere's the solution Shawn and I came up with.
Gratuity button that would function similarly to the Discount button. But should only be on the Pay page.
Tip icon (coffee cup) that will immediately apply the change as a gratuity.
Comment #12
TynanFox CreditAttribution: TynanFox as a volunteer commentedWow, that all looks really sleek guys, thanks for taking a look at this!
I will apply the patch to my dev site and test it out.
Just to note, at my shop we do not integrate our CC terminals with the Point-Of-Sale. This makes our PCI compliance much easier, at the expense of my baristas/sales associates having to double enter everything (once on the point of sale, then again on the stand alone terminal) but considering how small a business I run, it's just not worth the time pain and expense to integrate the two for a small operation. Maybe when we grow bigger. :) Point being, terminal or Paymentree integration won't be necessary for my specific use case - I was simply more interested in getting the cash drawer reports to balance out.
That is to say, when a client leaves a credit card tip, the barista who received it immediately pulls the CC tip as cash from the drawer. So at the end of the shift, ideally, the CC terminal batch-out total should equal Sales+Tips/Gratuities, and the cash drawer count should add up to Sales-Tips/Gratuities. (My baristas report their tips to me in an Excel sheet - employee tip reporting would likely be outside the scope of this project.)
I haven't looked deep into the patch yet, but was this considered when developing it?
Comment #13
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedYes, this patch is specific to manual tips and doesn't handle integration with a payment terminal, which will probably be handled in a totally separate issue.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedI refactored the PR to be more in line with what Shawn was thinking. It still needs more styling and design work to match the concepts submitted by jjpoole, but I'm submitting this now because it works functionally and can be tested. I'll submit another patch with the styling changes hopefully later tonight or tomorrow.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedPosted the wrong patch. Here's take 3 with some changes to order of elements.
Comment #16
thejacer87 CreditAttribution: thejacer87 at Acro Commerce commentedalmost everything looks good, one issue with the max gratuity though.
the logic for validating when clicking the 'add as gratuity' button was broken (see gifs).
i fixed that logic, though im not sure why there are two separate spots for the validation. and strangely, if you open up the hidden gratuity menu but then click the 'add as gratuity' button, both validations get called for some reason ( i assume bcuz something is submitting both buttons)
Comment #17
thejacer87 CreditAttribution: thejacer87 at Acro Commerce commentedah stupid sass change got in
Comment #18
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedInitial review from Jacer finished, flipping this back to needs work now for the last of the graphical changes
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedI've reviewed the patch and it looks good. Thanks thejacer87!
I'll work on the graphical changes more.
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous commentedI got all of the styling knocked out (see screenshot) and incorporated the fixes from the patch above. Here's the final patch, ready for review.
Also sorry but whenever I run npm build the map file looks a bit different from the style before, but I'm attaching it here regardless. Seems to work functionally.
Comment #21
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedComment #22
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedRerolled patch against newest dev
Comment #23
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedStyling on the gratuity buttons and form is off, compare with the mockup jason did, buttons and text box are wrong sizes. Otherwise everything seems good.
Comment #24
Anonymous (not verified) CreditAttribution: Anonymous commentedHmmm, that's odd. I rebased it just now and tried it on Firefox, Safari, and Chrome, desktop and mobile and they all looked good. See screenshots. Can you let me know which browser you are on? Also, did the CSS get generated correctly?
Here's a re-rolled patch.
Comment #25
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedTested with re-rolled patch in chrome and ff on ubuntu and in edge and chrome on windows 10 and get same display as my previous screenshot. Are you sure the right changes are getting bundled into your patch?
Looking over the patch, The only sass change I see is a single margin change, nothing else. Also, your patch is actually 8 separate patches, looks like you're generating a patch for each commit instead of the more standard "all in one" patch.
Comment #26
Anonymous (not verified) CreditAttribution: Anonymous commentedHmm, there's definitely more CSS changes than just that. I was adding .patch to the PR (https://github.com/AcroMedia/commerce_pos/pull/29) to generate that patch, so I guess that's how Github does it. I'm attaching a patch created from my PHPStorm to see if it is any different for you. I tested applying it against the latest dev and it worked still.
Comment #27
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #28
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedSlight reroll as patch didn't apply against newest master.
Comment #29
cbildstein CreditAttribution: cbildstein at Acro Commerce commentedDid a bit of CSS cleanup. New patch attached.
Comment #30
Anonymous (not verified) CreditAttribution: Anonymous commented@cbildstein - The CSS changes look fine to me. Thanks.
Comment #32
smccabe CreditAttribution: smccabe as a volunteer and at Acro Commerce commentedBoom! Merged this baby in! Thanks to everyone who helped build this functionality, with special thanks to wildkatana who did the bulk of the work. Great job!
Comment #33
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #35
TynanFox CreditAttribution: TynanFox as a volunteer commentedThis is awesome!
I'm sorry it took me so long to take a look at this - January-May is my busiest time of year at the shop.
But once again thank you all! :)