Support » Plugin: WooCommerce Multi-Step Checkout » Add filter for wmc-wizard parameters

  • Resolved edo888

    (@edo888)



    Hi,

    Please make it possible to modify wmc-wizard script vars with a callback using apply_filters wordpress function. More info: https://developer.wordpress.org/reference/functions/apply_filters/

    I would like to modify $vars before it is rendered. Currently I have modified woocommerce-multistep-checkout.php file to change the variables, which will be vanished by the next update.

    Here is the change I have made, so GTranslate can translate some parameters.

    $vars = array(
            'transitionEffect' => get_option('wmc_animation') ? get_option('wmc_animation') : 'fade',
            'stepsOrientation' => get_option('wmc_orientation') ? get_option('wmc_orientation') : 'horizontal',
            'enableAllSteps' => get_option('wmc_enable_all_steps') ? get_option('wmc_enable_all_steps') : 'false',
            'enablePagination' => get_option('wmc_enable_pagination') ? get_option('wmc_enable_pagination') : 'true',
            'next' => get_option('wmc_btn_next') ? __(get_option('wmc_btn_next'), 'woocommerce-multistep-checkout') : __('Next', 'woocommerce-multistep-checkout'),
            'previous' => get_option('wmc_btn_prev') ? __(get_option('wmc_btn_prev'), 'woocommerce-multistep-checkout') : __('Previous', 'woocommerce-multistep-checkout'),
            'finish' => get_option('wmc_btn_finish') ? __(get_option('wmc_btn_finish'), 'woocommerce-multistep-checkout') : __('Place Order', 'woocommerce-multistep-checkout'),
            'error_msg' => get_option('wmc_empty_error') ? __(get_option('wmc_empty_error'), 'woocommerce-multistep-checkout') : __('This field is required', 'woocommerce-multistep-checkout'),
            'email_error_msg' => get_option('wmc_email_error'),
            'phone_error_msg' => get_option('wmc_phone_error'),
            'terms_error' => get_option('wmc_terms_error'),
            'remove_numbers' => get_option('wmc_remove_numbers'),
            'zipcode_validation' => get_option('wmc_zipcode_validation'),
            'isAuthorizedUser' => isAuthorizedUser(),
            'loading_img' => plugins_url('images/animatedEllipse.gif', __FILE__),
            'ajaxurl' => admin_url('admin-ajax.php'),
            'wmc_remove_numbers' => get_option('wmc_remove_numbers'),
            'include_login' => get_option('wmc_add_login_form'),
            'include_register_form' => get_option('wmc_add_register_form'),
            'include_coupon_form' => get_option('wmc_add_coupon_form'),
            'woo_include_login' => get_option('woocommerce_enable_checkout_login_reminder'),
            'no_account_btn' => get_option('wmc_no_account_btn') ? __(stripslashes(get_option('wmc_no_account_btn')), 'woocommerce-multistep-checkout') : __("I don't have an account", 'woocommerce-multistep-checkout'),
            'login_nonce' => wp_create_nonce('wmc-login-nonce'),
    
            // gtranslate
            'gt_translate_keys' => array('no_account_btn', 'email_error_msg', 'finish', 'error_msg', 'phone_error_msg', 'terms_error'),
        );

    Thanks! 🙂

    • This topic was modified 3 months, 2 weeks ago by  edo888.
    • This topic was modified 3 months, 2 weeks ago by  edo888.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    I think there is a misunderstanding. In this plugin there is no $vars variable and none of our options start with “wmc_”.

    I assume you’re referring to another multi-step checkout plugin and mistakenly reported this here.

    I’m sorry for the confusion. My mistake.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.