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

Gift Certificate Auto Generate

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-15-2009, 01:09 AM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Gift Certificate Auto Generate

Is there anyway to auto generate a gift certificate for the amount of an order that is refunded? This would be a great way to give the customer a store credit, at the same time you change the order status to refund.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #2  
Old 12-20-2009, 08:05 AM
  jcorneli's Avatar 
jcorneli jcorneli is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 74
 

Default Re: Gift Certificate Auto Generate

I would be instrested in this as well. Anyone have an idea?
__________________
www.usapolicesupply.com
v4.6.3

Xcartmods reBoot Template
WebsiteCM CDSEO Pro SEO
BCS Multipe Upselling Links
Firetank Feed Manager

BCS Product Importer Updater Pro
BCS Drop Shipper Pro
BCS Quote Request Module
BCS Printable Online Catalog
Reply With Quote
  #3  
Old 12-21-2009, 01:15 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Gift Certificate Auto Generate

Ok I figured out how to make this possible, but you need to incorporate the 'Order Status - Refund' mod someone came up with on this site shown here:
http://forum.x-cart.com/showthread.php?t=33007&highlight=order+refund

Then do the following:

Open /include/func/func_orders.php and add the following to the other mod:
Code:
elseif ($status == "R" && $order["status"] != "R") { // Return products to stock func_update_quantity($order_data["products"],false); // Generate Gift Certificate $db_gc['gcid'] = $gcid = strtoupper(md5(uniqid(rand()))); $db_gc['status'] = 'A'; $db_gc['add_date'] = time(); $db_gc['purchaser'] = 'Your Company Name'; $db_gc['recipient'] = $order_data["userinfo"]['firstname']." ".$order_data["userinfo"]['lastname']; $db_gc['recipient_email'] = $order_data["userinfo"]['email']; $db_gc['message'] = stripslashes('There was an issue with your order either a specific item was not available or you have decided to cancel your order. A store credit has been issued by gift certificate for the amount of your initial order. If you have any questions or concerns, please feel free to contact us.'); $db_gc['amount'] = $order_data["order"]["total"]; $db_gc['debit'] = $order_data["order"]["total"]; func_array2insert('giftcerts', $db_gc); // Send Gift Certificate Via Email $mail_smarty->assign("giftcert", $db_gc); func_send_mail($db_gc["recipient_email"], "mail/giftcert_subj.tpl", "mail/giftcert.tpl", $config["Company"]["orders_department"], false); func_send_mail($config["Company"]["orders_department"], "mail/giftcert_notification_subj.tpl", "mail/giftcert_notification.tpl", $config["Company"]["orders_department"], false); # Send notification to customer $userinfo = $order_data["userinfo"]; $mail_smarty->assign("customer",$userinfo); func_send_mail($userinfo["email"], "mail/order_refunded_subj.tpl", "mail/order_customer_refunded.tpl", $config["Company"]["orders_department"], false); }

This will automatically generate an in store credit for the amount of their original order that was refunded including shipping and taxes. This is a great mod for store owners that want to only refund customers with a store credit by providing the customer with a Gift Certificate.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:54 PM.

   

 
X-Cart forums © 2001-2020