Home Forums WoodMart support forum Add to cart button in single producto page

Add to cart button in single producto page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #463121

    ernesto-8220
    Participant

    Hi im having trouble in the single product page, when i click ont he add to cart button it just keeps loading and nothing happens, just if i refresh the page then is added but the lateral panel does not opens nor the popup cart , if a deactivate the ajax button then it works the message is placed up like a woocommerce notice , but i want to show in the lateral panel when it clicks or a pop up .

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

    Luke Nielsen
    Keymaster

    Hello,

    Please deactivate all plugins except these ones:

    WPBakery Page Builder or Elementor
    Woodmart Core
    WooCommerce
    Please switch to the parent theme if you use the child.

    If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.

    If the issue still persists, please confirm the permission for the plugin’s deactivation, switching to the parent theme. As soon as we complete the testing we will enable all back.

    Kind Regards

    #465423

    ernesto-8220
    Participant

    Hi i tried the deactivation of the plugins but still nothing, what i did is paste a code that i found in the forum that i will paste in the end of this message it says that it should be paste on the functions.php file , and it worked but with every actualization it is erased, i tried a code snippet plugin but none seems to work , you have permission to deactivate the necessary plugins thank you

    this is the code that i pasted in function.php

    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);

    #465672

    Luke Nielsen
    Keymaster

    Hello,

    Ok, but firstly could you please update the access? Because seems that the earlier provided is not available: https://take.ms/uUHqs

    Thanks for your time and have a great day.

    Kind Regards

    #465717

    ernesto-8220
    Participant

    im sorry my mistake here are again

    #465891

    Luke Nielsen
    Keymaster

    Hello,

    First of all, you should create a child theme and then in the functions.php file in your child theme define the above code. So as a result it will not disappear after updating the theme and the button will work well.

    Don’t hesitate to let me know if you need any further help or any other info.

    Kind Regards

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