Plugin Directory

Changeset 2599321


Ignore:
Timestamp:
09/15/2021 12:33:57 PM (4 years ago)
Author:
subsbase
Message:

Adds Plan Picker Price Sorting V1.3

Location:
subsbase-integration
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • subsbase-integration/tags/1.3/scripts/js/main.js

    r2573892 r2599321  
    8585            checked: true
    8686        }
     87    });   
     88   
     89    $('#plan_card_defaultSort_row').dependsOn({
     90        '#plan_card_sort': {
     91            checked: false
     92        }
     93    });
     94
     95    $('#mob_plan_card_defaultSort_row').dependsOn({
     96        '#mob_plan_card_sort': {
     97            checked: false
     98        }
    8799    });
    88100
  • subsbase-integration/tags/1.3/settings-page.php

    r2573892 r2599321  
    413413                            </td>
    414414                        </tr>
     415                        <tr>
     416                                <th scope="row">
     417                                    <label for="plan_card_sort"><?php esc_html_e( 'Disable Plans Sorting', 'sbis' ); ?></label>
     418                                </th>
     419                                <td>
     420                                    <input name="plan_card_sort" type="checkbox" id="plan_card_sort"
     421                                    <?php
     422                                        echo isset( $sbis_values['plan_card_sort'] ) && $sbis_values['plan_card_sort'] == 1 ? 'checked' : ''
     423                                    ?>
     424                                    value="0">
     425                                </td>
     426                            </tr>
     427                            <tr id="plan_card_defaultSort_row">
     428                                <th scope="row"><label><?php esc_html_e( 'Default Sorting', 'sbis' ); ?></label></th>
     429                                <td>
     430                                    <fieldset>
     431                                        <p>
     432                                            <label><input name="plan_card_defaultSort" type="radio" value="price:ascending"
     433                                                    <?php
     434                                                    if ( ! isset( $sbis_values['plan_card_defaultSort'] ) ) {
     435                                                        echo 'checked';
     436                                                    }
     437                                                    echo isset( $sbis_values['plan_card_defaultSort'] ) && $sbis_values['plan_card_defaultSort'] == '"price:ascending' ? 'checked' : '' ?>><?php esc_html_e( 'Price: Low to High', 'sbis' ); ?>
     438                                            </label>
     439                                            <br>
     440                                            <label><input name="plan_card_defaultSort"
     441                                                          type="radio" <?php echo isset( $sbis_values['plan_card_defaultSort'] ) && $sbis_values['plan_card_defaultSort'] == 'price:descending' ? 'checked' : '' ?>
     442                                                          value="price:descending"><?php esc_html_e( 'Price: High to Low', 'sbis' ); ?></label>
     443                                        </p>
     444                                    </fieldset>
     445                                </td>
     446                            </tr>
    415447                    </table>
    416448                    <hr>
     
    631663                                    ?>
    632664                                    value="0">
     665                                </td>
     666                            </tr>
     667                            <tr>
     668                                <th scope="row">
     669                                    <label for="mob_plan_card_sort"><?php esc_html_e( 'Disable Plans Sorting', 'sbis' ); ?></label>
     670                                </th>
     671                                <td>
     672                                    <input name="mob_plan_card_sort" type="checkbox" id="mob_plan_card_sort"
     673                                    <?php
     674                                        echo isset( $sbis_values['mob_plan_card_sort'] ) && $sbis_values['mob_plan_card_sort'] == 1 ? 'checked' : ''
     675                                    ?>
     676                                    value="0">
     677                                </td>
     678                            </tr>
     679                            <tr id="mob_plan_card_defaultSort_row">
     680                                <th scope="row"><label><?php esc_html_e( 'Default Sorting', 'sbis' ); ?></label></th>
     681                                <td>
     682                                    <fieldset>
     683                                        <p>
     684                                            <label>
     685                                                <input name="mob_plan_card_defaultSort" type="radio" value="price:ascending"
     686                                                    <?php
     687                                                    if ( ! isset( $sbis_values['mob_plan_card_defaultSort'] ) ) {
     688                                                        echo 'checked';
     689                                                    }
     690                                                    echo isset( $sbis_values['mob_plan_card_defaultSort'] ) && $sbis_values['mob_plan_card_defaultSort'] == '"price:ascending' ? 'checked' : '' ?>><?php esc_html_e( 'Price: Low to High', 'sbis' ); ?>
     691                                            </label>
     692                                            <br>
     693                                            <label>
     694                                                <input name="mob_plan_card_defaultSort" type="radio" value="price:descending"
     695                                                    <?php echo isset( $sbis_values['mob_plan_card_defaultSort'] ) && $sbis_values['mob_plan_card_defaultSort'] == 'price:descending' ? 'checked' : '' ?>
     696                                                    ><?php esc_html_e( 'Price: High to Low', 'sbis' ); ?>
     697                                            </label>
     698                                        </p>
     699                                    </fieldset>
    633700                                </td>
    634701                            </tr>
  • subsbase-integration/tags/1.3/subsbase-integration.php

    r2573892 r2599321  
    44 * Plugin Name:  SubsBase Integration
    55 * Description:  Manage your integration with SubsBase's Subscription Management Platform.
    6  * Version:      1.2
     6 * Version:      1.3
    77 * Author:       SubsBase
    88 * Author URI:   https://subsbase.com/
     
    1717}
    1818
    19 define('SBIS_VERSION', '1.2');
     19define('SBIS_VERSION', '1.3');
    2020define('SBIS_DIR', plugin_dir_path(__FILE__));
    2121define('SBIS_URI', plugin_dir_url(__FILE__));
     
    133133        'expanded_plan_card'      => isset($_POST['expanded_plan_card']) ? 1 : 0,
    134134        'plan_card_collapse'      => isset($_POST['plan_card_collapse']) ? 1 : 0,
     135        'plan_card_sort'            => isset($_POST['plan_card_sort']) ? 1 : 0,
     136        'plan_card_defaultSort'   => isset($_POST['plan_card_defaultSort']) ? sanitize_text_field($_POST['plan_card_defaultSort']) : 'price:ascending',
    135137        'success_url'             => isset($_POST['success_url']) ? sanitize_text_field($_POST['success_url']) : '',
    136138        'checkout'                => sbis_sanitize_array($_POST['checkout']) ?? array(),
     
    151153        'mob_hide_all_group'          => isset($_POST['mob_hide_all_group']) ? 1 : 0,
    152154        'mob_expanded_plan_card'      => isset($_POST['mob_expanded_plan_card']) ? 1 : 0,
    153         'mob_plan_card_collapse'      => isset($_POST['mob_plan_card_collapse']) ? 1 : 0
     155        'mob_plan_card_collapse'      => isset($_POST['mob_plan_card_collapse']) ? 1 : 0,
     156        'mob_plan_card_sort'            => isset($_POST['mob_plan_card_sort']) ? 1 : 0,
     157        'mob_plan_card_defaultSort'   => isset($_POST['mob_plan_card_defaultSort']) ? sanitize_text_field($_POST['mob_plan_card_defaultSort']) : 'price:ascending',
    154158    );
    155159
     
    233237                    displayAll: <?php echo isset($config['hide_all_group']) && $config['hide_all_group'] == 1 ? 'false' : 'true'; ?>,
    234238                    expanded: <?php echo isset($config['expanded_plan_card']) && $config['expanded_plan_card'] != 1 ? 'false' : 'true'; ?>,
    235                     collapsable: <?php echo isset($config['plan_card_collapse']) && $config['plan_card_collapse'] == 1 ? 'false' : 'true'; ?>
     239                    collapsable: <?php echo isset($config['plan_card_collapse']) && $config['plan_card_collapse'] == 1 ? 'false' : 'true'; ?>,
     240                    sortable: <?php echo isset($config['plan_card_sort']) && $config['plan_card_sort'] == 1 ? 'false' : 'true'; ?>,
     241                    defaultSorting: '<?php echo isset($config['plan_card_defaultSort']) ? esc_js($config['plan_card_defaultSort']) : 'price:ascending'; ?>'
    236242                }
    237243            },
     
    252258                        displayAll: <?php echo isset($config['mob_hide_all_group']) && $config['mob_hide_all_group'] == 1 ? 'false' : 'true'; ?>,
    253259                        expanded: <?php echo isset($config['mob_expanded_plan_card']) && $config['mob_expanded_plan_card'] != 1 ? 'false' : 'true'; ?>,
    254                         collapsable: <?php echo isset($config['mob_plan_card_collapse']) && $config['mob_plan_card_collapse'] == 1 ? 'false' : 'true'; ?>
     260                        collapsable: <?php echo isset($config['mob_plan_card_collapse']) && $config['mob_plan_card_collapse'] == 1 ? 'false' : 'true'; ?>,
     261                        sortable: <?php echo isset($config['mob_plan_card_sort']) && $config['mob_plan_card_sort'] == 1 ? 'false' : 'true'; ?>,
     262                        defaultSorting: '<?php echo isset($config['mob_plan_card_defaultSort']) ? esc_js($config['mob_plan_card_defaultSort']) : 'price:ascending'; ?>'
    255263                    }
    256264                }
  • subsbase-integration/trunk/scripts/js/main.js

    r2573892 r2599321  
    8585            checked: true
    8686        }
     87    });   
     88   
     89    $('#plan_card_defaultSort_row').dependsOn({
     90        '#plan_card_sort': {
     91            checked: false
     92        }
     93    });
     94
     95    $('#mob_plan_card_defaultSort_row').dependsOn({
     96        '#mob_plan_card_sort': {
     97            checked: false
     98        }
    8799    });
    88100
  • subsbase-integration/trunk/settings-page.php

    r2573892 r2599321  
    413413                            </td>
    414414                        </tr>
     415                        <tr>
     416                                <th scope="row">
     417                                    <label for="plan_card_sort"><?php esc_html_e( 'Disable Plans Sorting', 'sbis' ); ?></label>
     418                                </th>
     419                                <td>
     420                                    <input name="plan_card_sort" type="checkbox" id="plan_card_sort"
     421                                    <?php
     422                                        echo isset( $sbis_values['plan_card_sort'] ) && $sbis_values['plan_card_sort'] == 1 ? 'checked' : ''
     423                                    ?>
     424                                    value="0">
     425                                </td>
     426                            </tr>
     427                            <tr id="plan_card_defaultSort_row">
     428                                <th scope="row"><label><?php esc_html_e( 'Default Sorting', 'sbis' ); ?></label></th>
     429                                <td>
     430                                    <fieldset>
     431                                        <p>
     432                                            <label><input name="plan_card_defaultSort" type="radio" value="price:ascending"
     433                                                    <?php
     434                                                    if ( ! isset( $sbis_values['plan_card_defaultSort'] ) ) {
     435                                                        echo 'checked';
     436                                                    }
     437                                                    echo isset( $sbis_values['plan_card_defaultSort'] ) && $sbis_values['plan_card_defaultSort'] == '"price:ascending' ? 'checked' : '' ?>><?php esc_html_e( 'Price: Low to High', 'sbis' ); ?>
     438                                            </label>
     439                                            <br>
     440                                            <label><input name="plan_card_defaultSort"
     441                                                          type="radio" <?php echo isset( $sbis_values['plan_card_defaultSort'] ) && $sbis_values['plan_card_defaultSort'] == 'price:descending' ? 'checked' : '' ?>
     442                                                          value="price:descending"><?php esc_html_e( 'Price: High to Low', 'sbis' ); ?></label>
     443                                        </p>
     444                                    </fieldset>
     445                                </td>
     446                            </tr>
    415447                    </table>
    416448                    <hr>
     
    631663                                    ?>
    632664                                    value="0">
     665                                </td>
     666                            </tr>
     667                            <tr>
     668                                <th scope="row">
     669                                    <label for="mob_plan_card_sort"><?php esc_html_e( 'Disable Plans Sorting', 'sbis' ); ?></label>
     670                                </th>
     671                                <td>
     672                                    <input name="mob_plan_card_sort" type="checkbox" id="mob_plan_card_sort"
     673                                    <?php
     674                                        echo isset( $sbis_values['mob_plan_card_sort'] ) && $sbis_values['mob_plan_card_sort'] == 1 ? 'checked' : ''
     675                                    ?>
     676                                    value="0">
     677                                </td>
     678                            </tr>
     679                            <tr id="mob_plan_card_defaultSort_row">
     680                                <th scope="row"><label><?php esc_html_e( 'Default Sorting', 'sbis' ); ?></label></th>
     681                                <td>
     682                                    <fieldset>
     683                                        <p>
     684                                            <label>
     685                                                <input name="mob_plan_card_defaultSort" type="radio" value="price:ascending"
     686                                                    <?php
     687                                                    if ( ! isset( $sbis_values['mob_plan_card_defaultSort'] ) ) {
     688                                                        echo 'checked';
     689                                                    }
     690                                                    echo isset( $sbis_values['mob_plan_card_defaultSort'] ) && $sbis_values['mob_plan_card_defaultSort'] == '"price:ascending' ? 'checked' : '' ?>><?php esc_html_e( 'Price: Low to High', 'sbis' ); ?>
     691                                            </label>
     692                                            <br>
     693                                            <label>
     694                                                <input name="mob_plan_card_defaultSort" type="radio" value="price:descending"
     695                                                    <?php echo isset( $sbis_values['mob_plan_card_defaultSort'] ) && $sbis_values['mob_plan_card_defaultSort'] == 'price:descending' ? 'checked' : '' ?>
     696                                                    ><?php esc_html_e( 'Price: High to Low', 'sbis' ); ?>
     697                                            </label>
     698                                        </p>
     699                                    </fieldset>
    633700                                </td>
    634701                            </tr>
  • subsbase-integration/trunk/subsbase-integration.php

    r2573892 r2599321  
    44 * Plugin Name:  SubsBase Integration
    55 * Description:  Manage your integration with SubsBase's Subscription Management Platform.
    6  * Version:      1.2
     6 * Version:      1.3
    77 * Author:       SubsBase
    88 * Author URI:   https://subsbase.com/
     
    1717}
    1818
    19 define('SBIS_VERSION', '1.2');
     19define('SBIS_VERSION', '1.3');
    2020define('SBIS_DIR', plugin_dir_path(__FILE__));
    2121define('SBIS_URI', plugin_dir_url(__FILE__));
     
    133133        'expanded_plan_card'      => isset($_POST['expanded_plan_card']) ? 1 : 0,
    134134        'plan_card_collapse'      => isset($_POST['plan_card_collapse']) ? 1 : 0,
     135        'plan_card_sort'            => isset($_POST['plan_card_sort']) ? 1 : 0,
     136        'plan_card_defaultSort'   => isset($_POST['plan_card_defaultSort']) ? sanitize_text_field($_POST['plan_card_defaultSort']) : 'price:ascending',
    135137        'success_url'             => isset($_POST['success_url']) ? sanitize_text_field($_POST['success_url']) : '',
    136138        'checkout'                => sbis_sanitize_array($_POST['checkout']) ?? array(),
     
    151153        'mob_hide_all_group'          => isset($_POST['mob_hide_all_group']) ? 1 : 0,
    152154        'mob_expanded_plan_card'      => isset($_POST['mob_expanded_plan_card']) ? 1 : 0,
    153         'mob_plan_card_collapse'      => isset($_POST['mob_plan_card_collapse']) ? 1 : 0
     155        'mob_plan_card_collapse'      => isset($_POST['mob_plan_card_collapse']) ? 1 : 0,
     156        'mob_plan_card_sort'            => isset($_POST['mob_plan_card_sort']) ? 1 : 0,
     157        'mob_plan_card_defaultSort'   => isset($_POST['mob_plan_card_defaultSort']) ? sanitize_text_field($_POST['mob_plan_card_defaultSort']) : 'price:ascending',
    154158    );
    155159
     
    233237                    displayAll: <?php echo isset($config['hide_all_group']) && $config['hide_all_group'] == 1 ? 'false' : 'true'; ?>,
    234238                    expanded: <?php echo isset($config['expanded_plan_card']) && $config['expanded_plan_card'] != 1 ? 'false' : 'true'; ?>,
    235                     collapsable: <?php echo isset($config['plan_card_collapse']) && $config['plan_card_collapse'] == 1 ? 'false' : 'true'; ?>
     239                    collapsable: <?php echo isset($config['plan_card_collapse']) && $config['plan_card_collapse'] == 1 ? 'false' : 'true'; ?>,
     240                    sortable: <?php echo isset($config['plan_card_sort']) && $config['plan_card_sort'] == 1 ? 'false' : 'true'; ?>,
     241                    defaultSorting: '<?php echo isset($config['plan_card_defaultSort']) ? esc_js($config['plan_card_defaultSort']) : 'price:ascending'; ?>'
    236242                }
    237243            },
     
    252258                        displayAll: <?php echo isset($config['mob_hide_all_group']) && $config['mob_hide_all_group'] == 1 ? 'false' : 'true'; ?>,
    253259                        expanded: <?php echo isset($config['mob_expanded_plan_card']) && $config['mob_expanded_plan_card'] != 1 ? 'false' : 'true'; ?>,
    254                         collapsable: <?php echo isset($config['mob_plan_card_collapse']) && $config['mob_plan_card_collapse'] == 1 ? 'false' : 'true'; ?>
     260                        collapsable: <?php echo isset($config['mob_plan_card_collapse']) && $config['mob_plan_card_collapse'] == 1 ? 'false' : 'true'; ?>,
     261                        sortable: <?php echo isset($config['mob_plan_card_sort']) && $config['mob_plan_card_sort'] == 1 ? 'false' : 'true'; ?>,
     262                        defaultSorting: '<?php echo isset($config['mob_plan_card_defaultSort']) ? esc_js($config['mob_plan_card_defaultSort']) : 'price:ascending'; ?>'
    255263                    }
    256264                }
Note: See TracChangeset for help on using the changeset viewer.