Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #721486

    Hey there

    I implemented a fix as suggested here https://kriesi.at/support/topic/woocommerce-2-6-problem-urgent/#post-650161 and i can update the cart. but the icon amount it not reflecting the amounts in the cart.

    If you add a quantity of the 1st product (20) then add to cart, it works perfect and icon correctly reflects the number in the cart.
    Add a product

    But if you then go to view Cart (hosted on WPengine) and change the quantity and then hit update cart. The dropdown shows the correct number but the icon is stuck at the initial value of 20.

    If you refresh the cart page,the icon does update and reflect the correct figure.

    Are you able to assist?

    Enfold 3.8
    Woocommerce 2.6.4

    #721494

    I’m using a temporary fix as found here : https://gist.github.com/mikaelz/f41e29c6a99a595602e4

    To force a page reload when cart is updated

    #721496

    Also something else i’ve just noticed. If you delete all products from the cart. The number still reflects in the icon until the page is refreshed.

    Screenshot
    or here
    https://postimg.org/image/w4geotl97/

    • This reply was modified 7 years, 11 months ago by interfacemedia. Reason: adding screenshot link
    #722137

    Hi,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    Login credentials include:

    • The URL to the login screen.
    • A valid username (with full administration capabilities).
    • As well as a password for that username.

    Best regards,
    Nikko

    #722140

    Here you go

    • This reply was modified 7 years, 11 months ago by interfacemedia. Reason: password was not being changed
    #723342

    Hi,

    Sorry for the late response. I tried to check your site but the login doesn’t work.

    Best regards,
    Nikko

    #723627

    Strange!. i’ve updated the credentials to the ones sent above. Also i have updated Enfold to the the latest version but the cart icon doesn’t update when changing the cart amount.

    #724680

    Hi,

    Thanks. It should be working now. I have commented out this code:

    function cart_update_qty_script() {
        if (is_cart()) :
        ?>
        <script>
            jQuery('div.woocommerce').on('change', '.qty', function(){
                jQuery("[name='update_cart']").trigger("click"); 
                location.reload(true);
            });
        </script>
        <?php
        endif;
    }
    

    as it might conflict with this code that I have added at the bottom of functions.php:

    add_action('wp_footer', 'ava_new_custom_script');
    function ava_new_custom_script(){
    ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
    	jQuery(".quantity .minus, .quantity .plus").on("click", function(){
    		jQuery("header").find("span.av-cart-counter").text(jQuery(this).closest(".quantity").find(".input-text").val());
    	});
    });
    
    </script>
    <?php
    }

    Let us know if it works well on your end :)

    Best regards,
    Nikko

    #724809

    Hi there

    Thanks for your assistance in this. While your fix does work for the first time. It doesn’t work a second time. Say for example i have 80 quantities of a product in my cart on page load. i can increase or decrease the quantities either way before pressing update cart and the icon reflects perfectly. The moment you press update cart is when it doesn’t do it again until you refresh the page.

    #725787

    Hi,

    I’ll try to help you with this, it might take some time. I hope for your extended patience :)

    Best regards,
    Nikko

    #725968

    No problem. Thanks very much for your assistance. Will wait for your reply

    #728393

    Hi,

    Thank you for patiently waiting. :) I have updated the code I put in functions.php and it’s now working fine, this is the code:

    add_action('wp_footer', 'ava_new_custom_script');
    function ava_new_custom_script(){
    ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
    
            jQuery('#top').on( 'click', '.quantity .minus, .quantity .plus', function() {
    		jQuery("header").find("span.av-cart-counter").text(customTotalPrice());
            });
    
            function customTotalPrice() {
                    var sum = 0;
                    jQuery(".input-text").each(function(){
                        sum += +jQuery(this).val();
                    });
                   return sum;
            }
    });
    
    </script>
    <?php
    }

    Let us know if there are still issues you are experiencing. Have a great holiday :)

    Best regards,
    Nikko

    #731036

    This fix worked like a charm. Many thanks for the update

    #732916

    Hi,

    Glad we could help :)

    Best regards,
    Nikko

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Cart Drop Down Icon Number Not Updating On Update Cart Button’ is closed to new replies.