Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1363252
    mediafbcfarmington
    Participant

    Hello,

    We recently installed woocommerce on our staging site and built out out products. We are using the “buy buttons” for the larger items we sell. I want the cart ajax icon to show when an item is added to the cart. i found on another thread to ad the code below to my child theme functions.php folder. It worked. However, we installed the bundles add on for woo commerce and not the cart ajox does not work just for the product that is bundled.

    Would you be able to assist me with this?

    Code I used.

    // AJAX
    // =============================================================================

    if ( ! function_exists( ‘x_woocommerce_navbar_cart_ajax_notification’ ) ) :
    function x_woocommerce_navbar_cart_ajax_notification() {

    if ( get_option( ‘woocommerce_enable_ajax_add_to_cart’ ) == ‘yes’ ) {
    $notification = ‘<div class=”x-cart-notification”>’
    . ‘<div class=”x-cart-notification-icon loading”>’
    . ‘<i class=”x-icon-cart-arrow-down” data-x-icon=””></i>’
    . ‘</div>’
    . ‘<div class=”x-cart-notification-icon added”>’
    . ‘<i class=”x-icon-check” data-x-icon=””></i>’
    . ‘</div>’
    . ‘</div>’;
    } else {
    $notification = ”;
    }

    echo $notification;

    }
    add_action( ‘x_before_site_end’, ‘x_woocommerce_navbar_cart_ajax_notification’ );
    endif;

    #1363775
    Lely
    Moderator

    Hi There,

    There is a settings for that in Woocommerce > Settings > Product Tab > Display Tab: Add to cart behaviour. We don’t need to added custom code. See attached screenshot.

    #1385417
    mediafbcfarmington
    Participant

    Thanks, however I have that selected already and it does not work. When we added the woocommerce bundle options it seemed to stop working.

    #1385421
    Thai
    Moderator

    Hi There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1363252 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>