About Club osCommerce

Showcasing osCommerce…the good, the bad and the ugly!

StumbleUpon It! DIGG It!

Two prices per product in osCommerce

Written By Gary on Feb 14 2010 · Comments (0)

Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!


Had an interesting puzzle presented to me the other day. Basically an osCommerce store owner wanted to have two prices of products. In other words;

- the standard price
- a "friends and family" price (% reduction)

My idea was to simply use a Coupon Code to get the % reduction, then amend the display_price to show both the standard price AND the reduced price.

Pleased to say that within an hour of thinking about it, I was able to come up with a workable solution…based on my version 5.5 Coupon Code system.

So, an installation of v5.5 coupon code was the first step. This allows the store owner to set up coupons for % off, money off or free shipping. It also gives the ability for the buyer to insert the coupon code BEFORE the checkout process (I think mine is the only Coupon Code system that does this), which of course means that the buyer can browse the store with the Coupon Session present [before accessing the checkout].

We can now determine if a coupon code is present and amend the display of all prices appropriately;

if (tep_session_is_registered('coupon_code')) {
$price_shown .= '
Friends and Family Price: ' . $this->format($this->calculate_price($products_price - ($products_price * ($_SESSION['coupon_amount'] / 100)), $products_tax, $quantity)) . '';
}

and to make it look pretty (stylesheet.css);

.FF {
background: yellow;
}

Very straightforward way to give two prices of products. Can be made more complicated by installing other things such as QPBPP (Quantity Price Breaks Per Product) or SPPC (Seperate Pricing Per Customer), but my way is an installation of a fairly simple coupon system and an extra couple of lines of code to deal with showing two prices. Easy!

No Comments

No comments yet.

Leave a comment

RSS feed for comments on this post

Hot 100 osCommerce Shops

View the osCommerce HOT 100These are the best looking, most exceptional osCommerce Stores as voted for by you.

New to osCommerce - get inspiration from these beautiful shops. Reckon your site has what it takes to become a member of the HOT 100? Submit it!