Jump to content

IOS Webmaster

Members
  • Posts

    3
  • Joined

  • Last visited

Reputation Activity

  1. Like
    IOS Webmaster reacted to Tyson in Package Pricing Display...   
    It's possible, but it's not natively supported. It would require you to make core changes, which will be overridden during upgrades. You would need to maintain the changes in your installation.
     
    Amounts are displayed in several places across the admin/client interfaces, but for brevity I'll give an example of one place on the Wizard order form. The other order forms (i.e. Standard/AJAX) would need to be updated similarly.
     
    This example will change the price display on the Wizard order form's drop-down menu for Term and Price. This will show prices using the per-month price rather than the price for all months combined.
     
     
    Open /plugins/order/views/templates/wizard/config.pdt
    Find (line 37):
    $prices[$price->id] = $this->_("Config.index.package_price", true, $period, $this->CurrencyFormat->format($price->price, $price->currency)); Replace with:
    $amount = $price->price; if ($price->period == "month" && $price->term > 0) $amount = ($price->price/$price->term); $prices[$price->id] = $this->_("Config.index.package_price", true, $period, $this->CurrencyFormat->format($amount, $price->currency));
  2. Like
    IOS Webmaster reacted to Tyson in Package Pricing Display...   
    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>
×
×
  • Create New...