Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hello halluzineyt, I am not sure what you are trying to achieve however have a read through this URL and see if that helps you.

    Kind regards

    Thread Starter halluzineyt

    (@halluzineyt)

    For example ill be querying category 1 so i will create a custom query where i can call the image and the exerpt only but not the content, now how can i insert the add to cart function there? For example i will query 5 posts from category one each having their own add to cart button?

    <?php query_posts('cat=1&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
    
    the image
    excerpt
    add to cart
    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi halluzineyt, the following code is added to the theme. You might find a way to add it to your custom query post.

    <?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>

    You can read more about other settings in the following URL.

    Let me know if that helps you.

    Thread Starter halluzineyt

    (@halluzineyt)

    That code still need to pull the product name and product price, since its a wp query i cant provide it manually one by one right ? Do i put it in custom fields?

    Plugin Contributor Tips and Tricks HQ

    (@tips-and-tricks-hq)

    Thread Starter halluzineyt

    (@halluzineyt)

    <?php
    $title = the_title();
    $price = get_post_meta($post->ID, 'price', true);
    echo print_wp_cart_button_for_product($title,$price);
    ?>

    Im doing this i dont know why the title appears on the top of the button?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add to wp query’ is closed to new replies.