-
AuthorPosts
-
June 29, 2018 at 6:37 pm #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>’;
}
June 29, 2018 at 6:46 pm #979432Hey,
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,
YigitJune 29, 2018 at 8:35 pm #979459Thank you Yigit. I’ve placed it below
July 3, 2018 at 2:02 pm #980570Hi,
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,
YigitJuly 3, 2018 at 2:31 pm #980589That’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.
July 3, 2018 at 3:00 pm #980601Hi,
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!
YigitJuly 3, 2018 at 8:58 pm #980755Thanks for your help Yigit,
I’ve tried again on the FTP info below.July 6, 2018 at 4:59 pm #982137Hello,
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.
July 6, 2018 at 5:05 pm #982141The 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!
July 7, 2018 at 12:16 am #982292These 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>’;
}July 7, 2018 at 1:37 am #982301Sorry 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.
July 7, 2018 at 2:55 am #982309Problem 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.
July 9, 2018 at 3:20 pm #983130Hi,
Our dev team is working to get that thing shorted out yes,
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.