Community Add-Ons
Recover Cart Sales
for osCommerce Online Merchant v2.2
If you have used the report Unsold Carts and are ready to step up to a tool that is designed to help with sales, then you are ready for Recover Cart Sales.
This tool is based on Unsold Carts 1.7 with the scart modifications (as discussed in http://forums.oscommerce.com/index.php?showtopic=61365&st=0)
This tool has it's own thread in the forums at: http://forums.oscommerce.com/index.php?showtopic=67701 and I look forward to enhancing it based on your feedback.
The tool contains a sales tool (that is also a report tool) and a separate report tool to see how well you have done in converting sales.
Tried the 2.23 package on a *nix server running PHP 5 and MySql 5 and it wouldn't work.
Found a bunch of php4 -> 5 typos + made some code changes + the mktime fix included.
All works fine now - stunning mod, a real must have..
Good Luck All
Courty
Hi
This is the same contribution with some bugfixes on mailing problems.
Also added spanish language to this fantastic contribution.
Foro oscommerce Oficial espaņol: http://oscommerce.qadram.com/modules.php?name=Forums
Regards from Barcelona Spain! ;)
Just a few fixes of incorrect install instructions, spelling mistake in the Recover Cart Sales ENGLISH Language File, and removal of garbage files in previous version zip file. Full package. Enjoy!
Bug found when sending emails to multiple customers. All email messages greeted the same person and contained the same product(s).
To fix: In file recover_cart_sales.php find
foreach ($custid as $cid)
{
----and replace with----
foreach ($custid as $cid)
{
unset($email);
Full contribution, same as below with bug fixed.
I just combined the last three into one package so you only have to download one package.
This is a full package.
The Install.html file had an incomplete sql query for the tep_get_products_special_price function in general.php. This is the fixed Install.html file with the complete sql query.
2.22 archive has a missing configuration insert command in the sql file. The instructions, update and install, are correct as well as the update sql files.
This is the single sql file for the install, and is not needed if you are upgrading from an earlier version of RCS or copy/paste from the instructions.
Full package. Change log:
# Fix upload of wrong recover_cart_sales.php file (had broken tax calculations!)
# Updated code and instructions so that fixed rate value is stored in same manner as tax rates for consistency
This is the full package of RCS v2.20, which incorporates the following changes over 2.11 (full change history in the documentation):
Added ability to include taxes in pricing, either based on trying to calculate the tax rate or by using a fixed tax rate.
Added step by step usage guide in "How to use" section so hopefully more people will understand the need to run the tool before using the report
Added ability to set the # of days to skip in searching for carts (ie, can now say "Show carts abandoned between 5 and 15 days ago")
Fixed emails to be sent using the configured "EMail From" address instead of the store owner's address
Expanded on a few of the tips on usage technique, fix some grammer errors
Updated FAQ section on needing to run tool to include where tool is located.
Updated FAQ section with info on sessions and /tmp directory, permissions, etc.
Updated install documentation to use stock osC code for step 9 to prevent run-time errors if the code is copied/pasted against instructions.
Minor maintanence update:
Added FAQ section on customer sessions and permission errors.
updated contribution page so it's found on user id search.
Sigh. Too much in a hurry to release 2.10 :)
This is the complete package. Support forum is:
http://forums.oscommerce.com/index.php?showtopic=67701
The only changes are inclusion of the correct install.sql file and adding the email to address instructions to the configuration portion of install.html.
Forgot to update the install sql file, here it is. This is only if you use the seperate SQL file and not the install.html instructions.
This file is not required for installation, as the complete and correct SQL commands are in the install.html file.
This is a complete archive. Support forum is:
http://forums.oscommerce.com/index.php?showtopic=67701
This release adds features requested by users and fixes several severe bugs from the initial implementation I discovered along the way.
# Fixed logic for skipping carts with a matching order, was not skipping in all cases
# Fixed attributes display (only displayes one item for each match, not multiples)
# Fixed numerous bad DB queries (original code had "= $value" which failed, because variables do not expand when inside quotes!)
# Added new preference to have cart check against all dates, not just dates after cart (ie, will find matching previous orders)
# Added new preference to control whether "safe" carts are automatically check for sending an email to
# Improved install instructions for copying tep_get_products_special_price function to admin area (includes folder, etc.)
# Updated colors to reflect purpose and more closely match each other in shading
# Fixed delete function's use of params within quotes
# Fixed mismatched table and td/tr tags (due to use inside and outside of if statement)
# Added date modified field to scart table so we can update records when sending followup email to a customer
# scartid and customers_id fields are now unique to avoid duplication problems (This could require updating users to empty their scart table!)
# Now when a customer has a "new" abandonded cart, his record is updated (datemodified) instead of a duplicate being created
Made a mistake I didn't catch on 2.00 release, so here's a 2.01 with the fix. (missing SQL statements, that were there in 1.7)
Just so it's not such a silly update, I also added automatic checking of those entries which seem to be mailable. Feedback in the discussion forum if this doesn't work for you or you would prefer it not to do this.
o Automatically checks those carts that should be safe to email.
o Fixed Install intructions missing 3 SQL statements. Sigh.
o Fixed email results page use of delete button (bad link/last one missing)
I got tired of manually checking each abandond cart to make sure the customer hadn't already ordered, so I fixed it. Oh, and some other stuff too :)
v2.00 Change History:
o We now look for existing orders from the same customer which have one or more of the same item (ie, matching orders). We do a variety of things with this information, from skipping entries where a matching order has already been placed, to indicating these orders in our output
o Added new preference to skip cart entries with a matching, non-pending, order
o Added new preference to select the last 'pending' order status
o Added new preferences to select even and odd row styles for the sales report
o Added new preference for sales report days
o Added new identifier for entries that may have a matching order already placed
o Current customers visually identified by colored name (and not the link-looking "CUSTOMER" text)
o Customer's are identified by orders matching their customer id OR email address (previously only id)
o The styles for the report rows are now configurable. These are CSS styles, not colors!
o The sales results report now has it's own days, as you often want the report to look further back than the tool
o The sales results report now matches to names and emails as well as customer ids (to handle customers who return to purchase but create a new account)
o Changed admin box text to better say what the tool and report do (hopefully avoid some confusion for new users)
o Added "What it does" section to documentation
o Cleaned up and commented source code
Find this code at around line 125
$custknt % 2 ? $class = 'dataTableRow' : $class = '';
$custlist .= "<tr class=".$class.">".
"<td class=datatablecontent align=right>".$inrec['scartid']."</td>".
"<td> </td>".
"<td class=datatablecontent align=center>".tep_date_order_stat($inrec['dateadded'])."</td>".
"<td> </td>".
"<td class=datatablecontent><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $crec['customers_lastname'], 'NONSSL') . "'>".$crec['customers_firstname']." ".$crec['customers_lastname']."</a></td>".
"<td class=datatablecontent>".tep_date_short($orders['date_purchased'])."</td>".
"<td class=datatablecontent align=center>".$orders['orders_status_name']."</td>".
"<td class=datatablecontent align=right>".strip_tags($orders['order_total'])."</td>".
"<td> </td>".
"</tr>";
}
}
And replace it with this:
$custknt % 2 ? $class = 'productListing-even' : $class = 'productListing-odd';
$custlist .= "<tr class=".$class.">".
"<td class=dataTableContent align=right>".$inrec['scartid']."</td>".
"<td> </td>".
"<td class=dataTableContent align=center>".tep_date_order_stat($inrec['dateadded'])."</td>".
"<td> </td>".
"<td class=dataTableContent><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $crec['customers_lastname'], 'NONSSL') . "'>".$crec['customers_firstname']." ".$crec['customers_lastname']."</a></td>".
"<td class=dataTableContent>".tep_date_short($orders['date_purchased'])."</td>".
"<td class=dataTableContent align=center>".$orders['orders_status_name']."</td>".
"<td class=dataTableContent align=right>".strip_tags($orders['order_total'])."</td>".
"<td> </td>".
"</tr>";
}
}
Now it works.
# Added example listings of the tep_ functions referenced
# Added ability to ignore customers with active sessions. Based on idea/code by Richard Lindsey, and expanded to work with DB or file based sessions
# Removed custom IFD store text from customer emails. Now has fully generic text
# Added FAQ section to instruction file
# Updated special pricing code to handle negative special pricing as "none" (as well as zero)
# Updated instruction and sql files
If you're like me, which in this instance you probably are... You only want to see carts that have actually been abandoned when you look at the info provided by this contribution... By default, this contribution shows you all current carts that fit the age range specified, but if someone has been afk for a while and you have long-lasting sessions, their cart isn't truly abandoned... This modification queries the existing session data, extracts customer id's from the session values with a regex, and then excludes those customer id's when querying for cart data, so you only get carts listed that were never checked out and the sessions have expired...
Note: This modification will only work if you store your sessions in a database, but it should be pretty easy to modify for use with file storage... also, if you've altered your custom session handling routines to encrypt and decrypt data as it's written and read from the database, you'll need to make sure you compensate for that when you query for the data (base64_decrypt it first)...
This is a super simple mod, just copy and paste 2 things within the same 15 line block of code and you're done :)
Enjoy!
This is just a documentation update; if you already have installed v1.60 there is NO reason to get this one!
# Added update.html to package to help people update from earlier versions. My hope is that this document will be easier to follow when updating the contribution vs. the full install instructions.
# Small corrections and updates to this install document
Addresses several requests/issues talked about in the support forum, plus some clean up and addition of a configuration area in the admin.
# Added install step for undefined filename declarations
# Added code to grab special pricing (copy/paste from catalog)
# Added HTML email; if HTML email is on HTML links are used in email
# Got tired of the editing the php code to change configuration; now in admin area
# Cleaned up readme file, brought important information to top (install, etc)
# Completely re-wrote installation instructions, shamelessly ripping off PopTheTop's excellent HTML code :)
Adds links in the email sent to customer for the login page, as well as product information links.
This is the full package and includes the 1.4f changes.
FULL package
Minor changed on the stats recover:
-displaying date added in the format date
-displaying totall in the currencie format
-translated missing french languages
This is the FULL and complete archive.
-Improved layout of output table (resizes better, nice breaks, etc.)
-Fixed divide by zero when no recovered sales were found
-Changes to make work on all top browsers under Mac OS X and Windows
-Incorporated PopTheTop's changes to report
-Total $ recovered rounded to nearest "penny" (2 decimal places)
-Fix incorrect setting of date range used (from 1.4c and earlier code I missed in 1.4d)
-Display correct order status (oops .... missed a check in the sql query!)
(Thanks to Dave "baddog" and PopTheTop for helping debug this version!)
I updated to v1.4d and noticed 1 problem...
1) The HTML coding in stats_recover_cart_sales.php is all messed up - So I fixed it. This is ONLY the updated stats_recover_cart_sales.php file.
Decided others might want the improved(?) report that I created for my own use, so here it is. I'll watch the support forum for a while, if you have questions ask there.
CHANGES
Tool:
-Improved layout of recover carts table
-changed the "delete" action button from "Reset" to "Delete"
-Added salutation to email (per Aalst)
-Improve emails sent (grammar, plus blurb for customers who thought they ordered)
Report:
- re-write HTML output to 1) fix bad and mismatched tags, 2) add much new information:
scart id, date added, date "recovered" order occurred, order's status & total
% of abandoned carts recovered, and total amount of sales gained
- re-write DB access to 1) simplify acces, and 2) fix multiple "hits" per scart
(ie, if customer abandons a cart and later places 3 orders, only 1 is recovered)
- fix use of header definitions (language files)
- fix DB queries to use FILENAME_ defines (vs hardcoded names)
-Fixed mistake in installation instructions for MS1
-Removed a duplicated and not necessary file present in the zip
-Added french language
*Version 1.4b*
CHANGES
-Fixed installation instructions making it easier to understand
-I really did not do much just added a few very simple instructions
*Version 1.4a*
CHANGES
-Did not change anything from 1.4 only added German language
-Compressed in Zip format
*Version 1.4*
CHANGES
-Cleaned up html output
-Fixed db query issues
-YOU MUST FLUSH OUT THE 'scart' DB OCCASIONALLY!
THIS WILL PREVENT 'uncontacted' ERRORS.
-Added 'delete' feature in two places
Updated README to correct a error in the installation steps.
If you already have 1.3.6 installed and working YOU DO NOT NEED THIS.
*Version 1.3.6*
CHANGES
-Fixed critical error in Readme that effected installation.
*Version 1.3.5*
CHANGES
-Fixed performance issue
-Fixed default language bug when more than one languages offered
-Changed Installation Instructions to handle MS1 and MS2
-Added Polish Language files, provided by
Pawel Robaczewski (pawel@gmx.net)
KNOWN ISSUES
-None at this time
FUTURE PLANS
-Have item price reflect active attribute pricing
-Have item price reflect active specials
-Ability to sort by column headings
-Fix 'possible' bugs in report file
-Updating report to provide more information
*Version 1.3*
CHANGES
-Fixed error in Readme where I forgot a define.
-Optimized attribute code to speed up script
-Added SHOW_ATTRIBUTES configuration variable
-Added German Language files, provided by
Matthias F.(webmaster@bodyfeelings.de)
-Added Spanish Language files, provided by
Aalst(aalst@aalst.com), no promises on my
Latin American Spanish translations.
KNOWN ISSUES
-None at this time
FUTURE PLANS
-Have item price reflect active attribute pricing
-Have item price reflect active specials
-Ability to sort by column headings
-Fix 'possible' bugs in report file
-Updating report to provide more information
*Version 1.2*
CHANGES
-Fixed several minor layout issues
-Updated layout for easier readability (I Hope)
-Added missing defines in the English file
TEXT_SEND_EMAIL and TEXT_RETURN
-Moved filename defines to the filenames.php file
-Moved database table define to the database_tables.php file
-Reorganized readme.txt file and installation instructions
-Added an SQL file for importing into DB
-Corrected a few minor typos in the English
-Modified e-mail message to follow standard business grammar rules
-Added Friendly E-mail configuration option which gives you the
choice between original greeting or a more friendlier greeting
using the customers first name.
-Removed duplication of information in language file regarding
e-mail message to reduce chance of errors. This also fixed
a bug where current customer e-mails had the PS Message
being placed after the cart information and not and the end of the
message
-Moved Configuration Variables from language file to the top of
the recover_cart_sales.php file
-Added CURCUST_COLOR configuration variable
-Added UNCONTACTED_COLOR configuration variable
-Added CONTACTED_COLOR configuration variable
-Added the display of Attribute information to the main tool display
-Renamed report_cart_sales.php to stats_cart_sales.php to follow
existing OSC file naming conventions
-I think there is more changes, but this is all I could remember
FUTURE PLANS
-Have item price reflect active attribute pricing
-Have item price reflect active specials
-Ability to sort by column headings
-Fix possible bugs in report file
-Updating report to provide more information
OTHER INFORMATION
-I didn't make any changes to inside the report files, however I do
believe their is a bug with the report. When I tested a recovered
sale buy abandoning a cart, then sending an e-mail, and finically
purchasing the cart, it went from 0 sales to 54 sales, and showed
the customer name 54 times.
-Because of the extensive changes to the English language file
I am distributing this release as English only. I would like to
receive all the translated versions of this for at least Spanish,
German, and French (all others welcomed) and then make a language
file release.
Just added polish and german (by bodyfeelings) translations. Also moved some things to the language files. Have fun with this great contrib!
If you have used the report Unsold Carts and are ready to step up to a tool that is designed to help with sales, then you are ready for Recover Cart Sales.
This tool is based on Unsold Carts 1.7 with the scart modifications (as discussed in http://forums.oscommerce.com/index.php?showtopic=61365&st=0)
This tool has it's own thread in the forums at: http://forums.oscommerce.com/index.php?showtopic=67701 and I look forward to enhancing it based on your feedback.
The tool contains a sales tool (that is also a report tool) and a separate report tool to see how well you have done in converting sales.
