-
Author
Tagged: woocommerce, button, description, add to cart
-
April 10, 2015 at 18:47 #53932
michalzwierz
ParticipantHi, is there an option to have ANOTHER (duplicated) “add to cart” button centered below detailed description?
April 12, 2015 at 17:23 #54100sharmstr
ModeratorHere’s some code I came up with that will filter the description and append the add-to-cart shortcode.
COPY CODEadd_filter('the_content','append_add_to_cart'); function append_add_to_cart( ) { if ( is_single() && get_post_type( get_the_ID() ) == 'product' ) { $content = get_the_content(); return $content . do_shortcode('[add_to_cart id="' . get_the_ID(). '"]'); } }That shortcode doesnt give you a qty box. You should ask over on the woo forums how to do this better.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
April 20, 2015 at 17:38 #55269michalzwierz
ParticipantI understand how this thing works but, two questions:
1. Where do I put it? When added to functions.php – breaks my website…
2. Does the shortcode looks like this now: [add_to_cart]?
Thank You!April 20, 2015 at 17:58 #55270sharmstr
ModeratorYou put it in functions.php. It doesnt break my site. Maybe you copied it wrong. I dont understand your second question. Perhaps you’re better off asking over on the woocommerce forum since you wont be touching any kleo code to add it.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.

