Jump to content

IOS Webmaster

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by IOS Webmaster

  1. Hello Again, identified the issue, the package term was set as 1 year, 2 year, 3 year. Needed to change it to 12 months, 24 months and 36 months, then the above code is working.

    Another thing we would like to achieve is - Display the prices in the lowest to the highest order in the product "Term and Price" dropdown?

    Can you please help us with the same.

    Thanks and Best Regards,

    Santosh

  2. On 12/29/2014 at 10:59 PM, Tyson said:

    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));

    Hello,  I would like to achieve the exact same objective as explained in the quoted post, i am running blesta 4.9.1. 6 years after this post was written, the code is changed now to:

    /plugins/order/views/templates/wizard/config.pdt - Line 39

    // Set the pricing text to include or not include renewal pricing
    $prices[$price->id] = ($this->Html->ifSet($price->period) == 'onetime' || ($this->Html->ifSet($price->price) == $this->Html->ifSet($price->price_renews))
        ? $this->_('Config.index.package_price', true, $period, $this->CurrencyFormat->format($this->Html->ifSet($price->price), $this->Html->ifSet($price->currency)))
        : $this->_('Config.index.package_price_recurring', true, $period, $this->CurrencyFormat->format($this->Html->ifSet($price->price), $this->Html->ifSet($price->currency)), $this->CurrencyFormat->format($this->Html->ifSet($price->price_renews), $this->Html->ifSet($price->currency)))
    );

    I tried to rewrite the code for the current version based on your example above, as below:

    $amount = $price->price;
    if ($price->period == "month" && $price->term > 0)
        $amount = ($price->price/$price->term);
        
    // Set the pricing text to include or not include renewal pricing
    $prices[$price->id] = ($this->Html->ifSet($price->period) == 'onetime' || ($this->Html->ifSet($price->price) == $this->Html->ifSet($price->price_renews))
        ? $this->_('Config.index.package_price', true, $period, $this->CurrencyFormat->format($this->Html->ifSet($amount), $this->Html->ifSet($price->currency)))
        : $this->_('Config.index.package_price_recurring', true, $period, $this->CurrencyFormat->format($this->Html->ifSet($amount), $this->Html->ifSet($price->currency)), $this->CurrencyFormat->format($this->Html->ifSet($price->price_renews), $this->Html->ifSet($price->currency)))
    );

    However its not working, can you please help with the same.

    Thanks and Best Regards

    Santosh

     

×
×
  • Create New...