Jump to content
Sign in to follow this  
Sid04

SMS Text Message Order Notification v1.0

Recommended Posts

I wanted to reply i the support thread( http://forums.oscommerce.com/index.php?sho...mp;#entry863307 ), but apparently your not allowed to :)

 

Heres the contrib:

http://www.oscommerce.com/community/contributions,4253

 

Heres everything thats added(to checkout_process.php):

//Prepare SMS Message

$SMS_subject = STORE_NAME . ' ' . $insert_id;
$SMS_order = '';
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text'] . ' to ' . $order->customer['state']) . "\n";
 }

  tep_mail('', 'phonenumber@mobile.mycingular.com;phonenumber2@mobile.mycingular.com', $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

 

I added the above to checkout_process.php and changed the "phonenumber@mobile.mycingular.com;phonenumber2@mobile.mycingular.com" to my cell address(which is actually '@cingularme.com'). It doesnt send anything upon checkout. Any ideas why it wouldnt work? I can add the same email address im using to 'send extra order emails to' in admin config and it gets the message.

 

Thanks for any help!

Share this post


Link to post
Share on other sites

Ok, problem was related to having another email invoice contribution installed.

 

I am now recieving the SMS messages. New problem though:

 

The messages are still over 160 characters. After every part it sends......sub total, shipping, sales tax(which i didnt think it was suppose to do anyhow) and grand total it lists the destination state. So its listing the destination state a couple times.

Share this post


Link to post
Share on other sites
Ok, problem was related to having another email invoice contribution installed.

 

I am now recieving the SMS messages. New problem though:

 

The messages are still over 160 characters. After every part it sends......sub total, shipping, sales tax(which i didnt think it was suppose to do anyhow) and grand total it lists the destination state. So its listing the destination state a couple times.

 

If you remove this portion [ . ' to ' . $order->customer['state']) . "\n" ] so that the code looks like the part below you will not receive information on where the order is going and it should fit in one sms.

 

//Prepare SMS Message

 

$SMS_subject = STORE_NAME . ' ' . $insert_id;

$SMS_order = '';

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text'];

}

 

tep_mail('', 'phonenumber@mobile.mycingular.com;phonenumber2@mobile.mycingular.com', $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

Share this post


Link to post
Share on other sites
If you remove this portion [ . ' to ' . $order->customer['state']) . "\n" ] so that the code looks like the part below you will not receive information on where the order is going and it should fit in one sms.

 

//Prepare SMS Message

 

$SMS_subject = STORE_NAME . ' ' . $insert_id;

$SMS_order = '';

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {

$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text'];

}

 

tep_mail('', 'phonenumber@mobile.mycingular.com;phonenumber2@mobile.mycingular.com', $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

 

Does it need a ')' after "strip_tags($order_totals[$i]['text']" ?

So it would look like:

$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']);

Is that correct or did you have it right?

Thanks for your time. :thumbsup:

Share this post


Link to post
Share on other sites

Nevermind, I updated to the new version you posted. Works great :thumbsup:

 

Question.....if you only put the address in the admin section such as '8015556789@vtext.com' instead of 'Shop Owner <8015556789@vtext.com>' what does that do? Ive always wondered that....I only use the email address for the "send extra order emails to" section as well instead of the whole 'Name 1 <email@address1>' deal.

Share this post


Link to post
Share on other sites

my client uses this contrib and loves it, but he was wanting to also see WHAT PRODUCT was ordered in the SMS, how can I add that?

 

I figure its gotta be in this code somewhere:

 

//Prepare SMS Message
 if (SEND_EXTRA_ORDER_SMS_TO != '') {

$SMS_subject = STORE_NAME . ' ' . $insert_id;
$SMS_order = '';
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

tep_mail('', SEND_EXTRA_ORDER_SMS_TO, $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);
 }

Share this post


Link to post
Share on other sites
my client uses this contrib and loves it, but he was wanting to also see WHAT PRODUCT was ordered in the SMS, how can I add that?

 

I figure its gotta be in this code somewhere:

 

//Prepare SMS Message
 if (SEND_EXTRA_ORDER_SMS_TO != '') {

$SMS_subject = STORE_NAME . ' ' . $insert_id;
$SMS_order = '';
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

tep_mail('', SEND_EXTRA_ORDER_SMS_TO, $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);
 }

 

 

Sorry for the delay in replies. I don't really check the forums very often. It depends what part of the product ordered he wants to have in the SMS. You could have the whole Model, Description, Quantity, Price if you wanted to but that would take it to multiple SMS messages per order. I don't even like to have two per order but if he does want that let me know what he wants and I can give you instructions.

 

You would look for a line further up in the file that starts with this $products_ordered .= $order->products[$i]['qty']

right about that you will put $sms_products .= $order->products[$i]['qty'] . ' ' . $order->products[$i]['model'] etc. Then you would change this line:

 

tep_mail('', SEND_EXTRA_ORDER_SMS_TO, $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

 

to this

 

tep_mail('', SEND_EXTRA_ORDER_SMS_TO, $SMS_subject, $SMS_order . $sms_products, STORE_OWNER, STORE_NAME);

Share this post


Link to post
Share on other sites

I have SMS working with other payments like bank transfer and stuff but after paypal IPN she's isn't working anymore...any idea how to fix this?

 

Thanks,

 

Nigelman

Share this post


Link to post
Share on other sites

Got it here's what I did to make this work with paypal IPN!

 

in the file catalog/includes/modules/payment/paypal_ipn I added the code:

CODE
In /catalog/checkout_process.php

Find:
----------------------------------------------------------------------------------
// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }
----------------------------------------------------------------------------------


And insert this after:
----------------------------------------------------------------------------------
//Prepare SMS Message
 if (SEND_EXTRA_ORDER_SMS_TO != '') {

$SMS_subject = STORE_NAME . ' ' . $insert_id;
$SMS_order = '';
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$SMS_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

tep_mail('', SEND_EXTRA_ORDER_SMS_TO, $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);
 }

 

 

did a fake order and no problem......remember if you want to do have SMS in your shop you will have to do a bit more (SQL install) but basically just adding this code your paypal IPN file will get you running smooth.

 

I hope someone finds this useful ;)

 

Nigelman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×