Skip to content

Commit c5ca575

Browse files
Release version 3.1.0
1 parent 345eada commit c5ca575

86 files changed

Lines changed: 1060 additions & 278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Afterpay/Afterpay/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Magento 2 extensions for Afterpay Payment
4+
*
5+
* @author Afterpay
6+
* @copyright 2016-2019 Afterpay https://www.afterpay.com
7+
*/
8+
namespace Afterpay\Afterpay\Block\Adminhtml\Order\Creditmemo;
9+
10+
class Controls extends \Magento\CustomerBalance\Block\Adminhtml\Sales\Order\Creditmemo\Controls
11+
{
12+
public function canRefundToCustomerBalance()
13+
{
14+
$creditMemo = $this->_coreRegistry->registry('current_creditmemo');
15+
$payment = $creditMemo->getOrder()->getPayment();
16+
if($payment->getMethod() == \Afterpay\Afterpay\Model\Payovertime::METHOD_CODE ){
17+
return false;
18+
}
19+
return true;
20+
}
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Magento 2 extensions for Afterpay Payment
4+
*
5+
* @author Afterpay
6+
* @copyright 2016-2019 Afterpay https://www.afterpay.com
7+
*/
8+
namespace Afterpay\Afterpay\Block\Adminhtml\Order\Creditmemo\Create;
9+
10+
class Items extends \Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Items
11+
{
12+
protected function _prepareLayout()
13+
{
14+
parent::_prepareLayout();
15+
$payment = $this->getCreditmemo()->getOrder()->getPayment();
16+
if($payment->getMethod() == \Afterpay\Afterpay\Model\Payovertime::METHOD_CODE ){
17+
$this->unsetChild(
18+
'submit_offline'
19+
);
20+
}
21+
}
22+
}

Afterpay/Afterpay/Block/Adminhtml/System/Config/Button/Update.php renamed to Block/Adminhtml/System/Config/Button/Update.php

File renamed without changes.

Afterpay/Afterpay/Block/Adminhtml/System/Config/Form/Field/Disable.php renamed to Block/Adminhtml/System/Config/Form/Field/Disable.php

File renamed without changes.

Afterpay/Afterpay/Block/Adminhtml/System/Config/Form/Field/Label.php renamed to Block/Adminhtml/System/Config/Form/Field/Label.php

File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function canShow()
113113
if($excluded_categories !=""){
114114
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
115115
$productRepository = $objectManager->get('\Magento\Catalog\Model\ProductRepository');
116-
116+
$excluded_categories_array = explode(",",$excluded_categories);
117117

118118
foreach ($quote->getAllVisibleItems() as $item) {
119119
$productid = $item->getProductId();
@@ -122,7 +122,7 @@ public function canShow()
122122

123123
foreach($categoryids as $k)
124124
{
125-
if(strpos($excluded_categories,$k) !== false){
125+
if(in_array($k,$excluded_categories_array)){
126126
return false;
127127
}
128128
}

Afterpay/Afterpay/Block/Catalog/Installments.php renamed to Block/Catalog/Installments.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ public function canShow()
9191
if($this->afterpayPayovertime->canUseForCurrency($this->afterpayConfig->getCurrencyCode())){
9292
$excluded_categories=$this->afterpayConfig->getExcludedCategories();
9393
if($excluded_categories!=""){
94+
$excluded_categories_array = explode(",",$excluded_categories);
9495
$product = $this->registry->registry('product');
9596
$categoryids = $product->getCategoryIds();
9697
foreach($categoryids as $k)
9798
{
98-
if(strpos($excluded_categories,$k) !== false){
99+
if(in_array($k,$excluded_categories_array)){
99100
return false;
100101
}
101102
}

0 commit comments

Comments
 (0)