X-Cart Mods, X-Cart Addons - WebsiteCM
 
X-Cart Excellence eZine
Subscribe for proven tips and special discounts!
   Forum Search
Forum Menu
Quick Links
Forum Login
Username:

Password

Remember Me
Forum Expert(s)
X-Cart Mods, X-Cart Addons - WebsiteCM
Developing websites since the early-to-mid 90's, and working extensively with e-commerce since 2001, Jon Peters of WebsiteCM is equipped to assist you with your design, programming, e-commerce, and x-cart specific questions.

Add a "Refunded" order status to X-Cart 4.1.x

About this Thread:
You are viewing the thread Add a "Refunded" order status to X-Cart 4.1.x in the eCommerce forum.

  #1  
Old February 1st, 2008, 11:19 AM
admin admin is offline
Jon Peters (Admin)
 
Join Date: Aug 2007
Location: Vancouver, Canada
Posts: 99
Default Add a "Refunded" order status to X-Cart 4.1.x

Below is an outline for adding a new order status to x-cart 4.1.x using, a "Refunded" status to illustrate the process. This modification will set the order status to refunded, return the products to stock, and automatically notify the customer about the refund.

Open skin1/main/order_status.tpl

FIND:

Code:
<option value="I"{if $status eq "I"} selected="selected"{/if}>{$lng.lbl_not_finished}</option>
AFTER ADD:

Code:
<option value="R"{if $status eq "R"} selected="selected"{/if}>Refunded</option>
FIND:

Code:
{if $status eq "I"}{$lng.lbl_not_finished}
AFTER ADD:

Code:
{elseif $status eq "R"}Refunded
Open include/func/func.order.php

FIND:

Code:
$allowed_order_status = 'IQPBDFC';
REPLACE WITH:

Code:
$allowed_order_status = 'IRQPBDFC';
FIND:

Code:
elseif ($status == "D" && $order["status"] != "D" && $order["status"] != "F") {
 func_decline_order($orderid, $status);
}
AFTER ADD:

Code:
// Custom Refund Function
elseif ($status == "R" && $order["status"] != "R") {
    // Return products to stock
    func_update_quantity($order_data["products"]);
    // Send email notification to user
    $userinfo = $order_data["userinfo"];
    $mail_smarty->assign("customer",$userinfo);
    func_send_mail($userinfo["email"], "mail/order_refunded_subj.tpl", "mail/order_refunded.tpl",     $config["Company"]["orders_department"], false);
}
Add language variable:

Log into your x-cart admin section, and click on "Languages." Select your primary language and add the following variable under "Labels."

lbl_wcm_refunded - Refunded

Add autoresponders:

The attached autoresponders can be modified and uploaded for automatic customer notification.
Attached Files
File Type: zip refund-templates.zip (787 Bytes, 32 views)

Last edited by admin : February 12th, 2008 at 08:42 AM. Reason: Updating skin1 path of attachment.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old February 12th, 2008, 01:16 AM
lumino lumino is offline
Junior Member
 
Join Date: Dec 2007
Posts: 2
Default

Anyone not too familiar with x-cart should note, that the templates in the zip file need to go into skin1/mail, not directly into skin1 as they appear in the zip.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old February 12th, 2008, 08:43 AM
admin admin is offline
Jon Peters (Admin)
 
Join Date: Aug 2007
Location: Vancouver, Canada
Posts: 99
Default

Thanks Paul, I've updated the path in the .zip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

Site Map