The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 03-09-2012, 08:02 AM
CALL4EATS99's Avatar
CALL4EATS99 is offline
 
Join Date: Mar 2012
Posts: 2
Default

SMS ME ON PLACED ORDER


I WANT TO RECEIVE AN SMS AFTER A USER PLACES AN ORDER WITH THERE ORDER AND TELEPHONE NUMBER.

WWW.CALL4EATS.COM

HELP??? I HAVE TRIED POSTBIN AND GET IN PHP BUT NO SUCCESS.

WHAT DO YOU SUGGEST?

ARRAN
  #2  
Old 03-10-2012, 01:33 PM
WoodYouLike's Avatar
WoodYouLike WoodYouLike is offline
 
Join Date: Aug 2010
Posts: 593
Default

First, leave the Caps-lock off ;-)

Are you using the API option? See here for instant notifications http://kb.ecwid.com/w/page/25232810/...tificationsAPI
__________________
Owner/manager of [URL="http://www.woodyoulike.co.uk"]Wood You Like Ltd[/URL], independent retailer of quality wooden flooring in rural Kent UK
Creator of E-guide "[URL="http://blog.1plus1makes3.co.uk/selling-online.html"]Selling Online Basics[/URL]" :ecwid:
  #3  
Old 03-10-2012, 02:07 PM
CALL4EATS99's Avatar
CALL4EATS99 CALL4EATS99 is offline
 
Join Date: Mar 2012
Posts: 2
Wink any thoughts???

yes, i am. can you help? so far i have this

<?php


$event_type = $_POST['event_type'];
$order_id = $_POST['order_id'];
$url = 'https://app.ecwid.com/api/v1/1081047/orders?secure_auth_key=1H8ZHzTNpJqg&order=8'.$orde r_id;

$gJSON=file_get_contents($url);
$gArray = JSON_decode($gJSON,true);

var_dump($gArray);

// print_r($gJSON);

foreach ($gArray as $value){
echo 'Name: '.$value[0][1][2][3]['name'].'<br>';
echo 'Name: '.$value[3][name].'<br>';
echo 'Name: '.$value[2][1].'<br>';
echo 'Name: '.$value[3][2].'<br>';
echo 'Name: '.$value[4][0].'<br>';



echo 'street: '.$value[2][street].'<br>';
echo 'postalCode: '.$value[1][postalCode].'<br>';
echo 'phone: '.$value[phone].'<br>';
echo 'items: '.$value[items].'<br>';

}




include("wp-includes/class-phpmailer.php");

function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = 'arrangilligan@gmail.com';
$mail->Password = 'mypass';
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
}

//if (smtpmailer('order@call4eats.com', 'arran@gilligan.com', 'arran', 'test mail message', 'event_type: '.$event_type.'\n order id: '.$order_id.' \nurl : ')) {
// do something
//}
if (!empty($error)) echo $error;

?>

but my foreach array loop is a problem because to display . i am testing with phpmailer class but i will use a sms class eventually.


main problems are free sms providers and the loop to display info and send it via sms ??????

help on the loop would be good.
  #4  
Old 03-10-2012, 02:25 PM
WoodYouLike's Avatar
WoodYouLike WoodYouLike is offline
 
Join Date: Aug 2010
Posts: 593
Default

sorry, not enough experience with the API myself to see where it goes wrong or how to sort it.
__________________
Owner/manager of [URL="http://www.woodyoulike.co.uk"]Wood You Like Ltd[/URL], independent retailer of quality wooden flooring in rural Kent UK
Creator of E-guide "[URL="http://blog.1plus1makes3.co.uk/selling-online.html"]Selling Online Basics[/URL]" :ecwid:
  #5  
Old 03-13-2012, 03:29 PM
Eugene Rimmer's Avatar
Eugene Rimmer Eugene Rimmer is offline
Senior Member
 
Join Date: Jan 2011
Location: Ecwid headquarters
Posts: 7,765
Default

Quote:
Originally Posted by CALL4EATS99 View Post
yes, i am. can you help? so far i have this

<?php


$event_type = $_POST['event_type'];
$order_id = $_POST['order_id'];
$url = 'https://app.ecwid.com/api/v1/1081047/orders?secure_auth_key=1H8ZHzTNpJqg&order=8'.$orde r_id;

$gJSON=file_get_contents($url);
$gArray = JSON_decode($gJSON,true);

var_dump($gArray);

// print_r($gJSON);

foreach ($gArray as $value){
echo 'Name: '.$value[0][1][2][3]['name'].'<br>';
echo 'Name: '.$value[3][name].'<br>';
echo 'Name: '.$value[2][1].'<br>';
echo 'Name: '.$value[3][2].'<br>';
echo 'Name: '.$value[4][0].'<br>';



echo 'street: '.$value[2][street].'<br>';
echo 'postalCode: '.$value[1][postalCode].'<br>';
echo 'phone: '.$value[phone].'<br>';
echo 'items: '.$value[items].'<br>';

}




include("wp-includes/class-phpmailer.php");

function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = 'arrangilligan@gmail.com';
$mail->Password = 'mypass';
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
}

//if (smtpmailer('order@call4eats.com', 'arran@gilligan.com', 'arran', 'test mail message', 'event_type: '.$event_type.'\n order id: '.$order_id.' \nurl : ')) {
// do something
//}
if (!empty($error)) echo $error;

?>

but my foreach array loop is a problem because to display . i am testing with phpmailer class but i will use a sms class eventually.


main problems are free sms providers and the loop to display info and send it via sms ??????

help on the loop would be good.
I can see at least one mistake in your PHP code:
Code:
$url = 'https://app.ecwid.com/api/v1/1081047/orders?secure_auth_key=1H8ZHzTNpJqg&order=8'.$orde  r_id;
Highlighted in bold and underlined above is the numeric eight that you add into every enpoint URL of your Order API requests. Most of the time such requests will return an error, since such orders do not exist in your store. Please, try removing that digit 8 from the URL and see if it works now.
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
sms order

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:05 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.