Version Notes
Kartparadigm Store Credit
Download this release
Release Info
Developer | Kartparadigm |
Extension | Kartparadigm_StoreCredit |
Version | 1.0.0.9 |
Comparing to | |
See all releases |
Code changes from version 1.0.0.8 to 1.0.0.9
- app/code/community/Kartparadigm/StoreCredit/Helper/Data.php +3 -3
- app/code/community/Kartparadigm/StoreCredit/Model/Observer.php +15 -8
- app/code/community/Kartparadigm/StoreCredit/Model/Resource/Transaction.php +3 -1
- app/code/community/Kartparadigm/StoreCredit/controllers/Adminhtml/CreditsController.php +4 -2
- app/code/community/Kartparadigm/StoreCredit/controllers/Adminhtml/CustomerController.php +1 -1
- package.xml +4 -4
app/code/community/Kartparadigm/StoreCredit/Helper/Data.php
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
class Kartparadigm_StoreCredit_Helper_Data extends
|
3 |
Mage_Core_Helper_Abstract {
|
4 |
public function getIsEnabled(){
|
5 |
-
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group2/field1');
|
6 |
}
|
7 |
public function getTaxEnabled(){
|
8 |
-
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field1');
|
9 |
}
|
10 |
public function getIsShippingEnabled(){
|
11 |
-
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field2');
|
12 |
}
|
13 |
public function getRefundDeductConfig(){
|
14 |
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field3'); //replace section & group with appropriate values.
|
2 |
class Kartparadigm_StoreCredit_Helper_Data extends
|
3 |
Mage_Core_Helper_Abstract {
|
4 |
public function getIsEnabled(){
|
5 |
+
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group2/field1');
|
6 |
}
|
7 |
public function getTaxEnabled(){
|
8 |
+
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field1');
|
9 |
}
|
10 |
public function getIsShippingEnabled(){
|
11 |
+
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field2');
|
12 |
}
|
13 |
public function getRefundDeductConfig(){
|
14 |
return Mage::getStoreConfigFlag('mycustom_section/mycustom_group/field3'); //replace section & group with appropriate values.
|
app/code/community/Kartparadigm/StoreCredit/Model/Observer.php
CHANGED
@@ -25,12 +25,16 @@ $array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();
|
|
25 |
$val1 = Mage::getSingleton('adminhtml/session')->getValue();
|
26 |
if(isset($val1))
|
27 |
{
|
28 |
-
$
|
|
|
|
|
29 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
30 |
}
|
31 |
else{
|
|
|
32 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
33 |
-
$
|
|
|
34 |
}
|
35 |
$isvirtual=0;
|
36 |
foreach($quote->getAllItems() as $item){
|
@@ -53,7 +57,9 @@ $tax = $quote->getShippingAddress()->getData('tax_amount');
|
|
53 |
if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){
|
54 |
$shippingPrice = $quote->getShippingAddress()->getShippingAmount();
|
55 |
}
|
56 |
-
$
|
|
|
|
|
57 |
|
58 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
59 |
$nowdate = date('Y-m-d H:m:s', $currentTimestamp);
|
@@ -198,8 +204,9 @@ $custname = $order->getCustomerName();
|
|
198 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
199 |
$nowdate = date('Y-m-d H:m:s', $currentTimestamp);
|
200 |
$amt =Mage::getSingleton('checkout/session')->getDiscount();
|
201 |
-
$
|
202 |
-
|
|
|
203 |
$balance = Mage::getSingleton('core/session')->getBalance();
|
204 |
$arr['c_id'] = $order->getCustomerId();
|
205 |
$arr['action_credits'] = - $amt;
|
@@ -329,9 +336,9 @@ if(Mage::getSingleton('adminhtml/session')->getTotal()['status'] == 1)
|
|
329 |
|
330 |
|
331 |
$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();
|
332 |
-
|
333 |
-
|
334 |
-
$currentCurrencyRefund =
|
335 |
/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */
|
336 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
337 |
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
|
25 |
$val1 = Mage::getSingleton('adminhtml/session')->getValue();
|
26 |
if(isset($val1))
|
27 |
{
|
28 |
+
$amt1 = array();
|
29 |
+
$amt1 = Mage::getSingleton('checkout/session')->getCredits();
|
30 |
+
$amt = $amt1['totalCredits']
|
31 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
32 |
}
|
33 |
else{
|
34 |
+
$amt1 = array();
|
35 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
36 |
+
$amt1 = Mage::getSingleton('checkout/session')->getCredits();
|
37 |
+
$amt = $amt1['discountCredits']
|
38 |
}
|
39 |
$isvirtual=0;
|
40 |
foreach($quote->getAllItems() as $item){
|
57 |
if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){
|
58 |
$shippingPrice = $quote->getShippingAddress()->getShippingAmount();
|
59 |
}
|
60 |
+
$totalCredits1 = array();
|
61 |
+
$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();
|
62 |
+
$totalCredits = $totalCredits1['totalCredits'];
|
63 |
|
64 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
65 |
$nowdate = date('Y-m-d H:m:s', $currentTimestamp);
|
204 |
$currentTimestamp = Mage::getModel('core/date')->timestamp(time());
|
205 |
$nowdate = date('Y-m-d H:m:s', $currentTimestamp);
|
206 |
$amt =Mage::getSingleton('checkout/session')->getDiscount();
|
207 |
+
$totalCredits1 = array();
|
208 |
+
$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();
|
209 |
+
$totalCredits = $totalCredits1['totalCredits'];
|
210 |
$balance = Mage::getSingleton('core/session')->getBalance();
|
211 |
$arr['c_id'] = $order->getCustomerId();
|
212 |
$arr['action_credits'] = - $amt;
|
336 |
|
337 |
|
338 |
$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();
|
339 |
+
$currentCurrencyRefund1 = array();
|
340 |
+
$currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();
|
341 |
+
$currentCurrencyRefund = $currentCurrencyRefund1['credits'];
|
342 |
/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */
|
343 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
344 |
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
|
app/code/community/Kartparadigm/StoreCredit/Model/Resource/Transaction.php
CHANGED
@@ -22,7 +22,9 @@ class Kartparadigm_StoreCredit_Model_Resource_Transaction extends Mage_Core_Mode
|
|
22 |
foreach ($this->_objects as $object) {
|
23 |
|
24 |
// default credits to base credits
|
25 |
-
$
|
|
|
|
|
26 |
if ($baseCurrencyCode != $currentCurrencyCode) {
|
27 |
|
28 |
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
22 |
foreach ($this->_objects as $object) {
|
23 |
|
24 |
// default credits to base credits
|
25 |
+
$defaultCredits1 = array();
|
26 |
+
$defaultCredits1 = Mage::getSingleton('adminhtml/session')->getTotal();
|
27 |
+
$defaultCredits = $defaultCredits1['credits'];
|
28 |
if ($baseCurrencyCode != $currentCurrencyCode) {
|
29 |
|
30 |
$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
|
app/code/community/Kartparadigm/StoreCredit/controllers/Adminhtml/CreditsController.php
CHANGED
@@ -63,7 +63,7 @@ $discountAmount;
|
|
63 |
$id = Mage::getSingleton('adminhtml/session_quote')->getCustomerId();
|
64 |
$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$id)->addFieldToFilter('website1','Main Website')->getLastItem();
|
65 |
$amt = $collection->getTotalCredits();
|
66 |
-
Mage::log($amt);
|
67 |
$creditData['totalCredits'] = $amt;
|
68 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
69 |
$grandTotal = $quote->getGrandTotal();
|
@@ -186,7 +186,9 @@ public function unselectAction()
|
|
186 |
$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();
|
187 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
188 |
$total = $quote->getBaseGrandTotal();
|
189 |
-
$
|
|
|
|
|
190 |
$discountAmount;
|
191 |
$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];
|
192 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
63 |
$id = Mage::getSingleton('adminhtml/session_quote')->getCustomerId();
|
64 |
$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$id)->addFieldToFilter('website1','Main Website')->getLastItem();
|
65 |
$amt = $collection->getTotalCredits();
|
66 |
+
//Mage::log($amt);
|
67 |
$creditData['totalCredits'] = $amt;
|
68 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
69 |
$grandTotal = $quote->getGrandTotal();
|
186 |
$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();
|
187 |
$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
|
188 |
$total = $quote->getBaseGrandTotal();
|
189 |
+
$amt1 = array()
|
190 |
+
$amt1 = Mage::getSingleton('checkout/session')->getCredits();
|
191 |
+
$amt = $amt1['discountCredits'];
|
192 |
$discountAmount;
|
193 |
$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];
|
194 |
$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();
|
app/code/community/Kartparadigm/StoreCredit/controllers/Adminhtml/CustomerController.php
CHANGED
@@ -57,7 +57,7 @@ if($data['notification'] === 'on'){
|
|
57 |
|
58 |
$templateName = Mage::getStoreConfig('mycustom_section/mycustom_group1/caritor_email_template');
|
59 |
|
60 |
-
Mage::log($templateName."sreehari");
|
61 |
// for sending mail to admin after order placed
|
62 |
$emailTemplate = Mage::getModel('core/email_template')
|
63 |
->loadDefault('caritor_email_template');
|
57 |
|
58 |
$templateName = Mage::getStoreConfig('mycustom_section/mycustom_group1/caritor_email_template');
|
59 |
|
60 |
+
//Mage::log($templateName."sreehari");
|
61 |
// for sending mail to admin after order placed
|
62 |
$emailTemplate = Mage::getModel('core/email_template')
|
63 |
->loadDefault('caritor_email_template');
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Kartparadigm_StoreCredit</name>
|
4 |
-
<version>1.0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Efficiently maintain customer credits in all store views.</description>
|
11 |
<notes>Kartparadigm Store Credit</notes>
|
12 |
<authors><author><name>Kartparadigm</name><user>kartparadigm</user><email>kartparadigm@gmail.com</email></author></authors>
|
13 |
-
<date>2015-04-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Kartparadigm"><dir name="StoreCredit"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><dir name="Credits"><file name="List1.php" hash="44228eee4508701546e2e4f794431b14"/><file name="List.php" hash="243615c727cebfe59d273da8b85b5db0"/></dir><file name="Credits.php" hash="8af8e7e7ae5634de6b7dc6dda9349269"/></dir></dir><file name="Grid.php" hash="335c1bee870644f106315be703e4c0d0"/></dir><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="36fe787ce9fd4c5d6283c35c741add92"/></dir></dir></dir></dir><dir name="Registries"><dir name="Edit"><file name="Form.php" hash="a2a4f87d29506b1bfd7adf9e420a3e8d"/></dir><file name="Edit.php" hash="2328aeadf074d5e7740947b8bfc54a84"/><file name="Grid.php" hash="99fd3e2d4528bd98aeda18783c2653c0"/></dir><dir name="Registries1"><dir name="Edit"><file name="Form.php" hash="78c893545865890297ac7f4d406d9afd"/></dir><file name="Edit.php" hash="b38d2e821374c9babdbe4c8de1dd71f0"/><file name="Grid.php" hash="74af81c3af7fe14a52fc03b9d06c5c38"/></dir><file name="Registries1.php" hash="5f821c5722e3e2ec2c635f13efae5270"/><file name="Registries.php" hash="77e441d9f86462eea31cd1ab3abbc24e"/></dir><file name="Collection.php" hash="06203b41373cbb51433aaff716e54a45"/><file name="Credit.php" hash="c207b8719fa5aba99fe0f49110b71e12"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CreditsController.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Kartparadigm_StoreCredit</name>
|
4 |
+
<version>1.0.0.9</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Efficiently maintain customer credits in all store views.</description>
|
11 |
<notes>Kartparadigm Store Credit</notes>
|
12 |
<authors><author><name>Kartparadigm</name><user>kartparadigm</user><email>kartparadigm@gmail.com</email></author></authors>
|
13 |
+
<date>2015-04-18</date>
|
14 |
+
<time>12:48:07</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Kartparadigm"><dir name="StoreCredit"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><dir name="Credits"><file name="List1.php" hash="44228eee4508701546e2e4f794431b14"/><file name="List.php" hash="243615c727cebfe59d273da8b85b5db0"/></dir><file name="Credits.php" hash="8af8e7e7ae5634de6b7dc6dda9349269"/></dir></dir><file name="Grid.php" hash="335c1bee870644f106315be703e4c0d0"/></dir><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="36fe787ce9fd4c5d6283c35c741add92"/></dir></dir></dir></dir><dir name="Registries"><dir name="Edit"><file name="Form.php" hash="a2a4f87d29506b1bfd7adf9e420a3e8d"/></dir><file name="Edit.php" hash="2328aeadf074d5e7740947b8bfc54a84"/><file name="Grid.php" hash="99fd3e2d4528bd98aeda18783c2653c0"/></dir><dir name="Registries1"><dir name="Edit"><file name="Form.php" hash="78c893545865890297ac7f4d406d9afd"/></dir><file name="Edit.php" hash="b38d2e821374c9babdbe4c8de1dd71f0"/><file name="Grid.php" hash="74af81c3af7fe14a52fc03b9d06c5c38"/></dir><file name="Registries1.php" hash="5f821c5722e3e2ec2c635f13efae5270"/><file name="Registries.php" hash="77e441d9f86462eea31cd1ab3abbc24e"/></dir><file name="Collection.php" hash="06203b41373cbb51433aaff716e54a45"/><file name="Credit.php" hash="c207b8719fa5aba99fe0f49110b71e12"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CreditsController.php" hash="a3ba777a62e7b72a09041d2ef409cddd"/><file name="CustomerController.php" hash="f55a626a2d8ae07a6879b0ec8d08aadb"/><dir name="Promo"><file name="CatalogController.php" hash="aac0c07d33396bc86c5adcfc234838d7"/></dir><dir name="Sales"><dir name="Order"><file name="CreditmemoController.php" hash="4e971e6c64d0763a570e315ccd0d980c"/></dir></dir></dir><dir name="Checkout"><file name="OnepageController.php" hash="2a9734b2099905ba8f0fd1ac79b614c6"/></dir><file name="IndexController.php" hash="d70f263cc210ed21eee8d1564aead14d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="1a78218db0c18efcf81ed04ba8b655c2"/><file name="config.xml" hash="39065261bc245ba54799940bea51d5e0"/><file name="system.xml" hash="4b4ef37096e12405ea23e9a7de8efa10"/></dir><dir name="Helper"><file name="Data.php" hash="d8bfacd9796c4947eeee1f28878ab8e4"/></dir><dir name="Model"><file name="Creditinfo.php" hash="a96ee7fd6d660ff6de22dbbdbc90a7ae"/><dir name="Mysql4"><dir name="Creditinfo"><file name="Collection.php" hash="6f62213e7f4f62d0f90ffaeb6ff61f03"/></dir><file name="Creditinfo.php" hash="85e01354a1e6973e74dd8fdf11af4eb8"/><dir name="Sendcreditstofriend"><file name="Collection.php" hash="93b7db3ec026d02fc205c8fc5e23630e"/></dir><file name="Sendcreditstofriend.php" hash="32be8731fb112f18d70e06e2b388ebd3"/></dir><file name="Observer.php" hash="5022b7935a1d59c64adf4a9da3a98137"/><dir name="Resource"><file name="Rule.php" hash="b6471332cf41e96cc6e60e57505bd0f5"/><file name="Setup.php" hash="7f5ed91bf4d6ab4bc2dd3496fdf37d1c"/><file name="Transaction.php" hash="1b8c9d66ba8457b166f8aca5f9e341ed"/></dir><file name="Sendcreditstofriend.php" hash="711f4fbee2493698486fbc162e1fda6e"/><file name="Source.php" hash="8f51c351a0c8d70ac2308f5b7f39a1aa"/></dir><dir name="sql"><dir name="kartparadigm_storecredit_setup"><file name="install-0.1.0.php" hash="0e60f75abadb436a7fbc9682245773ab"/><file name="upgrade-0.1.0-0.2.0.php" hash="9e9d855251ffa1ef256e4821a5e903c9"/><file name="upgrade-0.2.0-0.3.0.php" hash="4bafbe8bba6b4d6e824487220d1b49fb"/><file name="upgrade-0.3.0-0.4.0.php" hash="1f7b1d85ca78d5d42afb5f9c064b9acd"/><file name="upgrade-0.4.0-0.5.0.php" hash="4a3ba65764d6ae5bbde2bd48dba46bdc"/><file name="upgrade-0.5.0-0.6.0.php" hash="d60d6c4631750a02202220552c73d373"/><file name="upgrade-0.6.0-0.7.0.php" hash="37acfd4ef86bc0a7d7f7deaa393fdfbb"/><file name="upgrade-0.7.0-0.8.0.php" hash="3f23d2d79ea4b93b1012194677e55da0"/><file name="upgrade-0.8.0-0.9.0.php" hash="ae7b43bf8747d56bede623e52c824597"/></dir></dir></dir></dir><dir name="Mage"><dir name="Adminhtml"><dir name="Block"><dir name="Sales"><file name="Totals.php" hash="9d15eca76b896d950a59234c82d3786f"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="credit.xml" hash="128baf9ae30f2a2e01cd1779a9356229"/></dir><dir name="template"><dir name="kartparadigm"><dir name="storecredit"><file name="credit.phtml" hash="67a2b79a158a9b7190b1b6c6e970d7c9"/><dir name="customer"><file name="main.phtml" hash="db60ca5b83d64d2e180e84b86b48b126"/></dir><file name="payment.phtml" hash="d8c9566e168e25d371ed718e122394f9"/><file name="storecreditview.phtml" hash="81b3e839f3321b9b46ef70d80839c6a6"/><file name="transaction.phtml" hash="f2852bdefed025ee6ef326ffd990b932"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="credit.xml" hash="bdfdd8dbf648bf7846c9b4eab07a68a9"/></dir><dir name="template"><dir name="kartparadigm"><file name="mycredits.phtml" hash="8f3daee8faac9b6262eed78c33af08b1"/><file name="mytransactions.phtml" hash="f104dcf3016d7d414b139f81aa8e9517"/><file name="payment.phtml" hash="bab542921a9690d9afd006d541ac82b0"/><file name="product.phtml" hash="640ee05cb6c5ad478b3f6fffcac82764"/><file name="sendcreditsform.phtml" hash="db4cb8365272bd3e02f1976f8a542841"/><file name="totalcredits.phtml" hash="601bd8258fd0c06adcc16910db6a5037"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kartparadigm_StoreCredit.xml" hash="886b0f62af9d0dcdd64eabf698d9fdb9"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="caritor_email_template1.html" hash="4aa55abbeb482a6b156eadcfeda159e4"/><file name="caritor_email_template.html" hash="88f3d40c0d0eeba73a34a63577ade965"/></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|