Skip to content

Commit

Permalink
resolve issues with line length and unescaped output found by github …
Browse files Browse the repository at this point in the history
…actions for M2 coding standard
  • Loading branch information
Chris Mallory committed Feb 2, 2021
1 parent 9badacf commit 6d15265
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions view/frontend/templates/cart/freeshipping_progress_bar.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ $viewModel = $block->getData('viewModel');
<div class="freeship-progress">
<?php if (!$viewModel->isFreeShippingEligible()): ?>
<?php
$freeshippingProgress = $viewModel->getFreeShippingCompletionPercent();
$background = "background: linear-gradient(to right, #00b052 0%, #00b052 " . $freeshippingProgress . "%, lightgreen);";
if ($freeshippingProgress > 90) {
$background = "background: linear-gradient(to right, #00b052 0%, #00b052 95%, lightgreen);";
}
$freeshippingProgress = $viewModel->getFreeShippingCompletionPercent();
$background = "background: linear-gradient(to right, #00b052 0%, #00b052 "
. $freeshippingProgress . "%, lightgreen);";
if ($freeshippingProgress > 90) {
$background = "background: linear-gradient(to right, #00b052 0%, #00b052 95%, lightgreen);";
}
?>
<p class="upsell">Add
<span class="freeship-price">
Expand All @@ -30,7 +31,8 @@ $viewModel = $block->getData('viewModel');
<div class="freeship-progress-bar">
<div class="freeship-progress-bar-bg">
<div class="freeship-progress-bar-fill freeship-progress-bar-progress"
style="width: <?= /* @noEscape */ $viewModel->getFreeShippingCompletionPercent() ?>%; <?= $background ?>">
style="width: <?= /* @noEscape */ $viewModel->getFreeShippingCompletionPercent() ?>%;
<?= /* @noEscape */ $background ?>">
</div>
</div>
</div>
Expand Down

0 comments on commit 6d15265

Please sign in to comment.