Example #1
0
 public function getItemOptions()
 {
     $result = parent::getItemOptions();
     $item = Mage::getModel('sales/order_item')->load($this->getItem()->getOrderItemId());
     if ($item->getProductType() != 'giftvoucher') {
         return $result;
     }
     if ($options = $item->getProductOptionByCode('info_buyRequest')) {
         foreach (Mage::helper('giftvoucher')->getGiftVoucherOptions() as $code => $label) {
             if ($options[$code]) {
                 $result[] = array('label' => $label, 'value' => $options[$code], 'print_value' => $options[$code]);
             }
         }
     }
     $giftVouchers = Mage::getModel('giftvoucher/giftvoucher')->getCollection()->addItemFilter($item->getId());
     if ($giftVouchers->getSize()) {
         $giftVouchersCode = array();
         foreach ($giftVouchers as $giftVoucher) {
             $currency = Mage::getModel('directory/currency')->load($giftVoucher->getCurrency());
             $balance = $giftVoucher->getBalance();
             if ($currency) {
                 $balance = $currency->format($balance, array(), false);
             }
             $giftVouchersCode[] = $giftVoucher->getGiftCode() . ' (' . $balance . ') ';
         }
         $codes = implode(' ', $giftVouchersCode);
         $result[] = array('label' => Mage::helper('giftvoucher')->__('Gift Voucher Code'), 'value' => $codes, 'print_value' => $codes);
     }
     return $result;
 }
Example #2
0
 public function getItemOptions()
 {
     $opts = $this->getItem()->getOrderItem()->getProductOptions();
     $options = array();
     if (@$opts['info_buyRequest']) {
         if ($opts['info_buyRequest'] && ($periodTypeId = @$opts['info_buyRequest']['aw_sarp_subscription_type']) && ($periodStartDate = @$opts['info_buyRequest']['aw_sarp_subscription_start'])) {
             $startDateLabel = $this->getItem()->getOrderItem()->getIsVirtual() ? "Subscription start:" : "First delivery:";
             $options[] = array('label' => Mage::helper('sarp')->__('Subscription type:'), 'value' => Mage::getModel('sarp/period')->load($periodTypeId)->getName());
             $options[] = array('label' => Mage::helper('sarp')->__($startDateLabel), 'value' => $periodStartDate);
         }
     }
     $options = array_merge($options, parent::getItemOptions());
     return $options;
 }
Example #3
0
 public function getItemOptions()
 {
     $result = parent::getItemOptions();
     $result = Mage::helper('aitcg/options')->replaceAitTemplateWithText($result);
     return $result;
 }