本文整理汇总了PHP中KSSystem::loadTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP KSSystem::loadTemplate方法的具体用法?PHP KSSystem::loadTemplate怎么用?PHP KSSystem::loadTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KSSystem
的用法示例。
在下文中一共展示了KSSystem::loadTemplate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
defined('_JEXEC') or die('=;)');
if (!empty($this->rows)) {
foreach ($this->rows as $product) {
echo KSSystem::loadTemplate(array('product' => $product, 'params' => $this->params));
}
}
示例2: sendOrderMail
public static function sendOrderMail($order_id, $admin = false)
{
self::onExecuteBefore(array(&$order_id, &$admin));
$db = JFactory::getDBO();
JRequest::setVar('id', $order_id);
$model = KSSystem::getModel('orders');
$order = $model->getOrder();
$order->items = KSMOrders::getOrderItems($order_id);
$query = $db->getQuery(true);
$query->select('*')->from('#__ksenmart_shipping_fields')->where('shipping_id=' . $order->shipping_id)->where('position=' . $db->quote('address'))->where('published=1')->order('ordering');
$db->setQuery($query);
$address_fields = $db->loadObjectList();
$address = array();
foreach ($address_fields as $address_field) {
if ($address_field->system && isset($order->address_fields[$address_field->title])) {
$value = $order->address_fields[$address_field->title];
} elseif (!$address_field->system && isset($order->address_fields[$address_field->id])) {
$value = $order->address_fields[$address_field->id];
} else {
$value = '';
}
$title = $address_field->system ? JText::_('ksm_cart_shipping_field_' . $address_field->title) : $address_field->title;
$address[] = $title . ' - ' . $value;
}
$order->address_fields = implode(', ', $address);
$order->customer_name = '';
if (isset($order->customer_fields['name']) && !empty($order->customer_fields['name'])) {
$order->customer_name .= $order->customer_fields['name'];
}
if (isset($order->customer_fields['last_name']) && !empty($order->customer_fields['last_name'])) {
$order->customer_name .= $order->customer_fields['last_name'] . ' ';
}
if (isset($order->customer_fields['first_name']) && !empty($order->customer_fields['first_name'])) {
$order->customer_name .= $order->customer_fields['first_name'] . ' ';
}
if (isset($order->customer_fields['middle_name']) && !empty($order->customer_fields['middle_name'])) {
$order->customer_name .= $order->customer_fields['middle_name'];
}
$order->phone = isset($order->customer_fields['phone']) && !empty($order->customer_fields['phone']) ? $order->customer_fields['phone'] : '';
$mail = JFactory::getMailer();
$params = JComponentHelper::getParams('com_ksenmart');
$sender = array($params->get('shop_email'), $params->get('shop_name'));
$content = KSSystem::loadTemplate(array('order' => $order), 'order', 'default', 'mail');
$mail->isHTML(true);
$mail->setSender($sender);
$mail->Subject = 'Новый заказ №' . $order_id;
$mail->Body = $content;
if (!$admin) {
$mail->AddAddress($order->customer_fields['email'], $order->customer_fields['name']);
} else {
$mail->AddAddress($params->get('shop_email'), $params->get('shop_name'));
}
$mail->Send();
self::onExecuteAfter();
return true;
}
示例3: addComment
public function addComment($data)
{
$this->onExecuteBefore('addComment');
$user = KSUsers::getUser();
$jinput = JFactory::getApplication()->input;
$params = JComponentHelper::getParams('com_ksenmart');
$comment_object = new stdClass();
$comment_object->user_id = $user->id;
$comment_object->product_id = $data['product_id'];
$comment_object->name = $data['comment_name'];
$comment_object->comment = $data['comment_comment'];
$comment_object->good = $data['comment_good'];
$comment_object->bad = $data['comment_bad'];
$comment_object->rate = $data['comment_rate'];
if ($params->get('review_moderation', false)) {
$comment_object->published = 0;
}
try {
$result = $this->_db->insertObject('#__ksenmart_comments', $comment_object);
if ($params->get('review_notice', false)) {
$mail = JFactory::getMailer();
$sender = array($params->get('shop_email'), $params->get('shop_name'));
$content = KSSystem::loadTemplate(array('comment' => $comment_object), 'comments', 'default', 'mail');
$mail->isHTML(true);
$mail->setSender($sender);
$mail->Subject = 'Новый отзыв';
$mail->Body = $content;
$mail->AddAddress($params->get('shop_email'), $params->get('shop_name'));
$mail->Send();
}
$this->onExecuteAfter('addComment', array(&$result));
return true;
} catch (Exception $e) {
}
}