Does the woocommerce_order_status_changed hook fire when WooCommerce updates an order status automatically? [closed]

One of the results did bring up this (in reference to woocommerce_order_status_changed): “Where the hook is used (in WC core): Does not used.” Which seems to answer Question 1, which is what leads me to believe if WooCommerce or a payment gateway changes the order status automatically, it will never fire, thus not creating our … Read more

WooCommerce: Email Notifications

You may be using the wrong hook. I use this : add_action( “woocommerce_email_after_order_table”, “custom_woocommerce_email_after_order_table”, 10, 1); function custom_woocommerce_email_after_order_table( $order ) { echo ‘<p>content after email table</p>’; } now, if you look at this link it will show you other hooks that you can use if you want to append other information to the email. for … Read more

How to get all attributes with their terms related to specific Woocommerce product category [closed]

Well, I found the following solution: $args = array( ‘category’ => array( ‘category_slug’ ) // or ‘term_taxonomy_id’ => 4 i.e. category ID ); foreach( wc_get_products($args) as $product ){ foreach( $product->get_attributes() as $attr_name => $attr ){ echo wc_attribute_label( $attr_name ); // attr label // or get_taxonomy( $attr_name )->labels->singular_name; foreach( $attr->get_terms() as $term ){ echo $term->name; } … Read more

WooCommerce checkout: How can I change $field_container of a checkout field?

The woocommerce_form_field() is a pluggable function, defined as follows: if ( ! function_exists( ‘woocommerce_form_field’ ) ) { /** * Outputs a checkout/address form field. * * @param string $key Key. * @param mixed $args Arguments. * @param string $value (default: null). * @return string */ function woocommerce_form_field( $key, $args, $value = null ) { … … Read more

How to unhook a function in Woocommerce Template?

You need to unhook the function from that action specifically: remove_action( ‘woocommerce_review_before_comment_meta’, ‘woocommerce_review_display_rating’, 10 ); (e.g. look for the opposite add_action() line in includes/wc-template-hooks.php) You’ll also need to make sure that this is run after WooCommerce has loaded and added the action you’re about to remove, e.g. place this in a plugins_loaded hook: function unhook_display_rating() … Read more

Auto update cart after quantity change

Almost one year late, but this question might still get visitors: You trigger the click, but the button doesn’t have enough time to become enabled, so that is why, by the time you click the second time the button becomes enabled. Remove the “disabled” propriety before triggering the click: <script> jQuery(‘div.woocommerce’).on(‘change’, ‘.qty’, function(){ jQuery(“[name=”update_cart”]”).prop(“disabled”, false); … Read more

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