Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SMS Text Message Order Notification v1.0


Sid04

Recommended Posts

I wanted to reply i the support thread( http://www.oscommerce.com/forums/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('', '[email protected];[email protected]', $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

 

I added the above to checkout_process.php and changed the "[email protected];[email protected]" 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!

Link to comment
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.

Link to comment
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('', '[email protected];[email protected]', $SMS_subject, $SMS_order, STORE_OWNER, STORE_NAME);

Link to comment
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('', '[email protected];[email protected]', $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:

Link to comment
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 '[email protected]' instead of 'Shop Owner <[email protected]>' 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.

Link to comment
Share on other sites

  • 4 weeks later...

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);
 }

Link to comment
Share on other sites

  • 1 month later...
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);

Link to comment
Share on other sites

  • 1 month later...

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

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