Пример #1
0
 public function render(Varien_Object $row)
 {
     if (empty($row['history_id'])) {
         return '';
     }
     $result_mini = '';
     $history = Mage::getModel('storecreditpro/history')->load($row['history_id']);
     $type = $history->getTransactionType();
     $transaction_params = $history->getTransactionParams();
     $order_id = $history->getOrderId();
     $result = MW_Storecreditpro_Model_Type::getTransactionDetail($type, $transaction_params, $order_id, true);
     return $result;
 }
Пример #2
0
 public function sendEmailCustomerCreditChanged($customer_id, $data, $store_id)
 {
     $_customer = Mage::getModel('storecreditpro/customer')->load($customer_id);
     $credit_updated_notification = $_customer->getCreditUpdatedNotification();
     if ($this->allowSendEmailNotifications($store_id) && $credit_updated_notification == 1) {
         $store_name = Mage::getStoreConfig('general/store_information/name', $store_id);
         $sender = Mage::getStoreConfig('storecreditpro/email_notifications/email_sender', $store_id);
         $email = Mage::getModel('customer/customer')->load($customer_id)->getEmail();
         $name = Mage::getModel('customer/customer')->load($customer_id)->getName();
         $teampale = 'storecreditpro/email_notifications/credit_balance';
         $sender_name = Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $store_id);
         $customer_link = Mage::getBaseUrl();
         $data_mail['customer_name'] = $name;
         $data_mail['transaction_amount'] = MW_Storecreditpro_Model_Type::getAmountWithSign($data['amount'], $data['transaction_type']);
         $data_mail['customer_balance'] = $data['balance'];
         $data_mail['transaction_detail'] = $data['transaction_detail'];
         $data_mail['transaction_time'] = Mage::helper('core')->formatDate($data['transaction_time']) . " " . Mage::helper('core')->formatTime($data['transaction_time']);
         $data_mail['sender_name'] = $sender_name;
         $data_mail['store_name'] = $store_name;
         $data_mail['customer_link'] = $customer_link;
         $this->_sendEmailTransaction($sender, $email, $name, $teampale, $data_mail, $store_id);
     }
 }
Пример #3
0
 public function getAmount($amount, $type)
 {
     return MW_Storecreditpro_Model_Type::getAmountWithSign($amount, $type);
 }