This is a discussion on Refererce mod within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Has anyone seen a mod that alows you to add a drop down or text bar at the check out ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Has anyone seen a mod that alows you to add a drop down or text bar at the check out that asked your customers how they heard about your store? like: how did you here about us: yahoo; google; banner add; newspaper; tv; ect... Thanks, JIM |
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| nope, but it's easy to add. add a field to the orders table called reference_id create a new table called reference with 2 fields reference_id {int(11) auto-incr} and reference_name {varchar(155) not null} then when you want to display it you use code like Code: $reference_array = array(array('id' => '', 'text' => TEXT_NONE));
$reference_query = tep_db_query("select reference_id, reference_name from " . TABLE_REFERENCE . " order by reference_name");
while ($reference = tep_db_fetch_array($reference_query)) {
$reference_array[] = array('id' => $reference['reference_id'],
'text' => $reference['reference_name']);
}
Code: <tr>
<td class="main"><?php echo TEXT_REFERENCE; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('reference_id', $reference_array, $oInfo->reference_id); ?></td>
</tr>
Remember that you will also need to change the "inserts" to that data is inserted to the order table. On the admin side you will want to add a field to the orders.php display that shows the reference on the order, and you may want to add a report that list the reference, number of orders from the reference, the total dollars from the reference and then the mean order size and average order size as well. All in all, for an average php coder with an average amount of osc experience this is about a three hour job with testing to do the basics. if you want to add the ability to populate the list from the admin, add another hour. If you want to add the report, another hour on top of that. So, if I were quoting the job it would be 6 hours (though my quote would be in dollars so it would be $1,500 - my guess is that you could get someone at rentacoder to do the whole thing for about 10-20% of that, but then again, you wouldn't get my experience
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
|
#3
| |||
| |||
| Okay, here is the start... On the admin side... admin/recommend.php put in text file uploaded as it was "too long" for the post per the forum.... sql for recommend table Code: -- -------------------------------------------------------- -- -- Table structure for table `recomended` -- CREATE TABLE `recomended` ( `recomended_id` int(11) NOT NULL auto_increment, `recomended_name` varchar(32) NOT NULL default '', `recomended_comment` varchar(254) default '', `date_added` datetime default NULL, `last_modified` datetime default NULL, PRIMARY KEY (`recomended_id`), KEY `IDX_RECOMENDED_NAME` (`recomended_name`) ) TYPE=MyISAM AUTO_INCREMENT=6 ; -- -- Dumping data for table `recomended` -- INSERT INTO `recomended` VALUES (1, 'Google', 'The # 1 search engine', '2007-07-13 22:37:53', '2007-07-13 22:57:23'); INSERT INTO `recomended` VALUES (2, 'MSN', 'Microsoft''s Search Engine', '2007-07-13 22:38:53', '2007-07-13 22:58:01'); INSERT INTO `recomended` VALUES (3, 'Yahoo!', 'The Yahoo! Directory', '2007-07-13 22:58:46', '2007-07-13 22:59:10'); INSERT INTO `recomended` VALUES (4, 'Our Catalog', 'Our Catalog', '2007-07-13 23:06:36', '2007-07-13 23:06:49'); INSERT INTO `recomended` VALUES (5, 'Friend', 'The Customers Friend', '2007-07-13 23:07:00', '2007-07-13 23:07:16'); INSERT INTO `recomended` VALUES (0, 'No Response', '', NULL, NULL); You will have to add the database to admin/includes/database_tables.php You will have to add the filename to admin/includes/filenames.php You will have to add the link in the catalog sidebox admin/includes/boxes/catalog.php You will have to add the text display for the side box to admin/includes/languages/english.php you will have to add the following file to admin/includes/languages/english recommended.php Code: <?php
/*
$Id: recommended.php, JM Ivler Exp $
osCMax Power E-Commerce
http://oscdox.com
http://biasolutions.com
Copyright (c) 2007 BIAOSCMax, 2002 osCommerce
Released under the GNU General Public License
*/
define('HEADING_TITLE', 'Recomended Sources');
define('TABLE_HEADING_RECOMENDED', 'Recomended Sources');
define('TABLE_HEADING_ACTION', 'Action');
define('TEXT_HEADING_NEW_RECOMENDED', 'New Recomended Source');
define('TEXT_HEADING_EDIT_RECOMENDED', 'Edit Recomended Source');
define('TEXT_HEADING_DELETE_RECOMENDED', 'Delete Recomended Source');
define('TEXT_RECOMENDED', 'Recomended Sources:');
define('TEXT_DATE_ADDED', 'Date Added:');
define('TEXT_LAST_MODIFIED', 'Last Modified:');
define('TEXT_NEW_INTRO', 'Please fill out the following information for the new Recomended Source');
define('TEXT_EDIT_INTRO', 'Please make any necessary changes');
define('TEXT_RECOMENDED_NAME', 'Recomended Source Name:');
define('TEXT_RECOMENDED_COMMENT', 'Recomended Source Comment:');
define('TEXT_DELETE_INTRO', 'Are you sure you want to delete this Recomended Sources?');
define('ERROR_DIRECTORY_NOT_WRITEABLE', 'Error: I can not write to this directory. Please set the right user permissions on: %s');
define('ERROR_DIRECTORY_DOES_NOT_EXIST', 'Error: Directory does not exist: %s');
?>
Code: 'recomended` int(11) default '0' The next question is where to create the entry to capture the recommend from the customer. And then you have to shove the recomended value into the orders table (that would happen in checkout_success.php). And for the record, the coding so far took about 3 hours of code and test on a heavily modified version of oscmax. You may also want to create an "index" key so you can control the sort order. The current sort order is based on alpha for the recomended_name and you may want to get google at the top and the lesser used services at the bottom, which a sort index key would allow. If you think this has been valuable, please make a donation to oscmax.
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
| Sponsored Links | ||
| ||