示例#1
0
 public function postProcess()
 {
     parent::postProcess();
     if (Tools::isSubmit('markAsReceived')) {
         $idOrder = (int) Tools::getValue('id_order');
         $order = new Order($idOrder);
         if (Validate::isLoadedObject($order)) {
             if ($order->getCurrentState() == 15) {
                 $new_history = new OrderHistory();
                 $new_history->id_order = (int) $order->id;
                 $new_history->changeIdOrderState(16, $order);
                 // 16: Ready for Production
                 //var_dump($order,$new_history);
                 $myfile = fopen(PS_PRODUCT_IMG_PATH . "/orders/" . $order->reference . ".txt", "w") or die("Unable to open file!");
                 $txt = "Order Confirmed\n Order Reference: " . $order->reference;
                 fwrite($myfile, $txt);
                 fclose($myfile);
                 $new_history->addWithemail(true);
             }
             $this->context->smarty->assign('receipt_confirmation', true);
         } else {
             $this->_errors[] = Tools::displayError('Error: Invalid order number');
         }
     }
 }
 public function initContent()
 {
     parent::initContent();
     $_legal = Module::getInstanceByName('eu_legal');
     if (Validate::isLoadedObject($_legal) && Module::isInstalled($_legal->name) && Module::isEnabled($_legal->name)) {
         if ($tpl = $_legal->getThemeOverride('order-detail')) {
             $this->setTemplate($tpl);
         }
     }
 }
示例#3
0
 public function setMedia()
 {
     if (Tools::getValue('ajax') != 'true') {
         parent::setMedia();
         $this->addCSS(_THEME_CSS_DIR_ . 'history.css');
         $this->addCSS(_THEME_CSS_DIR_ . 'addresses.css');
     }
 }