• Resolved hetsfield

    (@hetsfield)


    Hi Guys,

    I like the plugin’s and I would like to confirm one point before purchasing the PRO.

    How can i add the specific class xoo-wsc-cart-trigger to my cart icon in AVADA them?
    I can’t use a menu items as the SEARCH / CART icon in the mobile version are embed in the theme.

    If can be done throught Snipppet Code plugin, it’s fine for me.

    Any lead?
    Ronnie

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xootix

    (@xootix)

    Hello,

    The design varies from theme to theme, you have to check your theme’s template design and make changes there.
    Since you are not willing to do that, here is the snippet to trigger side cart by your theme cart icon

    add_action( 'wp_footer', function(){
    
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function($){
                $('body').on('click', '.fusion-menu-cart', function(e){
     e.stopImmediatePropagation();
                        e.preventDefault();
                       if( $(this).hasClass('xoo-wsc-cart-trigger') ) return;
                    $(this).addClass('xoo-wsc-cart-trigger').trigger('click');
                })
            })
        </script>
    
        <?php
    } );
    
    • This reply was modified 3 years, 10 months ago by xootix.
    Thread Starter hetsfield

    (@hetsfield)

    Hi @xootix

    thanks for taking the time to reply.
    It is just that a snippet will avoid adjusting the theme file at every update i believe. Even if this is not perfect.

    I implemented your recommendation.
    Good news: it clearly add the class xoo-wsc-cart-trigger to the cart icon class.
    Bad news: on click, nothing appear. Something seems to prevent the ajax for showing up.

    You have a moment to look at it, thanks.
    Otherwise, i also asked the community forum of Avada.

    Thanks

    Thread Starter hetsfield

    (@hetsfield)

    Hi,

    for people using this great plugin’s with AVADA theme (or other just need to find out related class by inspecting elements).

    see it live on https://www.backafter.com/en

    This is the jquery script that worked for me.

    RESULT: FLYOUT (MOBILE) + DESKTOP Avada Theme cart trigger the AJAX CART MODAL.

    Go to wp-admin >> avada >> options >> advanced >> code fields

    input SCRIPT in the BODY as below.

    <script type=”text/javascript”>
    jQuery(document).ready(function($){
    $(‘body’).on(‘click’, ‘.fusion-menu-cart’, function(e){
    e.stopImmediatePropagation();
    e.preventDefault();
    if( $(this).hasClass(‘xoo-wsc-cart-trigger’) ) return;
    $(this).addClass(‘xoo-wsc-cart-trigger’).trigger(‘click’);
    })
    })
    jQuery(document).ready(function($){
    $(‘body’).on(‘click’, ‘.fusion-flyout-cart-wrapper’, function(e){
    e.stopImmediatePropagation();
    e.preventDefault();
    if( $(this).hasClass(‘xoo-wsc-cart-trigger’) ) return;
    $(this).addClass(‘xoo-wsc-cart-trigger’).trigger(‘click’);
    })
    })
    </script>

    I am not sure if this is a clean way but it works, no slow down.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pre-sales: add the class xoo-wsc-cart-trigger to AVADA CART ICON’ is closed to new replies.