So I flat out refuse to pay 40 bucks for a license that does nothing but save you a couple hours time. Don’t be lazy coders!
In a previous post I told you how I got into WP eCommerce to get products by ID.
Now I’m going to show you how to get a product search using the normal WordPress search.
Firstly create a file in your theme folder called loop-search.php
Done that? Great, well done.. Now paste the below code into it
<?php
if ( have_posts ( ) )
while ( have_posts ( ) ):
the_post ( )?>
<i id="post-">
<a class="entry-title" href="">
<?php the_title ( )?>
</a>
<div class="entry-content">
<a class="product-thumb-price" href="">
<img class="product_search_thumb" src="" alt="" />
</a>
<div class="product_search_description">
<p class="product-search-description-text">
<?php
#Echo a snippet of the content/description
echo substr( get_the_content ( ), 0, 400 )
?>
<a class="product-search-more-link" href="">[...]
</p>
<span class="product_search_price">
<?php echo wpsc_the_product_price ( )?>
</span>
<div class="search-product-buttons">
<?php echo wpsc_add_to_cart_button ( get_the_ID ( ) )?>
</div>
</div>
</div>
</li>
<?php endwhile?>
</ul>
Tada! Product search, that’s probably broken for actual wordpress post searches… But its a work in progress. Only works in WP eCommerce 3.8+ as well so no bitching it doesn’t work, pull our finger out and dig/mess around