Ok the last time I asked a question like this, more people got on my case for not knowing something this simple rather than actually helping me out. I don't want any of that. I just need help and would greatly appreciate it.
I am trying to style the search results on an ecommerce site. What I HAVE gotten to work so far is this statement.
<?php if(wpsc_product_normal_price() == wpsc_the_product_price()): ?>
<p class="s_price" style="margin:0 0 10px 30px;"><?php echo wpsc_the_product_price(); ?></p>
<?php else: ?>
<p class="s_price s_promo_price"><span class="s_old_price"><?php echo wpsc_product_normal_price(); ?></span><?php echo wpsc_the_product_price(); ?></p>
<?php endif; ?>
So as far as I understand and what I see happening, that snippet returns the price of the product being returned in the search.
BUT, not all of the results that come up are products for sale, sometimes they are blog posts, blah blah. So I tried the following code but I couldn't get it to work. What I want to happen is that if the price is 0, or if there isn't a price, there won't be anything displayed.
<?php $searchprice=wpsc_product_normal_price();
if $searchprice > "0" ?>
<?php if(wpsc_product_normal_price() == wpsc_the_product_price()): ?>
<p class="s_price" style="margin:0 0 10px 30px;"><?php echo wpsc_the_product_price(); ?></p>
<?php else: ?>
<p class="s_price s_promo_price"><span class="s_old_price"><?php echo wpsc_product_normal_price(); ?></span><?php echo wpsc_the_product_price(); ?></p>
<?php endif; ?>
<?php endif; ?>
Again, I know I am not as awesome as you all are so I would appreciate that you didn't point that out, that won't solve my problem.
Thanks!
I tried this but the prices don't show up
<?php $searchprice=wpsc_product_normal_price();
if ($searchprice > "0") : ?>
<?php if(wpsc_product_normal_price() == wpsc_the_product_price()): ?>
<p class="s_price" style="margin:0 0 10px 30px;"><?php echo wpsc_the_product_price(); ?></p>
<?php else: ?>
<p class="s_price s_promo_price"><span class="s_old_price"><?php echo wpsc_product_normal_price(); ?></span><?php echo wpsc_the_product_price(); ?></p>
<?php endif; ?>
<?php endif; ?>
while ( wpsc_have_products() ) : wpsc_the_product();?