Add to Cart Error

Hi, I’m having an issue while trying to use the add to cart option on the product page:

is not adding under firefox mozilla, iphone, samsung.

This error is in my logs:

2020/07/04 15:12:51 [error] 11125#11125: *36812 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function add_share_for_product(), 2 passed in /www/gotsultryskin_735/public/wp-includes/class-wp-hook.php on line 287 and exactly 4 expected in /www/gotsultryskin_735/public/wp-content/themes/pro-child/functions.php:29

Hello Edwin,

Thanks for writing in!

Based from your error log, you have added a custom PHP function namely add_share_for_product() in your child theme’s functions.php file and it resulted in a fatal error. You may need to check your PHP code and temporarily it for the moment so that the site will go back to normal. If you are not the one coding the mentioned add_share_for_product() function, you may need to contact the one who gave you the code.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third-party developer.

Thank you for your understanding.

Hi Ruenel, I’m 100% aware of that :wink: just need some basic help. Even after I’ve removed the code from functions.php the error persists. I don’t think you read or understood my original question.

THIS WAS THE QUESTION: Hi, I’m having an issue while trying to use the add to cart option on the product page:

is not adding under firefox mozilla, iphone, samsung.

thank four kind support and help.

regards,

Ed

Hi, never mind and please close this ticket. The issue was a plugin, after an update and clean cache it’s finally working.

sorry, I forgot something.

Since this code is causing the error:
// Add social sharing to product page
// =============================================================================
add_action(“woocommerce_share”, “add_social_sharing_to_product_page”);

function add_social_sharing_to_product_page() {
echo do_shortcode("[share facebook=‘true’ twitter=‘true’ pinterest=‘true’ class=‘mtl’]");
}
// =============================================================================

What can I use to fix this? I need to show the social buttons on the products description page under the Add to Cart button.

thanks,

Ed

Hey Ed,

This is basically a WooCommerce customization question because requires the use of a WooCommerce filter. We would be glad to answer 3rd party tech questions in our One service here: https://theme.co/one

Your kind consideration would be very much appreciated.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.