Home Forums WoodMart support forum problem with add to cart” b

problem with add to cart” b

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #438332

    salahkasmi97
    Participant

    Hello,
    I want to report a problem, when I am on a product and I click on “add to cart”, the rotation does not stop and the product is not added to the cart until I refresh the page.

    #438335

    Artem Temos
    Keymaster

    Hi,

    Could you please send us a link to your website where we can see this issue?

    Kind Regards

    #438338

    salahkasmi97
    Participant
    #438339

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    add_filter('woocommerce_add_to_cart_redirect', function( $url ) {
    	if( strpos( $url, 'product-added-to-cart' ) > 0 || strpos( $url, 'product_added_to_cart' ) > 0) {
    		if ( isset( $_REQUEST['wd-add-to-cart'] ) ) {
    			return wc_get_checkout_url();
    		}
    		return '';
    	} 
    	return $url;
     }, PHP_INT_MAX);

    Kind Regards

    #438347

    salahkasmi97
    Participant

    it works on the store page but not on the single product page

    #438396

    Artem Temos
    Keymaster

    Please, send us a screenshot of where exactly you added the code so we can see if it is correct.

    Kind Regards

    #438397

    salahkasmi97
    Participant

    Okay

    Attachments:
    You must be logged in to view attached files.
    #438399

    Artem Temos
    Keymaster

    Make sure that the child theme is currently active. Check this in Appearance -> Themes.

    Kind Regards

    #438400

    salahkasmi97
    Participant

    Actually, it has been deactivated.
    thank you it is solved and sorry for the inconvenience

    #438402

    Artem Temos
    Keymaster

    You are always welcome.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘problem with add to cart” b’ is closed to new replies.