Tag Archives: Shopp

Shopp: Custom Discount Price for Products

I’m not sure if anyone will ever have a need for this, but we had a random request from a client regarding price discounts in Shopp. Shopp has a built in discount function that you can set on a product by product basis, but we needed to show a 20% discount automatically based on the list price for each product.

How to:

So the first thing we did was open the product.php template (wp-content > plugins > shopp > core > model > product.php) and create a new case for the product table called “pricediscounted”. This will check the list price of a product and deduct 20%.

1
2
3
4
5
case "pricediscounted":
     if (empty($this->prices)) $this->load_data(array('prices'));
     $list_price = $this-> min['price'] + ($this-> min['price']*$taxrate);
     return money($list_price - ($list_price*0.20));
     break;

Next we wanted to show the exact amount the user would be saving. So we created another case that would calculate what 20% would amount to.

1
2
3
4
5
case "pricepercent":
     if (empty($this->prices)) $this->load_data(array('prices'));
     $list_price = $this->min['price'] + ($this->min['price']*$taxrate);
     return money($list_price - ($list_price*0.80));
     break;

Finally, here is an example of how you can display this information on your site. Simply place the following anywhere you are using the product loop.

1
2
3
List Price: <?php shopp('product','price'); ?>
Online Price: <span><?php shopp('product','pricediscounted'); ?>
A savings of: <?php shopp('product','pricepercent'); ?>

It’s Time to Shopp

I was recently given the opportunity to develop an eCommerce site for a client of mine.  I had developed a few eCommerce sites previously, all on different platforms, but for this project we wanted to go with WordPress as the CMS, and so my mind started to ponder back to eCommerce plug-ins I had used on previously.  Honestly the only remotely good one was WP eCommerce, and I actually ended up have a lot of issues with implementing it, as it was very “buggy” at times.  So I set out to hopefully find a new solution that would integrate as an eCommerce platform with WordPress and that’s when I came across Shopp.

After reading through the documentation and watching a few of the demo videos I was pretty much sold, but knew that I wouldn’t really know how good of fit it would be until I was able to install it in my own WP environment.  Unfortunately this became a little bit of a leap of faith as Shopp is not a free plug-in.  I had to pony up the doe before I would even know if it was good or not.  This is why I am writing this review and tutorial, to hopefully help people make a decision on using Shopp without having to feel like they might be wasting their money in making the “$55 blind leap”.

Luckily for me, I wasn’t let down. Overall I have to say I give the plug-in an 8.5 out