本文整理汇总了PHP中order::getCustomerId方法的典型用法代码示例。如果您正苦于以下问题:PHP order::getCustomerId方法的具体用法?PHP order::getCustomerId怎么用?PHP order::getCustomerId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类order
的用法示例。
在下文中一共展示了order::getCustomerId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderBonusPayment
public function renderBonusPayment(order $order, $template)
{
list($tpl_block) = def_module::loadTemplates("emarket/payment/" . $template, 'bonus_block');
$customer = customer::get($order->getCustomerId());
$block_arr = array('bonus' => $this->formatCurrencyPrice(array('reserved_bonus' => $order->getBonusDiscount(), 'available_bonus' => $customer->bonus, 'spent_bonus' => $customer->spent_bonus, 'actual_total_price' => $order->getActualPrice())));
$block_arr['void:reserved_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getBonusDiscount())));
$block_arr['void:available_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->bonus)));
$block_arr['void:spent_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->spent_bonus)));
$block_arr['void:actual_total_price'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getActualPrice())));
return def_module::parseTemplate($tpl_block, $block_arr);
}
示例2: sendCustomerNotification
public function sendCustomerNotification(order $order, $changedStatus, $codeName)
{
$customer = umiObjectsCollection::getInstance()->getObject($order->getCustomerId());
$email = $customer->email ? $customer->email : $customer->getValue("e-mail");
if ($email) {
$name = $customer->lname . " " . $customer->fname . " " . $customer->father_name;
$langs = cmsController::getInstance()->langs;
$statusString = "";
$subjectString = $langs['notification-status-subject'];
$regedit = regedit::getInstance();
switch ($changedStatus) {
case 'status_id':
if ($regedit->getVal('//modules/emarket/no-order-status-notification')) {
return;
}
if ($codeName == 'waiting') {
$paymentStatusCodeName = order::getCodeByStatus($order->getPaymentStatus());
$pkey = 'notification-status-payment-' . $paymentStatusCodeName;
$okey = 'notification-status-' . $codeName;
$statusString = $paymentStatusCodeName == 'initialized' ? (isset($langs[$okey]) ? $langs[$okey] . " " . $langs['notification-and'] : "") . (isset($langs[$pkey]) ? " " . $langs[$pkey] : "") : (isset($langs[$pkey]) ? $langs[$pkey] . " " . $langs['notification-and'] : "") . (isset($langs[$okey]) ? " " . $langs[$okey] : "");
$subjectString = $langs['notification-client-neworder-subject'];
} else {
$key = 'notification-status-' . $codeName;
$statusString = isset($langs[$key]) ? $langs[$key] : "_";
}
break;
case 'payment_status_id':
if ($regedit->getVal('//modules/emarket/no-payment-status-notification')) {
return;
}
$key = 'notification-status-payment-' . $codeName;
$statusString = isset($langs[$key]) ? $langs[$key] : "_";
break;
case 'delivery_status_id':
if ($regedit->getVal('//modules/emarket/no-delivery-status-notification')) {
return;
}
$key = 'notification-status-delivery-' . $codeName;
$statusString = isset($langs[$key]) ? $langs[$key] : "_";
break;
}
$collection = umiObjectsCollection::getInstance();
$paymentObject = $collection->getObject($order->payment_id);
if ($paymentObject) {
$paymentType = $collection->getObject($paymentObject->payment_type_id);
$paymentClassName = $paymentType->class_name;
} else {
$paymentClassName = null;
}
$templateName = $paymentClassName == "receipt" ? "status_notification_receipt" : "status_notification";
list($template) = def_module::loadTemplatesForMail("emarket/mail/default", $templateName);
$param = array();
$param["order_id"] = $order->id;
$param["order_name"] = $order->name;
$param["order_number"] = $order->number;
$param["status"] = $statusString;
$domain = cmsController::getInstance()->getCurrentDomain();
$currentHost = getServer('HTTP_HOST');
$param["domain"] = $domain->getHost();
if ($param["domain"] != $currentHost) {
$mirrowsList = $domain->getMirrowsList();
foreach ($mirrowsList as $mirrow) {
if ($mirrow->getHost() == $currentHost) {
$param["domain"] = $mirrow->getHost();
}
}
}
if ($paymentClassName == "receipt") {
$param["receipt_signature"] = sha1("{$customer->id}:{$customer->email}:{$order->order_date}");
}
$content = def_module::parseTemplateForMail($template, $param);
$regedit = regedit::getInstance();
$letter = new umiMail();
$letter->addRecipient($email, $name);
$cmsController = cmsController::getInstance();
$domains = domainsCollection::getInstance();
$domainId = $cmsController->getCurrentDomain()->getId();
$defaultDomainId = $domains->getDefaultDomain()->getId();
if ($regedit->getVal("//modules/emarket/from-email/{$domainId}")) {
$fromMail = $regedit->getVal("//modules/emarket/from-email/{$domainId}");
$fromName = $regedit->getVal("//modules/emarket/from-name/{$domainId}");
} elseif ($regedit->getVal("//modules/emarket/from-email/{$defaultDomainId}")) {
$fromMail = $regedit->getVal("//modules/emarket/from-email/{$defaultDomainId}");
$fromName = $regedit->getVal("//modules/emarket/from-name/{$defaultDomainId}");
} else {
$fromMail = $regedit->getVal("//modules/emarket/from-email");
$fromName = $regedit->getVal("//modules/emarket/from-name");
}
$letter->setFrom($fromMail, $fromName);
$letter->setSubject($subjectString);
$letter->setContent($content);
$letter->commit();
$letter->send();
}
}