Plugin Directory

Changeset 3005728


Ignore:
Timestamp:
12/05/2023 01:40:28 PM (2 years ago)
Author:
sizeme
Message:

Add flat meas option to ui

Location:
sizeme-for-woocommerce
Files:
4 edited
6 copied

Legend:

Unmodified
Added
Removed
  • sizeme-for-woocommerce/tags/2.3.4/classes/class-wc-settings-sizeme-for-woocommerce.php

    r2942526 r3005728  
    255255            ),
    256256            array(
     257                'title'   => __( 'Show measurements flat (not circular) in size guide', 'sizeme-for-woocommerce' ),
     258                'type'    => 'select',
     259                'options' => array(
     260                    self::ADD_TOGGLER_NO => 'No',       // re-using setting
     261                    self::ADD_TOGGLER_YES   => 'Yes',
     262                ),
     263                'default' => get_option( WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS, self::ADD_TOGGLER_YES ),
     264                'id'      => WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS,
     265            ),
     266            array(
    257267                'title'   => __( 'Custom styles', 'sizeme-for-woocommerce' ),
    258268                'type'    => 'textarea',
  • sizeme-for-woocommerce/tags/2.3.4/readme.txt

    r2967403 r3005728  
    33Tags: sizeme, measurements, sizeguide, size guide, size recommendations
    44Requires at least: 3.8
    5 Tested up to: 6.3.1
    6 Stable tag: 2.3.3
     5Tested up to: 6.4.1
     6Stable tag: 2.3.4
    77Requires PHP: 5.2.4
    88WC requires at least: 2.5
    9 WC tested up to: 8.1.0
     9WC tested up to: 8.3.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8686
    8787== Changelog ==
     88= 2.3.4 =
     89* Added user interface option for showing flat or circular measurements in size guide
     90
    8891= 2.3.3 =
    8992* Litespeed compatibility improved
  • sizeme-for-woocommerce/tags/2.3.4/sizeme-for-woocommerce.php

    r2967403 r3005728  
    1010 * Plugin Name: SizeMe for WooCommerce
    1111 * Description: SizeMe is a web store plugin that enables your consumers to input their measurements and get personalised fit recommendations based on actual product data.
    12  * Version:     2.3.3
     12 * Version:     2.3.4
    1313 * Author:      SizeMe Ltd
    1414 * Author URI:  https://www.sizeme.com/
     
    5454     * @var string VERSION The plugin version.
    5555     */
    56     const VERSION = '2.3.3';
     56    const VERSION = '2.3.4';
    5757
    5858    /**
     
    272272     */
    273273    const MEASUREMENT_UNIT_CHOICE_DISALLOWED = 'sizeme_measurement_unit_choice_disallowed';
     274
     275    /**
     276     * UI option, whether to show flat or circular measurements in size guide
     277     *
     278     * @since 2.3.4
     279     *
     280     * @var boolean FLAT_MEASUREMENTS.
     281     */
     282    const FLAT_MEASUREMENTS = 'sizeme_flat_measurements';
    274283
    275284    /**
     
    449458     *
    450459     * Gets the a boolean state from the configuration.
    451      * Either 'no' or 'yes'
     460     * Either true of false
    452461     *
    453462     * @since  2.0.0
    454      * @changed  2.3.0
    455      *
    456      * @return string The toggler status as a string.
     463     * @changed  2.3.4
     464     *
     465     * @return boolean The toggler yes status as a boolean.
    457466     */
    458467    public function is_toggler_yes( $option ) {
    459468        return ( get_option( $option ) == 'yes' );
     469    }
     470
     471    /**
     472     * Get a boolean state.
     473     *
     474     * Gets the a boolean state from the configuration.
     475     * Either true of false
     476     *
     477     * @since  2.3.4
     478     * @changed  2.3.4
     479     *
     480     * @return boolean The toggler no status as a boolean.
     481     */
     482    public function is_toggler_no( $option ) {
     483        return ( get_option( $option ) == 'no' );
    460484    }
    461485
  • sizeme-for-woocommerce/tags/2.3.4/templates/sizeme-product.php

    r2967403 r3005728  
    8383    }
    8484
     85    // possible flat measurement setting
     86    if ( $sizeme->is_toggler_no( WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS ) ) {
     87        echo 'sizeme_options.uiOptions.flatMeasurements = false;'.PHP_EOL;
     88    }
     89
    8590    // possible string
    8691    $gender_string = trim( $sizeme->get_ui_option( WC_SizeMe_for_WooCommerce::MATCH_GENDER_FROM_NAME_MALE, '' ) );
  • sizeme-for-woocommerce/trunk/classes/class-wc-settings-sizeme-for-woocommerce.php

    r2942526 r3005728  
    255255            ),
    256256            array(
     257                'title'   => __( 'Show measurements flat (not circular) in size guide', 'sizeme-for-woocommerce' ),
     258                'type'    => 'select',
     259                'options' => array(
     260                    self::ADD_TOGGLER_NO => 'No',       // re-using setting
     261                    self::ADD_TOGGLER_YES   => 'Yes',
     262                ),
     263                'default' => get_option( WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS, self::ADD_TOGGLER_YES ),
     264                'id'      => WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS,
     265            ),
     266            array(
    257267                'title'   => __( 'Custom styles', 'sizeme-for-woocommerce' ),
    258268                'type'    => 'textarea',
  • sizeme-for-woocommerce/trunk/readme.txt

    r2967403 r3005728  
    33Tags: sizeme, measurements, sizeguide, size guide, size recommendations
    44Requires at least: 3.8
    5 Tested up to: 6.3.1
    6 Stable tag: 2.3.3
     5Tested up to: 6.4.1
     6Stable tag: 2.3.4
    77Requires PHP: 5.2.4
    88WC requires at least: 2.5
    9 WC tested up to: 8.1.0
     9WC tested up to: 8.3.1
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8686
    8787== Changelog ==
     88= 2.3.4 =
     89* Added user interface option for showing flat or circular measurements in size guide
     90
    8891= 2.3.3 =
    8992* Litespeed compatibility improved
  • sizeme-for-woocommerce/trunk/sizeme-for-woocommerce.php

    r2967403 r3005728  
    1010 * Plugin Name: SizeMe for WooCommerce
    1111 * Description: SizeMe is a web store plugin that enables your consumers to input their measurements and get personalised fit recommendations based on actual product data.
    12  * Version:     2.3.3
     12 * Version:     2.3.4
    1313 * Author:      SizeMe Ltd
    1414 * Author URI:  https://www.sizeme.com/
     
    5454     * @var string VERSION The plugin version.
    5555     */
    56     const VERSION = '2.3.3';
     56    const VERSION = '2.3.4';
    5757
    5858    /**
     
    272272     */
    273273    const MEASUREMENT_UNIT_CHOICE_DISALLOWED = 'sizeme_measurement_unit_choice_disallowed';
     274
     275    /**
     276     * UI option, whether to show flat or circular measurements in size guide
     277     *
     278     * @since 2.3.4
     279     *
     280     * @var boolean FLAT_MEASUREMENTS.
     281     */
     282    const FLAT_MEASUREMENTS = 'sizeme_flat_measurements';
    274283
    275284    /**
     
    449458     *
    450459     * Gets the a boolean state from the configuration.
    451      * Either 'no' or 'yes'
     460     * Either true of false
    452461     *
    453462     * @since  2.0.0
    454      * @changed  2.3.0
    455      *
    456      * @return string The toggler status as a string.
     463     * @changed  2.3.4
     464     *
     465     * @return boolean The toggler yes status as a boolean.
    457466     */
    458467    public function is_toggler_yes( $option ) {
    459468        return ( get_option( $option ) == 'yes' );
     469    }
     470
     471    /**
     472     * Get a boolean state.
     473     *
     474     * Gets the a boolean state from the configuration.
     475     * Either true of false
     476     *
     477     * @since  2.3.4
     478     * @changed  2.3.4
     479     *
     480     * @return boolean The toggler no status as a boolean.
     481     */
     482    public function is_toggler_no( $option ) {
     483        return ( get_option( $option ) == 'no' );
    460484    }
    461485
  • sizeme-for-woocommerce/trunk/templates/sizeme-product.php

    r2967403 r3005728  
    8383    }
    8484
     85    // possible flat measurement setting
     86    if ( $sizeme->is_toggler_no( WC_SizeMe_for_WooCommerce::FLAT_MEASUREMENTS ) ) {
     87        echo 'sizeme_options.uiOptions.flatMeasurements = false;'.PHP_EOL;
     88    }
     89
    8590    // possible string
    8691    $gender_string = trim( $sizeme->get_ui_option( WC_SizeMe_for_WooCommerce::MATCH_GENDER_FROM_NAME_MALE, '' ) );
Note: See TracChangeset for help on using the changeset viewer.