<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function get_calender_events() { $params = array(); /*Get current date*/ $current_date = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key = "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...
add comment send on one step checkout order mail in magento.
got to
\code\app\code\core\Mage\Sales\Model\order.php
go to line no 1311 find below code
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId($templateId);
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
)
);
$mailer->send();
$this->setEmailSent(true);
$this->_getResource()->saveAttribute($this, 'email_sent');
return $this;
}
replace below code
if(isset($_POST['comments'])){
$comment = $_REQUEST['comments'];
}else {
$orderId = $this->getRealOrderId();
$comment = $this->__getComment($orderId);
}
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId($templateId);
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml,
'comment'=>$comment ,
)
);
$mailer->send();
$this->setEmailSent(true);
$this->_getResource()->saveAttribute($this, 'email_sent');
return $this;
}
public function __getComment($oderId=""){
if(!empty($oderId)){
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT * FROM sales_flat_order_grid where increment_id="'.$oderId.'"';
$results = $readConnection->fetchAll($query);
$val=$results[0]['entity_id'];
$query1 = 'SELECT * FROM sales_flat_order_status_history where parent_id='.$val;
$results1= $readConnection->fetchAll($query1);
$commentval= $results1[1]['comment'];
$commentval = explode(":", $commentval);
return $commentval[1];
}
//return false;
}
then in the mail template add below code
Your comment: {{var comment}}
got to
\code\app\code\core\Mage\Sales\Model\order.php
go to line no 1311 find below code
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId($templateId);
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml
)
);
$mailer->send();
$this->setEmailSent(true);
$this->_getResource()->saveAttribute($this, 'email_sent');
return $this;
}
replace below code
if(isset($_POST['comments'])){
$comment = $_REQUEST['comments'];
}else {
$orderId = $this->getRealOrderId();
$comment = $this->__getComment($orderId);
}
// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId($templateId);
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml,
'comment'=>$comment ,
)
);
$mailer->send();
$this->setEmailSent(true);
$this->_getResource()->saveAttribute($this, 'email_sent');
return $this;
}
public function __getComment($oderId=""){
if(!empty($oderId)){
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = 'SELECT * FROM sales_flat_order_grid where increment_id="'.$oderId.'"';
$results = $readConnection->fetchAll($query);
$val=$results[0]['entity_id'];
$query1 = 'SELECT * FROM sales_flat_order_status_history where parent_id='.$val;
$results1= $readConnection->fetchAll($query1);
$commentval= $results1[1]['comment'];
$commentval = explode(":", $commentval);
return $commentval[1];
}
//return false;
}
then in the mail template add below code
Your comment: {{var comment}}
Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”.
ReplyDeleteBagAndCanvas
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
ReplyDelete검증사이트