codemsivakumar
Forum Replies Created
-
Hi @mahfuzurwp
It is enqueued in my child theme.
wp-content/theme/storefront-child/inc/class/CustomCart.php
public function __construct()
{
if ( is_cart() ) {
wp_enqueue_script( 'cart-order-cart',get_theme_file_uri() . '/assets/js/cart-custom.js');
}Hi @mahfuzurwp
Thanks for your replyIn WooCommerce 9.8.5, the
cart-custom.js?ver=6.8.1script file is present on the page.However, after updating to WooCommerce 9.9.4, this script is missing from the page source (viewed via browser). It’s no longer loading in the
<head>or anywhere else in the markup.public function __construct()
{
if ( is_cart() ) {
wp_enqueue_script( 'cart-order-cart',get_theme_file_uri() . '/assets/js/cart-custom.js');
}- This reply was modified 9 months, 2 weeks ago by codemsivakumar.
Hi @lovingbro
As for the button — it’s currently used to prompt the user with a confirmation popup to clear the cart. When the user clicks “Yes,” the popup closes and an AJAX request is triggered to delete the cart data.
Here’s the current code in use:
<a onclick="AddEmptyconfirmationPopup();" id="lnkbtnEmptyCart" class="button--empty" href="javascript:__doPostBack('$lnkbtnEmptyCart','')">Empty cart</a>Hi @mosesmedh,
Thank you for your reply. I agree that this doesn’t seem to be caused directly by WooCommerce or WordPress itself. However, I noticed that after upgrading WooCommerce to version 9.9.4, the__doPostBack()function throws an error. When I revert back to version 9.8.5, the same code works as expected and shows the popup.Could something in the 9.9.4 release be affecting this behavior?
Hi Team,
Here is the implementation to show a confirmation popup which will be displayed earlier on doPost
<a onclick=”AddEmptyconfirmationPopup();” id=”lnkbtnEmptyCart” class=”button–empty” href=”javascript:__doPostBack(‘$lnkbtnEmptyCart’,”)”>Empty cart</a>
Post Woo update, it breaks this functionality and throws the mentioned error.
Hope this helps you to short out the issue.