WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » Issue with WooCommerce Shortcodes

Issue with WooCommerce Shortcodes

  • I have built a custom multi field search function and I am trying to populate the search results page with the product listing and the “Add To Cart” button.

    I have grabbed all items that match the search criteria and am using the following to build a list of items on the serach results page –

    if (is_array($searched_posts)){
    foreach ($searched_posts as $searched_post) {
    $post_id = $searched_post->ID;
    echo “<h1 class=\”entry-title\”>ID) . “\”>” . $searched_post->post_title . “</h1>”;
    echo get_post_meta($searched_post->ID,’width’,true) . “/”;
    echo get_post_meta($searched_post->ID,’sidewall’,true) . “R”;
    echo get_post_meta($searched_post->ID,’radius’,true) . “
    “;
    echo do_shortcode(‘[add_to_cart id=\”$post_id\”]’);
    echo “ID) . “\”>Read More“;
    }
    }

    Unfortunately I can not get the shortcodes to work – any hints?

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Issue with WooCommerce Shortcodes’ is closed to new replies.
Skip to toolbar