This topic has 16 replies, 5 voices, and was last updated 8 months, 2 weeks ago ago by Andrew Mitchell
OK, I submitted a ticket about this issue to WooCommerce—but they are hinting that It’s a theme issue.
I have WooCommerce Subscriptions plugin running. Which generally speaking is OK, but here is the specific use case that I’m finding a major issue with:
If you go and select a product to purchase one time, then go down the cart path, in the cart path you can change your selection to a subscription (or visaversa). But when you do that in the cart page, using the radio buttons, it doesn’t fire the update to the CART TOTAL. So the big problem is that in essence the user can change their purchase to one or the other, but the cart total doesn’t update, they complete the order, and now we have a purchase cost that doesn’t align with the option selected. Customer service will hate me 🙂
Thank you in advance for any direction on how to resolve this issue.
Hello,
Thank you for reaching out to us with your concern.
Kindly record a video illustrating the problem and the actions you have mentioned, and also provide temporary FTP access.
For FTP access, we require the following details: FTP host, FTP username, FTP password, FTP port, and FTP encryption type. If you need assistance in creating these credentials, please reach out to your hosting provider who will guide you through the process.
Best Regards,
The 8Theme Team
Hello, please find details in private content area.
Dear Sethr,
We hope this message finds you well.
We would like to provide you with a solution to the issue you are experiencing. Kindly insert the following snippet of code into the functions.php file located within your child theme directory:
add_action('wp_footer', '__wp_footer');
function __wp_footer(){
if(is_cart()){
?>
<script>
(function ( $ ) {
'use strict';
$(document).on('change', '.subscription-option input[type=radio], .one-time-option input[type=radio]', function (){
$('.quantity .quantity-wrapper input').trigger('change');
});
})( window.jQuery );
</script>
<?php
}
}
We trust that this will effectively address the problem at hand. Should you require any further assistance, please do not hesitate to reach out.
Warm regards,
The 8Theme Team
THANK YOU SO MUCH. This appears to solve it on my testing!
Hi @sethr,
In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?
Click here to share your thoughts: https://themeforest.net/downloads
Being part of our community means a lot, and your feedback contributes immensely.
Best Regards,
The 8Theme Team
Thanks for re-opening this ticket.
Since the provided solution, which is working perfectly on desktop, users have noticed that on MOBILE, the radio button selection dissapears after changing selection IN THE CART VIEW.
In the video i’m supplying in private area, you can see where i’m adding a single purchase to cart, going to cart, then changing form single, to subscription, back again, etc. The radio button highlights, until the AJAX update to cart total is finished, then it disappears.
Thank you in advance for any help.
Dear Sethr,
We hope this message finds you well.
We’re pleased to inform you that we have implemented an update to the custom codes as detailed below:
add_action('wp_footer', '__wp_footer');
function __wp_footer(){
if(is_cart()){
?>
<script>
(function ( $ ) {
'use strict';
$(document).ready(function(){
if( $(window).width() < 768 ){
$('.one-time-option input[type="radio"]').first().prop('checked', true);
}
});
$(document).on('change', '.subscription-option input[type=radio], .one-time-option input[type=radio]', function (){
$('.quantity .quantity-wrapper input').trigger('change');
});
})( window.jQuery );
</script>
<?php
}
}
This update has been tested and is now functioning correctly on mobile devices as well. We kindly request that you review the changes at your earliest convenience to ensure everything is to your satisfaction.
Please be advised that any further customizations may require the attention of the plugin’s author, as the issue addressed was not related to our XStore theme. We appreciate your understanding in this matter.
Thank you for your continued collaboration.
Best regards,
The 8Theme Team
Hello, thank you, and thank you for alerting me this is really a plugin issue not a theme issue. It’s challenging as WooCommerce is saying it’s not their problem? Again, appreciate the support!!
I just made sure this new block of code is in my child functions.php—but I do not see it working while testing.
I can make the width of my desktop browser very narrow, and the check box highlights still go away if user changes, as well as on actual mobile device—the issue seems to still be there for me.
The updated code snippet solved the problems on my site. Thanks so much!
Hey Brooke! When you say solved, do you mean the last code block provided, solving the specific MOBILE radio button issue? or do you mean the first code block, solving the UPDATE CART TOTAL issue? LMK, thanks~!
Hi @sethr,
We’re unable to login via this login URL anymore.
Can you please check?
Thank you!
Oh it expired, try again. See URL in private.
Hi @sethr,
We’ve updated the custom code to this:
add_action('wp_footer', '__wp_footer');
function __wp_footer(){
if(is_cart()){
?>
<script>
(function ( $ ) {
'use strict';
$(document).ready(function(){
if( $(window).width() < 768 ){
var current = $('input[type=radio]:checked', '.woocommerce-cart-form').val();
$('td.product-price.mob-hide ul').remove();
$(":radio[value=" + current + "]").prop("checked", true);
}
});
$( document.body ).on( 'updated_cart_totals', function(){
if( $(window).width() < 768 ){
var current = $('input[type=radio]:checked', '.woocommerce-cart-form').val();
$('td.product-price.mob-hide ul').remove();
$(":radio[value=" + current + "]").prop("checked", true);
}
});
$(document).on('change', '.subscription-option input[type=radio], .one-time-option input[type=radio]', function (){
$('.quantity .quantity-wrapper input').trigger('change');
});
})( window.jQuery );
</script>
<?php
}
}
Now it’s working on mobile also.
From now please be advised that any further customizations may require the attention of the plugin’s author, as the issue addressed was not related to our XStore theme. We appreciate your understanding in this matter.
Thank you for your continued collaboration.
Best regards,
The 8Theme Team
Tested, on mobile, absolutely stellar. Working perfectly. THANK YOU SO MUCH for following through on this solution for me, even though it was out of scope of the theme support. I am grateful and will be recommending 8theme to others!!
Dear sethr,
Choosing our theme reflects your commitment to quality, and for that, we’re genuinely grateful. As we constantly strive to elevate your experience, your feedback is an invaluable gift. Could you kindly take a moment to rate our product with 5 stars on ThemeForest?
Click here to share your insights: https://themeforest.net/downloads
Your support fuels our journey, and we appreciate it more than words can express.
Best Regards,
The 8Theme Team
The issue related to '‘Cart Total / Details don’t update when user switches between 1x purchase and Subscription purchase’' has been successfully resolved, and the topic is now closed for further responses