• Resolved helpanoobout

    (@helpanoobout)


    I need to add the woocommerce cart button to one of my pages and was wondering if someone could help with the code required to call the cart button. Here is the current code:

    <?php woocommerce_product_loop_start(); ?>
    
    <?php woocommerce_product_subcategories(); ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    <div id="product-image1">
    <a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>" title="<?php echo esc_attr( $product->get_title() ); ?>">
      <?php echo $product->get_image(); ?>
    </a>
    </div>
    <div id="product-description-container">
      <ul>
      <a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>" title="<?php echo esc_attr( $product->get_title() ); ?>">
        <li><h4><?php echo $product->get_title(); ?></h4></li></a>
        <li><?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt )?></li>
        <li><h6><?php echo $product->get_price_html(); ?>  **MISSING CODE TO ADD TO CART BUTTON HERE**</h6></li>
     </ul>
    </div>
    <?php endwhile; // end of the loop. ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘woocommerce code for add to cart button’ is closed to new replies.