public function editAction()
 {
     $id = $this->getRequest()->getParam('id');
     $model = Mage::getModel('corporate/corporate')->load($id);
     if ($model->getId() || $id == 0) {
         $data = Mage::getSingleton('adminhtml/session')->getFormData(TRUE);
         if (!empty($data)) {
             $model->setData($data);
         }
         if ($model->getShortcode()) {
             $imageFolderPath = Mage::getBaseURL('media') . DS . 'corporate' . DS . 'logos' . DS . $model->getShortcode() . '.png';
             $model->setCimage($imageFolderPath);
         }
         Mage::register('corporate_data', $model);
         $this->loadLayout();
         $this->_setActiveMenu('corporate/items');
         $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
         $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
         $this->getLayout()->getBlock('head')->setCanLoadExtJs(TRUE);
         $this->_addContent($this->getLayout()->createBlock('corporate/adminhtml_corporate_edit'))->_addLeft($this->getLayout()->createBlock('corporate/adminhtml_corporate_edit_tabs'));
         $this->renderLayout();
     } else {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('corporate')->__('Item does not exist'));
         $this->_redirect('*/*/');
     }
 }
예제 #2
0
 public function trackingCode()
 {
     $beetailerRef = Mage::getModel('core/cookie')->get('beetailer_ref');
     $beetailerRefDate = Mage::getModel('core/cookie')->get('beetailer_ref_date');
     if ($order = $this->getOrder()) {
         $res = '<script type="text/javascript" src=\'//www.beetailer.com/s.js' . '?p[order_number]=' . $order->getIncrementId() . '&p[amount]=' . urlencode(sprintf("%.2f", $order->getSubtotal())) . '&p[order_date]=' . urlencode($order->getCreatedAt()) . '&p[email]=' . urlencode($order->getCustomerEmail()) . '&p[beetailer_ref]=' . urlencode($beetailerRef) . '&p[beetailer_ref_date]=' . urlencode($beetailerRefDate) . '&p[shop_domain]=' . urlencode(Mage::getBaseURL()) . '\'></script>';
         Mage::getModel('core/cookie')->delete('beetailer_ref');
     }
     return $res;
 }
예제 #3
0
 public function indexAction()
 {
     $this->loadLayout();
     $this->_setActiveMenu('facebook-store');
     /* Load bitnami Passwd */
     $passw = $this->loadApiKey();
     $host = str_replace("/index.php", "", Mage::getBaseURL());
     $block = $this->getLayout()->createBlock('core/text', 'beetailer-admin')->setText("<iframe \nsrc='https://www.beetailer.com?from=iframe&api[key]=" . $passw . "&api[user]=beetailer&api[url]=" . $host . "' \nwidth=1124 height='7350' frameborder='0' scrolling='no' style='margin:0px auto;display:block;'></iframe>");
     $this->_addContent($block);
     $this->renderLayout();
 }