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

Change Sort Order for Gift Certificates
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 10-05-2012, 05:34 AM
 
notgrass notgrass is offline
 

Advanced Member
  
Join Date: Dec 2011
Location: Tennessee
Posts: 33
 

Default Change Sort Order for Gift Certificates

Our business does not sell gift certificates. We give them away as bonuses to our customers. Since these certificates do not have an order ID attached, the default sort order in the Gift Certificates module made no sense, and I had to hunt through the list to change Pending certificates to Active.

I modified the SQL query of the giftcerts table to sort the list of certificates as I preferred. In this file:

[X-Cart Directory]/admin/giftcerts.php

find the line--

$query = "SELECT *, add_date+'" . $config["Appearance"]["timezone_offset"] . "' as add_date FROM $sql_tbl[giftcerts] WHERE 1 $expired_condition";

After $expired_condition and before the closing "; you can add an ORDER BY modifier. I used "ORDER BY status DESC, debit" to group all of the Pending certificates at the top of the list and sort the Active certificates by amount remaining so I can clear out the empty ones. Like this:

$query = "SELECT *, add_date+'" . $config["Appearance"]["timezone_offset"] . "' as add_date FROM $sql_tbl[giftcerts] WHERE 1 $expired_condition ORDER BY status DESC, debit";
__________________
X-Cart v4.6.5
www.notgrass.com/notgrass/
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 12:13 PM.

   

 
X-Cart forums © 2001-2018