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
if ( have_posts ( ) )
while ( have_posts ( ) ):
the_post ( )?>
<a class="entry-title" href="">
<?php the_title ( )?>
<a class="product-thumb-price" href="">
<img class="product_search_thumb" src="" alt="" />
#Echo a snippet of the content/description
echo substr( get_the_content ( ), 0, 400 )
<a class="product-search-more-link" href="">[...]
<?php echo wpsc_the_product_price ( )?>
<?php echo wpsc_add_to_cart_button ( get_the_ID ( ) )?>
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