Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recover Cart Sales


Guest

Recommended Posts

I have problem in admin/recover_cart_sales.php on line 503.

 

Fatal error: Call to undefined function tep_get_products_special_price() in /home/webz/public_html/admin/recover_cart_sales.php on line 503

 

is line

$sprice = tep_get_products_special_price( $inrec['pid'] );
		if( $sprice < 1 )
			$sprice = $inrec2['price']; 

 

I need help please rsrs Thank's

Link to comment
Share on other sites

Copy this function and paste it into catalog/admin/includes/functions/general.php While you can paste it anywhere, I suggest doing so after the function:

 

tep_set_specials_status

 

In the stock admin general.php file this function is at ~ line 861, and looks like this after the paste operation:

 

// Sets the status of a product on special
 function tep_set_specials_status($specials_id, $status) {
   if ($status == '1') {
     return tep_db_query("update " . TABLE_SPECIALS . " set status = '1', expires_date = NULL, date_status_change = NULL where specials_id = '" . (int)$specials_id . "'");
   } elseif ($status == '0') {
     return tep_db_query("update " . TABLE_SPECIALS . " set status = '0', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
   } else {
     return -1;
   }
 }

////
// Return a product's special price (returns nothing if there is no offer)
// TABLES: products
 function tep_get_products_special_price($product_id) {
   $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . "  where products_id = '" . $product_id . "'");
   $product = tep_db_fetch_array($product_query);

   return $product['specials_new_products_price'];
 }

 

Effect:

 

Fatal error: Cannot redeclare tep_get_products_special_price() (previously declared in /home/mz/domains/a.targ.eu/public_html/admin/includes/functions/general.php:765) in /home/mz/domains/a.targ.eu/public_html/admin/includes/functions/general.php on line 1053

 

admin general.php

function tep_get_orders_status_name($orders_status_id, $language_id = '') {
   global $languages_id;

   if (!$language_id) $language_id = $languages_id;
   $orders_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . (int)$orders_status_id . "' and language_id = '" . (int)$language_id . "'");
   $orders_status = tep_db_fetch_array($orders_status_query);

   return $orders_status['orders_status_name'];
 }

 function tep_get_orders_status() {
   global $languages_id;

   $orders_status_array = array();
   $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "' order by orders_status_id");
   while ($orders_status = tep_db_fetch_array($orders_status_query)) {
     $orders_status_array[] = array('id' => $orders_status['orders_status_id'],
                                    'text' => $orders_status['orders_status_name']);
   }

   return $orders_status_array;
 }

 function tep_get_products_name($product_id, $language_id = 0) {
   global $languages_id;

   if ($language_id == 0) $language_id = $languages_id;
   $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);

   return $product['products_name'];
 }

 ////
////
// Return a product's special price (returns nothing if there is no offer)
// TABLES: products
 function tep_get_products_special_price($product_id) {
   $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . "  where products_id = '" . $product_id . "'");
   $product = tep_db_fetch_array($product_query);

   return $product['specials_new_products_price'];
 }

 function tep_get_products_description($product_id, $language_id) {
   $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);

   return $product['products_description'];
 }

 function tep_get_products_short_description($product_id, $language_id) {
   $product_query = tep_db_query("select products_short_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
   $product = tep_db_fetch_array($product_query);

   return $product['products_short_description'];
 }

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I'm having kind of the same issue with the from email on the messages, in my case the from email is showing-up as :

my store alias name" <@cgi13.cgi13 my store alias name <[email protected]>

 

Any hwlp will be greatly appreciated!

Thanks

 

I'm having this problem as well. E-mails sent from the orders page show as from Mydomain.com. However e-mails from RCS show up as: [email protected]

 

Any ideas? I tried playing with some e-mail settings and looking at the configuration.php but nothing really stood out.

 

Thanks very much.

Link to comment
Share on other sites

  • 1 month later...

Hi All

 

I've just spent about two days trying to get this to work on both a test and a live server - I eventually went back to around version 2.22 and did a lot of editing/ trial and error stuff. I have uploaded my changed files as version 2.0a (as it is a retrograde step). http://addons.oscommerce.com/info/1688

 

It is rough code and is probably best compared to what you have on your machine at the moment.

 

For email problems try using send() instead of tep_mail (it's in my file) and also check for a missing $i .

 

The error o.orders_status > a:3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";} is down to the way the contribution started saving multiple statuses - I've reverted to just saving one status so you'll get o.orders_status > 0 (or whatever) to properly correct that error you'll need to change the query to something along the lines of o.orders_status = 0 or o.orders_status = 3 and so on

 

This may save you some time but YMMV

 

Graeme

Link to comment
Share on other sites

  • 3 weeks later...

I have Recover Cart Sales installed on my site and it works perfectly. My only issue is that the emails that are sent to the customers doesn't list the attributes with each product. However, it does list the attributes in the admin panel. How can I have the emails list the product attributes as well?

Link to comment
Share on other sites

Has anyone installed this on RC2.2a with the multi store contribution?? I cant seem to get it to work, basically i get a grand total but no cart info and no customer info. I have tried a bunch of different versions and had no luck as of yet :S

 

Thanks :)

Link to comment
Share on other sites

I have installed and everything looks OK but when I execute related addon TOOL, it doesn't returns any result even choosing "Show last 0-90 days". Obviuosly when I go to REPORTS it is also completely empty.

 

There is only one strange thing at CONFIGURATION table. There are 2 similar entries:

 

 

configuration_id       configuration_title       configuration_key       configuration_value       configuration_description       configuration_group_id       sort_order       last_modified       date_added       use_function       set_function
297     Pending sales statuses     RCS_PENDING_SALE_STATUS     a:1:{i:0;s:1:"0";}     Select the order statuses that can be considered as pending. This information is used to find a succesfull order from the same customer with the same products     6501     85     2010-12-11 00:52:24     2010-12-11 00:51:33     tep_get_multiple_order_status_names     tep_cfg_pull_down_multiple_order_statuses(
316     Pending sales statuses     RCS_PENDING_SALE_STATUS     0     Select the order statuses that can be considered as pending. This information is used to find a succesfull order from the same customer with the same products     6501     85     2010-12-11 00:52:15     2010-11-12 06:00:58     tep_get_order_status_name     tep_cfg_pull_down_order_statuses(

 

This means when I go to CONFIGURATION area at admin, I found 2 configuration lines for this adddon called "Pending sales statuses".

 

As far as I know, entry with ID=297 was created by myself because of intalling instructions of this contribution that says that you have to install MULTIPLE DROPDOWN CONFIGURATION addon before proceed with installation.

 

I have tried deleting this entry (ID=297) but it still continues in the same eay.

 

What is failing?

 

Thank you for your assitance.

Edited by plutomon
Link to comment
Share on other sites

  • 1 month later...

hi

 

1st great contrib. had this working fine, for a little while, then moved to a dedicated server and although everything else in Osc works fine for some reason this contrib stopped working.

 

Not completely mind you, it still shows the carts to recover, it's just that when you hit "send email" it takes a few seconds then just takes you back to adnim/recover_cart_sales.php as if you had not done anything. The emails don't send and the carts are still there showing as uncontacted.

 

Has anyone come across this?

Link to comment
Share on other sites

The error o.orders_status > a:3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";} is down to the way the contribution started saving multiple statuses - I've reverted to just saving one status so you'll get o.orders_status > 0 (or whatever) to properly correct that error you'll need to change the query to something along the lines of o.orders_status = 0 or o.orders_status = 3 and so on

 

Where do I change this in the file? I can't seem to find where and what to change?

Link to comment
Share on other sites

  • 3 weeks later...

hi

 

1st great contrib. had this working fine, for a little while, then moved to a dedicated server and although everything else in Osc works fine for some reason this contrib stopped working.

 

Not completely mind you, it still shows the carts to recover, it's just that when you hit "send email" it takes a few seconds then just takes you back to adnim/recover_cart_sales.php as if you had not done anything. The emails don't send and the carts are still there showing as uncontacted.

 

Has anyone come across this?

 

Hi midijay, I experienced this issue too and think I have resolved the issue (at least all appears to be working for me now :-)

I have V2.23a dated 1DEC2008 installed but am using the file recover_cart_sales.php (catalog/admin) from the 2.0a version dated 11JAN2011 with a change to where the email is sent. I have replaced the code at around line 308 in catalog/admin/recover_cart_sales.php

 

Replaced this code below:

//tep_mail($custname, $outEmailAddr, EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, EMAIL_FROM);

//Let's build a message object using the email class

$mimemessage = new email(array('X-Mailer: osCommerce'));

// add the message to the object

$mimemessage->add_text($email);

$mimemessage->build_message();

 

$mimemessage->send($custname, $outEmailAddr, '', EMAIL_FROM, EMAIL_TEXT_SUBJECT);

With this code:

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

 

*** please note I am no expert in this code but this did work for me to at least get the emails sending. (I found info on this forum helpful - http://www.oscmax.com/forums/oscmax-v2-customization-mods/19425-cant-send-email-recover-cart-sales-2-22-a-2.html) I have not experienced any other fallout as a result of this change as yet but there could well be as its early days of this install for me.

Cheers, Sarah

Edited by sbetto
Link to comment
Share on other sites

  • 2 months later...

Hi,

 

I'm new to this contribution, I've installed everything following the steps and it seemed to work at the start. In my admin panel I have the recovert cart sales available under configuration but when I try to find it on Tools the only that appears is this:

 

cartproblem.jpg

 

Does anyone have had the same issue or knows how to solution it?

 

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I'm new to this contribution, I've installed everything following the steps and it seemed to work at the start. In my admin panel I have the recovert cart sales available under configuration but when I try to find it on Tools the only that appears is this:

 

cartproblem.jpg

 

Does anyone have had the same issue or knows how to solution it?

 

Thanks!

Surely its only a case of a missing define in your languages folder. I didnt know this worked with 2.3.1

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

  • 8 months later...

Hi,

 

I Installed this contribution as MS2 but it doesn't seem to work. I can edit all the aspects in the configuration but once Im at tools the I get this < as a new tool that goes to error. Do you know maybe why?

 

ScreenShot.png

Link to comment
Share on other sites

  • 1 month later...

Just a question...

I really not interested to have "Multiple dropdown Configuration" because it change my configuration.php in a way that i dont like.

I know that this contrib needs that (why?)...but i trying to keep things (and my code) as much clean it possible.

Is there a chance to install this contrib hacked without needing to install that "dropdown"?

I like this contrib but i think that I will have some conflicts..

Is there another contrib around that can make same job?

Tx

Link to comment
Share on other sites

Umm maybe i found the answer..

 

seems that is only one option that need this..

 

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` )
  VALUES ('', "Pending sales statuses", 'RCS_PENDING_SALE_STATUS', 'a:1:{i:0;s:1:"0";}',
  "Select the order statuses that can be considered as pending. This information is used to find a succesfull order from the same customer with the same products", 6501, 85, NULL, NOW(), 'tep_get_multiple_order_status_names', 'tep_cfg_pull_down_multiple_order_statuses(');

 

I will try to install without this

Link to comment
Share on other sites

  • 3 months later...

I recently installed this. Every aspect works great, except the send emails portion. The contrib acts like it is sending an email, but the mail is actually never sent. I am using v2.2 RCA. If this has been referenced somewhere else in this thread, please point me to it as I was not able to find thie same problem.

Link to comment
Share on other sites

This worked thanks!

 

Hi midijay, I experienced this issue too and think I have resolved the issue (at least all appears to be working for me now :-)

I have V2.23a dated 1DEC2008 installed but am using the file recover_cart_sales.php (catalog/admin) from the 2.0a version dated 11JAN2011 with a change to where the email is sent. I have replaced the code at around line 308 in catalog/admin/recover_cart_sales.php

 

Replaced this code below:

//tep_mail($custname, $outEmailAddr, EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, EMAIL_FROM);

//Let's build a message object using the email class

$mimemessage = new email(array('X-Mailer: osCommerce'));

// add the message to the object

$mimemessage->add_text($email);

$mimemessage->build_message();

 

$mimemessage->send($custname, $outEmailAddr, '', EMAIL_FROM, EMAIL_TEXT_SUBJECT);

With this code:

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

 

*** please note I am no expert in this code but this did work for me to at least get the emails sending. (I found info on this forum helpful - http://www.oscmax.com/forums/oscmax-v2-customization-mods/19425-cant-send-email-recover-cart-sales-2-22-a-2.html) I have not experienced any other fallout as a result of this change as yet but there could well be as its early days of this install for me.

Cheers, Sarah

Link to comment
Share on other sites

  • 3 weeks later...

I have exactly the same problem. Any solution to this yet??

 

Thanks !

 

 

It looks like this problem has been around for a while. Any solutions?

This is what I get

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':1:{i:0;s:1:"0";} and s.orders_status_id = o.orders_status and o.date_purchased ' at line 1

 

select o.orders_id, o.customers_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where (o.customers_id = 299 OR o.customers_email_address like "dana_XXXX" OR o.customers_name like "DanaXXXX") and o.orders_status > a:1:{i:0;s:1:"0";} and s.orders_status_id = o.orders_status and o.date_purchased >= "20120902" and ot.class = "ot_total"

 

 

Dana was the last person to abandon a cart.

Link to comment
Share on other sites

[quote name=Idefix_SIN' timestamp='1273999877' post='1509071'

snapback.pngxtreme109, on 23 February 2010, 15:19, said:

 

new problem on the reports/stats page!!

 

Working... 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";} and s.orders_status_id = o.orders_stat' at line 1

 

select o.orders_id, o.customers_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where (o.customers_id = 39 OR o.customers_email_address like "evan@@xxx.com" OR o.customers_name like "Evan xxx") and o.orders_status > a:3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";} and s.orders_status_id = o.orders_status and o.date_purchased >= "20100223" and ot.class = "ot_total"

 

Ideas?

 

]

I have exactly the same problem. Any solution to this yet??

 

Thanks !

Link to comment
Share on other sites

  • 1 month later...

Hi, I have installed this contrib last week and it works to my full statisfaction. :)

 

I have a question however.

The installation is 2.2 RC2, with version 2.0a of this contrib.

 

When I sent the e-mails, they arrive in plain text, showing the HTML tags. I can live with is, but this could look better.

 

Is there a setting or patch or so?

 

Cheers, Rene

Link to comment
Share on other sites

It looks like this problem has been around for a while. Any solutions?

This is what I get

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':1:{i:0;s:1:"0";} and s.orders_status_id = o.orders_status and o.date_purchased ' at line 1

 

select o.orders_id, o.customers_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where (o.customers_id = 299 OR o.customers_email_address like "dana_XXXX" OR o.customers_name like "DanaXXXX") and o.orders_status > a:1:{i:0;s:1:"0";} and s.orders_status_id = o.orders_status and o.date_purchased >= "20120902" and ot.class = "ot_total"

 

 

Dana was the last person to abandon a cart.

 

 

I found this on a French site, it worked for me:

 

 

Patch for stats_recover_cart_sales.php

 

REPLACE:

 $orders_query_raw = "select o.customers_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where (o.customers_id = " . (int)$cid . ' OR o.customers_email_address like "' . $crec['customers_email_address'] .'" OR o.customers_name like "' . $crec['customers_firstname'] . ' ' . $crec['customers_lastname'] . '") and o.orders_status > ' . RCS_PENDING_SALE_STATUS . ' and s.orders_status_id = o.orders_status and o.date_purchased >= "' . $inrec['dateadded'] . '" and ot.class = "ot_total"';

BY:

 

 

 $orders_query_raw = "select o.orders_id, o.customers_id, o.date_purchased, s.orders_status_name, ot.text as order_total, ot.value from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where (o.customers_id = " . (int)$cid . ' OR o.customers_email_address like "' . $crec['customers_email_address'] .'" OR o.customers_name like "' . $crec['customers_firstname'] . ' ' . $crec['customers_lastname'] . '") and orders_status NOT IN (' . implode(unserialize(RCS_PENDING_SALE_STATUS), ',') . ') and s.orders_status_id = o.orders_status and o.date_purchased >= "' . $inrec['dateadded'] . '" and ot.class = "ot_total"';

Edited by honda4
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Getting started early on new years resolutions, one of which to get RCS fully functional. Few months ago I migrated my sites (started over completely new) over to osc 2.3.1

 

1) I added the Multiple Dropdown Config addon (http://addons.oscommerce.com/info/6634)

2) Uploaded the RCS files to the appropriate locations

3) Added the sql for RCS

4) Found the forum reference to missing language file (stats_recover_cart_sales.php) and added that. That took care of the missing headers on the RCS report page.

 

Sign in under my test account and abandon a cart, then sign out. Run the RCS report under the Tools menu works correctly. Emails are sent correctly, and shown as having contacted the customer. If I then sign back in as the customer and complete the transaction, the abandoned cart is removed from the RCS report under Tools.

 

Here's where the last problem occurs: Under the Recovered Cart Sales Report (Under Reports), Examined Records and Recovered Sales are zero. Everything but this last step works.

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