• Hi there,

    I hope you are fine & safe during this time because of corona, so i wish you the best for you & your family.

    The Woocommerce hooks doesn’t work when adding it onto the code snippet (even with hooks priorities).

    add_filter('tc_ticket_instance_field_value', 'tc_sequential_order_id', 99, 5);
    add_filter('posts_join', 'extended_search_join', 99);
    add_filter('posts_where', 'extended_search_where', 1);
    
    add_action('woocommerce_new_order', 'wc_update_post_content', 10 ,1);
    add_action('ywraq_after_create_order', 'wc_update_post_content', 10, 1);
    add_action('yith_wcmv_suborder_created','wc_update_post_content', 10, 1);

    These hooks worked only when we added it to the funciton.php

    Is there is any issue in that ?

    Best Regards

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @magedmoh94

    Did you receive an output error message? I have been fighting this for several months and can’t figure it out – WooCommerce product pages won’t allow even simple PHP snippets to be added via shortcode without throwing an error.

    Even the most common code, such as:

    <?PHP echo 'Hello, World!'; ?>

    – when added as a shortcode to the long and short description fields on a product creates an instant fatal error.

    DJ

    Plugin Author Shea Bunge

    (@bungeshea)

    @magedmoh94 Unfortunately, without knowing the rest of the snippet code, there’s not a lot I can do to figure out what could be going wrong.

    @varsitysports Are you using a proper shortcode template to add that code? Adding direct output PHP code won’t work with this plugin.

    @bungeshea

    You wrote:

    Are you using a proper shortcode template to add that code?

    What would the “proper shortcode template” be?

    DJ

    Plugin Author Shea Bunge

    (@bungeshea)

    @varsitysports You need to call add_shortcode in order to register your HTML/PHP code as a usable shortcode: https://developer.ww.wp.xz.cn/reference/functions/add_shortcode/

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Woocommerce hooks issue’ is closed to new replies.