Here’s some code I came up with that will filter the description and append the add-to-cart shortcode.
COPY CODE
add_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 solution
This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com