-
AuthorPosts
-
June 15, 2016 at 11:51 am #648543
Hello,
I’ve just update ENFOLD to the last release and WOOCOMMERCE to 2.6 release
Everything seems fine except for the “Update basket” button in the cart which is not working anymore. Could you please help??Many thanks
DavidJune 16, 2016 at 10:59 am #649121I have the same problem, a solution would be super
Thanks
Heiko / Pit BullJune 16, 2016 at 11:19 am #649127Hello,
Same problem here. A few precisions : the button is disabled when nothing is changed (which is good) ; when using the arrows to change the quantity, the button is not available ; but if I type in the quantity “box” the new amount, then the button become clickable again.
It seems it is a problem of using the arrows actually changing the quantity from woocommerce’s ajax point of view…Thanks for your help in finding an answer !
(By the way, I used to have an ‘Empty cart’ button, but this one does not work anymore, very probably because they use ajax in the cart now ; if ever you stumble on a solution to make it work again, which should be similar to the one for the arrows of the quantity field, that would be great !)
June 17, 2016 at 6:38 am #649596Hi,
Thank you for using Enfold.
Please try to deactivate the plugins one at a time. Maybe, one of those plugins are causing the issue. Is this working when you switch to a default theme?
Best regards,
IsmaelJune 17, 2016 at 8:55 am #649659Hi Ismael, yes it does work fine with the default theme and all plugin installed.. so it must be something related to ENFOLD.
The button is always activated (even without changes) but clicking on it doesn’t produce any result.Cheers
DavidJune 17, 2016 at 9:30 am #649677Hi again,
By browsing the support forums I was able to find a very temporary fix, in this thread :
https://kriesi.at/support/topic/woocommerce-quantity-arrow-buttons/?login_errorWhen I added the code given in this thread to function.php, the button started working again. The only problem is that when it reloads with the updated quantity, the defaut Woocommerce quantity selector is displayed, and not the enfold one. So it only gives a possible way towards a solution, but is in no way a definitive fix.
Here is the code taken from the thread :
/* WOOCOMMERCE QTY FIX */ add_action('wp_footer', 'ava_new_custom_script'); function ava_new_custom_script(){ ?> <script type="text/javascript"> (function($) { "use strict"; $(window).load(function(){ $(".quantity .minus,.quantity .plus").on("click",function(){ $(this).closest(".quantity").find(".input-text").trigger("change"); }); }); })(jQuery); </script> <?php }
June 18, 2016 at 2:40 am #650049Hey!
I checked the update button and there is a “disabled” attribute applied to it. Did you add any custom script to the functions.php file?
Regards,
IsmaelJune 18, 2016 at 9:24 am #650127HI Ismael,
I’m not a developer.. I have made few adjustments in both functions.php and quick CSS but everything has been written by you guys.. feel free to access my website to fix it if you like.. I have no clue about what it may have caused the problem.
Many thanks
cheers
davidJune 18, 2016 at 12:23 pm #650142The issue stems from the new ajaxified cart in WooCommerce 2.6 and above.
In the first place there is a new function in cart.js to disable the update_cart button while the cart stays unchanged (no increase or decrease in quantities). From line 285 in cart.js downwards WooCommerce defines a input_changed event to enable the button again if the cart has changed (quantity decrease or increase). Due to the fact the plus and minus selectors are custom additions within Enfold WooCommerce does not know about them and the input_changed event gets not triggered if you click on the plus and minus button. If you change the quantity in the input field which is not modified by Enfold the event gets triggered and the update_cart button gets enabled.
Kriesi has to define a listener him self to Enfold to enable the update_cart button upon a click on the plus or minus button. Add the following function at the bottom of woocommerce-mod.js:
function enable_update_cart_button(){ var $update_cart_button = jQuery( 'table.shop_table.cart' ).closest( 'form' ).find( 'input[name="update_cart"]' ); if ( $update_cart_button.length ) { $update_cart_button.prop( 'disabled', false ); } }
Than insert a call to this function in the minus.on and plus.on events (lines 33 and 39 below the newNum.val(the_val) )
enable_update_cart_button();
However this wont help much because as soon as you change quantities and click on the update_cart button the plus and minus selectors will disapear. This is caused by the way the cart redraw works since WooCommerce 2.6. In prior versions the page was reloaded and the woocommerce-mod.js script was loaded and the function to add the plus and minus selector was executed again. Now the redraw happens using ajax. The Enfold script is not executed again and no selectors are drawn. Kriesi needs to change the way the script works. The whole part to draw the selectors and to listen to the onlcick event needs to be wrapped into a custom function. This function needs to be executed on the initial load of the cart and each time the “updated_wc_div” event is triggered.
Long story short. This is a bug/flaw i Enfold and has nothing to do with other plugins. You know I am one of the biggest Enfold fans but I have to say you definitely missed the goal with making Enfold WooCommerce 2.6 compatible. Please do us a favor and give it the highest priority so we can say this was a one-time slip-up.
Kind regards
Michael
June 18, 2016 at 2:06 pm #650161I have rewritten the woocommerce-mod.js script to work with woocommerce 2.6. This is considered a beta release. Use at your own risk.
You can download it at https://mensmaximus.de/dokumente/enfold/woocommerce/wc-26-cart/woocommerce-mod.zip
Installation
1. Download the file to your computer
2. Unzip the file
3. Connect to your hosting account with FTP
4. Navigate to /wp-content/themes/enfold/config-woocommerce
5. Rename woocommerce-mod.js on the remote machine to woocommerce-mod.js_original
6. Copy the local woocommerce-mod.js (see #2) to your remote machine (path from #4)
7. Visit your websites shopping cart and press Ctrl-R to make sure the new script is loaded instead of the old one from cache
8. Done. You have replaced the old script with the new oneI have tested it heavily including min, max and step changes but there might be issues in certain conditions.
Users should report back any issues in this thread.
Supporters should forward this to Kriesi for immediate testing and review (I think it should be rewritten in parts – as for now consider it as hot fix)This file will be overwritten with the next Enfold update. Please keep that in mind.
June 18, 2016 at 3:19 pm #650173Hi Michael,
impressive, really.. but not being a coder I don’t feel comfortable in editing or replacing crucial files in a working website which belongs to a client of mine. If anything will go wrong I will be screwed.
I’d like Kriesi people to come up with a safe update to fix this issue asap.
Cheers
DavidJune 20, 2016 at 9:26 am #650699Thank you mensmaximus. Perfect.
June 20, 2016 at 9:52 am #650705Hi Ismael,
waiting for your reply on this..
many thanks
DavidJune 20, 2016 at 1:30 pm #650783@ mensmaximus
we inserted your, WooCommerce-mod.js, in our page, it all works fine, thank you.- This reply was modified 8 years, 6 months ago by Pitbull_germany.
June 20, 2016 at 1:58 pm #650799June 20, 2016 at 2:09 pm #650806This appears to solve the issue. Thanks for the quick work and I’ll look forward to the next version to a final fix.
Thanks!
June 20, 2016 at 3:54 pm #650887yep, it works.. good job Michael :)
June 21, 2016 at 12:00 pm #651422Thank you Michael for this fix!
June 21, 2016 at 1:31 pm #651468Hi Mensmaximus
Thanks, saved a lot of time, so far so good, all works fine, on variable products as well.
CheersJune 23, 2016 at 6:07 am #652490Legend… Thank you…
June 24, 2016 at 8:40 am #652921Ran into this yesterday, and had the luck to find this thread very quickly. Cheers for that solution!
I hope this is fixed in a official way soon, as I feel hesitant to use this in the website.cheers!
rob
June 24, 2016 at 10:56 am #652973Great job.
June 24, 2016 at 2:09 pm #653019@Mensmaximus
Your fix did the trick for my site, thank you very much.June 28, 2016 at 8:41 am #654073Thanks!
June 28, 2016 at 9:50 am #654089great work maximus. thx.
my question is now: how long does it take for an official update?
June 28, 2016 at 12:58 pm #654178Hi,
@volmering Our devs are working on the update. We are hoping to release it soonBest regards,
YigitJune 28, 2016 at 12:59 pm #654180thank you yigit for the info
July 1, 2016 at 5:56 pm #655868Top Man Michael!
Thank god there are guys like you looking over us all
Kindest regards
Peter
July 3, 2016 at 7:33 pm #656306I have no luck :(
I just uploaded file, but there is nothing change on my cart page.===================
ah, my bad.
i forgot to configure on Minify plugins.Your patch is great!
- This reply was modified 8 years, 5 months ago by masyogie.
July 3, 2016 at 7:40 pm #656308@masyogie did you clear the browser cache as well as any cache from plugins like wp-rocket. Did you follow the instructions exactly?
-
AuthorPosts
- The topic ‘Woocommerce 2.6 problem – urgent!!!’ is closed to new replies.