Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recover Cart Sales


Guest

Recommended Posts

I can check into the cheque/money order payment module, but it will be several weeks before I can get to it. The module must do something non-standard to the orders... I actually can't think of WHY they would not show up.

Lane,

 

any news / updates on the above?

 

Thank you.

Absinthe Original Liquor Store

Link to comment
Share on other sites

Hi guys,

 

For my previous posting regarding my email portion doesn't work. I manage to narrow down to the portion of the php file which does not work and hope some expert can assist me. Portion of the admin\recover_cart_sales.php file

 

------------------------------------------------------------------------------------------

 

<?php // Are we doing an e-mail to some customers?

<?php echo 'test'; ?> - Shows as test on the webpage

if (count($custid) > 0 ) { ?>

<tr>

<td class="pageHeading" align="left" colspan=2 width="50%"><? echo HEADING_TITLE; ?> </td>

<td class="pageHeading" align="left" colspan=4 width="50%"><? echo HEADING_EMAIL_SENT; ?> </td>

</tr>

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" align="left" colspan="1" width="15%" nowrap><?php echo TABLE_HEADING_CUSTOMER; ?></td>

<td class="dataTableHeadingContent" align="left" colspan="1" width="30%" nowrap> </td>

<td class="dataTableHeadingContent" align="left" colspan="1" width="25%" nowrap> </td>

<td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td>

<td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td>

<td class="dataTableHeadingContent" align="left" colspan="1" width="10%" nowrap> </td>

</tr><tr> <br></tr>

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" align="left" colspan="1" width="15%" nowrap><?php echo TABLE_HEADING_MODEL; ?></td>

<td class="dataTableHeadingContent" align="left" colspan="2" width="55%" nowrap><?php echo TABLE_HEADING_DESCRIPTION; ?></td>

<td class="dataTableHeadingContent" align="center" colspan="1" width="10%" nowrap> <?php echo TABLE_HEADING_QUANTY; ?></td>

<td class="dataTableHeadingContent" align="right" colspan="1" width="10%" nowrap><?php echo TABLE_HEADING_PRICE; ?></td>

<td class="dataTableHeadingContent" align="right" colspan="1" width="10%" nowrap><?php echo TABLE_HEADING_TOTAL; ?></td>

</tr>

<?php

foreach ($custid as $cid)

{

$query1 = tep_db_query("select cb.products_id pid,

cb.customers_basket_quantity qty,

cb.customers_basket_date_added bdate,

cus.customers_firstname fname,

cus.customers_lastname lname,

cus.customers_email_address email

from " . TABLE_CUSTOMERS_BASKET . " cb,

" . TABLE_CUSTOMERS . " cus

where cb.customers_id = cus.customers_id and

cus.customers_id = '".$cid."'

order by cb.customers_basket_date_added desc ");

 

$knt = mysql_num_rows($query1);

for ($i = 0; $i < $knt; $i++)

{

$inrec = tep_db_fetch_array($query1);

 

// set new cline and curcus

if ($lastcid != $cid) {

if ($lastcid != "") {

$cline .= "

<tr>

<td class='dataTableContent' align='right' colspan='6' nowrap><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td>

</tr>

<tr>

<td colspan='6' align='right'><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td>

</tr>\n";

echo $cline;

}

$cline = "<tr> <td class='dataTableContent' align='left' colspan='6' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['fname'] . " " . $inrec['lname'] . "</a>".$customer."</td></tr>";

$tprice = 0;

}

$lastcid = $cid;

// get the shopping cart

$query2 = tep_db_query("select p.products_price price,

p.products_model model,

pd.products_name name

from " . TABLE_PRODUCTS . " p,

" . TABLE_PRODUCTS_DESCRIPTION . " pd,

" . TABLE_LANGUAGES . " l

where p.products_id = '" . $inrec['pid'] . "' and

pd.products_id = p.products_id and

pd.language_id = " . (int)$languages_id );

 

$inrec2 = tep_db_fetch_array($query2);

$sprice = tep_get_products_special_price( $inrec['pid'] );

if( $sprice < 1 )

$sprice = $inrec2['price'];

 

$tprice = $tprice + ($inrec['qty'] * $sprice);

$pprice_formated = $currencies->format($sprice);

$tpprice_formated = $currencies->format(($inrec['qty'] * $sprice));

 

$cline .= "<tr class='dataTableRow'>

<td class='dataTableContent' align='left' width='15%' nowrap>" . $inrec2['model'] . "</td>

<td class='dataTableContent' align='left' colspan='2' width='55%'><a href='" . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $inrec['pid'] . '&origin=' . FILENAME_RECOVER_CART_SALES . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . "'>" . $inrec2['name'] . "</a></td>

<td class='dataTableContent' align='center' width='10%' nowrap>" . $inrec['qty'] . "</td>

<td class='dataTableContent' align='right' width='10%' nowrap>" . $pprice_formated . "</td>

<td class='dataTableContent' align='right' width='10%' nowrap>" . $tpprice_formated . "</td>

</tr>";

 

$mline .= $inrec['qty'] . ' x ' . $inrec2['name'] . "\n";

 

if( EMAIL_USE_HTML == 'true' )

$mline .= ' <blockquote><a href="' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']) . '">' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']) . "</a></blockquote>\n\n";

else

$mline .= ' (' . tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id='. $inrec['pid']).")\n\n";

}

 

$cline .= "</td></tr>";

 

// E-mail Processing - Requires EMAIL_* defines in the

// includes/languages/english/recover_cart_sales.php file

$cquery = tep_db_query("select * from orders where customers_id = '".$cid."'" );

$email = EMAIL_TEXT_LOGIN;

 

if( EMAIL_USE_HTML == 'true' )

$email .= ' <a HREF="' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . '">' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . '</a>';

else

$email .= ' (' . tep_catalog_href_link(FILENAME_CATALOG_LOGIN, '', 'SSL') . ')';

 

$email .= "\n" . EMAIL_SEPARATOR . "\n\n";

 

if (RCS_EMAIL_FRIENDLY == 'true')

$email .= EMAIL_TEXT_SALUTATION . $inrec['fname'] . ",";

else

$email .= STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n";

 

if (mysql_num_rows($cquery) < 1)

$email .= sprintf(EMAIL_TEXT_NEWCUST_INTRO, $mline);

else

$email .= sprintf(EMAIL_TEXT_CURCUST_INTRO, $mline);

 

$email .= EMAIL_TEXT_BODY_HEADER . $mline . EMAIL_TEXT_BODY_FOOTER;

 

if( EMAIL_USE_HTML == 'true' )

$email .= '<a HREF="' . tep_catalog_href_link('', '') . '">' . STORE_OWNER . "\n" . tep_catalog_href_link('', '') . '</a>';

else

$email .= STORE_OWNER . "\n" . tep_catalog_href_link('', '');

 

$email .= "\n\n". $_POST['message'];

$custname = $inrec['fname']." ".$inrec['lname'];

 

$outEmailAddr = '"' . $custname . '" <' . $inrec['email'] . '>';

if( tep_not_null(RCS_EMAIL_COPIES_TO) )

$outEmailAddr .= ', ' . RCS_EMAIL_COPIES_TO;

 

tep_mail('', $outEmailAddr, EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

$mline = "";

 

// See if a record for this customer already exists; if not create one and if so update it

$donequery = tep_db_query("select * from ". TABLE_SCART ." where customers_id = '".$cid."'");

if (mysql_num_rows($donequery) == 0)

tep_db_query("insert into " . TABLE_SCART . " (customers_id, dateadded, datemodified ) values ('" . $cid . "', '" . seadate('0') . "', '" . seadate('0') . "')");

else

tep_db_query("update " . TABLE_SCART . " set datemodified = '" . seadate('0') . "' where customers_id = " . $cid );

 

echo $cline;

$cline = "";

}

echo "<tr><td colspan=8 align='right' class='dataTableContent'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td> </tr>";

echo "<tr><td colspan=6 align='right'><a href=" . tep_href_link(FILENAME_RECOVER_CART_SALES, "action=delete&customer_id=" . $cid . "&tdate=" . $tdate) . ">" . tep_image_button('button_delete.gif', IMAGE_DELETE) . "</a></td> </tr>\n";

echo "<tr><td colspan=6 align=center><a href=".$PHP_SELF.">" . TEXT_RETURN . "</a></td></tr>";

}

else //we are NOT doing an e-mail to some customers

{

?>

<?php echo 'test'; ?> - Shows as test on the webpage

 

---------------------------------------------------------------------------

 

What I did was to try echo test at certain portion of the php file and I did not get the test displayed on website at the portion of the php file shown above. That portion happens to be the part for getting info and sending the mail to the customer. I am not a php programmer and know nothing about php except that I learnt some programming before and know abit of troubleshooting. The history of my problem starts after I installed the MOD "register_globals_v1.3". Before this MOD was installed, I did a trial test and the email was sent to my mailbox. After that MOD was installed, I did not perform any further testing as I presume this MOD will still work. However, I am wrong. I strongly felt the "register_globals_v1.3" MOD somehow affected this MOD. Anyone manage to get this MOD worked with "register_globals_v1.3"? Or what could be the contribution to my problem? Any advise will be good. Thank you for reading this posting.

Edited by thpek
Link to comment
Share on other sites

Yes, this makes sense. I think I need to look at making this optional... this is an extremely easy mod to install if this step does not have to be done. Hmmm.....

 

No, that's the correct purpose of that step. As for why your items show up priced normally instead of as a special I'm not sure, could be one of several things: a) items have no special price, B) copied the code incorrectly, c) code in catalog is incorrect, d) problem with db, .... etc.

 

This is a problem with your install process; you copied the link in the column_left.php file to two places.

 

 

The items do have a special price (set by sale maker) and show on the site in red with a line through them. I am not sure though, I am not too worried about it.

 

As far as the extra link, it has been there since the other install but I am pretty sure it did something different when I has 1.50? Anyway, where is it that I go to remove it?

 

One more thing, I recently installed a mod called Inactive Users 1.2 that will give you a report of users that have never bought anything. This is great info but all it gives you is the email address, etc and a delete button for them. How hard would it be to "combine" these two mods in some way so you could email the inactive users in the same way as unsold carts? It seems very relevant and a combined mod would be awesome! Let me know your thoughts.

 

Craig

Link to comment
Share on other sites

Lane

 

Any idea on the correct way to make the Tax component to display in the prices on the recover_cart_sales.php?

 

I can do a simple addition to force a fixed amount percentage, but want to do it correctly.

 

Have tried various combinations like this: (from line 352)

<td class='dataTableContent' align='right' colspan='8'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format[$tprice] . '' . tep_get_tax_rate($tprice['products_tax_class_id']) . "</td>

 

But this one is not working and returns zero balance.

 

There is a number of section that actually need this (including the emails sent if sending prices with them)

 

Any ideas?

Link to comment
Share on other sites

Lane,

 

any news / updates on the above?

 

Thank you.

I only had time to look into it briefly, and from what I can tell the check/money order payment module is more like a FAX Order module in that payment is not received at the time of the order (it will be sent in). So, I would assume that something must be done within the admin area when the money actually arrives so the system knows payment is complete.

 

This partial payment issue is likely the cause. Unfortunately my time right now is limited as I'm only about to work 1/2 time due to needing to help out my grandparents so I don't expect to be able to look into this further any time soon.

 

<?php // Are we doing an e-mail to some customers?

<?php echo 'test'; ?> - Shows as test on the webpage

if (count($custid) > 0 ) { ?>

...

}

else //we are NOT doing an e-mail to some customers

{

?>

<?php echo 'test'; ?> - Shows as test on the webpage

This shows that $custid has no members.

What I did was to try echo test at certain portion of the php file and I did not get the test displayed on website at the portion of the php file shown above. That portion happens to be the part for getting info and sending the mail to the customer. I am not a php programmer and know nothing about php except that I learnt some programming before and know abit of troubleshooting. The history of my problem starts after I installed the MOD "register_globals_v1.3". Before this MOD was installed, I did a trial test and the email was sent to my mailbox. After that MOD was installed, I did not perform any further testing as I presume this MOD will still work. However, I am wrong. I strongly felt the "register_globals_v1.3" MOD somehow affected this MOD. Anyone manage to get this MOD worked with "register_globals_v1.3"? Or what could be the contribution to my problem? Any advise will be good. Thank you for reading this posting.

Aha! This should have been the first thing mentioned about the problem :) osC is dependent on register_globals (unfortunately), and I've not been able to get any of the mods I've tried to "fix" this fully. I've also not spent a great deal of time on it, as I keep thinking that r3 would be out any time.

 

See previous post about limited time :) The first thing I'd suggest looking at is determining why $custid is returning a count of zero. It's obviously from a globals usage, so it should be easy to find.

 

Of course, the real quick fix would be to turn register globals back on :)

 

As far as the extra link, it has been there since the other install but I am pretty sure it did something different when I has 1.50? Anyway, where is it that I go to remove it?

Yea, that's the column_left.php file I was talking about. Remove the customers area reference to the RCS link.

One more thing, I recently installed a mod called Inactive Users 1.2 that will give you a report of users that have never bought anything. This is great info but all it gives you is the email address, etc and a delete button for them. How hard would it be to "combine" these two mods in some way so you could email the inactive users in the same way as unsold carts? It seems very relevant and a combined mod would be awesome! Let me know your thoughts.

Not sure how hard it would be, but it's not a bad idea. Not going to be looked at anytime soon, but I will put it on the things to checkout list :)

 

Any idea on the correct way to make the Tax component to display in the prices on the recover_cart_sales.php?

 

I can do a simple addition to force a fixed amount percentage, but want to do it correctly.

 

Have tried various combinations like this: (from line 352)

<td class='dataTableContent' align='right' colspan='8'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format[$tprice] . '' . tep_get_tax_rate($tprice['products_tax_class_id']) . "</td>

 

But this one is not working and returns zero balance.

 

There is a number of section that actually need this (including the emails sent if sending prices with them)

Look at how tax is calculated during checkout and copy that code in. I think there is a tep function to calculate the actual tax from the rate, but it's been a while since I worked on that section of code.

Link to comment
Share on other sites

Dear Iane,

 

You are simply marvellous. With the indication of the error and your confirmation that the $custid requires register_global to be activated. I have managed to resolve this issue by reading through the register_global MODs again on the portion teaching people how to modify the MODs to work with register_global off. I hope the solution provided below will assist others who have both recover_cart_sales MOD and register_global MOD installed to get it working. Your MOD is simply marvellous. Solution as follows:

 

Backup Backup if need to. Just modify this file catalog/admin/recover_cart_sales.php.

 

Locate this portion:

 

require(DIR_WS_CLASSES . 'currencies.php');

 

Add this below the sentence:

 

link_post_variable('custid');

 

It should look like this now:

 

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');

 

link_post_variable('custid');

 

$currencies = new currencies();

----------------------------------------------------------------

 

It's just that simple. Add link_post_variable('custid'); and the problem is resolved.

 

Cheers everyone :)

I am a happy man once again.

Link to comment
Share on other sites

I have just run into the problem of where the client still shows regardless of what they may have done, that they have been contacted.

I then found this line in the instructions.

- If a customer has a cart recovered, future carts that should be recovered will be marked in red (ie, showing as already contacted). Need some more information being stored in the SCART table I think, but not sure what yet...

 

As a relatively simple solution to the problem.

Is it possible to simply write some code that will delete their Scart table info, upon next login after they have been contact last?

 

I can't do this but I think it's probably a simple bit of code that probably would go in the Login.php file or application_top.php may be a better place for those that also have a login box in the left or right columns.

 

Any thoughts anyone?

 

P.S. If you really wanted to get fancy about this, that same code could be set to check the clients order history and compare that to the product ID in the Scart table (new row) which the email was sent out for originally. Then delete if matched.

This idea I know, has some follow through problems but just thinking out loud.

The first suggestion is simple and may not be the total answer but would work quiet well I expect.

 

cheers

 

Just noticed another issue that needs addressing especially if the last suggestion was implemented.

There needs to be another table for the Recovered Cart Sales. ie Scart_History so this information is always kept and not always deleted with auto login delete function and with an option on the Recoered Cart Report page to delete this history older than a User Entered amount of days.

 

Sorry I can think of these ideas but just don't have php know how to write all this.

 

Just thinking again out loud and with the hope that someone else may be able to take the ideas and run with them.

 

John

Link to comment
Share on other sites

I have made some modifications in the recover_carts.php file to display the real total price including tax.

I live in Australia and mainly sell to clients of Australia and everything has 10% GST included.

So these changes will work for me 99% of the time. It's a little crude and simplistic coding but works.

(I know it can be done better in a few ways, but for the headache and my php experience this will do for now. So please be kind. :rolleyes: )

 

If anyone else would like this info, here it is.

recover_cart.php file

Lines 209 and 210

			$pprice_formated  = $currencies->format($sprice);
		$tpprice_formated = $currencies->format(($inrec['qty'] * $sprice));

Change too.

			$pprice_formated  = $currencies->format(($sprice) * 0.10 + $sprice);
		$tpprice_formated = $currencies->format(($inrec['qty'] * $sprice) * 0.10 + ($inrec['qty'] * $sprice));

 

Line 352

						  <td class='dataTableContent' align='right' colspan='8'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format($tprice) . "</td>

Change too.

						  <td class='dataTableContent' align='right' colspan='8'><b>" . TABLE_CART_TOTAL . "</b>" . $currencies->format(($tprice) * 0.10 + $tprice) . "</td>

 

Lines 505 & 506

			$pprice_formated  = $currencies->format($sprice);
		$tpprice_formated = $currencies->format(($inrec['qty'] * $sprice));

Change too.

			$pprice_formated  = $currencies->format(($sprice) * 0.10 + $sprice);
		$tpprice_formated = $currencies->format(($inrec['qty'] * $sprice) * 0.10 + ($inrec['qty'] * $sprice));

 

Line 520

  $totalAll_formated = $currencies->format($totalAll);

Change too.

  $totalAll_formated = $currencies->format(($totalAll) * 0.10 + $totalAll);

Link to comment
Share on other sites

Just modify this file catalog/admin/recover_cart_sales.php.

 

Locate this portion:

 

require(DIR_WS_CLASSES . 'currencies.php');

 

Add this below the sentence:

 

link_post_variable('custid');

Glad you got it working. Everyone please note that this only works if you are using the no globals mod, link_post_variable is unknown in standard osC. (Someone please correct me if I'm wrong).

 

For that matter, anyone know of a way to correct this in a manner that will work both for the stock osC and for one that had globlas off?

 

I have just run into the problem of where the client still shows regardless of what they may have done, that they have been contacted.

I then found this line in the instructions.

 

As a relatively simple solution to the problem.

Is it possible to simply write some code that will delete their Scart table info, upon next login after they have been contact last?

I think the solution would be to expand the existing scart table to include some information to determine old from new entries. When I get some time I'll put some thought into this, as it does need to be addressed.

 

Good thoughts by the way!

 

I have made some modifications in the recover_carts.php file to display the real total price including tax.

Thanks; that points out a problem where I'm using the flat price and not figuring the total price as configured for the store. When I get a chance I'll update the code to use tep_get_tax_rate and tep_add_tax where appropriate.

Link to comment
Share on other sites

I have the mod installed and it works GREAT! One of the more useful mods out there.

 

The problem I have (as many do) is that sometimes when a customer pays using paypal the transaction does not finalize and then you have what appears to be an abandonded cart even though you've received payment for it.

 

Does anyone know of a way to finalize an order that shows up as a abandoned cart?

Link to comment
Share on other sites

I have the mod installed and it works GREAT! One of the more useful mods out there.

 

The problem I have (as many do) is that sometimes when a customer pays using paypal the transaction does not finalize and then you have what appears to be an abandonded cart even though you've received payment for it.

 

Does anyone know of a way to finalize an order that shows up as a abandoned cart?

Depends on how the cart is not finalized. On my cart I can set the status of the order to fix this; but on a standard osC install the order may not even be in the system (it may only be a cart, not an order). This is because by default osC doesn't create orders until they have been fully processed at the payment gateway. In this case I don't think there is anything you can do.

 

(My "fix" was to force the creation of the order before submitting the cart to the payment gateway, I actually did this because it was the only way to create the order # in order to send it to the payment gateway, which is a requirement for AuthorizeNet now.)

Link to comment
Share on other sites

(My "fix" was to force the creation of the order before submitting the cart to the payment gateway, I actually did this because it was the only way to create the order # in order to send it to the payment gateway, which is a requirement for AuthorizeNet now.)

 

How were able to do this? Was it a mod or something that you changed just on your site?

Link to comment
Share on other sites

Just a thought folks, and take this from the guy who ceated the v1.0 tool, but there has been a great deal of focus on this tool and it's development and I never did see anyone write a tool that plugged into this in other ways.

 

For instance, one of the key things I wanted to do on carts that were recovered was know if, when they came back, they added new items to the cart or removed items from the cart or just checked out with what they had.

 

In addition, I was always wanted to add one more "human touch". Follow with me here. After the customer got contacted, and they came back and purchased, I wanted to have a process that, when we closed the sale (moved status from processing to shipped in my case) that sent out another e-mail that asked them "how did you feel about shopping with us?" I mean, we know that this customer was motivated to return based on the RCS e-mail (well we think, not know) and that e-mail was all about touching them on the personal sales level. This e-mail would re-enforce that personal touch increasing the probability that they would have a positive feeling about interacting with your store (ie: return again - bookmark, whatever).

 

It's nice to see the growth of the tool, and I'm glad everyone has found it as useful as I did when I created it. There have been some nice additions, but in a way I'm sort of disappointed that noone has taken it further into developing the customer relationship. Ah well...

 

[PS: and to the person who mentioned paypaling support... I released this free, my hope was that it would stay free. noone has ever paypaled me a penny, and if they did I would return it. I'm an old grayhair who has been making my living on the net since 1982 [apranet] and I intended this to be free when I released it. Karma; you give because you want and know that the good you do flows back to you, if not now, later. Keep your money, give back code freely. - end of my rant.]

Link to comment
Share on other sites

How were able to do this? Was it a mod or something that you changed just on your site?

Thread about re-arranging order creation

 

Basically, in checkout_process.php my changed code looks like this:

// load the order module
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

// load the order total moduel and get the final total (with gift vouchers, etc.)
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

// IFD OSC_MODSQUAD: BEGIN 040202 LR : pass order # to authorizenet to avoid high charges!
// -- moved below --
 //if(MODULE_PAYMENT_AUTHORIZENET_STATUS == "True") {
 // include(DIR_WS_MODULES . 'authorizenet_direct.php');
 //}
 //$payment_modules->before_process();
// IFD OSC_MODSQUAD: END

// IFD OSC_MODSQUAD: LR -- paypal "before_process" does all there rest and exits, including creating the table. So don't do it here!
if( $order->info['payment_method'] != 'PayPal' )
{
	// BOF: WebMakers.com Added: Downloads Controller
	$sql_data_array = array('customers_id' => $customer_id,
					  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
					  'customers_company' => $order->customer['company'],
					  'customers_street_address' => $order->customer['street_address'],
					  'customers_suburb' => $order->customer['suburb'],
					  'customers_city' => $order->customer['city'],
					  'customers_postcode' => $order->customer['postcode'], 
					  'customers_state' => $order->customer['state'], 
					  'customers_country' => $order->customer['country']['title'], 
					  'customers_telephone' => $order->customer['telephone'], 
					  'customers_email_address' => $order->customer['email_address'],
					  'customers_address_format_id' => $order->customer['format_id'], 
					  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 
					  'delivery_company' => $order->delivery['company'],
					  'delivery_street_address' => $order->delivery['street_address'], 
					  'delivery_suburb' => $order->delivery['suburb'], 
					  'delivery_city' => $order->delivery['city'], 
					  'delivery_postcode' => $order->delivery['postcode'], 
					  'delivery_state' => $order->delivery['state'], 
					  'delivery_country' => $order->delivery['country']['title'], 
					  'delivery_address_format_id' => $order->delivery['format_id'], 
					  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 
					  'billing_company' => $order->billing['company'],
					  'billing_street_address' => $order->billing['street_address'], 
					  'billing_suburb' => $order->billing['suburb'], 
					  'billing_city' => $order->billing['city'], 
					  'billing_postcode' => $order->billing['postcode'], 
					  'billing_state' => $order->billing['state'], 
					  'billing_country' => $order->billing['country']['title'], 
					  'billing_address_format_id' => $order->billing['format_id'], 
					  'payment_method' => $order->info['payment_method'], 
					  'cc_type' => $order->info['cc_type'], 
					  'cc_owner' => $order->info['cc_owner'], 
					  'cc_number' => $order->info['cc_number'], 
					  'cc_expires' => $order->info['cc_expires'], 
					  'date_purchased' => 'now()', 
					  'last_modified' => 'now()',
					  'orders_status' => $order->info['order_status'], 
					  'currency' => $order->info['currency'], 
					  'currency_value' => $order->info['currency_value']);
// EOF: WebMakers.com Added: Downloads Controller

	tep_db_perform(TABLE_ORDERS, $sql_data_array);
	$insert_id = tep_db_insert_id();
}

 $order_totals = $order_total_modules->process();

// IFD.COM -- We want to fix the authnet problem of no invoice #, this does it. (moved from just below $order = new order;
//					NOTE: side effect is that bad orders end up in the DB; which we want but might be objectionable to others

// IFD OSC_MODSQUAD: BEGIN 040202 LR
 //************************************************************
 // Authorizenet ADC Direct Connection
 // Make sure the /catalog/includes/class/order.php is included
 // and $order object is created before this!!!
 // IFD.COM - Moved below $order_total_modules->process(); so submission has correct order total!
 //		(thanks to BlueNoteMKVI for pointing this out)
 if(MODULE_PAYMENT_AUTHORIZENET_STATUS == "True") {
  include(DIR_WS_MODULES . 'authorizenet_direct.php');
 }
 //************************************************************

// load the before_process function from the payment modules
 $payment_modules->before_process();
// IFD OSC_MODSQUAD: END

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$sql_data_array = array('orders_id' => $insert_id,
						'title' => $order_totals[$i]['title'],
						'text' => $order_totals[$i]['text'],
						'value' => $order_totals[$i]['value'], 
						'class' => $order_totals[$i]['code'], 
						'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
 }

Link to comment
Share on other sites

Just a thought folks, and take this from the guy who ceated the v1.0 tool, but there has been a great deal of focus on this tool and it's development and I never did see anyone write a tool that plugged into this in other ways.

It's a great tool, and I'm glad you created it :)

For instance, one of the key things I wanted to do on carts that were recovered was know if, when they came back, they added new items to the cart or removed items from the cart or just checked out with what they had.

Hmmm... this probably wouldn't be too hard to add in, we could simply add the item ID's to the scart data. Not sure if it would be better to add as a single text field that got scanned at input (not sure how to do that in php) or use a separate table with an item per entry tied to an scart id.

In addition, I was always wanted to add one more "human touch". Follow with me here. After the customer got contacted, and they came back and purchased, I wanted to have a process that, when we closed the sale (moved status from processing to shipped in my case) that sent out another e-mail that asked them "how did you feel about shopping with us?" I mean, we know that this customer was motivated to return based on the RCS e-mail (well we think, not know) and that e-mail was all about touching them on the personal sales level. This e-mail would re-enforce that personal touch increasing the probability that they would have a positive feeling about interacting with your store (ie: return again - bookmark, whatever).

This is an interesting idea. I'd think the wording would have to be very carefully thought out so the customer didn't feel like your being pushy or that they are on a mailing list. (I get complaints every now and again from someone wanting off my "mailing list" because they got a confirmation email after creating an account.)

 

Anyway, it's an intriguing idea that definitely deserves some looking into. I'd also like to do more with the report part of the tool, for instance trying to use the data to determine common causes for abandoning carts. Is it tied to a product or type of product? A certain region? A language issue?

It's nice to see the growth of the tool, and I'm glad everyone has found it as useful as I did when I created it. There have been some nice additions, but in a way I'm sort of disappointed that noone has taken it further into developing the customer relationship. Ah well...

Heh... there is SO much I want to do with osC that I could work full time on my store... but I'm not a web developer, I'm a store owner/operator who can't afford to hire a quality web developer so I'm stuck doing the work :)

Link to comment
Share on other sites

I just installed Recover Cart Sales and it looks like it is working ;-) The only problem I came across was with adding the rcs_install.sql. When I added it in php admin I got the below error, did I do something wrong? My cart seems to still be working.

 

SQL query:

 

CREATE TABLE `scart` (

`scartid` INT( 11 ) NOT NULL AUTO_INCREMENT UNIQUE ,

`customers_id` INT( 11 ) NOT NULL UNIQUE ,

`dateadded` VARCHAR( 8 ) NOT NULL ,

`datemodified` VARCHAR( 8 ) NOT NULL ,

PRIMARY KEY ( `scartid` )

)

 

MySQL said: Documentation

#1050 - Table 'scart' already exists

[ Back ]

 

I'm still really new at understanding SQL so I apologize if this is a stupid question.

Link to comment
Share on other sites

I just installed Recover Cart Sales and it looks like it is working ;-) The only problem I came across was with adding the rcs_install.sql. When I added it in php admin I got the below error, did I do something wrong? My cart seems to still be working.

 

SQL query:

 

CREATE TABLE `scart` (

`scartid` INT( 11 ) NOT NULL AUTO_INCREMENT UNIQUE ,

`customers_id` INT( 11 ) NOT NULL UNIQUE ,

`dateadded` VARCHAR( 8 ) NOT NULL ,

`datemodified` VARCHAR( 8 ) NOT NULL ,

PRIMARY KEY ( `scartid` )

)

 

MySQL said: Documentation

#1050 - Table 'scart' already exists

[ Back ]

Simply means that the RCS DB table already existed, usually because of a previous install. Nothing to worry about if that was the only error.

Link to comment
Share on other sites

Hi great contrib,

 

Is it possible to change the customers details so it shows the company name instead of the customers first and lanst name?

 

Keep up the good work

 

Richard.

 

:huh:

The solution is never too far away ...

Link to comment
Share on other sites

Hi great contrib,

 

Is it possible to change the customers details so it shows the company name instead of the customers first and lanst name?

 

Keep up the good work

 

Richard.

 

:huh:

 

Richard

Have you thought about the various client's that do not have anything in that field.

All you would then see is "nothing" for who it is?

 

But yes simple to do.

Link to comment
Share on other sites

Richard

Have you thought about the various client's that do not have anything in that field.

All you would then see is "nothing" for who it is?

 

But yes simple to do.

 

 

Thanks for the fast reply

 

The Company name is mandatory so in theory there should always be something in this location.

 

Cheers

The solution is never too far away ...

Link to comment
Share on other sites

Hi

I have tried several things to change the customers name to company name with no luck all I seem to do is break the cart admin.

 

Can you offer any advice.

 

Cheers :(

The solution is never too far away ...

Link to comment
Share on other sites

Hi

I have tried several things to change the customers name to company name with no luck all I seem to do is break the cart admin.

 

Can you offer any advice.

 

Cheers :(

 

Richard

 

in the recover_cart_sales.php file starting around line 156 find this

	  foreach ($custid as $cid) {
 $query1 = tep_db_query("select	cb.products_id pid,
								cb.customers_basket_quantity qty,
								cb.customers_basket_date_added bdate,
								cus.customers_firstname fname,
								cus.customers_lastname lname,
								cus.customers_email_address email
					  from	  " . TABLE_CUSTOMERS_BASKET . " cb,
								" . TABLE_CUSTOMERS . " cus
					  where	 cb.customers_id = cus.customers_id  and
								cus.customers_id = '".$cid."'
					  order by  cb.customers_basket_date_added desc ");

 

Replace with this

	  foreach ($custid as $cid) {
 $query1 = tep_db_query("select	cb.products_id pid,
								cb.customers_basket_quantity qty,
								cb.customers_basket_date_added bdate,
								cus.customers_firstname fname,
								cus.customers_lastname lname,
								cus.customers_email_address email,
								ad.entry_company company
					  from	  " . TABLE_CUSTOMERS_BASKET . " cb,
								" . TABLE_ADDRESS_BOOK . " ad,
								" . TABLE_CUSTOMERS . " cus
					  where	 cb.customers_id = cus.customers_id  and
								cus.customers_id = '".$cid."'
					  order by  cb.customers_basket_date_added desc ");

 

Then around line 189 find:

	$cline = "<tr> <td class='dataTableContent' align='left' colspan='6' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['fname'] . " " . $inrec['lname'] . "</a>".$customer."</td></tr>";

 

Replace with this:

	$cline = "<tr> <td class='dataTableContent' align='left' colspan='6' nowrap><a href='" . tep_href_link(FILENAME_CUSTOMERS, 'search=' . $inrec['lname'], 'NONSSL') . "'>" . $inrec['company'] . "</a>".$customer."</td></tr>";

 

This should work but has not been tested. This also will not show the Company name in the stats. All you have to do is apply the same type of changes as the above to get that in the Stats file if that's also required.

 

Hope this helps.

John

Link to comment
Share on other sites

I got the same result. The problem isn't that we didn't follow directions, but that the directions (for that step) were confusing and we INTERPRETED them wrong. I'm pretty intelligent and can follow directions, especially when I'm being very careful to do things right, and I was a bit confused by that step. Don't ask me what *I* ended up doing... :> But I can recopy the code from a backup and redo this step. *dumb smile* I'm sure if that doesn't work to fix things, I'll be back around to post again soon. :)

 

This is possibly the most valuable tool available to a web site owner. Thank you ever so much for your work on it.

 

I have just installed your newest version and I am getting the following error when I run recover cart

Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 32040 is not allowed to access /tmp owned by uid 0 in /home/sweetd73/public_html/catalog/admin/recover_cart_sales.php on line 108

 

Warning: opendir(/tmp): failed to open dir: Success in /home/sweetd73/public_html/catalog/admin/recover_cart_sales.php on line 108

1054 - Unknown column 'customers_group_id' in 'field list'

 

select customers_group_id from customers where customers_id = ''

 

[TEP STOP]

I figure I must have forgotten to do something, or I did something only I did it wrong. I also figure you can look at this and say somthing like "This dummy just needs to do...." If you will kindly fill in the blank, I will take apropriate action.. and try not to screw it up too.

 

Thank You so very much.

Jim

--Sanguinarius

 

If you're reading this, I'm probably pulling my hair out. ;>

 

*waiting for osCommerce 3.0 alpha 6* (I'm after the coupons.)

Link to comment
Share on other sites

OK, I do have a bit of a problem. (First, I'm using Osc 2ms2 and Recover Cart Sales v 2.12.) I created a test account and added a "test widget" to my cart, then abandoned the cart. I went into admin and sent my test account an email which when received, read thus:

 

Login to your account here: /store/login.php

------------------------------------------------------

 

Dear Elizabeth,

 

Thank you for stopping by Dreamland Gallery and considering us for your purchase. We noticed that during a visit to our store you placed the following item(s) in your shopping cart, but did not complete the transaction.

 

Shopping Cart Contents:

 

1 x Test Widget - do not purchase

 

/store/product_info.php?products_id=28

 

 

 

We are always interested in knowing what happened and if there was a reason that you decided not to purchase at this time. If you could be so kind as to let us know if you had any issues or concerns, we would appreciate it. We are asking for feedback from you and others as to how we can help make your experience at Dreamland Gallery better.

 

PLEASE NOTE:

If you believe you completed your purchase and are wondering why it was not delivered, this email is an indication that your order was NOT completed, and that you have NOT been charged! Please return to the store in order to complete your order.

 

Our apologies if you already completed your purchase, we try not to send these messages in those cases, but sometimes it is hard for us to tell depending on individual circumstances.

 

Again, thank you for your time and consideration in helping us improve the Dreamland Gallery website.

 

Sincerely,

 

Sanguinarius

/store/

 

Test #3 (still relative paths in the links?)

 

The problem is that the email is containing relative paths in the links (which literally lead to:

 

Login to your account: http://mail.yahoo.com/config/login?/store/login.php

 

Test Widget link: http://mail.yahoo.com/config/login?/store/...?products_id=28

 

Store link beneath signature (which is part of the link, when I think it should not be..?): http://mail.yahoo.com/config/login?/store/

 

What is going on, and what do I need to fix/adjust/change and where?

 

Thanks in advance for any help.

--Sanguinarius

 

If you're reading this, I'm probably pulling my hair out. ;>

 

*waiting for osCommerce 3.0 alpha 6* (I'm after the coupons.)

Link to comment
Share on other sites

Yay me! I figured things out, finally. I did not have these defined in my admin/includes/configure.php file:

 

define('HTTP_CATALOG_SERVER', 'http://sanguinarius.org');

define('HTTPS_CATALOG_SERVER', 'https://sanguinarius.org');

 

*Sangi hops off to see what other problems she can run into* >;)~

--Sanguinarius

 

If you're reading this, I'm probably pulling my hair out. ;>

 

*waiting for osCommerce 3.0 alpha 6* (I'm after the coupons.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...