-
AuthorPosts
-
August 5, 2015 at 4:55 pm #351269
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
August 5, 2015 at 4:57 pm #351271This reply has been marked as private.August 5, 2015 at 8:55 pm #351391Hello 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.
August 6, 2015 at 8:37 am #351912Thanks.
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?
August 6, 2015 at 10:44 am #352010Additionally,
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.
August 6, 2015 at 11:03 am #352030Hi 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
August 6, 2015 at 11:43 am #352059Hey,
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
August 6, 2015 at 12:18 pm #352082Hi 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
August 6, 2015 at 4:22 pm #352267Hello 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.
August 6, 2015 at 4:32 pm #352277This reply has been marked as private.August 6, 2015 at 9:15 pm #352464Hi 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.
August 7, 2015 at 3:47 pm #353177Hi,
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.
August 7, 2015 at 4:28 pm #353203This reply has been marked as private.August 7, 2015 at 7:32 pm #353306Hello 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.
August 8, 2015 at 7:02 am #353639Works 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?
-
AuthorPosts