Skip to content

Commit

Permalink
Merge pull request #417 from BoulangerV/MAGE-478-Ratepay_Ratenkauf_Ra…
Browse files Browse the repository at this point in the history
…tenrechner_kaputt

MAGE-478: Fix Css styling in Frontend Ratepay calculator
  • Loading branch information
hreinberger authored Mar 26, 2020
2 parents bb5a80d + fabe018 commit b56735b
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 2 deletions.
33 changes: 33 additions & 0 deletions app/code/community/Payone/Core/Block/PaymentAdditionalStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,37 @@ public function getActiveShortcuts()
}
return $activeMethods;
}

/**
* @return string
*/
public function getRatepayExternalStyleUrl()
{
$ratepayMethods = array(
Payone_Core_Model_System_Config_PaymentMethodCode::RATEPAYINVOICING,
Payone_Core_Model_System_Config_PaymentMethodCode::RATEPAY,
Payone_Core_Model_System_Config_PaymentMethodCode::RATEPAYDIRECTDEBIT,
);

/** @var \Mage_Checkout_Model_Session $session */
$session = Mage::getSingleton('checkout/session');

/** @var \Mage_Payment_Helper_Data $paymentHelper */
$paymentHelper = Mage::helper('payment');

foreach ($ratepayMethods as $methodCode) {
$paymentMethod = $paymentHelper->getMethodInstance($methodCode);
try {
/** @var \Payone_Core_Model_Config_Payment_Method $paymentConfig */
$paymentConfig = $paymentMethod->getConfigForQuote($session->getQuote());
if (!empty($paymentConfig)) {
return 'https://www.ratepay.com/ratenrechner/resources/ratepay-bootstrap.min.css';
}
} catch (\Payone_Core_Exception_PaymentMethodConfigNotFound $e) {
continue;
}
}

return '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
foreach ($this->getActiveShortcuts() as $url) {
echo '<link rel="stylesheet" href="' . $url . '" />' . PHP_EOL;
}

$ratepayExternalStyleUrl = $this->getRatepayExternalStyleUrl();
if (!empty($ratepayExternalStyleUrl)) {
echo '<link rel="stylesheet" href="' . $ratepayExternalStyleUrl . '" />' . PHP_EOL;
}
?>
69 changes: 68 additions & 1 deletion skin/adminhtml/default/default/payone/core/ratepay.css
Original file line number Diff line number Diff line change
Expand Up @@ -747,4 +747,71 @@ table#ratepay-InstallmentTerms {
float:left;
outline: solid 2px white;
outline-offset: -3px;
}
}

/** MAGE-478 : reported from ratepay bootstrap */
.text-center {
text-align:center
}
.text-right {
text-align:right
}
.text-uppercase {
text-transform:uppercase
}
.small,
small {
font-size:85%
}
.table {
width:100%;
max-width:100%;
margin-bottom:20px
}
.table-striped>tbody>tr:nth-of-type(odd) {
background-color:#f9f9f9
}
.table>tbody>tr>td,
.table>tbody>tr>th,
.table>tfoot>tr>td,
.table>tfoot>tr>th,
.table>thead>tr>td,
.table>thead>tr>th {
padding:8px;
line-height:1.42857143;
vertical-align:top;
border-top:1px solid #ddd
}
.table>thead>tr>th {
vertical-align:bottom;
border-bottom:2px solid #ddd
}
.table>tbody>tr.warning>td,
.table>tbody>tr.warning>th,
.table>tbody>tr>td.warning,
.table>tbody>tr>th.warning,
.table>tfoot>tr.warning>td,
.table>tfoot>tr.warning>th,
.table>tfoot>tr>td.warning,
.table>tfoot>tr>th.warning,
.table>thead>tr.warning>td,
.table>thead>tr.warning>th,
.table>thead>tr>td.warning,
.table>thead>tr>th.warning {
background-color:#fcf8e3
}
.table>caption+thead>tr:first-child>td,
.table>caption+thead>tr:first-child>th,
.table>colgroup+thead>tr:first-child>td,
.table>colgroup+thead>tr:first-child>th,
.table>thead:first-child>tr:first-child>td,
.table>thead:first-child>tr:first-child>th {
border-top:0
}
.table>tbody+tbody {
border-top:2px solid #ddd
}
.table .table {
background-color:#fff
}
/** MAGE-478 : reported from ratepay bootstrap */
1 change: 0 additions & 1 deletion skin/frontend/base/default/payone/core/ratepay.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#ratepay-main-cont {
color: black!important;
width: 472px !important;
vertical-align: middle;
}

Expand Down

0 comments on commit b56735b

Please sign in to comment.