Hide Price in Product and Category Templates: Shopp Plugin for WordPress
on September 28, 2011
The need to hide a product’s price is common for many online retailers; we’ve helped a number of clients with this on multiple platforms. For instance, many clients like to have “Call for Price” displayed in place of an actual amount when a products price is $0.00 (zero). This can be useful when selling wholesale amounts, unique or rare products, such as pieces of art, or high ticket items, such as boats or vehicles, as well as for meeting minimum advertized price (MAP) criteria.
The steps below detail how to replace a the price display for a $0 priced product with a “Contact Us for Pricing” for the Shopp plugin for WordPress.
1) Locate the following code in /wp-content/plugins/shopp/templates/product.php
around line 28:
<?php shopp('product','price'); ?>
2) Change it to:
<?php //Looks to see if the price is equal to $0.00 if (shopp('product', 'price','return=true') == "$0.00") { //Shows nothing echo "Contact Us For Pricing"; } else { //Else, if the $0.00 price is not met then show price shopp('product','saleprice','starting=from','return=true'); } ?>
3) If you need to change the message displayed when a products price is $0 or zero simple edit the below line in the code:
echo "Contact Us For Pricing";
Let us know if you have any questions by commenting on this post.
[…] rest is here: Hide Price in Product and Category Templates: Shopp Plugin for … Tagged as: price Leave a comment Comments (0) Trackbacks (0) ( subscribe to comments on this […]
[…] Read the original: Hide Price in Product and Category Templates: Shopp Plugin for … […]
[…] the original: Hide Price in Product and Category Templates: Shopp Plugin for … hopfeed_affiliate='fwsjay'; hopfeed_affiliate_tid=''; hopfeed_cellpadding=5; […]
As you can see here, the-amplified-bible.com/shop/do-pets-and-other-animals-go-to-heaven-book
I wanted to include a clickable image.
How would I also remove the add to cart button or feature.
Thanks!
Hi Rob, you can probably remove the Add to Cart image with some CSS (set the class for the image to display:none;). It looks like you have a custom build so there isn’t a short answer to your other questions. We’d recommend consulting the Shopp documentation.
Ya I’m messing with the PHP to see if I can remove it.
I have everything working, I have my image showing.
My biggest issue is the add to cart button is displayed.
I’m trying to remove the add to cart line in the code….
And I only know a little about php, so I thought I would mimic what you have written to remove the add to cart.
(shopp(‘$addtocart’,’$label= ’;);
}
If you know how to remove it that would be cool.
Rob — just sent you an email. We’d be happy to take a look at your code.
Thanks for sharing this fix…one question. Now prices on products that have them don’t display at all. Have you encountered this problem and what do you suggest to fix?
Hi Kristin, no it should only hide prices (and display the desired message) for products that have price set to $0. Is this not the case? If so, send us a message via the contact form and we’ll be happy to help.
Hi
Hoping you can help me. I’m trying to get the above to work on our site, however we have dynamic pricing in out Product.php file which is making it difficult for me to implement the code. I’ve tried a few different ways with no success. Sadly I’m not an expert on php coding and the dynamic pricing was set up by a developer. What I am asking is if you can tell/show me what to do with the coding please?
Emailing you a code snippet from our product.php file containing the dynamic pricing code. Thanks in advance.
Sure, we’ll take a look at your email and let you know.
I would like to use this for our donations option as I don’t want it to be listed as “$0.00”–this understandably will confused people. However, when I follow the instructions it doesn’t work? I just want this to work for the product “donation” not all of my other products (tickets). Please advise. Thanks!
Hi Roxanne, what version of Shopp and WordPress are you using?