/**
  * 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);
 }
Exemple #2
0
 /**
  * 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;
 }