-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1efa79d
commit 63d9c05
Showing
16 changed files
with
255 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* Magento 2 extensions for Afterpay Payment | ||
* | ||
* @author Afterpay | ||
* @copyright 2016-2020 Afterpay https://www.afterpay.com | ||
*/ | ||
namespace Afterpay\Afterpay\Helper; | ||
|
||
/** | ||
* Catalog category helper | ||
* | ||
* @SuppressWarnings(PHPMD.LongVariable) | ||
*/ | ||
class Category extends \Magento\Catalog\Helper\Category | ||
{ | ||
|
||
/** | ||
* Retrieve current store categories | ||
* | ||
* @param bool|string $sorted | ||
* @param bool $asCollection | ||
* @param bool $toLoad | ||
* @return \Magento\Framework\Data\Tree\Node\Collection or | ||
* \Magento\Catalog\Model\ResourceModel\Category\Collection or array | ||
*/ | ||
public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true,$storeId = 1) | ||
{ | ||
$parent = $this->_storeManager->getStore($storeId)->getRootCategoryId(); | ||
$cacheKey = sprintf('%d-%d-%d-%d', $parent, $sorted, $asCollection, $toLoad); | ||
if (isset($this->_storeCategories[$cacheKey])) { | ||
return $this->_storeCategories[$cacheKey]; | ||
} | ||
|
||
/** | ||
* Check if parent node of the store still exists | ||
*/ | ||
$category = $this->_categoryFactory->create(); | ||
/* @var $category ModelCategory */ | ||
if (!$category->checkId($parent)) { | ||
if ($asCollection) { | ||
return $this->_dataCollectionFactory->create(); | ||
} | ||
return []; | ||
} | ||
|
||
$recursionLevel = max( | ||
0, | ||
(int)$this->scopeConfig->getValue( | ||
'catalog/navigation/max_depth', | ||
\Magento\Store\Model\ScopeInterface::SCOPE_STORE | ||
) | ||
); | ||
$storeCategories = $category->getCategories($parent, $recursionLevel, $sorted, $asCollection, $toLoad); | ||
|
||
$this->_storeCategories[$cacheKey] = $storeCategories; | ||
return $storeCategories; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,16 @@ | |
cart_page1 = "Check out with Afterpay and pay by instalment.</span> | ||
<span>Simply pay 4 fortnightly instalments of " | ||
cart_page2 = "<br> Use your payment card, instant approval.</span> | ||
<span><a href="[modal-href]" class="afterpay-modal-popup-trigger">Learn more</a></span>" | ||
<span><a href="[modal-href]" class="afterpay-modal-popup-trigger">Learn more</a></span>" | ||
|
||
[CAD] | ||
name = "CA" | ||
product_page1 = "or 4 installments of " | ||
product_page2 = 'by <img class="afterpay_instalments_logo" src="https://static.afterpay.com/integration/logo-afterpay-colour-72x15.png" srcset="https://static.afterpay.com/integration/logo-afterpay-colour-72x15.png 1x,https://static.afterpay.com/integration/[email protected] 2x,https://static.afterpay.com/integration/[email protected] 3x" height="15"/><a href="[modal-href]" class="afterpay-modal-popup-trigger-ca">More info</a>' | ||
product_page_from = "or 4 installments from " | ||
cart_page1 = "Check out with Afterpay and pay by installments.</span></h3> | ||
<span>Pay 4 installments of " | ||
cart_page2 = "<br> Use your payment card, approval decision online.</span> | ||
<span><a href="[modal-href]" class="afterpay-modal-popup-trigger-ca">More info</a></span>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
{ | ||
"name": "afterpay-global/module-afterpay", | ||
"license": "OSL-3.0", | ||
"type": "magento2-module", | ||
"description": "Magento 2 Afterpay Payment Module", | ||
"version": "3.1.3", | ||
"require": { | ||
}, | ||
"authors":[ | ||
{ | ||
"name":"Afterpay", | ||
"homepage":"https://www.afterpay.com" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Afterpay\\Afterpay\\": "" | ||
} | ||
} | ||
} | ||
"name" : "afterpay-global/module-afterpay", | ||
"license" : "OSL-3.0", | ||
"type" : "magento2-module", | ||
"description" : "Magento 2 Afterpay Payment Module", | ||
"version" : "3.1.4", | ||
"authors" : [{ | ||
"name" : "Afterpay", | ||
"homepage" : "https://www.afterpay.com" | ||
} | ||
], | ||
"autoload" : { | ||
"files" : [ | ||
"registration.php" | ||
], | ||
"psr-4" : { | ||
"Afterpay\\Afterpay\\" : "" | ||
} | ||
} | ||
} |
Oops, something went wrong.