Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3713323
Ask how to custom 'Shaking' action of the cart
Open

Comments

  • Lĩnh started the conversation

    Currently, the cart is shaking every time the page is reloaded, even when nothing is in it.
    I want it only to shake when has something inside.

    My website is refold.la
    Pleased to have your response in Vietnamese ( or English)

  •  1,222
    Dustin replied

    Hi Lĩnh,

    Please add the custom code below. (How to add custom code? ↗):

    add_action( 'wp_footer', function () {
        ?>
        <style>
            body.woofc-ready .woofc-count.woofc-count-shake {
                animation: none !important;
            }
        </style>
        <script type="text/javascript">
          (function($) {
            $(function() {
              // ready
              $('body').addClass('woofc-ready');
            });
            $(document.body).on('added_to_cart', function() {
              $('body').removeClass('woofc-ready');
            });
          })(jQuery);
        </script>
        <?php
    }, 99 );

    Best regards,
    Dustin

  • Lĩnh replied

    The code did not work at all, and the cart stopped shaking on both case (empty or not)

  •  1,222
    Dustin replied

    If you want to stop shaking for the empty cart only, please UPDATE the snippet:

    add_action( 'wp_footer', function () {
        ?>
        <style>
            body.woofc-ready .woofc-count.woofc-count-0.woofc-count-shake {
                animation: none !important;
            }
        </style>
        <script type="text/javascript">
          (function($) {
            $(function() {
              // ready
              $('body').addClass('woofc-ready');
            });
            $(document.body).on('added_to_cart', function() {
              $('body').removeClass('woofc-ready');
            });
          })(jQuery);
        </script>
        <?php
    }, 99 );

    We provide premium support exclusively for users who have purchased the premium plugin. If you need more help, please provide your license key or email so I can verify your purchase.

    Best regards,
    Dustin