Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/27/2020 in all areas

  1. https://dev.blesta.com/browse/CORE-3631
    1 point
  2. The "Starting At" price is from the /plugins/order/views/templates/wizard/main_packages.pdt template. It currently shows the lowest numeric price, however, it would require several changes to show the lowest price per month. It becomes more complex if you have non-monthly terms in the mix as well. As an example, I will only show changes for the Wizard Boxes template, and ignore non-monthly terms for simplicity. Find: foreach ($package->pricing as $price) { if ($lowest_price === null || $lowest_price->price > $price->price) $lowest_price = $price; } Replace with: $lowest_monthly_price = null; $lowest_monthly_currency = null; foreach ($package->pricing as $price) { if ($lowest_price === null) { $lowest_price = $price; } if ($price->period == "month" && $lowest_price->period == "month" && $price->term > 0 && $lowest_price->term > 0 && ($price->price/$price->term) < ($lowest_price->price/$lowest_price->term)) { $lowest_monthly_price = ($price->price/$price->term); $lowest_monthly_currency = $price->currency; } } Find: <div class="package panel-blesta <?php echo ($this->Html->ifSet($package_id) == $package->id ? "selected" : "");?>" data-group-id="<?php $this->Html->_($package_group->id);?>" data-pricing-id="<?php $this->Html->_($lowest_price->id);?>"> Replace with: <div class="package panel-blesta <?php echo ($this->Html->ifSet($package_id) == $package->id ? "selected" : "");?>" data-group-id="<?php $this->Html->_($package_group->id);?>" data-pricing-id="<?php echo $this->Html->safe($this->Html->ifSet($lowest_monthly_id, $lowest_price->id));?>"> Find: <h4><?php echo $this->CurrencyFormat->format($this->Html->ifSet($lowest_price->price), $this->Html->ifSet($lowest_price->currency));?></h4> Replace with: <h4><?php echo $this->CurrencyFormat->format($this->Html->ifSet($lowest_monthly_price, $lowest_price->price), $this->Html->ifSet($lowest_monthly_currency, $lowest_price->currency));?><?php echo ($lowest_monthly_price !== null) ? "/month" : "";?></h4>
    1 point
×
×
  • Create New...