本文整理汇总了PHP中Orders::getSubstitutionArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::getSubstitutionArray方法的具体用法?PHP Orders::getSubstitutionArray怎么用?PHP Orders::getSubstitutionArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders::getSubstitutionArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendConfirmationMail
/**
* Send a confirmation e-mail with the order data
*
* Calls {@see Orders::getSubstitutionArray()}, which en route
* creates User accounts for individual electronic Products by default.
* Set $create_accounts to false when sending a copy.
* @static
* @param integer $order_id The order ID
* @param boolean $create_accounts Create User accounts for electronic
* Products it true
* @return boolean The Customers' e-mail address
* on success, false otherwise
* @access private
*/
static function sendConfirmationMail($order_id, $create_accounts = true)
{
$arrSubstitution = Orders::getSubstitutionArray($order_id, $create_accounts);
$customer_id = $arrSubstitution['CUSTOMER_ID'];
$objCustomer = Customer::getById($customer_id);
if (!$objCustomer) {
//die("Failed to get Customer for ID $customer_id");
return false;
}
$arrSubstitution += $objCustomer->getSubstitutionArray() + self::getSubstitutionArray() + array('TIMESTAMP' => date(ASCMS_DATE_FORMAT_INTERNATIONAL_DATETIME, date_timestamp_get(date_create())), 'ROOT_URL' => \Cx\Core\Routing\Url::fromDocumentRoot()->toString());
//DBG::log("sendConfirmationMail($order_id, $create_accounts): Subs: ".var_dump($arrSubstitution, true));
if (empty($arrSubstitution)) {
return false;
}
// Prepared template for order confirmation
$arrMailTemplate = array('section' => 'Shop', 'key' => 'order_confirmation', 'lang_id' => $arrSubstitution['LANG_ID'], 'to' => $arrSubstitution['CUSTOMER_EMAIL'] . ',' . \Cx\Core\Setting\Controller\Setting::getValue('email_confirmation', 'Shop'), 'substitution' => &$arrSubstitution);
//DBG::log("sendConfirmationMail($order_id, $create_accounts): Template: ".var_export($arrMailTemplate, true));
//DBG::log("sendConfirmationMail($order_id, $create_accounts): Substitution: ".var_export($arrSubstitution, true));
// NOTE: Creates some XML order file (for customizing)
// $template = file_get_contents(
// ASCMS_MODULE_PATH.'/Shop/View/Template/Backend/module_shop_export_orders.xml');
// \Cx\Core\MailTemplate\Controller\MailTemplate::substitute($template, $arrSubstitution, true);
// // Strip leftover comments from blocks: "<!---->" or "<!-- -->"
// $template = preg_replace('/<!--\s*-->/', '', $template);
// $file = new Cx\Lib\FileSystem\File(
// ASCMS_DOCUMENT_ROOT.'/orders/'.$order_id.'.xml');
// //$file->makeWritable(); // Fails on win32
// $file->write($template);
///
if (!\Cx\Core\MailTemplate\Controller\MailTemplate::send($arrMailTemplate)) {
return false;
}
return $arrSubstitution['CUSTOMER_EMAIL'];
}
示例2: getPage
//.........这里部分代码省略.........
break;
case 'cart':
self::cart();
break;
case 'discounts':
self::discounts();
break;
case 'login':
self::login();
break;
case 'paypalIpnCheck':
// OBSOLETE -- Handled by PaymentProcessing::checkIn() now
$objPaypal = new \PayPal();
$objPaypal->ipnCheck();
exit;
case 'sendpass':
self::view_sendpass();
break;
case 'changepass':
self::_changepass();
break;
// Test for PayPal IPN.
// *DO NOT* remove this! Needed for site testing.
// Test for PayPal IPN.
// *DO NOT* remove this! Needed for site testing.
case 'testIpn':
\PayPal::testIpn();
// die()s!
// Test for PayPal IPN validation
// *DO NOT* remove this! Needed for site testing.
// die()s!
// Test for PayPal IPN validation
// *DO NOT* remove this! Needed for site testing.
case 'testIpnValidate':
\PayPal::testIpnValidate();
// die()s!
// Test mail body generation
// *DO NOT* remove this! Needed for site testing.
// die()s!
// Test mail body generation
// *DO NOT* remove this! Needed for site testing.
case 'testMail':
// Test with
// http://localhost/contrexx_300/de/index.php?section=Shop&act=testMail&key=&order_id=5
//MailTemplate::errorHandler();die();
$order_id = !empty($_GET['order_id']) ? $_GET['order_id'] : 10;
$key = !empty($_GET['key']) ? $_GET['key'] : 'order_confirmation';
$arrSubstitution = Orders::getSubstitutionArray($order_id);
$customer_id = $arrSubstitution['CUSTOMER_ID'];
$objCustomer = Customer::getById($customer_id);
if (!$objCustomer) {
die("Failed to get Customer for ID {$customer_id}");
return false;
}
$arrSubstitution += $objCustomer->getSubstitutionArray($customer_id) + self::getSubstitutionArray();
$arrMailTemplate = array('section' => 'Shop', 'key' => $key, 'lang_id' => $arrSubstitution['LANG_ID'], 'substitution' => &$arrSubstitution, 'to' => 'reto.kohli@comvation.com');
\DBG::activate(DBG_LOG_FIREPHP);
// DBG::activate(DBG_LOG_FILE);
die(nl2br(contrexx_raw2xhtml(var_export($arrMailTemplate, true))));
// DBG::log(MailTemplate::send($arrMailTemplate) ? "Sent successfully" : "Sending FAILED!");
// DBG::deactivate(DBG_LOG_FILE);
break;
case 'testAttachment':
\Cx\Core\MailTemplate\Controller\MailTemplate::send(array('from' => 'reto.kohli@comvation.com', 'to' => 'reto.kohli@comvation.com', 'subject' => 'Test Attachment', 'message' => 'Test', 'attachments' => array(0 => 'images/content/banner/qualidator.gif', 'images/content/banner/itnews.gif' => 'Sch�nes Bild')));
die("Done!");
case 'pricelist':
self::send_pricelist();
break;
case 'terms':
// Static content only (fttb)
break;
// TODO: Add Order history view (see History.class.php)
// case 'history':
// self::view_history();
// break;
// TODO: Add Order history view (see History.class.php)
// case 'history':
// self::view_history();
// break;
case 'destroy':
self::destroyCart();
// TODO: Experimental
// self::destroyCart(true);
// No break on purpose
// TODO: Experimental
// self::destroyCart(true);
// No break on purpose
case 'lastFive':
case 'products':
default:
self::view_product_overview();
}
// Note that the Shop Navbar *MUST* be set up *after* the request
// has been processed, otherwise the cart info won't be up to date!
self::setNavbar();
// TODO: Set the Messages in the global template instead when that's ready
\Message::show(self::$objTemplate);
//\DBG::deactivate();
return self::$objTemplate->get();
}
示例3: sendProcessedMail
/**
* Send an e-mail to the Customer with the confirmation that the Order
* with the given Order ID has been processed
* @param integer $order_id The order ID
* @return boolean True on success, false otherwise
*/
static function sendProcessedMail($order_id)
{
$arrSubstitution = Orders::getSubstitutionArray($order_id) + self::getSubstitutionArray();
$lang_id = $arrSubstitution['LANG_ID'];
// Select template for: "Your order has been processed"
$arrMailTemplate = array('section' => 'Shop', 'key' => 'order_complete', 'lang_id' => $lang_id, 'to' => $arrSubstitution['CUSTOMER_EMAIL'], 'substitution' => &$arrSubstitution);
if (!\Cx\Core\MailTemplate\Controller\MailTemplate::send($arrMailTemplate)) {
return false;
}
return $arrSubstitution['CUSTOMER_EMAIL'];
}