Remove action added through function

Found the answer here: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623 <?php function child_remove_parent_function() { remove_action( ‘woocommerce_before_main_content’, ‘mod_output_content_wrapper’, 10 ); } add_action( ‘wp_loaded’, ‘child_remove_parent_function’ ); ?> Explanation is in the link.

WooCommerce shipping – Different product different shipping? [closed]

Create shipping classes for each of your product variations which require one. On your product page, add the attributes for the product, then add the variations, based on the added attributes. Once loaded, you may select the individual product variations to modify price, size, weight, inventory, and shipping class for each specific product variation. To … Read more

How do you add custom metadata to WooCommerce orders? Specifically a second external order ID

you can use woocommerce_checkout_update_order_meta hook to update order meta. Please check sample code add_action(‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_field_update_order_meta’); function custom_checkout_field_update_order_meta($order_id) { session_start(); if ($_SESSION[‘mapics_order’]) update_post_meta($order_id, ‘mapics_order’, esc_attr(htmlspecialchars($_SESSION[‘mapics_order’]))); }

woocommerce_get_price filter hook not working for product variation price

I had to add the filter hook for product variation as well. add_filter( ‘woocommerce_product_get_price’, ‘pr_reseller_price’, 10, 2 ); add_filter( ‘woocommerce_product_variation_get_price’, ‘pr_reseller_price’, 10, 2 ); add_filter( ‘woocommerce_product_get_regular_price’, ‘pr_reseller_price’, 10, 2 ); add_filter( ‘woocommerce_product_get_sale_price’, ‘pr_reseller_price’, 10, 2 );

How to disable users from editing billing address in WooCommerce checkout?

Okay I found a solution after Slack conversation. It is possible to remove the fields from checkout by unsetting them in woocommerce_billing_fields hook and then re-adding the values again to the order from users profile with woocommerce_checkout_posted_data hook. add_filter( ‘woocommerce_checkout_posted_data’, ‘fill_order_billing_details’ ); function fill_order_billing_details( $data ) { $customer_id = get_current_user_id(); $data[‘billing_first_name’] = get_user_meta( $customer_id, ‘billing_first_name’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)