Skip to content

Commit

Permalink
Merge pull request #196 from getbread/pg-1745-fixes
Browse files Browse the repository at this point in the history
v2.3.3 updates
  • Loading branch information
KiprotichMaritim authored May 4, 2023
2 parents 7cc772a + 9767863 commit 3279104
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Helper/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getFormattedDefaultShippingAddress()
'city' => $defaultShippingAddress->getCity(),
'state' => $defaultShippingAddress->getRegionCode(),
'zip' => $defaultShippingAddress->getPostcode(),
'phone' => substr(preg_replace('/[^0-9]+/', '', $defaultShippingAddress->getTelephone()), -10)
'phone' => is_null($defaultShippingAddress->getTelephone()) ? "": substr(preg_replace('/[^0-9]+/', '', $defaultShippingAddress->getTelephone()), -10)
];

return $primaryData;
Expand Down Expand Up @@ -171,7 +171,7 @@ public function getFormattedDefaultBillingAddress()
'state' => $defaultBillingAddress->getRegionCode(),
'zip' => $defaultBillingAddress->getPostcode(),
'email' => $customer->getEmail(),
'phone' => substr(preg_replace('/[^0-9]+/', '', $defaultBillingAddress->getTelephone()), -10)
'phone' => is_null($defaultBillingAddress->getTelephone()) ? "" : substr(preg_replace('/[^0-9]+/', '', $defaultBillingAddress->getTelephone()), -10)
];

return $primaryData;
Expand Down
6 changes: 3 additions & 3 deletions Helper/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function getBillingAddressData()
'city' => $billingAddress->getCity(),
'state' => $billingAddress->getRegionCode(),
'zip' => $billingAddress->getPostcode(),
'phone' => substr(preg_replace('/[^0-9]+/', '', $billingAddress->getTelephone()), -10),
'phone' => is_null($billingAddress->getTelephone()) ? '' : substr(preg_replace('/[^0-9]+/', '', $billingAddress->getTelephone()), -10),
'email' => $billingAddress->getEmail(),
'firstName' => trim($billingAddress->getFirstname()),
'lastName' => trim($billingAddress->getLastname()),
Expand Down Expand Up @@ -268,7 +268,7 @@ public function getShippingAddressData()
'email' => $shippingAddress->getEmail(),
'state' => $shippingAddress->getRegionCode(),
'zip' => $shippingAddress->getPostcode(),
'phone' => substr(preg_replace('/[^0-9]+/', '', $shippingAddress->getTelephone()), -10)
'phone' => is_null($shippingAddress->getTelephone()) ? '' : substr(preg_replace('/[^0-9]+/', '', $shippingAddress->getTelephone()), -10)
];
}

Expand Down Expand Up @@ -298,7 +298,7 @@ public function getShippingAddressAPIData()
'city' => $shippingAddress->getCity(),
'state' => $shippingAddress->getRegionCode(),
'zip' => $shippingAddress->getPostcode(),
'phone' => substr(preg_replace('/[^0-9]+/', '', $shippingAddress->getTelephone()), -10)
'phone' => is_null($shippingAddress->getTelephone()) ? '' : substr(preg_replace('/[^0-9]+/', '', $shippingAddress->getTelephone()), -10)
];
// @codingStandardsIgnoreEnd
}
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
== Changelog ==

= 2.3.3
* Current release
* PHP 8.2 comaptibility updates
* Healthcare mode refactor, healthcare checks have been moved to the SDK
* Closed https://github.com/getbread/magento-v2-bread/issues/189

= 2.3.2
* Current release
* Replaced Zend_Http_Client with Laminas_Http
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Offers Bread Pay financing and checkout tools for your Magento store",
"license": "MIT",
"minimum-stability": "stable",
"version": "2.3.2",
"version": "2.3.3",
"require": {
"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"
},
Expand Down
7 changes: 0 additions & 7 deletions etc/adminhtml/system.ca.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@
<field id="active">1</field>
</depends>
</field>
<field id="enableonminicart" type="select" sortOrder="11" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled on Minicart page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="enabled_on_cart_page" type="select" sortOrder="12" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled on Cart Overview Page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down
1 change: 1 addition & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<depends>
<field id="active">1</field>
<field id="api_version">classic</field>
</depends>
</field>
<field id="allowminicartcheckout" type="select" sortOrder="29" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Bread_BreadCheckout" setup_version="2.3.2">
<module name="Bread_BreadCheckout" setup_version="2.3.3">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Sales"/>
Expand Down
6 changes: 2 additions & 4 deletions view/frontend/templates/breadcheckout/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
bread_sdk.on('INSTALLMENT:APPLICATION_CHECKOUT', onCheckout);
let currentCurrencyCode = "<?= /* @noEscape */ $block->getCurrentCurrencyCode(); ?>";
let itemsObject = [];
<?php if(!$block->isHealthcare()) : ?>
for (var i = 0; i < items.length; i++) {
let item = {
name: items[i].name,
Expand All @@ -71,7 +70,6 @@

itemsObject.push(item);
}
<?php endif; ?>
bread_sdk.registerPlacements([{
allowCheckout: false,
domID: 'bread-checkout-btn',
Expand Down Expand Up @@ -101,8 +99,8 @@
}
}]);

bread_sdk.__internal__.setInitMode('manual');
bread_sdk.__internal__.init();
bread_sdk.setInitMode('manual');
bread_sdk.init();


} else {
Expand Down

0 comments on commit 3279104

Please sign in to comment.