Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #351269

    GRCo
    Participant

    Hi Support,

    On my single product page I’d like the “Add to Cart” button and Quantity selection to live directly below the price, rather than below the details.

    I believe the thread below is asking the same question but the css suggested had no affect. Any suggestions?

    https://community.theme.co//forums/topic/woocommerce-add-to-cart-button-positioning/

    Login info to follow.

    Thanks again and again.

    Cheers

    #351271

    GRCo
    Participant
    This reply has been marked as private.
    #351391

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in!

    What you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Once your child theme is active, please add this code in your child theme’s functions.php file

    function move_add_to_cart(){
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart' );
      add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 15 );
    }
    add_action( 'wp', 'move_add_to_cart' );

    Please let us know if this works out for you.

    #351912

    GRCo
    Participant

    Thanks.

    Sounds like I’m delving into child themes.

    Once I set up a child theme should all of my Custom CSS live in the style.css file or can it stay in the customizer?

    #352010

    GRCo
    Participant

    Additionally,

    The below thread left me concerned about having to manually update plugins each time I updated X.

    Has this been addressed or will I have to follow the procedure outlined (in the thread) to ensure I always have the latest version of X’s native plugins?

    https://community.theme.co//forums/topic/updating-parent-theme-does-not-update-child-theme-plugins/

    Thanks and cheers.

    #352030

    Rupok
    Member

    Hi There,

    Thanks for updating! You can still use Customizer for custom CSS or you can place the CSS into Cild Theme’s style.css file.

    And about the last question, I am not sure what’s your concern actually. It’s a pretty old thread and X got some major updates since then. Would you please clarify the question here? FYI, you need to keep the parent theme and extensions updated. You can update the extensions automatically.

    Thanks

    #352059

    GRCo
    Participant

    Hey,
    Thanks again.

    Regarding last question. Yes, I saw it was old and figured it’s been resolved. Just wanted to ask if I still had to manually update x’s plugins via FTP.

    Just uploaded child theme on my test site.. stupid simple as your many demos stated. My apprehension was simply due to inexperience.

    Trying out the above edit to functions.php now. Will let you know how it goes.

    Cheers

    #352082

    GRCo
    Participant

    Hi Support,

    Followed the above instructions. Worked great. Thank you!

    I now have 2 add to cart and qty buttons. How can I remove the bottom button? See page example and login info (if necessary) above.

    For anyone else following this thread the last line is missing a “c” in action. You’ll receive a FATAL ERROR if this is not edited. It should read:
    add_action( ‘wp’, ‘move_add_to_cart’ );

    Cheers

    #352267

    Lely
    Moderator

    Hello There,

    Thanks for pointing that out 🙂
    Upon checking the product page, I am only seeing one Add to cart button. Can you clarify how and where you see those two buttons?

    You may also add the following CSS to remove the extra scroll bar:

    body {
        overflow: initial;
    }

    Hope this helps.

    #352277

    GRCo
    Participant
    This reply has been marked as private.
    #352464

    Rad
    Moderator

    Hi there,

    It’s a bug on that version of X theme. Please update your theme to latest, and if you have custom woocommerce template then please remove them (as long as you have a backup).

    Thanks.

    #353177

    GRCo
    Participant

    Hi,

    So I updated following instructed in the below link. According to my WP dashboard i’m still running x4.02.
    https://community.theme.co//kb/updating-your-theme-and-plugins/

    As such, I then followed the same steps but used the file downloaded from my x community dashboard which stated x4.06.
    https://community.theme.co//dashboard/

    My WP dashboard still states i’m using x4.02 and the double button is still there.
    Any suggestions as to why I’m unable to properly update?

    Also,
    To remove the add to cart buttons from my main shop page I added a blank add-to-cart.php file in x/woocommerce/loop. I removed this file and this had no affect on the dual button and simply brought the add to cart buttons back on the main page. Any chance this is having an affect on the double add to cart on my product pages?

    Thanks again and cheers to a great weekend.

    #353203

    GRCo
    Participant
    This reply has been marked as private.
    #353306

    Rue Nel
    Moderator

    Hello There,

    To resolve the duplicate add to cart button, please remove the code we gave you in our previous response and replace it with this code instead:

    function move_add_to_cart(){
      remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
      add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 15 );
    }
    add_action( 'wp', 'move_add_to_cart' );

    We changed the code a bit and given priority numbers when this code should be executed. This should remove the second add to cart button and make your add to cart button just below the price.

    Please let us know how it goes.

    #353639

    GRCo
    Participant

    Works perfect! Thank you!

    I’m still unable to update to 4.06.

    I’m transferring x-4.0.6.zip into my “themes” folder via FTP. The “addons” page in the WP dashboard still shows i’m running 4.02.

    Any idea whats going wrong?