• Resolved bluedogranch

    (@bluedogranch)


    Hi,
    How can I determine when the multi-step checkout is on a particular tab?

    I need to apply CSS or jQuery to the page when the last tab “Confirm Order” is active.

    This is the markup of the “Confirm Order” tab:

    <li class="thwmsc-tab tab-active">
    <a href="javascript:void(0)" id="step-3" data-step_name="order_review" data-step_title="Confirm Order" data-step="3" class="last active">
    <span class="thwmsc-tab-label"><span class="thwmsc-index thwmsc-tab-icon">4 </span>Confirm Order</span>
    </a>
    </li>

    I need to do something like

    if jQuery tab “Confirm Order” is active {
    // do this
    }

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Please try adding the below code in your theme’s functions.php file.

    add_action('wp_footer', 'th123_check_step_number', 99);
    function th123_check_step_number() {
     if(is_checkout()){
     ? ?>
     ? <script type="text/javascript">
     ? ? (function($) {
     ? ? ? ? ? ?$(document).on('step_jumped', function(event, step_no) {
    
     ? ? ? ? ? ? ? ? if(step_no == 'yor_step_number'){
     ? ? ? ? ? ? ? ? 	// you can add css here by using js
     ? ? ? ? ? ? ? ? }
     ? ? ? ? ? });
    
     ? ? })(jQuery, window, document)
     ? </script>
     ? <?php
     }
    }

    Please modify it based on your requirement. By adding this code you can identify the current tab number.

    We hope this will help.

    Thank you!

    Plugin Author ThemeHigh

    (@themehigh)

    We hope your issue is resolved.

    We are going to mark this thread as resolved.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Determine the active tab’ is closed to new replies.