I am building a custom plugin based on woocommerce. As a part of this development I have added few custom fields to single product page at woocommerce_before_add_to_cart_button hook. These fields will be populated with some user meta data. I am able to see the custom fields on the page properly but problem arises when I try to submit the product to cart. As soon as I click on Add to Cart button I am seeing a blank page whose URL in address bar is same as that product page, may be the redirection to cart is no happening. When I go directly to the cart page to verify , I am able to see the added product in cart. Is there any solution for this blank page problem?

| improve this question | | | | |
  • In wp-config.php file, define('WP_DEBUG',true); for error checking. – WisdmLabs Aug 11 '15 at 5:25
  • I just did that and had this notice along with few warnings.Notice: The add_to_cart_redirect filter is deprecated since version ! Use woocommerce_add_to_cart_redirect instead. in XXXXXXXXXX/wp-includes/functions.php on line 3391 – krishna89 Aug 11 '15 at 7:25
  • I think this is due to some functions deprecated in latest version of woocommerce. I have updated woocommerce and I have to sort out my theme overrides as well. – krishna89 Aug 11 '15 at 8:35
  • change the hook name from add_to_cart_redirect to woocommerce_add_to_cart_redirect. – WisdmLabs Aug 11 '15 at 9:19
  • the notice says to replace add_to_cart_redirect with woocommerce_add_to_cart_redirect in wordpress functions.php. But i am not able to find add_to_cart_redirect filter in functions.php. Please correct me if I am wrong. – krishna89 Aug 11 '15 at 10:23

After so much research I figured it that the issue is due to a custom function I was trying to hook to the product page. All this while the custom function was wrongly hooked and I corrected it now.

| improve this answer | | | | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.