Custom Redirect after registration in WooCommerce

Internally, WooCommerce uses WordPress’ wp_safe_redirect() which does not allow redirects to external hosts. In order to get around this, we must add our desired host to the whitelist. The whitelist can be modified using the allowed_redirect_hosts which has been demonstrated below: /** * Adds example.com to the list of allowed hosts when redirecting using wp_safe_redirect() … Read more

Get user payment details when payment successfully done in woocommerce [closed]

Yes, after an order created you can get details of it. The woocommerce_payment_complete hook is fired when the payment is completed. The only variable passed is the order id, though from that you can get the order object, and ultimately the user. add_action( ‘woocommerce_order_status_completed’, ‘so_payment_complete’ ); function so_payment_complete( $order_id ){ $order = wc_get_order( $order_id ); … Read more

WooCommerce add_to_cart url not working [closed]

So I ended up making a workaround because I still have no clue what’s happening. I changed the url to point to the product page and I’m using ol’good PHP to get the values and add the product with WooCommerce API. Here’s my code: if(isset($_GET[‘order’]) && $_GET[‘order’] == ‘true’) { $typo = isset($_GET[‘attribute_pa_typographie’]) ? $_GET[‘attribute_pa_typographie’] … Read more

WooCommerce Shop Page Not Found 404

What you’ve done here is changing slug for products. For example : http://localhost:8080/shop/product-category/sample-product as explained in WP, but not your Woocommerce home. Change the base to base default in permalinks settings. Then read after 🙂 If you want to change your “Shop Homepage” go to http://localhost:8080/wp-admin/admin.php?page=wc-settings&tab=products&section=display That’s the good way to do it !