X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Gift Certificates (Simple) Mod (https://forum.x-cart.com/showthread.php?t=4092)

machnhed1 08-22-2003 07:33 AM

Gift Certificates (Simple) Mod
 
This is quick and simple mod, but I thought it was needed for computer luddites out there.

If you enter in a gift certificate and happen to copy the previous or trailing blanks space around the number, you will get an invalid gift certificate error. Here's how to fix it (it's easy):

In your payment/payment_giftcert.php file...

Change this:
Code:

#
# Checking GC if it's already applied to order
#
$gc_applied = false;


to this
Code:

#
# Checking GC if it's already applied to order
#
$gcid = trim($gcid);

$gc_applied = false;


Pretty simple, but it works really well and will help cut down on errors and the subsequent support inquiries. :)

dealsondeals 09-27-2003 02:54 PM

The file is actually: payment/payment_giftcert.php

machnhed1 09-29-2003 05:07 AM

Good spot. I'll fix my original post.

Hope you found it useful nonetheless.

dealsondeals 09-29-2003 06:03 AM

:wink: Very Useful! I apologize for not saying so in my previous post.

Thanks,

Glen

markwhoo 01-18-2006 10:42 AM

This is an old thread, but thought maybe someone out there has modded their customer coupons to do the same thing...

Trim the copy pasted number free of blank spaces?

if so how?

machnhed1 01-18-2006 12:14 PM

markwhoo,

I'm not exactly sure what you are talking about. Can you describe what you mean in more detail? I may be able to help.

MachnHed1

markwhoo 01-18-2006 12:40 PM

Quote:

Originally Posted by machnhed1
markwhoo,

I'm not exactly sure what you are talking about. Can you describe what you mean in more detail? I may be able to help.

MachnHed1


Originally you trimmed the gift certificate code to remove possible blank spaces when it was copied and pasted into gc window.

I always have people complain that the code does not work and I tell them to simply type it in and all is well with the world; and always have to tell them why it happened; and it is due to the blank spaces being copied with the code.

I thought that maybe I could incorporate this into that area and would eliminate this issue.

I looked at the code for the coupons, but it is not laid out the same.

If I were a php guru, I would be making mods out the wazzoo, so I am crippled at this point and was hoping someone else had the same issue and a fix.


Any ideas?

machnhed1 01-18-2006 01:30 PM

Gotcha.

In your /modules/Discount_Coupons/discount_coupons.php file...

Change this:
Code:

if ($mode=="add_coupon" && $coupon) {
#
# Check if coupon is valid
#


to this
Code:

if ($mode=="add_coupon" && $coupon) {

$coupon = trim($coupon);

#
# Check if coupon is valid
#


markwhoo 01-19-2006 12:00 AM

totally awesome machinehead1!

I have added this and will wait and watch to see the improved results!

thanks tons.


By the by, where are you in IL?

machnhed1 01-19-2006 04:49 AM

Southern IL now, but originally from the Chicago suburbs. You nearby?


All times are GMT -8. The time now is 11:31 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.