diff --git a/Model/Payment/Method/Bread.php b/Model/Payment/Method/Bread.php index 0573128c..9ba0e64f 100644 --- a/Model/Payment/Method/Bread.php +++ b/Model/Payment/Method/Bread.php @@ -572,7 +572,10 @@ public function getTitle() $title = parent::getTitle(); $showPerMonth = $this->helper->showPerMonthCalculation(); - if ($this->_appState->getAreaCode() == \Magento\Framework\App\Area::AREA_WEBAPI_REST && $showPerMonth) { + $areaIsRestOrFrontend = $this->_appState->getAreaCode() == \Magento\Framework\App\Area::AREA_WEBAPI_REST + || $this->_appState->getAreaCode() == \Magento\Framework\App\Area::AREA_FRONTEND; + + if ($areaIsRestOrFrontend && $showPerMonth) { $data = $this->quoteHelper->submitQuote(null); if (isset($data['asLowAs']) && isset($data['asLowAs']['amount'])) { $title .= ' ' . sprintf(__('as low as %s/month*'), $data['asLowAs']['amount']); diff --git a/Model/Ui/ConfigProvider.php b/Model/Ui/ConfigProvider.php index 71cf6554..d9bb9ef8 100644 --- a/Model/Ui/ConfigProvider.php +++ b/Model/Ui/ConfigProvider.php @@ -23,12 +23,19 @@ class ConfigProvider implements ConfigProviderInterface */ public $helperData; + /** + * @var \Bread\BreadCheckout\Model\Payment\Method\Bread + */ + public $breadMethod; + public function __construct( \Bread\BreadCheckout\Helper\Quote $helper, - \Bread\BreadCheckout\Helper\Data $helperData + \Bread\BreadCheckout\Helper\Data $helperData, + \Bread\BreadCheckout\Model\Payment\Method\Bread $breadMethod ) { $this->helper = $helper; $this->helperData = $helperData; + $this->breadMethod = $breadMethod; } /** @@ -68,7 +75,8 @@ public function getConfig() 'buttonLocation' => $this->helperData->getCheckoutLocation(), 'methodTooltip' => $this->helper->getMethodTooltip(), 'productTypeMessage' => $this->helperData->getProductTypeMessage(), - 'cartValidation' => $this->helper->validateAllowedProductTypes() + 'cartValidation' => $this->helper->validateAllowedProductTypes(), + 'methodTitle' => $this->breadMethod->getTitle() ] ] ] diff --git a/view/adminhtml/web/js/breadcheckout.js b/view/adminhtml/web/js/breadcheckout.js index 6e65aa08..804a2dde 100644 --- a/view/adminhtml/web/js/breadcheckout.js +++ b/view/adminhtml/web/js/breadcheckout.js @@ -13,6 +13,7 @@ define( var breadConfig = { buttonId: 'bread-checkout-btn', + allowSplitPayCheckout: false, shippingOptions: [data.shippingOptions], tax: data.tax, customTotal: data.grandTotal, diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index 7674b0dc..168e0ad2 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -10,5 +10,8 @@ + + + diff --git a/view/frontend/layout/catalog_product_view_type_bundle.xml b/view/frontend/layout/catalog_product_view_type_bundle.xml index b75367d2..950579a5 100644 --- a/view/frontend/layout/catalog_product_view_type_bundle.xml +++ b/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -5,6 +5,9 @@ + + + diff --git a/view/frontend/layout/catalog_product_view_type_grouped.xml b/view/frontend/layout/catalog_product_view_type_grouped.xml index f802c4a4..0a39a38b 100644 --- a/view/frontend/layout/catalog_product_view_type_grouped.xml +++ b/view/frontend/layout/catalog_product_view_type_grouped.xml @@ -3,6 +3,7 @@ + diff --git a/view/frontend/requirejs-config.js b/view/frontend/requirejs-config.js index 9fedd33e..9b3e7385 100644 --- a/view/frontend/requirejs-config.js +++ b/view/frontend/requirejs-config.js @@ -8,7 +8,8 @@ var config = { map: { '*': { buttonConfig: 'Bread_BreadCheckout/js/button-config', - bundleHelper: 'Bread_BreadCheckout/js/bundle-helper' + bundleHelper: 'Bread_BreadCheckout/js/bundle-helper', + splitPay: 'Bread_BreadCheckout/js/product/splitpay' } } }; diff --git a/view/frontend/templates/breadcheckout/bundle.phtml b/view/frontend/templates/breadcheckout/bundle.phtml index 85ffa687..93d81140 100644 --- a/view/frontend/templates/breadcheckout/bundle.phtml +++ b/view/frontend/templates/breadcheckout/bundle.phtml @@ -219,6 +219,7 @@ require([ document.defaultItems[0]["price"] = this.cache.currentElement.selectedPrice * 100; document.selectedSku = this.cache.currentElement.selectedSku; document.configureButton(document.defaultItems); + document.splitPayConfigureButton(document.defaultItems); } } }, diff --git a/view/frontend/templates/breadcheckout/cartview.phtml b/view/frontend/templates/breadcheckout/cartview.phtml index b6bf35a3..e3cb1867 100644 --- a/view/frontend/templates/breadcheckout/cartview.phtml +++ b/view/frontend/templates/breadcheckout/cartview.phtml @@ -9,10 +9,11 @@
 
+
diff --git a/view/frontend/templates/breadcheckout/view.phtml b/view/frontend/templates/breadcheckout/view.phtml index e879d78c..532ca68c 100644 --- a/view/frontend/templates/breadcheckout/view.phtml +++ b/view/frontend/templates/breadcheckout/view.phtml @@ -10,6 +10,7 @@
 
+