HC_PayByFinance - Version 1.0.4.0

Version Notes

Change Log:
* Removed unneded template files
* Text changes in version information (CD->CE)
* HC-170 Disabled products on the cart are still financeable
* HC-171 Paypal - do not show finance amount when it's 0

Download this release

Release Info

Developer Sandor Czettner
Extension HC_PayByFinance
Version 1.0.4.0
Comparing to
See all releases


Code changes from version 1.0.3.5 to 1.0.4.0

app/code/local/HC/PayByFinance/Block/Adminhtml/Version.php CHANGED
@@ -28,7 +28,7 @@
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Template
30
  {
31
- const PATCH_LEVEL = 5;
32
 
33
  protected $_template = "paybyfinance/version.phtml";
34
 
@@ -73,7 +73,7 @@ class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Templ
73
  $saux = 'EE';
74
  } else {
75
  $aux = 'Community Edition';
76
- $saux = 'CD';
77
  }
78
  $mageVersion = Mage::getVersion();
79
  $mage = "Magento {$aux} {$mageVersion}";
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Template
30
  {
31
+ const PATCH_LEVEL = 0;
32
 
33
  protected $_template = "paybyfinance/version.phtml";
34
 
73
  $saux = 'EE';
74
  } else {
75
  $aux = 'Community Edition';
76
+ $saux = 'CE';
77
  }
78
  $mageVersion = Mage::getVersion();
79
  $mage = "Magento {$aux} {$mageVersion}";
app/code/local/HC/PayByFinance/Helper/Data.php CHANGED
@@ -161,7 +161,7 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
161
  }
162
 
163
  if ($product->getPaybyfinanceEnable() == $options::VALUES_DISABLE) {
164
- return;
165
  }
166
 
167
  switch ($product->getPaybyfinanceEnable()) {
161
  }
162
 
163
  if ($product->getPaybyfinanceEnable() == $options::VALUES_DISABLE) {
164
+ return false;
165
  }
166
 
167
  switch ($product->getPaybyfinanceEnable()) {
app/code/local/HC/PayByFinance/Model/Observer.php CHANGED
@@ -91,6 +91,20 @@ class HC_PayByFinance_Model_Observer
91
  }
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
  * Order save event. Responds only if it's the first save after converted from quote
96
  * See $order->setFromQuote() in function convertQuoteAddressToOrder()
@@ -191,11 +205,13 @@ class HC_PayByFinance_Model_Observer
191
  $cart = $observer->getPaypalCart();
192
  $order = $cart->getSalesEntity();
193
  $address = $order->getShippingAddress();
194
- $cart->addItem(
195
- Mage::helper('paybyfinance')->__('Financed Amount'),
196
- 1,
197
- $address->getFinanceAmount()
198
- );
 
 
199
  return $this;
200
  }
201
 
91
  }
92
  }
93
 
94
+ /**
95
+ * Set paybyfinance_enable attribute on quote items based on products attribute
96
+ *
97
+ * @param Object $observer Observer
98
+ *
99
+ * @return void
100
+ */
101
+ public function salesQuoteItemSetPaybyfinanceENable($observer)
102
+ {
103
+ $quoteItem = $observer->getQuoteItem();
104
+ $product = $observer->getProduct();
105
+ $quoteItem->setPaybyfinanceEnable($product->getPaybyfinanceEnable());
106
+ }
107
+
108
  /**
109
  * Order save event. Responds only if it's the first save after converted from quote
110
  * See $order->setFromQuote() in function convertQuoteAddressToOrder()
205
  $cart = $observer->getPaypalCart();
206
  $order = $cart->getSalesEntity();
207
  $address = $order->getShippingAddress();
208
+ if ($address->getFinanceAmount() != 0) {
209
+ $cart->addItem(
210
+ Mage::helper('paybyfinance')->__('Financed Amount'),
211
+ 1,
212
+ $address->getFinanceAmount()
213
+ );
214
+ }
215
  return $this;
216
  }
217
 
app/code/local/HC/PayByFinance/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <HC_PayByFinance>
5
- <version>1.0.3</version>
6
  </HC_PayByFinance>
7
  </modules>
8
  <global>
@@ -50,6 +50,11 @@
50
  </models>
51
  <sales>
52
  <quote>
 
 
 
 
 
53
  <totals>
54
  <financeamount>
55
  <class>paybyfinance/sales_quote_financeamount</class>
@@ -82,6 +87,18 @@
82
  </totals>
83
  </order_creditmemo>
84
  </sales>
 
 
 
 
 
 
 
 
 
 
 
 
85
  <resources>
86
  <paybyfinance_setup>
87
  <setup>
@@ -132,6 +149,14 @@
132
  </paybyfinance_salesquoteaddressconvert>
133
  </observers>
134
  </sales_convert_quote_address_to_order>
 
 
 
 
 
 
 
 
135
  <paybyfinance_quote_financeamount_collect_before>
136
  <observers>
137
  <paybyfinance_collectafter>
2
  <config>
3
  <modules>
4
  <HC_PayByFinance>
5
+ <version>1.0.4</version>
6
  </HC_PayByFinance>
7
  </modules>
8
  <global>
50
  </models>
51
  <sales>
52
  <quote>
53
+ <item>
54
+ <product_attributes>
55
+ <paybyfinance_enable />
56
+ </product_attributes>
57
+ </item>
58
  <totals>
59
  <financeamount>
60
  <class>paybyfinance/sales_quote_financeamount</class>
87
  </totals>
88
  </order_creditmemo>
89
  </sales>
90
+ <fieldsets>
91
+ <sales_convert_quote_item>
92
+ <paybyfinance_enable>
93
+ <to_order_item>*</to_order_item>
94
+ </paybyfinance_enable>
95
+ </sales_convert_quote_item>
96
+ <sales_convert_order_item>
97
+ <paybyfinance_enable>
98
+ <to_quote_item>*</to_quote_item>
99
+ </paybyfinance_enable>
100
+ </sales_convert_order_item>
101
+ </fieldsets>
102
  <resources>
103
  <paybyfinance_setup>
104
  <setup>
149
  </paybyfinance_salesquoteaddressconvert>
150
  </observers>
151
  </sales_convert_quote_address_to_order>
152
+ <sales_quote_item_set_product>
153
+ <observers>
154
+ <paybyfinance_enable>
155
+ <class>paybyfinance/observer</class>
156
+ <method>salesQuoteItemSetPaybyfinanceEnable</method>
157
+ </paybyfinance_enable>
158
+ </observers>
159
+ </sales_quote_item_set_product>
160
  <paybyfinance_quote_financeamount_collect_before>
161
  <observers>
162
  <paybyfinance_collectafter>
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/{mysql4-install-1.0.3.php → mysql4-install-1.0.4.php} RENAMED
@@ -17,6 +17,7 @@
17
 
18
  $installer = $this;
19
  $setup = Mage::getModel('eav/entity_setup', 'core_setup');
 
20
 
21
  $installer->startSetup();
22
 
@@ -196,6 +197,26 @@ $setup->addAttribute(
196
  )
197
  );
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  $content = file_get_contents(
200
  'app/code/local/HC/PayByFinance/sql/paybyfinance_setup/html/page-finance-options.html'
201
  );
17
 
18
  $installer = $this;
19
  $setup = Mage::getModel('eav/entity_setup', 'core_setup');
20
+ $resinstaller = Mage::getModel('sales/resource_setup', 'core_setup');
21
 
22
  $installer->startSetup();
23
 
197
  )
198
  );
199
 
200
+ /**
201
+ * Add 'paybyfinance_enable' attribute for entities.
202
+ */
203
+ $entities = array(
204
+ 'quote',
205
+ 'quote_address',
206
+ 'quote_item',
207
+ 'quote_address_item',
208
+ 'order',
209
+ 'order_item'
210
+ );
211
+ $options = array(
212
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
213
+ 'visible' => true,
214
+ 'required' => false
215
+ );
216
+ foreach ($entities as $entity) {
217
+ $resinstaller->addAttribute($entity, 'paybyfinance_enable', $options);
218
+ }
219
+
220
  $content = file_get_contents(
221
  'app/code/local/HC/PayByFinance/sql/paybyfinance_setup/html/page-finance-options.html'
222
  );
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.3-1.0.4.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hitachi Capital Pay By Finance
4
+ *
5
+ * Hitachi Capital Pay By Finance Extension
6
+ *
7
+ * PHP version >= 5.3.*
8
+ *
9
+ * @category HC
10
+ * @package PayByFinance
11
+ * @author Healthy Websites <support@healthywebsites.co.uk>
12
+ * @copyright 2014 Hitachi Capital
13
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.healthywebsites.co.uk/
15
+ *
16
+ */
17
+
18
+ $updater = $this; // $this is class Mage_Eav_Model_Entity_Setup
19
+ $updater->startSetup();
20
+
21
+ $resinstaller = Mage::getModel('sales/resource_setup', 'core_setup');
22
+
23
+ /**
24
+ * Add 'paybyfinance_enable' attribute for entities.
25
+ */
26
+ $entities = array(
27
+ 'quote',
28
+ 'quote_address',
29
+ 'quote_item',
30
+ 'quote_address_item',
31
+ 'order',
32
+ 'order_item'
33
+ );
34
+ $options = array(
35
+ 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
36
+ 'visible' => true,
37
+ 'required' => false
38
+ );
39
+ foreach ($entities as $entity) {
40
+ $resinstaller->addAttribute($entity, 'paybyfinance_enable', $options);
41
+ }
42
+
43
+ $updater->endSetup();
app/design/adminhtml/default/default/template/paybyfinance/history.phtml DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- /**
3
- * Magento Enterprise Edition
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Magento Enterprise Edition License
8
- * that is bundled with this package in the file LICENSE_EE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://www.magentocommerce.com/license/enterprise-edition
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package default_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://www.magentocommerce.com/license/enterprise-edition
25
- */
26
- ?>
27
- <div id="order_history_block">
28
- <?php if ($this->canAddComment()):?>
29
- <div id="history_form" class="order-history-form">
30
- <div><?php echo Mage::helper('sales')->__('Add Order Comments') ?></div>
31
- <span class="field-row">
32
- <label class="normal" for="history_status"><?php echo Mage::helper('sales')->__('Status') ?></label><br/>
33
- <select name="history[status]" class="select" id="history_status">
34
- <?php foreach ($this->getStatuses() as $_code=>$_label): ?>
35
- <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
36
- <?php endforeach; ?>
37
- </select>
38
- </span>
39
- <span class="field-row">
40
- <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment') ?></label>
41
- <textarea name="history[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
42
- </span>
43
- <div class="f-left">
44
- <?php if ($this->canSendCommentEmail()): ?>
45
- <input name="history[is_customer_notified]" type="checkbox" id="history_notify" value="1" /><label class="normal" for="history_notify"> <?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
46
- <?php endif; ?>
47
- <input name="history[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
48
- </div>
49
- <div class="f-right">
50
- <?php echo $this->getChildHtml('submit_button') ?>
51
- </div>
52
- <div class="clear"></div>
53
- </div>
54
- <div class="divider"></div>
55
- <?php endif;?>
56
- <ul class="note-list">
57
- <?php foreach ($this->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
58
- <li>
59
- <strong><?php echo $this->helper('core')->formatDate($_item->getCreatedAtDate(), 'medium') ?></strong>
60
- <?php echo $this->helper('core')->formatTime($_item->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><strong><?php echo $_item->getStatusLabel() ?></strong><br/><small><?php echo $this->helper('sales')->__('Customer') ?>
61
- <strong class="subdue">
62
- <?php if ($this->isCustomerNotificationNotApplicable($_item)): ?>
63
- <?php echo $this->helper('sales')->__('Notification Not Applicable') ?>
64
- <?php elseif ($_item->getIsCustomerNotified()): ?>
65
- <?php echo $this->helper('sales')->__('Notified') ?>
66
- <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
67
- <?php else: ?>
68
- <?php echo $this->helper('sales')->__('Not Notified') ?>
69
- <?php endif; ?>
70
- </strong></small>
71
- <?php if ($_item->getComment()): ?>
72
- <br/><?php echo strip_tags($_item->getComment(), '<b><br><strong><i><u><a>'); ?>
73
- <?php endif; ?>
74
- </li>
75
- <?php endforeach; ?>
76
- </ul>
77
- <script type="text/javascript">
78
- if($('order_status'))$('order_status').update('<?php echo $this->getOrder()->getStatusLabel() ?>');
79
- </script>
80
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/paybyfinance/redirect.phtml DELETED
@@ -1,5 +0,0 @@
1
- <h1>Redirect log</h1>
2
- <p>Send the below to PBF in order to debug.</p>
3
- <pre>
4
- <?php echo $this->getLog()->getContent(); ?>
5
- </pre>
 
 
 
 
 
app/design/adminhtml/default/default/template/paybyfinance/version.phtml DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- /**
3
- * @see Ebizmarts_SagePaySuite_Block_Adminhtml_System_Config_Fieldset_Hint
4
- */
5
- ?>
6
- <div class="paybyfinance-config-version" style="background: #e0e0e9; border: 1px solid #6f8992; margin-bottom: 10px; padding: 10px;">
7
- <?php echo $this->getVersionHtml(); ?>
8
- </div>
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/paybyfinance.xml CHANGED
@@ -6,7 +6,10 @@
6
  <!-- If you have any problems with the templates, comment out this section -->
7
  <checkout_cart_index>
8
  <reference name="checkout.cart">
 
 
9
  <action method="setCartTemplate"><value>checkout/cart-pbf.phtml</value></action>
 
10
  </reference>
11
  <reference name="checkout.cart.totals">
12
  <action method="setTemplate"><template>checkout/cart/totals-pbf.phtml</template></action>
6
  <!-- If you have any problems with the templates, comment out this section -->
7
  <checkout_cart_index>
8
  <reference name="checkout.cart">
9
+ <!-- Use setTemplate for Magento 1.8 and below -->
10
+ <action method="setTemplate"><value>checkout/cart-pbf.phtml</value></action>
11
  <action method="setCartTemplate"><value>checkout/cart-pbf.phtml</value></action>
12
+
13
  </reference>
14
  <reference name="checkout.cart.totals">
15
  <action method="setTemplate"><template>checkout/cart/totals-pbf.phtml</template></action>
app/design/frontend/base/default/template/paybyfinance/selector.phtml CHANGED
@@ -18,6 +18,7 @@
18
  $_services = $this->getServices();
19
  $_product = $this->getProduct(); // returns with null if we are not on the product page
20
  $_data = json_decode($this->getJSON());
 
21
  ?>
22
 
23
  <div class="paybyfinance-selector"><div id="paybyfinance">
@@ -288,7 +289,7 @@ $_data = json_decode($this->getJSON());
288
  var service_id = $$('#paybyfinance input:checked[name=service]')[0].value;
289
  var deposit = $("pbf-input-deposit").value * 10;
290
  var postBody = 'service=' + service_id + '&deposit=' + deposit + '&enabled=1';
291
- new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/session/save", array("_secure" => true)) ?>', {method: 'post', postBody: postBody,
292
  onSuccess: function() {
293
  productAddToCartForm.submit(this);
294
  },
@@ -300,7 +301,7 @@ $_data = json_decode($this->getJSON());
300
 
301
  function pbf_ajax_update()
302
  {
303
- new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/selector/services", array("_secure" => true)) ?>', {
304
  onSuccess: function(response) {
305
  pbf_selector_data = response.responseJSON;
306
  if (pbf_selector_user.service) {
@@ -333,7 +334,7 @@ $_data = json_decode($this->getJSON());
333
 
334
  var deposit = $("pbf-input-deposit").value * 10;
335
  var postBody = 'service=' + service_id + '&deposit=' + deposit + '&enabled=' + enabled;
336
- new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/session/save", array("_secure" => true)) ?>', {method: 'post', postBody: postBody,
337
  onSuccess: function() {
338
  if(document.getElementById('onestepcheckout-form')) {
339
  //if we're using onestepcheckout
@@ -347,6 +348,7 @@ $_data = json_decode($this->getJSON());
347
  Form.Element.enable('pbf-cart-btn');
348
  } else if (document.getElementById('checkoutSteps')) {
349
  // OnePage checkout (Magento's default)
 
350
  steppable = ["shipping_method", "payment", "review"]
351
  var i = steppable.length;
352
  while (i--) {
@@ -354,7 +356,10 @@ $_data = json_decode($this->getJSON());
354
  shipping.save();
355
  }
356
  }
357
- Form.Element.disable('pbf-cart-btn');
 
 
 
358
  } else {
359
  // Any other
360
  location.reload(true);
@@ -420,7 +425,7 @@ $_data = json_decode($this->getJSON());
420
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
421
  '<ul id="pbf-types-ruler" class="healthy-ruler">';
422
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
423
- inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'" onclick="javascript:pbf_type('+index+');">'+selector_data.types[index].name+'</li>';
424
  };
425
  inputType += '</ul></div>';
426
  } else if (pbf_selector_data.types.length == 2) {
@@ -430,7 +435,7 @@ $_data = json_decode($this->getJSON());
430
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
431
  '<ul id="pbf-types-ruler" class="healthy-ruler ruler-toggle">';
432
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
433
- inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'" onclick="javascript:pbf_type('+index+');" class="ruler-'+index+'"><div class="ruler-text ruler-text-'+index+'"><div class="ruler-tick">✓</div><span>'+pbf_selector_data.types[index].name+'</span></li>';
434
  };
435
  inputType += '</ul></div></div>';
436
  }
18
  $_services = $this->getServices();
19
  $_product = $this->getProduct(); // returns with null if we are not on the product page
20
  $_data = json_decode($this->getJSON());
21
+ $_secure = $this->getRequest()->isSecure();
22
  ?>
23
 
24
  <div class="paybyfinance-selector"><div id="paybyfinance">
289
  var service_id = $$('#paybyfinance input:checked[name=service]')[0].value;
290
  var deposit = $("pbf-input-deposit").value * 10;
291
  var postBody = 'service=' + service_id + '&deposit=' + deposit + '&enabled=1';
292
+ new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/session/save", array("_secure" => $_secure)) ?>', {method: 'post', postBody: postBody,
293
  onSuccess: function() {
294
  productAddToCartForm.submit(this);
295
  },
301
 
302
  function pbf_ajax_update()
303
  {
304
+ new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/selector/services", array("_secure" => $_secure)) ?>', {
305
  onSuccess: function(response) {
306
  pbf_selector_data = response.responseJSON;
307
  if (pbf_selector_user.service) {
334
 
335
  var deposit = $("pbf-input-deposit").value * 10;
336
  var postBody = 'service=' + service_id + '&deposit=' + deposit + '&enabled=' + enabled;
337
+ new Ajax.Request('<?php echo Mage::getUrl("paybyfinance/session/save", array("_secure" => $_secure)) ?>', {method: 'post', postBody: postBody,
338
  onSuccess: function() {
339
  if(document.getElementById('onestepcheckout-form')) {
340
  //if we're using onestepcheckout
348
  Form.Element.enable('pbf-cart-btn');
349
  } else if (document.getElementById('checkoutSteps')) {
350
  // OnePage checkout (Magento's default)
351
+ Form.Element.disable('pbf-cart-btn');
352
  steppable = ["shipping_method", "payment", "review"]
353
  var i = steppable.length;
354
  while (i--) {
356
  shipping.save();
357
  }
358
  }
359
+ setTimeout(function() {
360
+ Form.Element.enable('pbf-cart-btn');
361
+ }
362
+ , 2000);
363
  } else {
364
  // Any other
365
  location.reload(true);
425
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
426
  '<ul id="pbf-types-ruler" class="healthy-ruler">';
427
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
428
+ inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'%" onclick="javascript:pbf_type('+index+');" class="ruler ruler-'+index+'">'+selector_data.types[index].name+'</li>';
429
  };
430
  inputType += '</ul></div>';
431
  } else if (pbf_selector_data.types.length == 2) {
435
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
436
  '<ul id="pbf-types-ruler" class="healthy-ruler ruler-toggle">';
437
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
438
+ inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'%" onclick="javascript:pbf_type('+index+');" class="ruler-'+index+'"><div class="ruler-text ruler-text-'+index+'"><div class="ruler-tick">✓</div><span>'+pbf_selector_data.types[index].name+'</span></li>';
439
  };
440
  inputType += '</ul></div></div>';
441
  }
app/etc/modules/HC_PayByFinance.xml CHANGED
@@ -5,6 +5,7 @@
5
  <active>true</active>
6
  <codePool>local</codePool>
7
  <depends>
 
8
  <Mage_Sales />
9
  </depends>
10
  </HC_PayByFinance>
5
  <active>true</active>
6
  <codePool>local</codePool>
7
  <depends>
8
+ <Mage_Checkout />
9
  <Mage_Sales />
10
  </depends>
11
  </HC_PayByFinance>
package.xml CHANGED
@@ -1,19 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HC_PayByFinance</name>
4
- <version>1.0.3.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.healthywebsites.co.uk/license.html">Healthy Websites</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hitachi Capital Pay By Finance</summary>
10
  <description>Hitachi Capital Pay By Finance</description>
11
- <notes> * HC-159 Version information in configuration&#xD;
12
- * HC-165 Accepted cipher methods</notes>
 
 
 
13
  <authors><author><name>Sandor Czettner</name><user>MAG000003395</user><email>support@healthywebsites.co.uk</email></author><author><name>Alistair Macneil</name><user>MAG000006529</user><email>support@healthywebsites.co.uk</email></author><author><name>Rhuaridh Clark</name><user>MAG002562063</user><email>support@healthywebsites.co.uk</email></author></authors>
14
- <date>2015-03-31</date>
15
- <time>14:02:00</time>
16
- <contents><target name="magelocal"><dir><dir name="HC"><dir name="PayByFinance"><dir name="Block"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="Redirect.php" hash="e833b66126df043c3c82ddad731b72ee"/><dir name="Service"><dir name="Edit"><file name="Form.php" hash="83c8b9c20619ba8754c4ff589b9a93d8"/><dir name="Tab"><file name="Form.php" hash="b1cc9b35c4504f12d75e5fd05c286ceb"/></dir><file name="Tabs.php" hash="563cd0546a62114f4ce0ad226dcbd284"/></dir><file name="Edit.php" hash="6c27682856959920a054c5e46f9e6202"/><file name="Grid.php" hash="3b1decef1063f3f4dc6220b1d770ac34"/></dir><file name="Service.php" hash="863a6adb6aa194f80ef85eff35b835fc"/></dir><file name="Version.php" hash="5a468f33e17d7d3d4086ccc62afa68d7"/></dir><dir name="Checkout"><file name="Redirect.php" hash="d666ffdae5d127c041d72af7a4125222"/></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="32f03e3a7529b91e41ed203b67b1a776"/></dir></dir><file name="Selector.php" hash="e5a43cbc50858ce6ba9e3695c2a53251"/><file name="Status.php" hash="e2cfd097569fdb0dbf4f6f56ce282181"/></dir><dir name="Helper"><file name="Cart.php" hash="02314da8f564f015698ea0c640a2412a"/><file name="Checkout.php" hash="ace804f10a6673cb89d7621cd0f56a3b"/><file name="Data.php" hash="17c4567187d366d5943441b974d48ab5"/><file name="Notification.php" hash="92e04e043b2eced9f6159f8817d0d7fa"/></dir><dir name="Model"><file name="Calculator.php" hash="7c86b984569f07616005ea3fa5748eb3"/><dir name="Config"><dir name="Source"><dir name="Catalog"><dir name="Product"><file name="Finance.php" hash="ff556af6968a9ddc48313446f117a161"/><file name="Type.php" hash="497f87f6e6f8ff94e6308436e8c23339"/></dir></dir><dir name="Cms"><file name="Block.php" hash="6f27ccfc9ed421b4e329fcb1aa898d7e"/></dir><file name="Connectionmode.php" hash="2b37d9563a3a1721b3aa9e1400866e6c"/><file name="Type.php" hash="3fe934255019556ddc6ed4fe3f485dea"/></dir></dir><file name="Log.php" hash="6565186d165b38aa4513dc15b9f88fc9"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="e3886eeb186a92c8ec81fc7fd03b4c38"/></dir><file name="Log.php" hash="7444e07d1d77554ae82e9900fb8a7e4c"/><dir name="Service"><file name="Collection.php" hash="2fdccc0f53a2e038fe46d18c667df818"/></dir><file name="Service.php" hash="846486c8584eab5656a54961cd2da208"/></dir><file name="Observer.php" hash="fccb8c4e4a752e6b1b2af800cae5f220"/><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="b9716601482ba2f95b092b272b0a719f"/></dir><dir name="Hostedpro"><file name="Request.php" hash="609a2f59d5135c98d65a7bf57e6765ef"/></dir></dir><dir name="PaypalUk"><dir name="Api"><file name="Nvp.php" hash="86649f5e35d9c766055ca9bfc50d74ee"/></dir></dir><dir name="Post"><file name="Abstract.php" hash="8f3130d405916573deecdd4572e74ece"/><file name="Live.php" hash="b0c86feedfee4fa7ad2f0a681f3f8074"/><file name="Simulation.php" hash="27a113919d0e7e121a2d09aa4842acad"/><file name="Test.php" hash="0c6a8e53162c4fc8d267f4151d1a5b97"/><file name="Unittest.php" hash="1cf9d2280c568e5b1bf540c15a796bef"/></dir><file name="Post.php" hash="b5396f260e9fb59ffb001fff2f0858fd"/><dir name="Resource"><file name="Setup.php" hash="c9b783bd9bef1ceeb1cc649e91ef3b9a"/></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Financeamount.php" hash="f6fc2d9bedb7e6748ef06fafb3bd7b10"/></dir><dir name="Invoice"><file name="Financeamount.php" hash="7f652017f58594cb9fa0a3348d49ad15"/></dir></dir><dir name="Quote"><file name="Financeamount.php" hash="87f684a300050432b1b9ad7c265a19f4"/><file name="Totalcost.php" hash="edc6e156abba2c8bd3a3d48671694e95"/></dir></dir><file name="Service.php" hash="2043375b0586e18bcdfe98ed579770a8"/><file name="Session.php" hash="705be3666220145cbbd78fff158ddf71"/><file name="Sessionobserver.php" hash="4ac76db4f11990e1426de6c60abb7639"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="RedirectController.php" hash="12a6b1951a07fa5d50fcf38a6fb3d57e"/><file name="ServiceController.php" hash="e0354ea82610cb3821a91fa89c8aeb2b"/></dir></dir><file name="CheckoutController.php" hash="1b26b2b1933471445ccf48bf5977e2c5"/><file name="NotificationController.php" hash="2ae082f6a856187268dd7bea4cd8ddad"/><file name="SelectorController.php" hash="8d55176bbd5787b9981e60f96cf8254a"/><file name="SessionController.php" hash="ea6f58e8a3f024e2d55c8b363c6448fd"/><file name="StatusController.php" hash="f017c622790033a9c928debdd5c94427"/></dir><dir name="etc"><file name="adminhtml.xml" hash="216df222a5f5d9fdcf29c238cfd78bd5"/><file name="config.xml" hash="5c1fce29b38aa19402f923c033be31fd"/><file name="system.xml" hash="28c240d36d67c0f8d4df44ad7744b37b"/></dir><dir name="sql"><dir name="paybyfinance_setup"><dir name="html"><file name="abandoned.html" hash="424f900dbddc267f7dac72e67752df25"/><file name="accepted.html" hash="5a12318275410a8bf62d7508422d9503"/><file name="declined.html" hash="bd3e7565c3d98645629d9f6274e4bf24"/><file name="error.html" hash="4a448b052f101b2648dfe84423ad1313"/><file name="information.html" hash="b364458ba3d9ad7579fa4935e3449b46"/><file name="page-finance-options.html" hash="d6786a27e4bf82a73e3134df0f98888b"/><file name="referred.html" hash="5955befddbb2e274f350ba71458b6151"/></dir><file name="mysql4-install-1.0.3.php" hash="7ddff316dc5a2b55470afd63d7adffff"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="ebbf4e768317754347893a4ed6b624e2"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="6424964cd6c10967ee6eb1f6db558a63"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="paybyfinance"><file name="form.phtml" hash="6f583d5629e39fe564d4b86535242c7a"/><dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir><file name="selector-no.phtml" hash="b54c570f68254a2e879464a0b761c7db"/><file name="selector.phtml" hash="96cb46b21fd5edb89c3de05bbfcab493"/><file name="status.phtml" hash="9e02cb668c470d72612bccc09e34c51a"/></dir><dir name="checkout"><dir name="cart"><file name="totals-pbf.phtml" hash="f14878e618aa3c8943f3728128aadaa6"/></dir><dir name="onepage"><dir name="review"><file name="info-pbf.phtml" hash="e4c7c70c798f1956ae7aaa5c09114fab"/><file name="totals-pbf.phtml" hash="f26e488359433c3814a1cd416006869a"/></dir></dir><file name="cart-pbf.phtml" hash="9f6b1873ed02e5e2ae1966e3e5a1910d"/></dir></dir><dir name="layout"><file name="paybyfinance.xml" hash="9daac883c68fb411cc0ddf3a629086ff"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="paybyfinance.xml" hash="6dd419ed31a10c3fc409a5a58f89fe01"/></dir><dir name="template"><dir name="paybyfinance"><file name="history.phtml" hash="31fbbbb8477717175da3de1e9fe98f54"/><file name="redirect.phtml" hash="90e7aa306768f5aac337300848c04e6a"/><file name="version.phtml" hash="09a8f416156d853ecc47b24a15744563"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="paybyfinance"><file name="checkout.js" hash="21051d8691dd773427d3e761403896ab"/><file name="functions.js" hash="98c27381b3f7eaeaa845271dbe763f05"/><file name="slider.js" hash="453a7468c528377d4b0db03848a62f93"/></dir></dir><dir name="css"><file name="paybyfinance.css" hash="25d02dc5cf228662c30d908d7c2f1356"/><file name="paybyfinance-ie8.css" hash="a6be9c7af8b95300bc62e4fe9ef252ac"/></dir><dir name="images"><dir name="paybyfinance"><file name="bullet.png" hash="ea2baab34b2eb7d0aacb7a67d5b080f1"/><file name="pointer-toggle.png" hash="e661d42aed7a5562f75828312c7a635a"/><file name="pointer.png" hash="68c58b28d6ebd77d415f8666c301a199"/><file name="progress.png" hash="6d46a109cc9e38a663678918142d89f2"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="HC_PayByFinance.xml" hash="ff9284d6a9b1c132d6b6c25352cfd134"/></dir></dir></target></contents>
17
  <compatible/>
18
- <dependencies><required><php><min>5.4.25</min><max>5.6.7</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HC_PayByFinance</name>
4
+ <version>1.0.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.healthywebsites.co.uk/license.html">Healthy Websites</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hitachi Capital Pay By Finance</summary>
10
  <description>Hitachi Capital Pay By Finance</description>
11
+ <notes>Change Log:&#xD;
12
+ * Removed unneded template files&#xD;
13
+ * Text changes in version information (CD-&gt;CE)&#xD;
14
+ * HC-170 Disabled products on the cart are still financeable&#xD;
15
+ * HC-171 Paypal - do not show finance amount when it's 0</notes>
16
  <authors><author><name>Sandor Czettner</name><user>MAG000003395</user><email>support@healthywebsites.co.uk</email></author><author><name>Alistair Macneil</name><user>MAG000006529</user><email>support@healthywebsites.co.uk</email></author><author><name>Rhuaridh Clark</name><user>MAG002562063</user><email>support@healthywebsites.co.uk</email></author></authors>
17
+ <date>2015-04-15</date>
18
+ <time>11:45:55</time>
19
+ <contents><target name="magelocal"><dir><dir name="HC"><dir name="PayByFinance"><dir name="Block"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="Redirect.php" hash="e833b66126df043c3c82ddad731b72ee"/><dir name="Service"><dir name="Edit"><file name="Form.php" hash="83c8b9c20619ba8754c4ff589b9a93d8"/><dir name="Tab"><file name="Form.php" hash="b1cc9b35c4504f12d75e5fd05c286ceb"/></dir><file name="Tabs.php" hash="563cd0546a62114f4ce0ad226dcbd284"/></dir><file name="Edit.php" hash="6c27682856959920a054c5e46f9e6202"/><file name="Grid.php" hash="3b1decef1063f3f4dc6220b1d770ac34"/></dir><file name="Service.php" hash="863a6adb6aa194f80ef85eff35b835fc"/></dir><file name="Version.php" hash="aa97be54ab2ad29c30aaed7f8843032a"/></dir><dir name="Checkout"><file name="Redirect.php" hash="d666ffdae5d127c041d72af7a4125222"/></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="32f03e3a7529b91e41ed203b67b1a776"/></dir></dir><file name="Selector.php" hash="e5a43cbc50858ce6ba9e3695c2a53251"/><file name="Status.php" hash="e2cfd097569fdb0dbf4f6f56ce282181"/></dir><dir name="Helper"><file name="Cart.php" hash="02314da8f564f015698ea0c640a2412a"/><file name="Checkout.php" hash="ace804f10a6673cb89d7621cd0f56a3b"/><file name="Data.php" hash="7477d16906caae487d6cbc8325006ce5"/><file name="Notification.php" hash="92e04e043b2eced9f6159f8817d0d7fa"/></dir><dir name="Model"><file name="Calculator.php" hash="7c86b984569f07616005ea3fa5748eb3"/><dir name="Config"><dir name="Source"><dir name="Catalog"><dir name="Product"><file name="Finance.php" hash="ff556af6968a9ddc48313446f117a161"/><file name="Type.php" hash="497f87f6e6f8ff94e6308436e8c23339"/></dir></dir><dir name="Cms"><file name="Block.php" hash="6f27ccfc9ed421b4e329fcb1aa898d7e"/></dir><file name="Connectionmode.php" hash="2b37d9563a3a1721b3aa9e1400866e6c"/><file name="Type.php" hash="3fe934255019556ddc6ed4fe3f485dea"/></dir></dir><file name="Log.php" hash="6565186d165b38aa4513dc15b9f88fc9"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="e3886eeb186a92c8ec81fc7fd03b4c38"/></dir><file name="Log.php" hash="7444e07d1d77554ae82e9900fb8a7e4c"/><dir name="Service"><file name="Collection.php" hash="2fdccc0f53a2e038fe46d18c667df818"/></dir><file name="Service.php" hash="846486c8584eab5656a54961cd2da208"/></dir><file name="Observer.php" hash="4f952770c3d379a7352d5b61c6982515"/><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="b9716601482ba2f95b092b272b0a719f"/></dir><dir name="Hostedpro"><file name="Request.php" hash="609a2f59d5135c98d65a7bf57e6765ef"/></dir></dir><dir name="PaypalUk"><dir name="Api"><file name="Nvp.php" hash="86649f5e35d9c766055ca9bfc50d74ee"/></dir></dir><dir name="Post"><file name="Abstract.php" hash="8f3130d405916573deecdd4572e74ece"/><file name="Live.php" hash="b0c86feedfee4fa7ad2f0a681f3f8074"/><file name="Simulation.php" hash="27a113919d0e7e121a2d09aa4842acad"/><file name="Test.php" hash="0c6a8e53162c4fc8d267f4151d1a5b97"/><file name="Unittest.php" hash="1cf9d2280c568e5b1bf540c15a796bef"/></dir><file name="Post.php" hash="b5396f260e9fb59ffb001fff2f0858fd"/><dir name="Resource"><file name="Setup.php" hash="c9b783bd9bef1ceeb1cc649e91ef3b9a"/></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Financeamount.php" hash="f6fc2d9bedb7e6748ef06fafb3bd7b10"/></dir><dir name="Invoice"><file name="Financeamount.php" hash="7f652017f58594cb9fa0a3348d49ad15"/></dir></dir><dir name="Quote"><file name="Financeamount.php" hash="87f684a300050432b1b9ad7c265a19f4"/><file name="Totalcost.php" hash="edc6e156abba2c8bd3a3d48671694e95"/></dir></dir><file name="Service.php" hash="2043375b0586e18bcdfe98ed579770a8"/><file name="Session.php" hash="705be3666220145cbbd78fff158ddf71"/><file name="Sessionobserver.php" hash="4ac76db4f11990e1426de6c60abb7639"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="RedirectController.php" hash="12a6b1951a07fa5d50fcf38a6fb3d57e"/><file name="ServiceController.php" hash="e0354ea82610cb3821a91fa89c8aeb2b"/></dir></dir><file name="CheckoutController.php" hash="1b26b2b1933471445ccf48bf5977e2c5"/><file name="NotificationController.php" hash="2ae082f6a856187268dd7bea4cd8ddad"/><file name="SelectorController.php" hash="8d55176bbd5787b9981e60f96cf8254a"/><file name="SessionController.php" hash="ea6f58e8a3f024e2d55c8b363c6448fd"/><file name="StatusController.php" hash="f017c622790033a9c928debdd5c94427"/></dir><dir name="etc"><file name="adminhtml.xml" hash="216df222a5f5d9fdcf29c238cfd78bd5"/><file name="config.xml" hash="46692d1909b3c9394bd1552631a986ed"/><file name="system.xml" hash="28c240d36d67c0f8d4df44ad7744b37b"/></dir><dir name="sql"><dir name="paybyfinance_setup"><dir name="html"><file name="abandoned.html" hash="424f900dbddc267f7dac72e67752df25"/><file name="accepted.html" hash="5a12318275410a8bf62d7508422d9503"/><file name="declined.html" hash="bd3e7565c3d98645629d9f6274e4bf24"/><file name="error.html" hash="4a448b052f101b2648dfe84423ad1313"/><file name="information.html" hash="b364458ba3d9ad7579fa4935e3449b46"/><file name="page-finance-options.html" hash="d6786a27e4bf82a73e3134df0f98888b"/><file name="referred.html" hash="5955befddbb2e274f350ba71458b6151"/></dir><file name="mysql4-install-1.0.4.php" hash="94c5a58f3c5055785dcba46aa8143eb1"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="ebbf4e768317754347893a4ed6b624e2"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="6424964cd6c10967ee6eb1f6db558a63"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="a0c089fe5893948802367333dc2d6edf"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="paybyfinance"><file name="form.phtml" hash="6f583d5629e39fe564d4b86535242c7a"/><dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir><file name="selector-no.phtml" hash="b54c570f68254a2e879464a0b761c7db"/><file name="selector.phtml" hash="10f989f65562ded614a268712058f5d5"/><file name="status.phtml" hash="9e02cb668c470d72612bccc09e34c51a"/></dir><dir name="checkout"><dir name="cart"><file name="totals-pbf.phtml" hash="f14878e618aa3c8943f3728128aadaa6"/></dir><dir name="onepage"><dir name="review"><file name="info-pbf.phtml" hash="e4c7c70c798f1956ae7aaa5c09114fab"/><file name="totals-pbf.phtml" hash="f26e488359433c3814a1cd416006869a"/></dir></dir><file name="cart-pbf.phtml" hash="9f6b1873ed02e5e2ae1966e3e5a1910d"/></dir></dir><dir name="layout"><file name="paybyfinance.xml" hash="7260a6fd47c42aec9bdd1d3acb7d9a26"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="paybyfinance.xml" hash="6dd419ed31a10c3fc409a5a58f89fe01"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="paybyfinance"><file name="checkout.js" hash="21051d8691dd773427d3e761403896ab"/><file name="functions.js" hash="98c27381b3f7eaeaa845271dbe763f05"/><file name="slider.js" hash="16d83f4f0faa449276c926d2afac75fb"/></dir></dir><dir name="css"><file name="paybyfinance.css" hash="25d02dc5cf228662c30d908d7c2f1356"/><file name="paybyfinance-ie8.css" hash="a6be9c7af8b95300bc62e4fe9ef252ac"/></dir><dir name="images"><dir name="paybyfinance"><file name="bullet.png" hash="ea2baab34b2eb7d0aacb7a67d5b080f1"/><file name="pointer-toggle.png" hash="e661d42aed7a5562f75828312c7a635a"/><file name="pointer.png" hash="68c58b28d6ebd77d415f8666c301a199"/><file name="progress.png" hash="6d46a109cc9e38a663678918142d89f2"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="HC_PayByFinance.xml" hash="7cbf54af53b5b2fe9047988444fd407c"/></dir></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.4.26</min><max>5.6.7</max></php></required></dependencies>
22
  </package>
skin/frontend/base/default/js/paybyfinance/slider.js CHANGED
@@ -150,7 +150,9 @@ Healthy.Slider = Class.create({
150
  el.removeClassName('active');
151
  });
152
 
153
- slider.ruler.select('li.ruler-'+ slider.inputField.value)[0].addClassName('active');
 
 
154
  }
155
 
156
  this.pointer.setStyle({left: x + 'px'});
150
  el.removeClassName('active');
151
  });
152
 
153
+ if (slider.ruler.select('li.ruler-'+ slider.inputField.value).length !== 0) {
154
+ slider.ruler.select('li.ruler-'+ slider.inputField.value)[0].addClassName('active');
155
+ }
156
  }
157
 
158
  this.pointer.setStyle({left: x + 'px'});