Jump to content

Question

Posted

I am using "Winzard List" Template and want to show Pricing from Yearly to Monthly but blesta is showing from monthly to Yearly.

 

Eg:

1 Year - $20

6 Month - $10

3 Month - $5

 

Currently Blesta is showing pricing by this method:

 

And I want to change this to

(Image screenshot taken by high resolution camera, 20MP HD)

 

 

 

How can I do this?

 

 

 

Thanks.

7 answers to this question

Recommended Posts

  • 0
Posted

I think (sort of know) it's in /plugins/order/views/templates/wizard/main_packages.pdt however I'm not sure how you can change it from the lowest_price to the highest_price for you.

  • 0
Posted

Sorry for the delay ... open the file  /app/models/packages.php 

 

search (line 1428)

order(array('period' => "ASC", 'term' => "ASC"))->fetchAll();

replace with

order(array('period' => "DESC", 'term' => "DESC"))->fetchAll();

you are done ..

 

NOTE :every upgrade of blesta you should do the same .

  • 0
Posted

Update for this thread - in Version 4.0.1 the line has moved to the function getPackagePricing and constructed in a slightly different way:

Before: 

    private function getPackagePricing($package_id)
    {
        $fields = ['package_pricing.id', 'package_pricing.pricing_id', 'package_pricing.package_id', 'pricings.term',
            'pricings.period', 'pricings.price', 'pricings.setup_fee',
            'pricings.cancel_fee', 'pricings.currency'];
        return $this->Record->select($fields)->from('package_pricing')->
            innerJoin('pricings', 'pricings.id', '=', 'package_pricing.pricing_id', false)->
            where('package_pricing.package_id', '=', $package_id)->
            order(['period' => 'ASC', 'term' => 'ASC'])->fetchAll();
    }

After:

    private function getPackagePricing($package_id)
    {
        $fields = ['package_pricing.id', 'package_pricing.pricing_id', 'package_pricing.package_id', 'pricings.term',
            'pricings.period', 'pricings.price', 'pricings.setup_fee',
            'pricings.cancel_fee', 'pricings.currency'];
        return $this->Record->select($fields)->from('package_pricing')->
            innerJoin('pricings', 'pricings.id', '=', 'package_pricing.pricing_id', false)->
            where('package_pricing.package_id', '=', $package_id)->
            order(['period' => 'DESC', 'term' => 'DESC'])->fetchAll();
    }

So change the Order clause to DESC instead of ASC (y)

  • 0
Posted

I made this change (because I also want the Yearly price shown first...) and the drop-down is now displaying it in the correct order, however, the "selected" option is the lowest monthly choice.  So where can the "selected" option be changed to the first item in the list (which would be the yearly option)?

  • 0
Posted

I figured it out.  I'm using the wizard template and modified: plugins/order/views/templates/wizard/config.pdt

Line 29 was this:  $selected_price = $this->Html->ifSet($vars->pricing_id, $item['pricing_id']);

I changed it to: $selected_price = 1;

Yes it is a core mod which I need to keep in mind during upgrades, but at least the most expensive package is presented and selected first now.

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...