Skip to content

Commit 37e4bf2

Browse files
Merge pull request #192 from getbread/pg-1677-pg-1722-updates
service auth URl & bundled products ALA
2 parents eb5c52b + f549c1b commit 37e4bf2

File tree

7 files changed

+64
-31
lines changed

7 files changed

+64
-31
lines changed

Block/Product/Bundle.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,4 +510,28 @@ public function isDownloadable()
510510
public function getApiVersion() {
511511
return (string) $this->dataHelper->getApiVersion();
512512
}
513-
}
513+
514+
/**
515+
* @since 2.1.0
516+
* @return string
517+
*/
518+
public function getIntegrationKey() {
519+
return $this->dataHelper->getIntegrationKey();
520+
}
521+
522+
/**
523+
* @since 2.1.0
524+
* @return string
525+
*/
526+
public function getConfigClient() {
527+
return $this->dataHelper->getConfigClient();
528+
}
529+
530+
/**
531+
* @since 2.1.0
532+
* @return string
533+
*/
534+
public function getCurrentCurrencyCode() {
535+
return $this->catalogHelper->getCurrentCurrencyCode();
536+
}
537+
}

Model/Payment/Api/Client.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,7 @@ protected function getUpdateTransactionUrl($transactionId)
873873
*/
874874
protected function getAuthTokenUrl() {
875875
$baseUrl = $this->helper->getTransactionApiUrl('bread_2', $this->getStoreId());
876-
//return join('/', [trim($baseUrl, '/'), 'auth/service/authorize']);
877-
return join('/', [trim($baseUrl, '/'), 'auth/sa/authenticate']);
876+
return join('/', [trim($baseUrl, '/'), 'auth/service/authorize']);
878877
}
879878

880879
/**

changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
== Changelog ==
2+
3+
= 2.3.1
4+
* Current release
5+
* ALA button now shows correctly for Bundled products under the view category section
6+
* Fixed the fetch Auth token API end-point
7+
* Extension is now PHP 8.2 compatible

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"description": "Offers Bread Pay financing and checkout tools for your Magento store",
44
"license": "MIT",
55
"minimum-stability": "stable",
6-
"version": "2.3.0",
6+
"version": "2.3.1",
77
"require": {
8-
"php": "~7.0.13||~7.1.0||~7.1.3||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0"
8+
"php": "~7.0.13||~7.1.0||~7.1.3||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0||8.2.0"
99
},
1010
"type": "magento2-module",
1111
"repositories": [{

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Bread_BreadCheckout" setup_version="2.3.0">
3+
<module name="Bread_BreadCheckout" setup_version="2.3.1">
44
<sequence>
55
<module name="Magento_Checkout"/>
66
<module name="Magento_Sales"/>

view/frontend/templates/breadcheckout/catalog/product/view.phtml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Maritim, Kip
44
* @copyright (c) 2023, Bread Financial
55
*
6-
* @var Bread\BreadCheckout\Block\CatalogProductCollection $block
6+
* @var Bread\BreadCheckout\Block\Catalog\ProductCollection $block
77
*/
88
$collection = $block->getCategoryProductCollection();
99
$products = array();
@@ -21,30 +21,33 @@ endforeach;
2121
var currentCurrencyCode = "<?= /* @noEscape */ $block->getCurrentCurrencyCode(); ?>";
2222
var placementObject = [];
2323
<?php foreach ($products as $product) : ?>
24-
var itemPlacement = {
25-
"allowCheckout": allowCheckout,
26-
"financingType": "installment",
27-
"domID": 'bread-checkout-btn-<?= /* @noEscape */ $product['id'];?>',
28-
"locationType": buttonLocation,
29-
"order": {
30-
"items": [
31-
{
32-
"name": "<?= /* @noEscape */ $product['name']?>",
33-
"quantity": <?= /* @noEscape */ $product['quantity']?>,
34-
"shippingCost": {"currency": currentCurrencyCode, "value": 0},
35-
"shippingDescription": "",
36-
"unitTax": {"currency": currentCurrencyCode, "value": 0},
37-
"unitPrice": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>}
24+
var price = <?= /* @noEscape */ $product['price']?>;
25+
if(price != 0) {
26+
var itemPlacement = {
27+
"allowCheckout": allowCheckout,
28+
"financingType": "installment",
29+
"domID": 'bread-checkout-btn-<?= /* @noEscape */ $product['id'];?>',
30+
"locationType": buttonLocation,
31+
"order": {
32+
"items": [
33+
{
34+
"name": "<?= /* @noEscape */ $product['name']?>",
35+
"quantity": <?= /* @noEscape */ $product['quantity']?>,
36+
"shippingCost": {"currency": currentCurrencyCode, "value": 0},
37+
"shippingDescription": "",
38+
"unitTax": {"currency": currentCurrencyCode, "value": 0},
39+
"unitPrice": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>}
40+
}
41+
],
42+
"subTotal": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>},
43+
"totalPrice": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>},
44+
"totalDiscounts": {"currency": currentCurrencyCode, "value": 0},
45+
"totalShipping": {"currency": currentCurrencyCode, "value": 0},
46+
"totalTax": {"currency": currentCurrencyCode, "value": 0}
3847
}
39-
],
40-
"subTotal": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>},
41-
"totalPrice": {"currency": currentCurrencyCode, "value": <?= /* @noEscape */ $product['price']?>},
42-
"totalDiscounts": {"currency": currentCurrencyCode, "value": 0},
43-
"totalShipping": {"currency": currentCurrencyCode, "value": 0},
44-
"totalTax": {"currency": currentCurrencyCode, "value": 0}
45-
}
46-
};
47-
placementObject.push(itemPlacement);
48+
};
49+
placementObject.push(itemPlacement);
50+
}
4851
<?php endforeach; ?>
4952
if (typeof window.BreadPayments !== 'undefined' || typeof window.RBCPayPlan !== 'undefined') {
5053
var bread_sdk = null;

view/frontend/templates/breadcheckout/view.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<?php endif; ?>
7575
bread_sdk.registerPlacements([{
7676
allowCheckout: false,
77-
domID: 'bread-btn-render',
77+
domID: 'bread-checkout-btn',
7878
order: {
7979
currency: currentCurrencyCode,
8080
items: itemsObject,

0 commit comments

Comments
 (0)