Shop Categories

X

Problem with removing hooks from woocommerce single product page

Home Forums Agama Pro Problem with removing hooks from woocommerce single product page

Topic Resolution: Resolved

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23323
    Michael.srm
    Participant

    Hey,

    I want to change the position of the product short description on my single product page. I have the problem that the add_action does work perfectly. remove action does not.

    function unhook_function() {
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );
    }
    add_action(‘template_redirect’,’unhook_function’);

    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 5 );

    Could it be that the Agama_Pro theme is the reason for that?

    Do you have an idea for a solution?

    Greetings,
    Michael

    #23324
    Michael.srm
    Participant

    additional info:

    remove_action works for the price (woocommerce_template_single_price – 10)

    #23326
    Zex
    Moderator

    Hello, Michael!

    Do the next:
    1. From your dashboard Install and activate the “My Custom Functions” plugin.
    2. Navigate to Dashboard->Settings-> PHP Inserter https://prnt.sc/qqap72
    3. Insert the following code into the main screen:

    // Reorder single product excerpt
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20 );
    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 5 );

    4. Save the changes
    5. turn On the code
    https://prnt.sc/qqasmv

    I hope this will help you with your problem.

    PS:
    Also, you can edit the class-agama-woocommerce.php file directly, using the child theme.

    It’s located at the following path: wp-content/themes/agama-pro/framework

    modify line #140 per your needs.
    https://prnt.sc/qqb0ko

    Regards

    • This reply was modified 3 years, 5 months ago by Zex.
    #23328
    Michael.srm
    Participant

    Your PS did the trick! 🙂

    That is a good solution for my Multisite.

    Thanks a lot!

    • This reply was modified 3 years, 5 months ago by Michael.srm.
    #23330
    Zex
    Moderator

    I’m glad I could help.

    Best Regards

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.