Tagged: enfold, update cart
-
AuthorPosts
-
December 7, 2016 at 2:05 pm #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 productBut 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.4December 7, 2016 at 2:37 pm #721494I’m using a temporary fix as found here : https://gist.github.com/mikaelz/f41e29c6a99a595602e4
To force a page reload when cart is updated
December 7, 2016 at 2:39 pm #721496Also 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.
or here
https://postimg.org/image/w4geotl97/- This reply was modified 7 years, 11 months ago by interfacemedia. Reason: adding screenshot link
December 8, 2016 at 7:28 pm #722137Hi,
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,
NikkoDecember 8, 2016 at 7:36 pm #722140Here you go
- This reply was modified 7 years, 11 months ago by interfacemedia. Reason: password was not being changed
December 12, 2016 at 8:18 pm #723342Hi,
Sorry for the late response. I tried to check your site but the login doesn’t work.
Best regards,
NikkoDecember 13, 2016 at 10:11 am #723627Strange!. 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.
December 15, 2016 at 12:23 am #724680Hi,
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,
NikkoDecember 15, 2016 at 9:49 am #724809Hi 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.
December 18, 2016 at 3:11 am #725787Hi,
I’ll try to help you with this, it might take some time. I hope for your extended patience :)
Best regards,
NikkoDecember 19, 2016 at 9:42 am #725968No problem. Thanks very much for your assistance. Will wait for your reply
December 29, 2016 at 1:40 am #728393Hi,
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,
NikkoJanuary 9, 2017 at 10:42 am #731036This fix worked like a charm. Many thanks for the update
January 13, 2017 at 2:38 am #732916Hi,
Glad we could help :)
Best regards,
Nikko -
AuthorPosts
- The topic ‘Cart Drop Down Icon Number Not Updating On Update Cart Button’ is closed to new replies.