Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Can I automatically apply Gift Certificate balance to order on checkout?

Can I automatically apply Gift Certificate balance to order on checkout?

Locked

Started by timryan on 12 May 2010, 1:57 AM · Views: 2,876

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
12 May 2010, 1:57 AM
#1
timryan avatar

timryan

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Can I automatically apply Gift Certificate balance to order on checkout?

Hi,

I've been able to avoid having to ask how to do something as I have been able to find what I needed on here! Until now...I can't seem to find any related threads to my question, and I am stumpted trying to figure it out myself. So ANY help will be appreciated!

In relation to Gift Certificates, I want to change how it gets applied to the customers order. Currently, the customer has to manually apply what amount they want to use from their available balance on the Checkout page, which then get's updated on the Confirmation page.

Now, I find it a little silly, and an extra step for the customer to have to apply it themselves. My question is, is there a way to insert coding to automatically apply their available gv amount when they checkout their shopping cart.

For example, if a customer has a $50 gv balance, and the product they're purchasing is $20, on the checkout page, it displays a -$20 from their gv balance. Making the order total $0.00 and leaving them with $30 gv balance after the order. Or if they are purchasing something that is $80, then their full available balance is used, ie -$50, and they pay for the remaining $30.

So in summary, I need to tailor the code so when a customer clicks checkout on the shopping cart, and lands on the checkout page, their order total shows the gift certificate deduction automatically (for customers with a gv balance), without having to enter anything.

I am currently using 1.3.8a, with some mods, but nothing that should impact what I'm asking for...

I need to get this working in the next 3-4 days.

Hope it all makes sense...

12 May 2010, 3:35 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can I automatically apply Gift Certificate balance to order on checkout?

The current code is not designed for this as many people purchase Gift Certificates to send to others ...

You would have to customize the code to preload the balance of the Customer's gv balance to do this automatically for them ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 May 2010, 3:43 AM
#3
drbyte avatar

drbyte

Sensei

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

Re: Can I automatically apply Gift Certificate balance to order on checkout?

And you might want to consider the case where the customer DOESN'T really want to use the GV balance to pay for their full order, but if you don't CLEARLY tell them to change the automatically-applied amount, then they'll end up blowing their GV balance without any warning.

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

12 May 2010, 3:59 AM
#4
timryan avatar

timryan

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Can I automatically apply Gift Certificate balance to order on checkout?

Thanks guys.

Ajeh. Is there any existing code that I can copy/adapt that would preload the gv balance and apply to the order total on the checkout page? If somebody could lead me in the right direction for which code does what and how I can adapt for my needs that would be great!

DrByte. I would still probably provide a 'gv amount override' option, so the customer can remove/change the auto-applied gv amount if they wish.

Thanks again.

12 May 2010, 4:21 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can I automatically apply Gift Certificate balance to order on checkout?

I have not seen any code running around for this ... but having posted so many threads you never know what I or someone else might have customized for folks needing odd code ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

13 May 2010, 1:15 AM
#6
timryan avatar

timryan

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Can I automatically apply Gift Certificate balance to order on checkout?

Well I've almost got it..

In the ot_gv.php module, I replaced

    // if we have no GV amount selected, set it to 0
     if (!$_POST['cot_gv']) $_SESSION['cot_gv'] = '0.00';

with

    // if we have no GV amount selected, set it to 0
     if (!$_POST['cot_gv']) $_SESSION['cot_gv'] = zen_user_has_gv_account($_SESSION['customer_id']);

Now when a customer goes to the checkout page, their balance is automatically applied to their order total.

The customer can still apply (and override) a different amount if they wish, which applies on the confirmation page. However, if they enter '0' (ie to remove the gv deduction all together), it still uses their balance, due to what I've told the code above to do.

I'll keep on working on ideas to have it do what I've got it to do, but allow the customer to remove it completely. If anyone has any ideas, feel free to send em my way :smile:

13 May 2010, 1:42 AM
#7
timryan avatar

timryan

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Can I automatically apply Gift Certificate balance to order on checkout?

I accidently duplicated my last post...