Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #979426

    Still having issues with adding code to my functions.php. My hosting company says it’s a theme issue so hoping someone can help. I added the below to the bottom of my functions.php and it shows up twice on my site. beside the button and below it I tried adding the note via the abandon cart plugin for Woo because theres a field there for GDRP I thought I could take advantage of, and it did the same thing…added twice.

    add_action( ‘woocommerce_after_add_to_cart_button’, ‘add_content_after_addtocart_button_func’ );

    function add_content_after_addtocart_button_func() {

    // Echo content.

    echo ‘<div class=”second_content”>* All prices in Canadian Dollars</div>’;

    }

    #979432

    Hey,

    Could you please post WP logins here privately, we will need them. If you do not mind, please post FTP logins as well. Since we are going to work on php file, we can fix if any issue occurs:)

    Best regards,
    Yigit

    #979459

    Thank you Yigit. I’ve placed it below

    #980570

    Hi,

    FTP logins did not work for me. Could you please check them once again?

    I tried editing functions.php file in Appearance > Editor but i am getting “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.” error.

    Best regards,
    Yigit

    #980589

    That’s part of the issue I’m having. I can’t make any edits using WordPress, I have to go to my cpanel and my host says it’s because of the theme.

    #980601

    Hi,

    That should not be the case, maybe a plugin conflict but could you please check FTP logins once again so we can look into it?

    Cheers!
    Yigit

    #980755

    Thanks for your help Yigit,
    I’ve tried again on the FTP info below.

    #982137

    Hello,
    I’m just following up as this is still happening. Again, I can’t add functions.php via WordPress Editor. And when I add Via cpanel content below add to cart….it shows up twice. I have just added a secure site image and it’ is there twice Please have a look

    • This reply was modified 6 years, 4 months ago by Rgrant74.
    #982141

    The strange thing is that it’s not happening on all pages. See below

    I really want to launch my store this weekend so I’m begging for assistance with this!

    #982292

    These are the two pieces that are duplicating. Both after cart.

    1.
    add_action( ‘woocommerce_after_add_to_cart_button’, ‘add_content_after_addtocart_button_func’ );

    function add_content_after_addtocart_button_func() {

    // Echo content.

    echo ‘<div class=”second_content”>* All prices in Canadian Dollars</div>’;

    }

    2.

    add_action( ‘woocommerce_after_add_to_cart_button’, ‘content_after_addtocart_button’ );
    function content_after_addtocart_button() {
    echo ‘<div class=”content-section”></script>
    </div>’;
    }

    #982301

    Sorry for the may messages but I desperately need to fix this. SO I have changed the code for the after add to cart and it is no longer duplicating. This issue I have now is the secure checkout image is BESIDE the add to cart and not BELOW. If I can fix this all will be right in my world. Please help!

    add_action( ‘woocommerce_after_add_to_cart_button’, ‘add_content_after_addtocart_button_func’ );

    function add_content_after_addtocart_button_func() {

    // Echo content.

    echo ‘<div class=”second_content”><CONTENT HERE></div>’;

    }

    • This reply was modified 6 years, 4 months ago by Rgrant74.
    #982309

    Problem not solved.

    On product pages where there are variations the Add To Cart is in a boxed area wit the variations. On these pages, anything added after Add To Cart is duplicating.

    On product pages where there are no variations, the add to cart has no box around it and anything placed after Add To Cart is NOT duplicating.

    I’ve placed examples below.

    #983130

    Hi,

    Our dev team is working to get that thing shorted out yes,

    Best regards,
    Basilis

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.