Relative Content

Tag Archive for phpwordpresswoocommercehook-woocommerce

How do I conditionally stop woocommerce from saving shipping/billing addresses

I’m trying to write an Address book plugin that will allow users to add multiple shipping & billing addresses to their account so they can choose an address at checkout. I need to stop woocommerce from overwriting the default shipping/billing address when they use the edit-address form so I can save the new addresses separately. I know I could create a new form with its own logic in handling form submissions/saving addresses but I would like to stick with the woocommerce edit-address form if possible.

Using woocommerce_loaded hook after data migration to fix variations

We have just mirigated nearly 6k products over from the live site. We are experiencing similar issues to the following post: Woocommerce: function to update all products. I’ve tried the fix mentioned in the post but it does not seem to fire when I go a product page. I’ve used query monitor and it is listing my call under the woocommerce_loaded hook but it does not fire.

Remove notice only for Composite Products in Woocommerce

I would like to only get a ‘Product is removed’ for the product type ‘Composite Product’. Currently, when I would remove a composite product in WooCommerce, it will display a notice for all child products that are removed in the cart. The only notice I would like to keep, is from the composite product itself.

Show newly created/split order and details on Woocommerce Thank You page

I am using a nifty piece of code (thanks 7uc1f3r) to split an order if it contains any backordered products: Split a WooCommerce order and create a new order if the original order has products in backorder.
This works great to create the second order at checkout, but it only shows the original order on the Thank You page. As mentioned by Pathfinder, there is a way to hook into the session data, pass the new order id, and show the newly created order details below the OG order table using woocommerce_after_order_details.