Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Gift Certificates (Simple) Mod

 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 08-22-2003, 07:33 AM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default 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.
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #2  
Old 09-27-2003, 02:54 PM
 
dealsondeals dealsondeals is offline
 

eXpert
  
Join Date: Dec 2002
Location: Dallas, Texas, USA
Posts: 231
 

Default

The file is actually: payment/payment_giftcert.php
__________________
Never understimate stupidity.
--------
X-Cart Version: 3.5.2
Hosting:mind-in-design.net
Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14
Reply With Quote
  #3  
Old 09-29-2003, 05:07 AM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default

Good spot. I'll fix my original post.

Hope you found it useful nonetheless.
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #4  
Old 09-29-2003, 06:03 AM
 
dealsondeals dealsondeals is offline
 

eXpert
  
Join Date: Dec 2002
Location: Dallas, Texas, USA
Posts: 231
 

Default

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

Thanks,

Glen
__________________
Never understimate stupidity.
--------
X-Cart Version: 3.5.2
Hosting:mind-in-design.net
Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14
Reply With Quote
  #5  
Old 01-18-2006, 10:42 AM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default

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?
__________________
vs 4.1.12
Reply With Quote
  #6  
Old 01-18-2006, 12:14 PM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default

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
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #7  
Old 01-18-2006, 12:40 PM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default

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?
__________________
vs 4.1.12
Reply With Quote
  #8  
Old 01-18-2006, 01:30 PM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default

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 #
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
  #9  
Old 01-19-2006, 12:00 AM
 
markwhoo markwhoo is offline
 

X-Adept
  
Join Date: Nov 2003
Posts: 799
 

Default

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?
__________________
vs 4.1.12
Reply With Quote
  #10  
Old 01-19-2006, 04:49 AM
 
machnhed1 machnhed1 is offline
 

eXpert
  
Join Date: Feb 2003
Location: Illinois
Posts: 274
 

Default

Southern IL now, but originally from the Chicago suburbs. You nearby?
__________________
Following the signature guidelines : xcart pro 3.5.8 - [RedHat]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:48 AM.

   

 
X-Cart forums © 2001-2020