Jump to content
  • 0

[Resolved] Show Pricing From Yearly To Monthly On Order Form?


PreMadeKB

Question

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.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

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 .

Link to comment
Share on other sites

  • 0

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)

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...