diff --git a/Helper/Data.php b/Helper/Data.php index d6687dd4..7e1ab135 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -41,6 +41,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper const XML_CONFIG_AS_LOW_AS = 'payment/breadcheckout/as_low_as'; const XML_CONFIG_PAYMENT_ACTION = 'payment/breadcheckout/payment_action'; const XML_CONFIG_HEALTHCARE_MODE = 'payment/breadcheckout/healthcare_mode'; + const XML_CONFIG_SHOW_SPLITPAY_LABEL = 'payment/breadcheckout/show_splitpay_label'; const XML_CONFIG_ACTIVE_ON_PDP = 'payment/breadcheckout/enabled_on_product_page'; const XML_CONFIG_ACTIVE_ON_CAT = 'payment/breadcheckout/bread_category/enabled_on_category_page'; const XML_CONFIG_ACTIVE_ON_CART_VIEW = 'payment/breadcheckout/enabled_on_cart_page'; @@ -540,6 +541,18 @@ public function isHealthcare($storeCode = null, $store = \Magento\Store\Model\Sc $this->isActive($store, $storeCode) && $this->scopeConfig->getValue(self::XML_CONFIG_HEALTHCARE_MODE, $store, $storeCode) ); } + + /** + * Are we showing the split pay label + * + * @param null $store + * @return bool + */ + public function showSplitpayLabelOnCheckout($storeCode = null, $store = \Magento\Store\Model\ScopeInterface::SCOPE_STORE) { + return (bool) ( + $this->isActive($store, $storeCode) && $this->scopeConfig->getValue(self::XML_CONFIG_SHOW_SPLITPAY_LABEL, $store, $storeCode) + ); + } /** * Use As Low As Pricing View? diff --git a/Model/Ui/ConfigProvider.php b/Model/Ui/ConfigProvider.php index d9bb9ef8..bcd23d3e 100644 --- a/Model/Ui/ConfigProvider.php +++ b/Model/Ui/ConfigProvider.php @@ -76,7 +76,8 @@ public function getConfig() 'methodTooltip' => $this->helper->getMethodTooltip(), 'productTypeMessage' => $this->helperData->getProductTypeMessage(), 'cartValidation' => $this->helper->validateAllowedProductTypes(), - 'methodTitle' => $this->breadMethod->getTitle() + 'methodTitle' => $this->breadMethod->getTitle(), + 'showSplitpayLabel' => $this->helper->showSplitpayLabelOnCheckout() ] ] ] diff --git a/README.md b/README.md index e412b760..43ac5b96 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,55 @@ -# Bread Checkout for Magento 2 +Bread Checkout for Magento 2 +============================ + +Bread is a full-funnel, white label financing solution that helps retailers acquire +and convert more customers. Retailers who use Bread have seen an increase of 5-15% in sales, +up to 120% higher AOV, and an 84% increase in email click-through-rates. + +Bread’s Features +---------------- + +* Full Funnel. Your shoppers can discover, pre-qualify, and check out from anywhere - your homepage, +category page, product page, cart, or checkout. +* Real-Time Decision. Pre-qualification is quick and easy. Let your customers learn +about their purchase power in seconds without ever leaving your site. + +Installation +------------ + +### Install using Composer + +1. Navigate to your Magento 2 root folder + +2. Install the Bread Checkout module + + ```bash + composer require breadfinance/module-breadcheckout + ``` +3. Enable module + ```bash + bin/magento module:enable Bread/BreadCheckout + bin/magento setup:upgrade + bin/magento setup:di:compile + bin/magento setup:static-content:deploy + ``` + +### Install using Zip archive + +1. Download Bread checkout module from Magento marketplace + https://marketplace.magento.com/bread-module-breadcheckout.html + +2. Unzip contents into `app/code/Bread/BreadCheckout` folder + +3. Enable module + ```bash + bin/magento module:enable Bread/BreadCheckout + bin/magento setup:upgrade + bin/magento setup:di:compile + bin/magento setup:static-content:deploy + ``` -## Installation instructions: -1. Download repository as zip file -2. Unzip contents into `app/code` folder -3. Run `magento module:enable Bread_BreadCheckout` -4. Run `magento module:update` ## Usage instructions: + See documentation at https://docs.getbread.com Contact your Bread representative for login credentials. diff --git a/composer.json b/composer.json index e050082f..a7aeabe5 100644 --- a/composer.json +++ b/composer.json @@ -3,14 +3,14 @@ "description": "Offers the Bread financing and checkout tools for your Magento store", "license": "MIT", "minimum-stability": "stable", - "version": "1.1.17", + "version": "1.1.18", "require": { "php": "~7.0.13||~7.1.0||~7.1.3||~7.2.0||~7.3.0||~7.4.0" }, "type": "magento2-module", "repositories": [{ "type": "vcs", - "url": "git@github.com:breadfinance/magento-v2-bread.git" + "url": "git@github.com:getbread/magento-v2-bread.git" }], "autoload": { "files": ["registration.php"], diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index b61ef204..f002047f 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -104,18 +104,25 @@ ]]> - + + + Magento\Config\Model\Config\Source\Yesno + + 1 + + + Magento\Config\Model\Config\Source\Yesno 1 - + Magento\Config\Model\Config\Source\Yesno - + - + - + - + Magento\Config\Model\Config\Source\Yesno @@ -161,7 +168,7 @@ ]]> - + Magento\Config\Model\Config\Source\Yesno @@ -177,15 +184,15 @@ ]]> - + Magento\Config\Model\Config\Source\Yesno - + Magento\Config\Model\Config\Source\Yesno - + Magento\Config\Model\Config\Source\Yesno @@ -196,7 +203,7 @@ ]]> - + Magento\Config\Model\Config\Source\Yesno @@ -207,7 +214,7 @@ ]]> - + Pay Over Time authorize 0 + 1 Please click the pay over time button and complete the finance forms or choose another payment method. 1 diff --git a/view/frontend/web/js/view/payment/method-renderer/breadcheckout.js b/view/frontend/web/js/view/payment/method-renderer/breadcheckout.js index b083d6ca..a191e832 100644 --- a/view/frontend/web/js/view/payment/method-renderer/breadcheckout.js +++ b/view/frontend/web/js/view/payment/method-renderer/breadcheckout.js @@ -87,9 +87,14 @@ define( var SPLITPAY_GREEN = '#57c594'; var label = jQuery('#breadcheckout').next('label').attr("for", "breadcheckout"); label.text(''); - label.append('Pay Over Time with ' + + if(window.checkoutConfig.payment[this.getCode()].breadConfig.showSplitpayLabel) { + label.append('Pay Over Time with ' + 'Installments or ' + 'SplitPay'); + } else { + label.append('Pay Over Time with ' + + 'Installments'); + } return window.checkoutConfig.payment[this.getCode()].breadConfig.methodTitle; },