Inic_Creditpayment - Version 0.1.1

Version Notes

Credit points are an added bonus to our customers on the site and just one of the ways we thank you for being a loyal customer.

Download this release

Release Info

Developer indianic
Extension Inic_Creditpayment
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/local/Inic/Creditpayment/Model/Observer.php CHANGED
@@ -54,15 +54,25 @@ class Inic_Creditpayment_Model_Observer
54
  }
55
  public function isAvailable(Varien_Event_Observer $observer)
56
  {
 
57
  $event = $observer->getEvent();
58
  $method = $event->getMethodInstance();
59
  $result = $event->getResult();
60
  $quote = $event->getQuote();
61
  if($method->getCode() == 'creditpayment' ){
62
- $customerGroup = $quote->getCustomerGroupId();
 
 
 
 
 
 
 
 
 
63
  $SelectedCustomerGroups = Mage::getStoreConfig('payment/creditpayment/specificcustomers');
64
  $SelectedCustomerGroupsArray = explode(",", $SelectedCustomerGroups);
65
- if($SelectedCustomerGroups != "" || $quote->getCustomerId() == " "){
66
  if(!in_array($customerGroup, $SelectedCustomerGroupsArray)) {
67
  $result->isAvailable = false;
68
  }
54
  }
55
  public function isAvailable(Varien_Event_Observer $observer)
56
  {
57
+
58
  $event = $observer->getEvent();
59
  $method = $event->getMethodInstance();
60
  $result = $event->getResult();
61
  $quote = $event->getQuote();
62
  if($method->getCode() == 'creditpayment' ){
63
+ //$customerGroup = $quote->getCustomerGroupId();
64
+ $customerGroup="";
65
+ $customerID="";
66
+ $login = Mage::getSingleton( 'customer/session' )->isLoggedIn(); //Check if User is Logged In
67
+ if($login)
68
+ {
69
+ $customerGroup = Mage::getSingleton('customer/session')->getCustomerGroupId(); //Get Customers Group ID
70
+ $customerID = Mage::getSingleton('customer/session')->getCustomerId(); //Get Customers Group ID
71
+
72
+ }
73
  $SelectedCustomerGroups = Mage::getStoreConfig('payment/creditpayment/specificcustomers');
74
  $SelectedCustomerGroupsArray = explode(",", $SelectedCustomerGroups);
75
+ if($SelectedCustomerGroups != "" || $customerID == " "){
76
  if(!in_array($customerGroup, $SelectedCustomerGroupsArray)) {
77
  $result->isAvailable = false;
78
  }
app/design/frontend/base/default/template/creditpayment/customer/creditpayment.phtml CHANGED
@@ -1,11 +1,9 @@
1
- <div class="box-account">
2
  <div class="box-head">
3
  <h2><?php echo $this->__('Credit Limit')?></h2>
4
  </div>
5
  <div>
6
- <?php
7
- $currencySymbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
8
- $CrditBalance = $currencySymbol.$this->getCustomer()->getCreditLimit();?> <?php echo $this->__('Your Credit balance is ').$CrditBalance;?>
9
 
10
  </div>
11
 
1
+ <div class="box-account">
2
  <div class="box-head">
3
  <h2><?php echo $this->__('Credit Limit')?></h2>
4
  </div>
5
  <div>
6
+ <?php echo $this->__('Your Credit balance is %s',$this->helper('core')->currency($this->getCustomer()->getCreditLimit(),true,false));?>
 
 
7
 
8
  </div>
9
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Inic_Creditpayment</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -20,9 +20,9 @@ Supports on Order creation from admin side&#xD;
20
  Payment option works if total order amount is less than or equal to Credit available in account.</description>
21
  <notes>Credit points are an added bonus to our customers on the site and just one of the ways we thank you for being a loyal customer.</notes>
22
  <authors><author><name>indianic</name><user>indianic</user><email>enquiry@indianic.com</email></author></authors>
23
- <date>2013-06-19</date>
24
- <time>04:24:10</time>
25
- <contents><target name="magelocal"><dir name="Inic"><dir name="Creditpayment"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Credit.php" hash="7817e2527a34a966a963fa164a1e1965"/></dir></dir><file name="Editcustomer.php" hash="42700c2ab0b7cd928b60b0998129aec7"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4fd596c9fa025252b88cb92a7feb9ac0"/></dir><dir name="Model"><dir name="Checkout"><dir name="Type"><file name="Multishipping.php" hash="ff1df095bcd7ebd99226b10f7802ba26"/><file name="Onepage.php" hash="dbbf8ad0a330efc05c5a6139dd84953e"/></dir></dir><file name="Creditpayment.php" hash="90ca96af5bf218912e9efc16be494a30"/><file name="Customer.php" hash="dade5ab5c0b46de0d195f20773f37014"/><dir name="Method"><file name="Creditpayment.php" hash="2581429356b3b430d1b950c81cbc90d5"/></dir><dir name="Mysql4"><dir name="Creditpayment"><file name="Collection.php" hash="2a99b21cc832446b91c8d53f39c5f5f6"/></dir><file name="Creditpayment.php" hash="6e0ae712783b4fa6081ebbf1933c098b"/></dir><file name="Observer.php" hash="c74abe7f3cd879049c8ec61112385dd7"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="1138f0ca790b63265f12572f89482c5e"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4892ff9528cb24b1f3e8dbb40445e93e"/><file name="system.xml" hash="e3a18b665eeec23326f95768c82d865e"/></dir><dir name="sql"><dir name="creditpayment_setup"><file name="mysql4-install-0.1.0.php" hash="e10c250efd42691f723173074fee0149"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inic_Creditpayment.xml" hash="039e0c15a06b409001dacf20beff364d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="creditpayment.xml" hash="a7cdf1caf3e14e4655a32985d6edb132"/></dir><dir name="template"><dir name="creditpayment"><dir name="customer"><dir name="account"><file name="dashboard.phtml" hash="a50d7afced8b802771118adf457c89cb"/></dir><file name="creditpayment.phtml" hash="4b32d070a1b278f849236f067cad9bcd"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="creditpayment.xml" hash="295e7c2715b2b17ff9b85b824b995f58"/></dir><dir name="template"><dir name="creditpayment"><file name="creditpayment.phtml" hash="be77ae4bbea4212b89d12f32956fd296"/><file name="js.phtml" hash="bc073792a58bc2bcac3d511ccbe236c0"/></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Inic_Creditpayment</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
20
  Payment option works if total order amount is less than or equal to Credit available in account.</description>
21
  <notes>Credit points are an added bonus to our customers on the site and just one of the ways we thank you for being a loyal customer.</notes>
22
  <authors><author><name>indianic</name><user>indianic</user><email>enquiry@indianic.com</email></author></authors>
23
+ <date>2013-10-02</date>
24
+ <time>04:44:25</time>
25
+ <contents><target name="magelocal"><dir name="Inic"><dir name="Creditpayment"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Credit.php" hash="7817e2527a34a966a963fa164a1e1965"/></dir></dir><file name="Editcustomer.php" hash="42700c2ab0b7cd928b60b0998129aec7"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="4fd596c9fa025252b88cb92a7feb9ac0"/></dir><dir name="Model"><dir name="Checkout"><dir name="Type"><file name="Multishipping.php" hash="ff1df095bcd7ebd99226b10f7802ba26"/><file name="Onepage.php" hash="dbbf8ad0a330efc05c5a6139dd84953e"/></dir></dir><file name="Creditpayment.php" hash="90ca96af5bf218912e9efc16be494a30"/><file name="Customer.php" hash="dade5ab5c0b46de0d195f20773f37014"/><dir name="Method"><file name="Creditpayment.php" hash="2581429356b3b430d1b950c81cbc90d5"/></dir><dir name="Mysql4"><dir name="Creditpayment"><file name="Collection.php" hash="2a99b21cc832446b91c8d53f39c5f5f6"/></dir><file name="Creditpayment.php" hash="6e0ae712783b4fa6081ebbf1933c098b"/></dir><file name="Observer.php" hash="22be572d9fc42efa6535d66e47122f34"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="1138f0ca790b63265f12572f89482c5e"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4892ff9528cb24b1f3e8dbb40445e93e"/><file name="system.xml" hash="e3a18b665eeec23326f95768c82d865e"/></dir><dir name="sql"><dir name="creditpayment_setup"><file name="mysql4-install-0.1.0.php" hash="e10c250efd42691f723173074fee0149"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inic_Creditpayment.xml" hash="039e0c15a06b409001dacf20beff364d"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="creditpayment.xml" hash="a7cdf1caf3e14e4655a32985d6edb132"/></dir><dir name="template"><dir name="creditpayment"><dir name="customer"><dir name="account"><file name="dashboard.phtml" hash="a50d7afced8b802771118adf457c89cb"/></dir><file name="creditpayment.phtml" hash="9350a9462f75c395601aba2017dcfe90"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="creditpayment.xml" hash="295e7c2715b2b17ff9b85b824b995f58"/></dir><dir name="template"><dir name="creditpayment"><file name="creditpayment.phtml" hash="be77ae4bbea4212b89d12f32956fd296"/><file name="js.phtml" hash="bc073792a58bc2bcac3d511ccbe236c0"/></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>