• Resolved Vasja

    (@vasja1)


    Hi, I was trying to move the PPOM fields under the add to cart button by putting the following code into the functions.php of the website’s child theme:

    remove_action ( ‘woocommerce_before_add_to_cart_button’, ‘ppom_woocommerce_show_fields’, 15);
    add_action ( ‘woocommerce_after_add_to_cart_button’, ‘ppom_woocommerce_show_fields’, 15);

    The system nicely adds the fields where they were supposed to be however the remove_action does not work.
    Can you please help me with this issue?

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    use this:

    remove_action ( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_inputs_template_base', 15);
    
    add_action ( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_inputs_template_base', 15);
    Thread Starter Vasja

    (@vasja1)

    Hi,
    Thank you for the quick answer. Unfortunately, that does not remove the section either. I have tried that before actually, and what happens is by using add_action that you recommended (ppom_woocommerce_inputs_template_base) it duplicates all the fields below the search button. Mind that I am putting the PPOM section under the add to cart button therefore I am using woocommerce_after_add_to_cart_button instead of woocommerce_before_add_to_cart_button.
    That is how it looks like: https://1drv.ms/u/s!ArALXfKUms0wgogkypPRLaFrdQeTtg?e=HoVKbe
    Where is if I use the ppom_woocommerce_show_fields hook it seems to add the fields under the add to cart button correctly. Here is the screenshot https://1drv.ms/u/s!ArALXfKUms0wgoglYbECGduiNw2lAA?e=VMLtvP

    Also, neither of those two hooks adds the table with the prices. But that’s probably another problem.
    What I want to resolve first is to make remove_action work to remove everything that is PPOM related from above the add to cart button. The fact that the two hooks that we are talking about don’t add the table with the prices makes me think that there is a different hook that needs to be used here?
    Or maybe the PPOM plugin executes its add hooks after the child theme functions.php kicks in?
    Let me know what do you think and what can I do to move foreward.
    Thanks.

    Thread Starter Vasja

    (@vasja1)

    HI @nmedia, I just wanted to ask if you saw my previous message? is there a different hook that I can use?
    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Moving PPOM fields below add to cart button’ is closed to new replies.