[resolved] Place "Add to Cart" link next to custom post type. (3 posts)

  1. theatereleven
    Posted 2 years ago #

    I've installed WooCommerce (it rocks) and I've got a simple need, but just not sure how to do it:

    My custom WP site already has product pages that are laid out in a detailed manner - I'm not re-working them for WooCommerce. All I need to do is place an "Add to Cart" button on my existing pages that references the right product in WooCommerce and adds it to the cart.

    Is this possible? My custom pages are using either ACF or custom post types (depending on the page).


    BTW - I've tried using their short codes, but I can't get them to show anything. I'm using the format: <?php echo do_shortcode("[product id="99"]"); ?>.

    It just breaks the page.


  2. Roy Ho
    Posted 2 years ago #

    You can use the WC shortcodes to add a "add to cart" button in any page you want.

  3. theatereleven
    Posted 2 years ago #

    You know...found the answer.

    This formatting worked:

    <?php echo do_shortcode('[product id="99"]'); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic