コード例 #1
0
 /**
  * Check order view availability
  *
  * @param   Enterprise_Rma_Model_Rma $rma
  * @return  bool
  */
 protected function _canViewRma($rma)
 {
     $currentOrder = Mage::registry('current_order');
     if ($rma->getOrderId() && $rma->getOrderId() === $currentOrder->getId()) {
         return true;
     }
     return false;
 }
コード例 #2
0
 /**
  * Check order view availability
  *
  * @param   Enterprise_Rma_Model_Rma $rma
  * @return  bool
  */
 protected function _canViewRma($rma)
 {
     if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
         $currentOrder = Mage::registry('current_order');
         if ($rma->getOrderId() && $rma->getOrderId() === $currentOrder->getId()) {
             return true;
         }
         return false;
     } else {
         return true;
     }
 }
コード例 #3
0
 /**
  * Sending authorizing email with RMA data
  *
  * @return Enterprise_Rma_Model_Rma
  */
 public function sendAuthorizeEmail()
 {
     if ($this->_config->transactionalEmailer === 'eb2c') {
         return $this;
     } else {
         return parent::sendAuthorizeEmail();
     }
 }
コード例 #4
0
 /**
  * Configuration for popup window for packaging
  *
  * @param Enterprise_Rma_Model_Rma $model
  * @return string
  */
 protected function _getConfigDataJson($model)
 {
     $urlParams = array();
     $itemsQty = array();
     $itemsPrice = array();
     $itemsName = array();
     $itemsWeight = array();
     $itemsProductId = array();
     $urlParams['id'] = $model->getId();
     $items = $model->getShippingMethods(true);
     $createLabelUrl = $this->getUrl('*/*/saveShipping', $urlParams);
     $itemsGridUrl = $this->getUrl('*/*/getShippingItemsGrid', $urlParams);
     $thisPage = $this->getUrl('*/*/edit', $urlParams);
     $code = $this->getRequest()->getParam('method');
     $carrier = Mage::helper('enterprise_rma')->getCarrier($code, $model->getStoreId());
     if ($carrier) {
         $getCustomizableContainers = $carrier->getCustomizableContainerTypes();
     }
     foreach ($items as $item) {
         $itemsQty[$item->getItemId()] = $item->getQty();
         $itemsPrice[$item->getItemId()] = $item->getPrice();
         $itemsName[$item->getItemId()] = $item->getName();
         $itemsWeight[$item->getItemId()] = $item->getWeight();
         $itemsProductId[$item->getItemId()] = $item->getProductId();
         $itemsOrderItemId[$item->getItemId()] = $item->getItemId();
     }
     $shippingInformation = $this->getLayout()->createBlock('enterprise_rma/adminhtml_rma_edit_tab_general_shipping_information')->setIndex($this->getRequest()->getParam('index'))->toHtml();
     $data = array('createLabelUrl' => $createLabelUrl, 'itemsGridUrl' => $itemsGridUrl, 'errorQtyOverLimit' => Mage::helper('enterprise_rma')->__('The quantity you want to add exceeds the total shipped quantity for some of selected Product(s)'), 'titleDisabledSaveBtn' => Mage::helper('enterprise_rma')->__('Products should be added to package(s)'), 'validationErrorMsg' => Mage::helper('enterprise_rma')->__('The value that you entered is not valid.'), 'shipmentItemsQty' => $itemsQty, 'shipmentItemsPrice' => $itemsPrice, 'shipmentItemsName' => $itemsName, 'shipmentItemsWeight' => $itemsWeight, 'shipmentItemsProductId' => $itemsProductId, 'shipmentItemsOrderItemId' => $itemsOrderItemId, 'shippingInformation' => $shippingInformation, 'thisPage' => $thisPage, 'customizable' => $getCustomizableContainers);
     return Mage::helper('core')->jsonEncode($data);
 }
コード例 #5
0
ファイル: Data.php プロジェクト: hientruong90/ee_14_installer
 /**
  * Retrieve tracking url with params
  *
  * @param  string $key
  * @param  Enterprise_Rma_Model_Shipping|Enterprise_Rma_Model_Rma $model
  * @param  string $method - option
  * @return string
  */
 protected function _getTrackingUrl($key, $model, $method = 'getId')
 {
     $param = array('hash' => Mage::helper('core')->urlEncode("{$key}:{$model->{$method}()}:{$model->getProtectCode()}"));
     $storeId = is_object($model) ? $model->getStoreId() : null;
     $storeModel = Mage::app()->getStore($storeId);
     return $storeModel->getUrl('rma/tracking/popup', $param);
 }
コード例 #6
0
ファイル: Item.php プロジェクト: hazaeluz/magento_connect
 /**
  * Declare rma instance
  *
  * @param   Enterprise_Rma_Model_Rma $rma
  * @return  Enterprise_Rma_Model_Item
  */
 public function setRma(Enterprise_Rma_Model_Rma $rma)
 {
     $this->_rma = $rma;
     $this->setRmaEntityId($rma->getId());
     return $this;
 }