• Resolved osherezra3363

    (@osherezra3363)


    Hey guys, Thanks in advance to all.

    I was wondering if there is a way to change the location of the paypal button in the single product page ?

    currently it’s under the Add to cart button and I want it next to it.
    ** I tried to find the Php template file, but couldn’t, also didn’t didn’t find any actions filters referring to this. hope you guys could give a hint or two cheers to all ??

    issue pic

    • This topic was modified 6 years, 5 months ago by osherezra3363.
Viewing 5 replies - 1 through 5 (of 5 total)
  • melinda a11n

    (@melindahelt)

    Automattic Happiness Engineer

    Right now, the button is hooked in to woocommerce_after_add_to_cart_form.

    You could unhook it and then hook it into an earlier action to move it on the page.

    Thread Starter osherezra3363

    (@osherezra3363)

    Hey Melinda thanks for the help,
    so basically what I need to do is add a filter function to function.php,

    can you give me an example on what do you mean by un-hooking ?
    Cheers ??

    Plugin Contributor Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    @osherezra3363 – this is not done with a filter but rather by using remove_action.

    This tutorial goes over the idea:

    https://wpbackoffice.com/reorder-product-page-contents-woocommerce/

    I’m not sure that you can easily render the button right next to the ‘Add to Cart’ button, it certainly wouldn’t be as simple as a CSS rule to make it float:right;. The reason is because the ‘Add to Cart’ button is part of a <form> element.

    Hope that helps!

    Thread Starter osherezra3363

    (@osherezra3363)

    @shellbeezy thanks man I’l check it out and update below =====>

    **update:** well it seems to be that the button is under the <form> parent so i’v decided to use flex-box to get the job done. all works fine and looks great, just one issue. it seems that all the changes I make in chrome dev tools appear, but when it gets to the theme css file it doesnt work, Iv tried adding !important to the changes and purge cache, but still no luck ?? any idea what’s causing this ?

    cheers,

    Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    Since you seem to be familiar with the chrome dev tools, can you see the changes that you have made to the theme CSS in the inspector?

    Have you tried to use the customizer to insert your custom CSS rather than the theme’s CSS file?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing button location’ is closed to new replies.