Home Forums Weaver Xtreme Theme woocommerce – trying to use weaver xtreme tabs in my-account template

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17828
    c2t_webmaster
    Participant
    Weaver Xtreme – 1.1.3
    Weaver Xtreme Theme Support – 1.1
    WordPress – 4.2.2
    PHP – 5.3.21
    WooCommerce – 2.3.8
    and numerous other plugins


    I have a theme specific my-account/my-account.php.  If you’ve ever used WooCommerce, you should know the my-account.php is weak at best.  Between downloads and orders, a long list of stuff can easily materialize.  I’ve tried various other internet sourced approaches to making tabs on the my-account page without luck.   I got inspired to try to use the Weaver Xtreme Theme tabs.   At first I thought I could embed the tabs shortcodes into the template and then got discouraged.   I then tried to build the same div stuff in my template and this kind of works with one major, show-stopping exception: switching between tabs isn’t working.

    Here’s the snippet of what I have in my-account.php:
    …..
    <style type=”text/css”>
    #wvr-tab-group-1.wvr-tabs-style .wvr-tabs-nav span {background-color:#cccccc;}
    #wvr-tab-group-1.wvr-tabs-style .wvr-tabs-nav span.wvr-tabs-current,#wvr-tab-group-1.wvr-tabs-style .wvr-tabs-nav span:hover {background-color:#CCD8FF;}
    </style>
    <div id=”wvr-tab-group-1″ class=”wvr-tabs wvr-tabs-style”><!– tab_group –>
            <div class=”wvr-tabs-nav”>
                    <span class=””>Dashboard</span>
                    <span class=”wvr-tabs-current”>Downloads (<?php echo $downloads_cnt;?>)</span>
                    <span class=””>Orders (<?php echo $orders_cnt;?>)</span>
            </div>
            <div class=”wvr-tabs-panes”>
                    <div class=”wvr-tabs-pane” style=”display: block;”><br/>
                    <h2>dashboard</h2>
                    </div>
                    <div class=”wvr-tabs-pane” style=”display: none;”><br/>
                            <?php wc_get_template( ‘myaccount/my-downloads.php’ ); ?>
                    </div>
                    <div class=”wvr-tabs-pane” style=”display: none;”><br/>
                            <?php wc_get_template( ‘myaccount/my-orders.php’, array( ‘order_count’ => $order_count ) ); ?>
                    </div>
            </div>
            <div class=”wvr-tabs-clear”></div>
    </div>
    I wasn’t sure what style=”” to put in the wvr-tabs-pane, nor what class to put in the wvr-tabs-nav. 
    There is this “extra” <div class=”woocommerce”> between “entry-content clearfix” and the <style>.  It’s not clear what control, if any, one has over its insertion.  My template is not explicitly inserting it.
    I should say the rendering of the tabs seems right.  It’s just the toggling to a particular tab that isn’t working at all.  If I use Chrome debugger, it looks like the ‘event listener — click’ for ‘div.wvr-tabs-nav’ isn’t “registered”.  I have a completely different WordPress instance that uses Weaver Xtreme Theme and tabs, but the tabs are populated using the shortcodes in a page.   I’ve been “reverse engineering” this good site.   I suspect there is either some conflict and/or I’m missing something.
    Any sort of guidance is welcome!
    #22319
    Weaver
    Keymaster

    Well, the problem here is that the tabs are controlled by a JavaScript supplied by the Weaver Xtreme Theme Support plugin. But it is really smart, and doesn’t include the script unless you actually use the [tab] shortcode.

    So your code won’t have a chance of working without the script.

    If you have Weaver Xtreme Plus AND the Weaver Xtreme Support plugin installed, you can add

    wp_enqueue_script(‘wvrxtsJSLib’, wvrx_ts_plugins_url(‘/js/wvrx-ts-jslib.min.js’),array(‘jquery’),WVRX_TS_VERSION,true);

    to the Advanced Options : <HEAD Section> : Actions and Filters section.

    #22320
    c2t_webmaster
    Participant

    Brilliant guidance.   Given I did something just the other day wrt WooCommerce product lightbox JS and wp_enqueue_script(), I did suspect something like this might be part of answer. 

    THX!
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.