Пример #1
0
 public function shipment()
 {
     $transaction = new TransactionModel();
     $session = new Ajde_Session('AC.Shop');
     if ($session->has('currentTransaction') && $transaction->loadByPK($session->get('currentTransaction'))) {
         if (Ajde::app()->getRequest()->has('country')) {
             $transaction->shipment_country = Ajde::app()->getRequest()->getParam('country');
             $transaction->save();
         }
         $shipment = new ShippingModel($transaction);
         $method = $transaction->shipment_method;
         if (empty($method) || !$shipment->isAvailable($method)) {
             $method = $shipment->getFirstMethod()->getName();
         }
     } else {
         $shipment = false;
         $method = false;
         $transaction = false;
     }
     $this->getView()->assign('method', $method);
     $this->getView()->assign('shipment', $shipment);
     $this->getView()->assign('transaction', $transaction);
     return $this->render();
 }