Esempio n. 1
0
    /**
     * Prepare html output
     *
     * @return string
     */
    protected function _toHtml()
    {
        $order = $this->getOrder();
        $orderRow = Mage::getModel('bronto_order/queue')->load($order->getId());
        $tid = $orderRow->getBrontoTid();
        $imported = $orderRow->getBrontoImported();
        $deliveryHtml = empty($tid) ? $this->_getNoHtml() : $this->_getYesHtml();
        $importedHtml = empty($imported) ? $this->_getNoHtml() : $this->_getYesHtml();
        $html = parent::_toHtml();
        $html .= <<<SCRIPT
<script>
var orderTable, orderTableRow, orderTableCell;

// Add Delivery Row
// orderTableRow  = orderTable.insertRow(orderTable.rows.length);
// orderTableCell = orderTableRow.insertCell(0);
// orderTableCell.innerHTML = "<label>Associated with Bronto Delivery?</label>";
// orderTableCell = orderTableRow.insertCell(1);
// orderTableCell.innerHTML = "{$deliveryHtml}";

// Add Imported Row
// orderTableRow  = orderTable.insertRow(orderTable.rows.length);
// orderTableCell = orderTableRow.insertCell(0);
// orderTableCell.innerHTML = "<label>Imported into Bronto?</label>";
// orderTableCell = orderTableRow.insertCell(1);
// orderTableCell.innerHTML = "{$importedHtml}";
</script>
SCRIPT;
        return $html;
    }
Esempio n. 2
0
 protected function _toHtml()
 {
     $html = parent::_toHtml();
     $list = Mage::app()->getLayout()->createBlock('amorderattr/adminhtml_order_attribute_view_list');
     $html = preg_replace('@<div class="entry-edit">(\\s*)<div class="entry-edit-head">(\\s*)(.*?)head-products@', $list->toHtml() . '<div class="entry-edit"><div class="entry-edit-head">$3head-products', $html, 1);
     return $html;
 }
Esempio n. 3
0
 protected function _toHtml()
 {
     $html = parent::_toHtml();
     $attachments = Mage::app()->getLayout()->createBlock('amorderattach/adminhtml_sales_order_view_attachment');
     $html = preg_replace('@<div class="box-left">(\\s*)<!--Billing Address-->(\\s*)<div class="entry-edit">(\\s*)<div class="entry-edit-head">(\\s*)(.*?)head-billing-address@', $attachments->toHtml() . '<div class="box-left"><div class="entry-edit"><div class="entry-edit-head">$5head-billing-address', $html, 1);
     return $html;
 }
Esempio n. 4
0
 public function getPaymentHtml()
 {
     $order = $this->getOrder();
     $html = parent::getPaymentHtml();
     if ($order->getState() != "canceled") {
         $clearsale = Mage::getModel('cammino_clearsale/gateway');
         $url = $clearsale->getScoreUrl($order);
         $html .= "<div style=\"margin-left:-8px;\"><iframe style=\"width:277px;height:96px;border:none;\" src=\"" . $url . "\"></iframe></div>";
     }
     return $html;
 }
Esempio n. 5
0
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('fooman/jirafe/order/view/tab/analytics.phtml');
 }
Esempio n. 6
0
 /**
  * Retrive giftmessage block html
  *
  * @return string
  */
 public function getGiftmessageHtml()
 {
     return parent::getGiftmessageHtml();
 }
Esempio n. 7
0
    public function getGiftOptionsHtml()
    {
        $parentHTML = parent::getGiftOptionsHtml();
        $order = $this->getOrder();
        $payment = $order->getPayment();
        $output = "";
        $outputlines = array();
        $billingCountry = Zend_Locale_Data::getContent(Mage::app()->getLocale()->getLocale(), 'country', $order->getBillingAddress()->getCountry());
        $remainingCredits = Mage::getResourceModel('frauddetection/stats')->getValue("remaining_maxmind_credits");
        $result = Mage::getModel('frauddetection/result')->loadByOrderId($order->getId());
        $res = @unserialize(utf8_decode($result->getFraudData()));
        if (empty($res)) {
            if ($payment->getId()) {
                $res = $this->helper('frauddetection')->normaliseMaxMindResponse($this->helper('frauddetection')->getMaxMindResponse($payment));
                if (empty($res['err']) || !in_array($res['err'], Directshop_FraudDetection_Model_Result::$fatalErrors)) {
                    Mage::helper('frauddetection')->saveFraudData($res, $order);
                }
            } else {
                $res = array('errmsg' => 'This order has no payment data.');
            }
        }
        // for backwards compatibility
        if (!isset($res['ourscore']) && isset($res['score'])) {
            $res['ourscore'] = $res['score'];
        }
        if (isset($res['err']) && (in_array($res['err'], Directshop_FraudDetection_Model_Result::$fatalErrors) || $res['ourscore'] == -1)) {
            $output = isset($res['errmsg']) ? $res['errmsg'] : $res['err'];
        } else {
            $score = 0;
            if (isset($res['ourscore'])) {
                $score = $res['ourscore'];
            }
            $colour = "auto";
            if ($res['ourscore'] >= Mage::getStoreConfig('frauddetection/general/threshold')) {
                $colour = "red";
            }
            $per = "N/A";
            if (isset($score) && !empty($score)) {
                $riskScore = number_format($score, 2);
                if ($riskScore >= 0.1 && $riskScore <= 4.99) {
                    $per = "90%";
                } else {
                    if ($riskScore >= 5 && $riskScore <= 9.99) {
                        $per = "5%";
                    } else {
                        if ($riskScore >= 10 && $riskScore <= 29.99) {
                            $per = "3%";
                        } else {
                            if ($riskScore >= 30 && $riskScore <= 99.98999999999999) {
                                $per = "2%";
                            }
                        }
                    }
                }
            }
            $output = "<table class='form-list' cellspacing='0'><tbody><tr><td class='label' style='width: 135px;'><label style='width: 135px;'>Risk Score Estimate (%)</label></td><td><span style='color:{$colour};font-weight:bold;display: block;margin-top: 5px;'>{$score}%  (Approximately {$per} of all orders fall in this range)</span></td></tr></tbody></table>";
        }
        $newHTML = <<<EOD
<div class="box-left">
\t<div class="entry-edit-head"><h4 class="icon-head head-payment-method">Fraud Detection</h4></div>
\t<fieldset>
\t\t{$output}
\t\t<small style="float:right;text-align:right;">Maxmind Credits Remaining: {$remainingCredits}<br/><a href="http://www.maxmind.com/app/ccfd_promo?promo=DIRECTSHOP3942">Purchase Additional Credits</a></small>
\t</fieldset>
</div>
EOD;
        return $newHTML . $parentHTML;
    }
Esempio n. 8
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->setTemplate('ordereditor/tab/info.phtml');
 }
Esempio n. 9
0
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('adjcartalert/quotestat.phtml');
 }