ateebahamd
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Actually I fixed this by modifying the code . here is the piece of code that I modified . would love if you can update the code and send an update in next version
function cqoc_add_js(){ if ( is_checkout() ) { $plugin_version = $this->plugin_version; wp_enqueue_style( 'cqoc_checkout', plugins_url( '/assets/css/change-quantity-on-checkout.css', __FILE__ ), '', $plugin_version, false ); ?> <script type="text/javascript"> <?php $admin_url = get_admin_url(); ?> jQuery("form.checkout").on("keypress", "input.qty", function( event ){ return event.charCode >= 48 && event.charCode <= 57; }); jQuery("form.checkout").on("change", "input.qty", function( event ){ var quantityValue = jQuery(this).val(); if (quantityValue === '0') { jQuery(this).val(''); } $form = jQuery( 'form.checkout' ); if ( $form[0].checkValidity() ){ var data = { action: 'cqoc_update_order_review', security: wc_checkout_params.update_order_review_nonce, post_data: jQuery( 'form.checkout' ).serialize() }; jQuery.post( '<?php echo $admin_url; ?>' + 'admin-ajax.php', data, function( response ) { jQuery( 'body' ).trigger( 'update_checkout' ); }); } }); </script> <?php } }
I added a check inside the change event listener for quantity inputs (
jQuery("form.checkout").on("change", "input.qty", function( event ){
) to detect if the quantity entered is ‘0’. If it is, the script sets the input field value to an empty string, effectively treating it as empty.Forum: Plugins
In reply to: [Contact Form 7] “Failed to send your message.” errorI had the same issue but i came with the fixation i tried to contact with the hosting providers but it was okay from their side but. then i found this guide Contact form 7 Fixation
Can you please disable the open graph meta tags generator .
Viewing 3 replies - 1 through 3 (of 3 total)