osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Refererce mod

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 07-12-2007, 04:18 AM
Member
 
Join Date: Sep 2005
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jschafer52
Default Refererce mod

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 07-12-2007, 11:21 AM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 461
Thanks: 4
Thanked 79 Times in 73 Posts
Rep Power: 7
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Refererce mod

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']);
    }
later you will display it by using something like

Code:
          <tr>
            <td class="main"><?php echo TEXT_REFERENCE; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('reference_id', $reference_array, $oInfo->reference_id); ?></td>
          </tr>
(the oInfo-> may not be the best class to use as I'm not sure what class is used in the order process, it's my best guess based on coding standards)

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 - and no, I don't have the bandwidth to take the task on, but it would be a good thing for YOU to do as it will teach you a great deal about how OSCMax is put together and how it works. So it may take you 12 hours, but the additional 6 hours you get from learning how to do it will be invaluable.).
__________________
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-13-2007, 11:59 PM
Active Member
 
Join Date: Oct 2005
Location: wherever I happen to be at the moment
Posts: 461
Thanks: 4
Thanked 79 Times in 73 Posts
Rep Power: 7
met00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nicemet00 is just really nice
Default Re: Refererce mod

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 recommended.php to a side menu (I suggest under catalog)

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');
?>
you will have to add the following to the orders table

Code:
'recomended` int(11) default '0'
and that should set up the admin side of the recommend.

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. I have no idea how to do that so just ask the boss http://www.oscmax.com/forums/members/michael_s.html
Attached Files
File Type: txt recommend.txt (10.9 KB, 1 views)
__________________
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 03:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax