Pro Sites Pricing Table - set preferred payment period

The pricing table defaults to the month view. I would rather have it default to year view (cheaper per month; longer commitment). How do I hack this, and can you add this as a feature for the next version.
Also, please change the dropdown to something more exciting (tabs, buttons) so people realise they should click on it.

  • Bojan Radonic
    • Head of Support

    Hey @Open Forest,

    Thanks for the suggestion about the tabs/buttons, I'll be more then happy to move this to features and feedback so other members can vote on it and if it proves to be popular we'll consider adding it to future plugin updates.

    As for default option, I've been playing with jQuery and while I could change the selected option, info displayed in the actual tables wasn't changing so I'll have to include an available SLS developer for his input on this one.

    Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Bojan

  • Hoang Ngo
    • Code Slayer

    Hi @Open Forest,

    I hope you are well today.
    Please add this code to your theme functions.php or use mu-plugins

    add_action( 'wp_footer', 'select_year_by_default_ps' );
    
    function select_year_by_default_ps() {
    	?>
    	<script type="text/javascript">
    		jQuery(function ($) {
    			if ($('.chosen').size() > 0) {
    				$('.chosen').val('price_12').change();
    			}
    		})
    	</script>
    <?php
    }

    If you have any issues please don't hesitate to let us know so we can assist.

    Best regards,
    Hoang

  • Hoang Ngo
    • Code Slayer

    Hi @Open Forest,

    I hope you are well today.

    Can you please send me your site URL? I've checked on my end, the code still works for me. Perhaps some minor changes required on your site, I think I can send you a new code after checking your site :slight_smile:

    Best regards,
    Hoang

  • maremiru
    • Site Builder, Child of Zeus

    Hi @Hoang Ngo

    I saw you change how you manage the switch between subscription periods. Could you please check out if I modified your code correctly?

    add_action( 'wp_footer', 'select_year_by_default_ps' );
    
    function select_year_by_default_ps() {
    	?>
    	<script type="text/javascript">
    		jQuery(function ($) {
    			$("#prosites-checkout-table").attr("data-period", "12");
    		})
    	</script>
    <?php
    }

    Best regards,
    Damian

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.