• Resolved Henrijs

    (@hekcis)


    Hello!

    Simple thing, I’m not using the default cart button as my navigation is set to Sticky.
    I was wondering, how can I open the side-cart using my custom button?

    Currently my workaround is a simple jQuery click function:

    jQuery("#nav-cart").click(function () {
        jQuery(".xoo-wsc-modal").toggleClass("xoo-wsc-cart-active")
    })

    Is there a CSS class that could trigger this maybe?

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

    (@xootix)

    Hello @hekcis

    Use this class
    xoo-wsc-cart-trigger

    Thread Starter Henrijs

    (@hekcis)

    Thank you! This worked.

    Note that it would be great to include this in the documentation, which by now is very outdated.

    Hey @hekcis , what was your code for achieving this?

    • This reply was modified 4 years, 3 months ago by joelreed33.

    Or @xootix are you able to help me out with what code to use for this?
    Thanks ??

    Thread Starter Henrijs

    (@hekcis)

    @joelreed33

    Just add the class to the element you want to be clicked on.

    This also depends if you’re coding your own theme or just building on an existing one.
    If you already have a theme, then maybe the code in my original reply might be the one to work for you.

    For example:

    
    <navigation>
        <div class="container">
            <!-- Layout will be according to your theme. -->
            <div class="nav-logo"></div>
            <div class="nav-links"></div>
            <div class="nav-icons">
                <!-- Here add the Icon you want to use -->
                <a href="#" class="open-cart xoo-wsc-cart-trigger"><!--  Where the Class is, add xoo-wsc-cart-trigger -->
                    icon
                </a>
            </div>
        </div>
    </navigation>
    

    Ahh perfect, thanks

    To put code use – Beaver template customizer – Personalize > Code > Javascript.

    Put there Javascript code:

    jQuery(document).ready(function (e) {
        jQuery("#what").click(function(){
        jQuery(".xoo-wsc-modal").toggleClass(".xoo-wsc-modal xoo-wsc-active");
         }); 
    });

    Button code in custom Beaver menu header template as html element:
    <div id="what"><a href="#">WHAT</a></div>

    • This reply was modified 4 years, 3 months ago by equalan.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom “Open cart” button’ is closed to new replies.