Skip to content

Instantly share code, notes, and snippets.

@steverobbins
Last active July 1, 2017 02:25
Show Gist options
  • Save steverobbins/f2494fcb915ccc55d61f to your computer and use it in GitHub Desktop.
Save steverobbins/f2494fcb915ccc55d61f to your computer and use it in GitHub Desktop.
<?php
include 'app/Mage.php';
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
umask(0);
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::app($mageRunCode, $mageRunType);
Mage::register('wishlist', Mage::getModel('wishlist/wishlist')->load(5620));
echo Mage::getModel('core/email_template')->loadDefault('wishlist_email_email_template')->getProcessedTemplate(array(
'customer' => Mage::getModel('customer/customer')->load(95998),
'salable' => 'yes',
'items' => Mage::app()->getLayout()->createBlock('wishlist/share_email_items')->toHtml(),
'addAllLink' => Mage::getUrl('*/shared/allcart', array('code' => 'foo')),
'viewOnSiteLink' => Mage::getUrl('*/shared/index', array('code' => 'foo')),
'message' => 'Buy this'
));
exit;
$order = Mage::getModel('sales/order')->loadByIncrementId(200007810);
$storeId = $order->getStore()->getId();
$paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())
->setIsSecureMode(true);
$paymentBlock->getMethod()->setStore($storeId);
$paymentBlockHtml = $paymentBlock->toHtml();
echo Mage::getModel('core/email_template')->load(3)/*->loadDefault('sales_email_order_template')*/->getProcessedTemplate(array(
'order' => $order,
'billing' => $order->getBillingAddress(),
'payment_html' => $paymentBlockHtml
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment